@skbkontur/side-menu 3.3.4 → 3.3.5-19a67.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/SideMenuDataTids.js +4 -1
- package/hooks/useAnimateOnMount.js +12 -10
- package/hooks/useMemoIcon.js +18 -13
- package/index.js +17 -14
- package/internal/themes/SideMenuTheme.js +209 -282
- package/lib/theming/ThemeHelpers.js +33 -42
- package/lib/theming/ThemeTypes.js +2 -1
- package/lib/utils/memo.js +7 -3
- package/lib/utils/scripts.js +12 -6
- package/package.json +1 -1
- package/src/Navigation.js +81 -123
- package/src/SideMenu/SideMenu.js +202 -207
- package/src/SideMenu/SideMenu.styles.js +145 -73
- package/src/SideMenuAvatar/SideMenuAvatar.js +13 -11
- package/src/SideMenuBody/SideMenuBody.js +21 -20
- package/src/SideMenuBody/SideMenuBody.styles.js +17 -10
- package/src/SideMenuContext.js +5 -2
- package/src/SideMenuDivider/SideMenuDivider.js +13 -12
- package/src/SideMenuDivider/SideMenuDivider.styles.js +14 -8
- package/src/SideMenuDropdown/SideMenuDropdown.js +34 -36
- package/src/SideMenuDropdown/SideMenuDropdown.styles.js +25 -15
- package/src/SideMenuFooter/SideMenuFooter.js +24 -23
- package/src/SideMenuFooter/SideMenuFooter.styles.js +25 -12
- package/src/SideMenuHeader/SideMenuHeader.js +28 -29
- package/src/SideMenuHeader/SideMenuHeader.styles.js +34 -16
- package/src/SideMenuItem/SideMenuItem.js +9 -7
- package/src/SideMenuLink/SideMenuLink.js +11 -10
- package/src/SideMenuLink/SideMenuLink.styles.js +11 -7
- package/src/SideMenuNotifications/BellWidget.js +61 -78
- package/src/SideMenuNotifications/BellWidgetError.js +22 -18
- package/src/SideMenuNotifications/BellWidgetView.styles.js +48 -20
- package/src/SideMenuNotifications/SideMenuNotifications.js +29 -27
- package/src/SideMenuNotifications/utils/getMarker.js +4 -1
- package/src/SideMenuNotifications/utils/getNotificationsErrorMessages.js +15 -11
- package/src/SideMenuOrganisations/SideMenuOrganisations.js +9 -7
- package/src/SideMenuSubItem/SideMenuSubItem.js +10 -8
- package/src/SideMenuSubItemHeader/SideMenuSubItemHeader.js +18 -17
- package/src/SideMenuSubItemHeader/SideMenuSubItemHeader.styles.js +18 -10
- package/src/SideMenuSubLink/SideMenuSubLink.js +10 -7
- package/src/Tree.js +39 -112
- package/src/internal/BackButton.js +17 -16
- package/src/internal/Backdrop.js +18 -12
- package/src/internal/Backdrop.styles.js +16 -8
- package/src/internal/Burger.js +17 -12
- package/src/internal/Burger.styles.js +14 -9
- package/src/internal/ClickableElement.js +97 -86
- package/src/internal/ClickableElement.styles.js +48 -21
- package/src/internal/InnerSubMenu.js +16 -14
- package/src/internal/ItemContent/Caption.js +47 -48
- package/src/internal/ItemContent/Caption.styles.js +84 -36
- package/src/internal/ItemContent/Icon.js +30 -27
- package/src/internal/ItemContent/Icon.styles.js +49 -20
- package/src/internal/ItemContent/ItemContent.js +44 -44
- package/src/internal/ItemContent/ItemContent.styles.js +65 -28
- package/src/internal/ItemContent/Marker.js +23 -20
- package/src/internal/ItemContent/Marker.styles.js +59 -22
- package/src/internal/NestedMenu.js +21 -19
- package/src/internal/NestedMenu.styles.js +11 -8
- package/src/internal/RightBorder.js +26 -24
- package/src/internal/RightBorder.styles.js +26 -10
- package/src/internal/SeparatedSubMenu.js +48 -49
- package/src/internal/SeparatedSubMenu.styles.js +58 -29
- package/src/internal/SideMenuLogotype.js +48 -49
- package/src/internal/SideMenuLogotype.styles.js +50 -23
- package/src/internal/SubMenu.js +16 -14
|
@@ -1,31 +1,68 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.jsStyles = void 0;
|
|
4
|
+
const Emotion_1 = require("@skbkontur/react-ui/lib/theming/Emotion");
|
|
5
|
+
const ThemeHelpers_1 = require("../../../lib/theming/ThemeHelpers");
|
|
6
|
+
const styles = {
|
|
7
|
+
root(t) {
|
|
8
|
+
return (0, Emotion_1.css) `
|
|
9
|
+
padding: ${t.sideMenuMarkerPaddingY} ${t.sideMenuMarkerPaddingX};
|
|
10
|
+
background: ${t.sideMenuMarkerBg};
|
|
11
|
+
border-radius: 9999px;
|
|
12
|
+
margin-left: auto;
|
|
13
|
+
margin-right: ${t.sideMenuMarkerMarginRight};
|
|
14
|
+
color: ${t.sideMenuMarkerColor};
|
|
15
|
+
font-size: ${t.sideMenuMarkerFontSize};
|
|
16
|
+
line-height: ${t.sideMenuMarkerLineHeight};
|
|
17
|
+
font-weight: ${t.sideMenuMarkerFontWeight};
|
|
18
|
+
min-width: 8px;
|
|
19
|
+
min-height: 8px;
|
|
20
|
+
text-align: center;
|
|
21
|
+
flex-shrink: 0;
|
|
22
|
+
`;
|
|
7
23
|
},
|
|
8
|
-
rootEmpty
|
|
9
|
-
return
|
|
24
|
+
rootEmpty(t) {
|
|
25
|
+
return (0, Emotion_1.css) `
|
|
26
|
+
padding: 0;
|
|
27
|
+
margin-right: calc(${t.sideMenuMarkerMarginRight} + ${t.sideMenuMarkerPaddingX});
|
|
28
|
+
`;
|
|
10
29
|
},
|
|
11
|
-
rootDisabled
|
|
12
|
-
return
|
|
30
|
+
rootDisabled(t) {
|
|
31
|
+
return (0, Emotion_1.css) `
|
|
32
|
+
background: ${t.sideMenuMarkerBgDisabled};
|
|
33
|
+
`;
|
|
13
34
|
},
|
|
14
|
-
rootMultiline
|
|
15
|
-
return
|
|
35
|
+
rootMultiline(t) {
|
|
36
|
+
return (0, Emotion_1.css) `
|
|
37
|
+
align-self: flex-start;
|
|
38
|
+
margin-top: ${t.sideMenuMarkerMultilineMarginTop};
|
|
39
|
+
`;
|
|
16
40
|
},
|
|
17
|
-
rootSubMenu
|
|
18
|
-
return
|
|
41
|
+
rootSubMenu(t) {
|
|
42
|
+
return (0, Emotion_1.css) `
|
|
43
|
+
background: transparent;
|
|
44
|
+
color: ${t.sideMenuMarkerSubItemColor};
|
|
45
|
+
font-weight: ${t.sideMenuSubItemMarkerFontWeight};
|
|
46
|
+
`;
|
|
19
47
|
},
|
|
20
|
-
rootSubMenuEmpty
|
|
21
|
-
return
|
|
48
|
+
rootSubMenuEmpty(t) {
|
|
49
|
+
return (0, Emotion_1.css) `
|
|
50
|
+
background: ${t.sideMenuSubItemEmptyMarkerBg};
|
|
51
|
+
`;
|
|
22
52
|
},
|
|
23
|
-
rootMinimized
|
|
24
|
-
return
|
|
53
|
+
rootMinimized() {
|
|
54
|
+
return (0, Emotion_1.css) `
|
|
55
|
+
position: absolute;
|
|
56
|
+
right: 0;
|
|
57
|
+
top: 0;
|
|
58
|
+
margin: 0;
|
|
59
|
+
`;
|
|
25
60
|
},
|
|
26
|
-
rootEmptyMinimized
|
|
27
|
-
return
|
|
61
|
+
rootEmptyMinimized() {
|
|
62
|
+
return (0, Emotion_1.css) `
|
|
63
|
+
right: 4px;
|
|
64
|
+
top: 4px;
|
|
65
|
+
`;
|
|
28
66
|
},
|
|
29
67
|
};
|
|
30
|
-
|
|
31
|
-
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8;
|
|
68
|
+
exports.jsStyles = (0, ThemeHelpers_1.memoizeStyle)(styles);
|
|
@@ -1,26 +1,28 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NestedMenu = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const react_1 = tslib_1.__importStar(require("react"));
|
|
6
|
+
const ThemeContext_1 = require("@skbkontur/react-ui/lib/theming/ThemeContext");
|
|
7
|
+
const Emotion_1 = require("@skbkontur/react-ui/lib/theming/Emotion");
|
|
8
|
+
const ThemeHelpers_1 = require("../../lib/theming/ThemeHelpers");
|
|
9
|
+
const SideMenu_styles_1 = require("../SideMenu/SideMenu.styles");
|
|
10
|
+
const SideMenuContext_1 = require("../SideMenuContext");
|
|
11
|
+
const NestedMenu_styles_1 = require("./NestedMenu.styles");
|
|
8
12
|
/**
|
|
9
13
|
* Вложенное подменю
|
|
10
14
|
*
|
|
11
15
|
* @visibleName NestedMenu
|
|
12
16
|
*/
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
_b[jsStyles.root(theme)] = true,
|
|
22
|
-
_b)), id: htmlId }, children));
|
|
17
|
+
const NestedMenu = (0, react_1.forwardRef)(({ children, htmlId, isOpened }, ref) => {
|
|
18
|
+
const theme = (0, ThemeHelpers_1.getSideMenuTheme)((0, react_1.useContext)(ThemeContext_1.ThemeContext));
|
|
19
|
+
const context = (0, react_1.useContext)(SideMenuContext_1.SideMenuContext);
|
|
20
|
+
return (react_1.default.createElement("ul", { ref: ref, className: (0, Emotion_1.cx)({
|
|
21
|
+
[SideMenu_styles_1.jsStylesForSideMenu.list()]: true,
|
|
22
|
+
[SideMenu_styles_1.jsStylesForSideMenu.hidden()]: !isOpened || (!context.isOpened && (context.isMobile || context.isTablet)),
|
|
23
|
+
[NestedMenu_styles_1.jsStyles.root(theme)]: true,
|
|
24
|
+
}), id: htmlId }, children));
|
|
23
25
|
});
|
|
24
26
|
NestedMenu.displayName = 'NestedMenu';
|
|
25
|
-
|
|
26
|
-
|
|
27
|
+
const NestedMenuWithStaticFields = Object.assign(NestedMenu, { __KONTUR_REACT_UI__: 'NestedMenu' });
|
|
28
|
+
exports.NestedMenu = NestedMenuWithStaticFields;
|
|
@@ -1,10 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.jsStyles = void 0;
|
|
4
|
+
const Emotion_1 = require("@skbkontur/react-ui/lib/theming/Emotion");
|
|
5
|
+
const ThemeHelpers_1 = require("../../lib/theming/ThemeHelpers");
|
|
6
|
+
const styles = {
|
|
7
|
+
root(t) {
|
|
8
|
+
return (0, Emotion_1.css) `
|
|
9
|
+
padding-left: ${t.sideMenuNestedMenuPaddingLeft};
|
|
10
|
+
`;
|
|
7
11
|
},
|
|
8
12
|
};
|
|
9
|
-
|
|
10
|
-
var templateObject_1;
|
|
13
|
+
exports.jsStyles = (0, ThemeHelpers_1.memoizeStyle)(styles);
|
|
@@ -1,34 +1,36 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RightBorder = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const react_1 = tslib_1.__importStar(require("react"));
|
|
6
|
+
const Emotion_1 = require("@skbkontur/react-ui/lib/theming/Emotion");
|
|
7
|
+
const ThemeContext_1 = require("@skbkontur/react-ui/lib/theming/ThemeContext");
|
|
8
|
+
const Hint_1 = require("@skbkontur/react-ui/components/Hint/Hint");
|
|
9
|
+
const ThemeHelpers_1 = require("../../lib/theming/ThemeHelpers");
|
|
10
|
+
const useMemoIcon_1 = require("../../hooks/useMemoIcon");
|
|
11
|
+
const SideMenuContext_1 = require("../SideMenuContext");
|
|
12
|
+
const SideMenuDataTids_1 = require("../../SideMenuDataTids");
|
|
13
|
+
const RightBorder_styles_1 = require("./RightBorder.styles");
|
|
10
14
|
/**
|
|
11
15
|
* Элемент интерактивной правой границы
|
|
12
16
|
*
|
|
13
17
|
* @visibleName RightBorder
|
|
14
18
|
*/
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
_b[jsStyles.rootWithButton()] = showButton,
|
|
26
|
-
_b)), ref: ref, onClick: onClick, onKeyDown: function (e) {
|
|
19
|
+
const RightBorder = (0, react_1.forwardRef)(({ onClick, showButton }, ref) => {
|
|
20
|
+
const theme = (0, ThemeHelpers_1.getSideMenuTheme)((0, react_1.useContext)(ThemeContext_1.ThemeContext));
|
|
21
|
+
const context = (0, react_1.useContext)(SideMenuContext_1.SideMenuContext);
|
|
22
|
+
const icon = (0, useMemoIcon_1.useMemoBorderIcon)(context.isCollapsable);
|
|
23
|
+
const hintText = context.isCollapsable ? 'Закрепить меню' : 'Свернуть меню';
|
|
24
|
+
return (react_1.default.createElement(Hint_1.Hint, { text: hintText, pos: 'right' },
|
|
25
|
+
react_1.default.createElement("div", { className: (0, Emotion_1.cx)({
|
|
26
|
+
[RightBorder_styles_1.jsStyles.root(theme)]: true,
|
|
27
|
+
[RightBorder_styles_1.jsStyles.rootWithButton()]: showButton,
|
|
28
|
+
}), ref: ref, onClick: onClick, onKeyDown: (e) => {
|
|
27
29
|
if (e.key === 'Enter' || e.key === 'Space') {
|
|
28
30
|
onClick();
|
|
29
31
|
}
|
|
30
|
-
}, role: "button", tabIndex: 0, "data-tid": SideMenuDataTids.rightBorder }, icon)));
|
|
32
|
+
}, role: "button", tabIndex: 0, "data-tid": SideMenuDataTids_1.SideMenuDataTids.rightBorder }, icon)));
|
|
31
33
|
});
|
|
32
34
|
RightBorder.displayName = 'RightBorder';
|
|
33
|
-
|
|
34
|
-
|
|
35
|
+
const RightBorderWithStaticFields = Object.assign(RightBorder, { __KONTUR_REACT_UI__: 'RightBorder' });
|
|
36
|
+
exports.RightBorder = RightBorderWithStaticFields;
|
|
@@ -1,13 +1,29 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.jsStyles = void 0;
|
|
4
|
+
const Emotion_1 = require("@skbkontur/react-ui/lib/theming/Emotion");
|
|
5
|
+
const ThemeHelpers_1 = require("../../lib/theming/ThemeHelpers");
|
|
6
|
+
const styles = {
|
|
7
|
+
root(t) {
|
|
8
|
+
return (0, Emotion_1.css) `
|
|
9
|
+
opacity: 0;
|
|
10
|
+
position: absolute;
|
|
11
|
+
width: ${t.sideMenuRightBorderWidth};
|
|
12
|
+
height: 100%;
|
|
13
|
+
right: 0;
|
|
14
|
+
background: transparent;
|
|
15
|
+
display: flex;
|
|
16
|
+
color: ${t.sideMenuRightBorderIconColor};
|
|
17
|
+
transition: opacity, color 150ms cubic-bezier(0.5, 1, 0.89, 1);
|
|
18
|
+
&:hover {
|
|
19
|
+
color: ${t.sideMenuRightBorderHoverIconColor};
|
|
20
|
+
}
|
|
21
|
+
`;
|
|
7
22
|
},
|
|
8
|
-
rootWithButton
|
|
9
|
-
return
|
|
23
|
+
rootWithButton() {
|
|
24
|
+
return (0, Emotion_1.css) `
|
|
25
|
+
opacity: 1;
|
|
26
|
+
`;
|
|
10
27
|
},
|
|
11
28
|
};
|
|
12
|
-
|
|
13
|
-
var templateObject_1, templateObject_2;
|
|
29
|
+
exports.jsStyles = (0, ThemeHelpers_1.memoizeStyle)(styles);
|
|
@@ -1,63 +1,62 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SeparatedSubMenu = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const react_1 = tslib_1.__importStar(require("react"));
|
|
6
|
+
const react_dom_1 = tslib_1.__importDefault(require("react-dom"));
|
|
7
|
+
const Emotion_1 = require("@skbkontur/react-ui/lib/theming/Emotion");
|
|
8
|
+
const ThemeContext_1 = require("@skbkontur/react-ui/lib/theming/ThemeContext");
|
|
9
|
+
const ScrollContainer_1 = require("@skbkontur/react-ui/components/ScrollContainer");
|
|
10
|
+
const client_1 = require("@skbkontur/react-ui/lib/client");
|
|
11
|
+
const SideMenu_styles_1 = require("../SideMenu/SideMenu.styles");
|
|
12
|
+
const SideMenuContext_1 = require("../SideMenuContext");
|
|
13
|
+
const SideMenuDataTids_1 = require("../../SideMenuDataTids");
|
|
14
|
+
const ThemeHelpers_1 = require("../../lib/theming/ThemeHelpers");
|
|
15
|
+
const Navigation_1 = require("../Navigation");
|
|
16
|
+
const BackButton_1 = require("./BackButton");
|
|
17
|
+
const SeparatedSubMenu_styles_1 = require("./SeparatedSubMenu.styles");
|
|
14
18
|
/**
|
|
15
19
|
* Отдельностоящее подменю
|
|
16
20
|
*
|
|
17
21
|
* @visibleName SeparatedSubMenu
|
|
18
22
|
*/
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
var scrollContainerRef = useRef(null);
|
|
25
|
-
var theme = getSideMenuTheme(useContext(ThemeContext));
|
|
26
|
-
useEffect(function () {
|
|
23
|
+
const SeparatedSubMenu = (0, react_1.forwardRef)(({ children, caption, htmlId, isOpened }, ref) => {
|
|
24
|
+
const context = (0, react_1.useContext)(SideMenuContext_1.SideMenuContext);
|
|
25
|
+
const scrollContainerRef = (0, react_1.useRef)(null);
|
|
26
|
+
const theme = (0, ThemeHelpers_1.getSideMenuTheme)((0, react_1.useContext)(ThemeContext_1.ThemeContext));
|
|
27
|
+
(0, react_1.useEffect)(() => {
|
|
27
28
|
if (!context.isMobile) {
|
|
28
29
|
return;
|
|
29
30
|
}
|
|
30
|
-
setTimeout(
|
|
31
|
-
|
|
32
|
-
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'))));
|
|
31
|
+
setTimeout(() => {
|
|
32
|
+
isOpened && context.setHasScrollBar?.(!!scrollContainerRef.current?.hasScrollBar('y'));
|
|
33
33
|
}, 50);
|
|
34
|
-
}, [
|
|
35
|
-
if (!
|
|
34
|
+
}, [context.navigation?.activeMenuItem]);
|
|
35
|
+
if (!context.sideMenuRef?.current) {
|
|
36
36
|
return null;
|
|
37
37
|
}
|
|
38
|
-
return
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
(_a = context.setScrollState) === null || _a === void 0 ? void 0 : _a.call(context, state);
|
|
38
|
+
return react_dom_1.default.createPortal(react_1.default.createElement("div", { className: (0, Emotion_1.cx)({
|
|
39
|
+
[SideMenu_styles_1.jsStylesForSideMenu.container(theme)]: true,
|
|
40
|
+
[SideMenu_styles_1.jsStylesForSideMenu.containerForTouchScreens(theme)]: context.isTouchScreen,
|
|
41
|
+
[SeparatedSubMenu_styles_1.jsStyles.root(theme)]: true,
|
|
42
|
+
[SeparatedSubMenu_styles_1.customStyles.rootForMobiles(context.headerHeight)]: context.isMobile,
|
|
43
|
+
[SeparatedSubMenu_styles_1.jsStyles.rootForDesktop()]: context.isDesktop,
|
|
44
|
+
[SeparatedSubMenu_styles_1.jsStyles.rootForTouchScreens(theme)]: context.isTouchScreen && context.isOpened && context.isCollapsable,
|
|
45
|
+
[SeparatedSubMenu_styles_1.jsStyles.rootForNarrowDesktop(theme)]: context.isCollapsable,
|
|
46
|
+
[SeparatedSubMenu_styles_1.jsStyles.rootWithShadow(theme)]: context.isTablet && !client_1.isIE11,
|
|
47
|
+
[SideMenu_styles_1.jsStylesForSideMenu.hidden()]: !isOpened || (!context.isOpened && (context.isTablet || context.isMobile)),
|
|
48
|
+
}), ref: ref, "data-tid": SideMenuDataTids_1.SideMenuDataTids.separatedSubMenu, [Navigation_1.navigationAttributeForSeparatedMenu]: htmlId },
|
|
49
|
+
react_1.default.createElement(ScrollContainer_1.ScrollContainer, { onScrollStateChangeY: (state) => {
|
|
50
|
+
context.setScrollState?.(state);
|
|
52
51
|
}, ref: scrollContainerRef, showScrollBar: context.isTouchScreen ? 'always' : context.showScrollBar },
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
context.isMobile &&
|
|
59
|
-
children))),
|
|
52
|
+
react_1.default.createElement("ul", { className: (0, Emotion_1.cx)({
|
|
53
|
+
[SideMenu_styles_1.jsStylesForSideMenu.list()]: true,
|
|
54
|
+
[SeparatedSubMenu_styles_1.jsStyles.contentWrapper(theme)]: true,
|
|
55
|
+
[SeparatedSubMenu_styles_1.jsStyles.contentWrapperForMobiles()]: context.isMobile,
|
|
56
|
+
}) },
|
|
57
|
+
context.isMobile && react_1.default.createElement(BackButton_1.BackButton, { caption: caption, id: htmlId }),
|
|
58
|
+
children))), context.sideMenuRef?.current);
|
|
60
59
|
});
|
|
61
60
|
SeparatedSubMenu.displayName = 'SeparatedSubMenu';
|
|
62
|
-
|
|
63
|
-
|
|
61
|
+
const SeparatedSubMenuWithStaticFields = Object.assign(SeparatedSubMenu, { __KONTUR_REACT_UI__: 'SeparatedSubMenu' });
|
|
62
|
+
exports.SeparatedSubMenu = SeparatedSubMenuWithStaticFields;
|
|
@@ -1,33 +1,62 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.jsStyles = exports.customStyles = void 0;
|
|
4
|
+
const Emotion_1 = require("@skbkontur/react-ui/lib/theming/Emotion");
|
|
5
|
+
const ThemeHelpers_1 = require("../../lib/theming/ThemeHelpers");
|
|
6
|
+
const styles = {
|
|
7
|
+
root(t) {
|
|
8
|
+
return (0, Emotion_1.css) `
|
|
9
|
+
position: absolute;
|
|
10
|
+
top: 0;
|
|
11
|
+
background: ${t.sideMenuSeparatedSubMenuBgColor};
|
|
12
|
+
left: 100%;
|
|
13
|
+
justify-content: flex-start;
|
|
14
|
+
border-right: 1px solid ${t.sideMenuSeparatedSubMenuBorderRightColor};
|
|
15
|
+
z-index: 8000;
|
|
16
|
+
`;
|
|
17
|
+
},
|
|
18
|
+
rootForTouchScreens(t) {
|
|
19
|
+
return (0, Emotion_1.css) `
|
|
20
|
+
left: ${t.sideMenuWidthForTouchScreens};
|
|
21
|
+
z-index: -1;
|
|
22
|
+
`;
|
|
23
|
+
},
|
|
24
|
+
rootForNarrowDesktop(t) {
|
|
25
|
+
return (0, Emotion_1.css) `
|
|
26
|
+
left: ${t.sideMenuMinimizedWidth};
|
|
27
|
+
z-index: -1;
|
|
28
|
+
`;
|
|
29
|
+
},
|
|
30
|
+
rootForDesktop() {
|
|
31
|
+
return (0, Emotion_1.css) `
|
|
32
|
+
z-index: -1;
|
|
33
|
+
`;
|
|
34
|
+
},
|
|
35
|
+
rootWithShadow(t) {
|
|
36
|
+
return (0, Emotion_1.css) `
|
|
37
|
+
box-shadow: ${t.sideMenuBoxShadow};
|
|
38
|
+
clip-path: inset(0 -${t.sideMenuBoxShadowBlurRadius} 0 0);
|
|
39
|
+
border-right: none;
|
|
40
|
+
`;
|
|
41
|
+
},
|
|
42
|
+
contentWrapper(t) {
|
|
43
|
+
return (0, Emotion_1.css) `
|
|
44
|
+
padding: ${t.sideMenuSeparatedSubMenuPaddingY} ${t.sideMenuSeparatedSubMenuPaddingX};
|
|
45
|
+
`;
|
|
46
|
+
},
|
|
47
|
+
contentWrapperForMobiles() {
|
|
48
|
+
return (0, Emotion_1.css) `
|
|
49
|
+
padding-top: 0;
|
|
50
|
+
`;
|
|
25
51
|
},
|
|
26
52
|
};
|
|
27
|
-
|
|
28
|
-
rootForMobiles
|
|
29
|
-
return
|
|
53
|
+
exports.customStyles = {
|
|
54
|
+
rootForMobiles(headerHeight) {
|
|
55
|
+
return (0, Emotion_1.css) `
|
|
56
|
+
height: calc(100vh - ${headerHeight}px);
|
|
57
|
+
left: 0;
|
|
58
|
+
top: ${headerHeight}px;
|
|
59
|
+
`;
|
|
30
60
|
},
|
|
31
61
|
};
|
|
32
|
-
|
|
33
|
-
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8;
|
|
62
|
+
exports.jsStyles = (0, ThemeHelpers_1.memoizeStyle)(styles);
|