@skbkontur/side-menu 5.0.0-alpha.1 → 5.0.0-alpha.2
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/internal/themes/SideMenuDarkTheme.js +3 -1
- package/internal/themes/SideMenuTheme.d.ts +25 -3
- package/internal/themes/SideMenuTheme.js +41 -13
- package/package.json +2 -2
- package/src/SideMenu/SideMenu.d.ts +3 -0
- package/src/SideMenu/SideMenu.js +90 -54
- package/src/SideMenu/SideMenu.styles.d.ts +4 -0
- package/src/SideMenu/SideMenu.styles.js +28 -11
- package/src/SideMenuBody/SideMenuBody.js +2 -0
- package/src/SideMenuBody/SideMenuBody.styles.js +1 -1
- package/src/SideMenuDivider/SideMenuDivider.js +4 -1
- package/src/SideMenuDivider/SideMenuDivider.styles.d.ts +1 -0
- package/src/SideMenuDivider/SideMenuDivider.styles.js +5 -2
- package/src/SideMenuDropdown/SideMenuDropdown.js +7 -7
- package/src/SideMenuDropdown/SideMenuDropdown.styles.d.ts +1 -0
- package/src/SideMenuDropdown/SideMenuDropdown.styles.js +8 -4
- package/src/SideMenuFooter/SideMenuFooter.js +41 -5
- package/src/SideMenuFooter/SideMenuFooter.styles.d.ts +7 -0
- package/src/SideMenuFooter/SideMenuFooter.styles.js +30 -8
- package/src/SideMenuSubItemHeader/SideMenuSubItemHeader.js +1 -1
- package/src/SideMenuSubItemHeader/SideMenuSubItemHeader.styles.d.ts +1 -1
- package/src/SideMenuSubItemHeader/SideMenuSubItemHeader.styles.js +2 -2
- package/src/internal/ClickableElement.js +1 -0
- package/src/internal/ClickableElement.styles.d.ts +1 -0
- package/src/internal/ClickableElement.styles.js +16 -11
- package/src/internal/CollapseToggle.js +6 -2
- package/src/internal/CollapseToggle.styles.d.ts +2 -0
- package/src/internal/CollapseToggle.styles.js +7 -1
- package/src/internal/ItemContent/Caption.js +1 -0
- package/src/internal/ItemContent/Caption.styles.d.ts +1 -0
- package/src/internal/ItemContent/Caption.styles.js +16 -13
- package/src/internal/ItemContent/Icon.js +2 -0
- package/src/internal/ItemContent/Icon.styles.d.ts +2 -0
- package/src/internal/ItemContent/Icon.styles.js +14 -8
- package/src/internal/ItemContent/Marker.js +8 -2
- package/src/internal/ItemContent/Marker.styles.d.ts +3 -0
- package/src/internal/ItemContent/Marker.styles.js +16 -5
- package/src/internal/NarrowAccordionDropdown.js +8 -8
|
@@ -4,7 +4,7 @@ export var getStyles = memoizeGetStyles(function (_a) {
|
|
|
4
4
|
var css = _a.css;
|
|
5
5
|
return ({
|
|
6
6
|
root: function (t) {
|
|
7
|
-
return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n flex-grow: 1;\n margin: 0 ", ";\n min-height: 100%;\n "], ["\n flex-grow: 1;\n margin: 0 ", ";\n min-height: 100%;\n "])), t.
|
|
7
|
+
return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n flex-grow: 1;\n margin: 0 ", ";\n min-height: 100%;\n "], ["\n flex-grow: 1;\n margin: 0 ", ";\n min-height: 100%;\n "])), t.sideMenuItemsMarginX);
|
|
8
8
|
},
|
|
9
9
|
wrapper: function (t) {
|
|
10
10
|
return css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n padding-bottom: ", ";\n "], ["\n padding-bottom: ", ";\n "])), t.sideMenuBodyPaddingBottom);
|
|
@@ -3,13 +3,16 @@ import { useEmotion, useStyles } from '@skbkontur/react-ui/lib/renderEnvironment
|
|
|
3
3
|
import { ThemeContext } from '@skbkontur/react-ui/lib/theming/ThemeContext';
|
|
4
4
|
import React, { forwardRef, useContext } from 'react';
|
|
5
5
|
import { getSideMenuTheme } from '../../lib/theming/ThemeHelpers.js';
|
|
6
|
+
import { SideMenuContext } from '../SideMenuContext.js';
|
|
6
7
|
import { getStyles } from './SideMenuDivider.styles.js';
|
|
7
8
|
var SideMenuDividerInner = forwardRef(function (_a, ref) {
|
|
9
|
+
var _b;
|
|
8
10
|
var className = _a.className, rest = __rest(_a, ["className"]);
|
|
9
11
|
var theme = getSideMenuTheme(useContext(ThemeContext));
|
|
10
12
|
var styles = useStyles(getStyles);
|
|
11
13
|
var cx = useEmotion().cx;
|
|
12
|
-
|
|
14
|
+
var isLarge = useContext(SideMenuContext).size === 'large';
|
|
15
|
+
return (React.createElement("hr", __assign({ className: cx(styles.root(theme), (_b = {}, _b[styles.rootLarge(theme)] = isLarge, _b), className), ref: ref }, rest)));
|
|
13
16
|
});
|
|
14
17
|
SideMenuDividerInner.displayName = 'SideMenuDivider';
|
|
15
18
|
/**
|
|
@@ -4,8 +4,11 @@ export var getStyles = memoizeGetStyles(function (_a) {
|
|
|
4
4
|
var css = _a.css;
|
|
5
5
|
return ({
|
|
6
6
|
root: function (t) {
|
|
7
|
-
return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n height: 1px;\n border: none;\n background: ", ";\n margin: ", " ", ";\n "], ["\n height: 1px;\n border: none;\n background: ", ";\n margin: ", " ", ";\n "])), t.sideMenuDividerBg, t.
|
|
7
|
+
return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n height: 1px;\n border: none;\n background: ", ";\n margin: ", " ", " ", ";\n "], ["\n height: 1px;\n border: none;\n background: ", ";\n margin: ", " ", " ", ";\n "])), t.sideMenuDividerBg, t.sideMenuDividerMarginTop, t.sideMenuDividerMarginX, t.sideMenuDividerMarginBottom);
|
|
8
|
+
},
|
|
9
|
+
rootLarge: function (t) {
|
|
10
|
+
return css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n margin-top: ", ";\n margin-bottom: ", ";\n "], ["\n margin-top: ", ";\n margin-bottom: ", ";\n "])), t.sideMenuDividerMarginTopLarge, t.sideMenuDividerMarginBottomLarge);
|
|
8
11
|
},
|
|
9
12
|
});
|
|
10
13
|
});
|
|
11
|
-
var templateObject_1;
|
|
14
|
+
var templateObject_1, templateObject_2;
|
|
@@ -8,11 +8,11 @@ import { SideMenuContext } from '../SideMenuContext.js';
|
|
|
8
8
|
import { SideMenuItem } from '../SideMenuItem/SideMenuItem.js';
|
|
9
9
|
import { getStyles } from './SideMenuDropdown.styles.js';
|
|
10
10
|
var SideMenuDropdownInner = forwardRef(function (_a, ref) {
|
|
11
|
-
var _b;
|
|
11
|
+
var _b, _c;
|
|
12
12
|
var icon = _a.icon, id = _a.id, children = _a.children, caption = _a.caption, marker = _a.marker, subCaption = _a.subCaption, className = _a.className, menuWidth = _a.menuWidth, _isAvatar = _a._isAvatar, onClose = _a.onClose, onOpen = _a.onOpen, ariaLabel = _a["aria-label"], rest = __rest(_a, ["icon", "id", "children", "caption", "marker", "subCaption", "className", "menuWidth", "_isAvatar", "onClose", "onOpen", 'aria-label']);
|
|
13
13
|
var context = useContext(SideMenuContext);
|
|
14
14
|
var theme = getSideMenuTheme(useContext(ThemeContext));
|
|
15
|
-
var
|
|
15
|
+
var _d = __read(useState(false), 2), isMenuOpen = _d[0], setIsMenuOpen = _d[1];
|
|
16
16
|
var cx = useEmotion().cx;
|
|
17
17
|
var styles = useStyles(getStyles);
|
|
18
18
|
var dropdownChildren = useMemo(function () {
|
|
@@ -30,11 +30,11 @@ var SideMenuDropdownInner = forwardRef(function (_a, ref) {
|
|
|
30
30
|
return child;
|
|
31
31
|
});
|
|
32
32
|
}, [children, context.toggleIsOpened]);
|
|
33
|
-
return (React.createElement("li", { className: cx(styles.wrapper(), className) },
|
|
34
|
-
React.createElement(DropdownMenu, __assign({ ref: ref, caption: React.createElement("div", { className: cx(styles.label(theme), (
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
33
|
+
return (React.createElement("li", { className: cx(styles.wrapper(), (_b = {}, _b[styles.wrapperCollapsed()] = !context.isOpened, _b), className) },
|
|
34
|
+
React.createElement(DropdownMenu, __assign({ ref: ref, caption: React.createElement("div", { className: cx(styles.label(theme), (_c = {},
|
|
35
|
+
_c[styles.labelTouchScreen(theme)] = context.isTouchScreen,
|
|
36
|
+
_c[styles.labelCollapsed()] = !context.isOpened,
|
|
37
|
+
_c)) },
|
|
38
38
|
React.createElement(SideMenuItem, { "aria-label": ariaLabel, icon: icon, caption: caption, subCaption: subCaption, marker: marker, id: id, _isDropdown: true, _isDropdownOpen: isMenuOpen, _isAvatar: _isAvatar })), positions: ['top left'], disableAnimations: true, menuWidth: menuWidth, onOpen: function () {
|
|
39
39
|
setIsMenuOpen(true);
|
|
40
40
|
onOpen === null || onOpen === void 0 ? void 0 : onOpen();
|
|
@@ -6,17 +6,21 @@ export var getStyles = memoizeGetStyles(function (_a) {
|
|
|
6
6
|
var _unused = injectGlobal(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n [data-tid='MenuItem']:active {\n background: rgba(0, 0, 0, 0.1) !important;\n transition: background 80ms ease-out;\n }\n "], ["\n [data-tid='MenuItem']:active {\n background: rgba(0, 0, 0, 0.1) !important;\n transition: background 80ms ease-out;\n }\n "])));
|
|
7
7
|
return {
|
|
8
8
|
label: function (t) {
|
|
9
|
-
return css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n width: calc(\n ", " - 2 * ", " - var(--side-menu-footer-trailing-reserved-width, 0px)\n );\n min-width: 0;\n transition: width ", "ms ease-out;\n "], ["\n width: calc(\n ", " - 2 * ", " - var(--side-menu-footer-trailing-reserved-width, 0px)\n );\n min-width: 0;\n transition: width ", "ms ease-out;\n "])), t.sideMenuWidth, t.
|
|
9
|
+
return css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n width: calc(\n ", " - 2 * ", " - var(--side-menu-footer-trailing-reserved-width, 0px)\n );\n min-width: 0;\n transition: width ", "ms ease-out;\n "], ["\n width: calc(\n ", " - 2 * ", " - var(--side-menu-footer-trailing-reserved-width, 0px)\n );\n min-width: 0;\n transition: width ", "ms ease-out;\n "])), t.sideMenuWidth, t.sideMenuItemsMarginX, transitionDuration);
|
|
10
10
|
},
|
|
11
11
|
labelTouchScreen: function (t) {
|
|
12
|
-
return css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n width: calc(\n ", " - 2 *\n ", " - var(--side-menu-footer-trailing-reserved-width, 0px)\n );\n "], ["\n width: calc(\n ", " - 2 *\n ", " - var(--side-menu-footer-trailing-reserved-width, 0px)\n );\n "])), t.sideMenuWidthTouchScreen, t.
|
|
12
|
+
return css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n width: calc(\n ", " - 2 *\n ", " - var(--side-menu-footer-trailing-reserved-width, 0px)\n );\n "], ["\n width: calc(\n ", " - 2 *\n ", " - var(--side-menu-footer-trailing-reserved-width, 0px)\n );\n "])), t.sideMenuWidthTouchScreen, t.sideMenuItemsMarginX);
|
|
13
13
|
},
|
|
14
14
|
labelCollapsed: function () {
|
|
15
15
|
return css(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n width: 100%;\n "], ["\n width: 100%;\n "])));
|
|
16
16
|
},
|
|
17
17
|
wrapper: function () {
|
|
18
|
-
return css(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n overflow-x: hidden;\n min-width: 0;\n "], ["\n overflow-x: hidden;\n min-width: 0;\n "])));
|
|
18
|
+
return css(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n overflow-x: hidden;\n min-width: 0;\n /* \u041E\u0431\u043B\u0430\u0441\u0442\u044C \u043E\u0431\u0440\u0435\u0437\u043A\u0438 \u043D\u0430 1px \u0448\u0438\u0440\u0435 \u043F\u0443\u043D\u043A\u0442\u0430, \u0447\u0442\u043E\u0431\u044B \u043D\u0435 \u0441\u0440\u0435\u0437\u0430\u0442\u044C \u0432\u044B\u0441\u0442\u0443\u043F\u0430\u044E\u0449\u0435\u0435 \u043A\u043E\u043B\u044C\u0446\u043E \u0444\u043E\u043A\u0443\u0441\u0430 */\n padding: 1px;\n margin: -1px;\n "], ["\n overflow-x: hidden;\n min-width: 0;\n /* \u041E\u0431\u043B\u0430\u0441\u0442\u044C \u043E\u0431\u0440\u0435\u0437\u043A\u0438 \u043D\u0430 1px \u0448\u0438\u0440\u0435 \u043F\u0443\u043D\u043A\u0442\u0430, \u0447\u0442\u043E\u0431\u044B \u043D\u0435 \u0441\u0440\u0435\u0437\u0430\u0442\u044C \u0432\u044B\u0441\u0442\u0443\u043F\u0430\u044E\u0449\u0435\u0435 \u043A\u043E\u043B\u044C\u0446\u043E \u0444\u043E\u043A\u0443\u0441\u0430 */\n padding: 1px;\n margin: -1px;\n "])));
|
|
19
|
+
},
|
|
20
|
+
// В свёрнутом меню подпись скрыта, а бейдж выступает за границы пункта — не обрезаем его
|
|
21
|
+
wrapperCollapsed: function () {
|
|
22
|
+
return css(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n overflow: visible;\n "], ["\n overflow: visible;\n "])));
|
|
19
23
|
},
|
|
20
24
|
};
|
|
21
25
|
});
|
|
22
|
-
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5;
|
|
26
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6;
|
|
@@ -3,15 +3,16 @@ import { getDOMRect } from '@skbkontur/react-ui/lib/dom/getDOMRect';
|
|
|
3
3
|
import { mergeRefs } from '@skbkontur/react-ui/lib/mergeRefs';
|
|
4
4
|
import { useEmotion, useStyles } from '@skbkontur/react-ui/lib/renderEnvironment';
|
|
5
5
|
import { ThemeContext } from '@skbkontur/react-ui/lib/theming/ThemeContext';
|
|
6
|
-
import React, { forwardRef, useContext, useEffect, useRef, useState } from 'react';
|
|
6
|
+
import React, { forwardRef, useContext, useEffect, useLayoutEffect, useRef, useState } from 'react';
|
|
7
7
|
import { getSideMenuTheme } from '../../lib/theming/ThemeHelpers.js';
|
|
8
8
|
import { flattenChildren } from '../../lib/utils/scripts.js';
|
|
9
9
|
import { SideMenuDataTids } from '../../SideMenuDataTids.js';
|
|
10
|
+
import { transitionDuration } from '../SideMenu/SideMenu.js';
|
|
10
11
|
import { getStyles as getSideMenuStyles } from '../SideMenu/SideMenu.styles.js';
|
|
11
12
|
import { SideMenuContext } from '../SideMenuContext.js';
|
|
12
13
|
import { getStyles } from './SideMenuFooter.styles.js';
|
|
13
14
|
var SideMenuFooterInner = forwardRef(function (_a, ref) {
|
|
14
|
-
var _b;
|
|
15
|
+
var _b, _c, _d;
|
|
15
16
|
var className = _a.className, children = _a.children, rest = __rest(_a, ["className", "children"]);
|
|
16
17
|
var context = useContext(SideMenuContext);
|
|
17
18
|
var theme = getSideMenuTheme(useContext(ThemeContext));
|
|
@@ -19,14 +20,38 @@ var SideMenuFooterInner = forwardRef(function (_a, ref) {
|
|
|
19
20
|
var styles = useStyles(getStyles);
|
|
20
21
|
var sideMenuStyles = useStyles(getSideMenuStyles);
|
|
21
22
|
var footerRef = useRef(null);
|
|
22
|
-
var
|
|
23
|
+
var _e = __read(useState(false), 2), isFixed = _e[0], setIsFixed = _e[1];
|
|
23
24
|
useEffect(function () {
|
|
24
25
|
var _a;
|
|
25
26
|
if (footerRef.current) {
|
|
26
27
|
(_a = context.setFooterHeight) === null || _a === void 0 ? void 0 : _a.call(context, getDOMRect(footerRef.current).height);
|
|
27
28
|
}
|
|
28
29
|
}, [children, context.isOpened, context.setFooterHeight]);
|
|
30
|
+
// При сворачивании кнопка сворачивания переезжает из строки аватара в отдельную строку
|
|
31
|
+
// (и обратно), из-за чего высота футера меняется скачком, а пункты футера подпрыгивают.
|
|
32
|
+
// Футер прижат к низу меню, поэтому плавно доводим его от прежнего положения к новому.
|
|
33
|
+
var prevHeightRef = useRef(null);
|
|
34
|
+
useLayoutEffect(function () {
|
|
35
|
+
var _a;
|
|
36
|
+
var node = footerRef.current;
|
|
37
|
+
var prevHeight = prevHeightRef.current;
|
|
38
|
+
if (!node || prevHeight === null || typeof node.animate !== 'function') {
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
var offset = getDOMRect(node).height - prevHeight;
|
|
42
|
+
var prefersReducedMotion = (_a = globalThis.matchMedia) === null || _a === void 0 ? void 0 : _a.call(globalThis, '(prefers-reduced-motion: reduce)').matches;
|
|
43
|
+
if (offset && !prefersReducedMotion) {
|
|
44
|
+
node.animate([{ transform: "translateY(".concat(offset, "px)") }, { transform: 'translateY(0)' }], {
|
|
45
|
+
duration: transitionDuration,
|
|
46
|
+
easing: 'ease-out',
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
}, [context.isOpened]);
|
|
50
|
+
useLayoutEffect(function () {
|
|
51
|
+
prevHeightRef.current = footerRef.current ? getDOMRect(footerRef.current).height : null;
|
|
52
|
+
});
|
|
29
53
|
var isTabletOrMobile = context.isTablet || context.isMobile;
|
|
54
|
+
var isLarge = context.size === 'large';
|
|
30
55
|
var showCollapseToggle = (context.isDesktop || context.isNarrowDesktop) && !context.disableCollapsing;
|
|
31
56
|
var showTrailingItem = showCollapseToggle && context.isOpened;
|
|
32
57
|
var footerItems = flattenChildren(children);
|
|
@@ -37,13 +62,24 @@ var SideMenuFooterInner = forwardRef(function (_a, ref) {
|
|
|
37
62
|
}, [context.hasScrollBar, context.scrollState]);
|
|
38
63
|
if (!isTabletOrMobile || context.isOpened) {
|
|
39
64
|
return (React.createElement("footer", __assign({ "data-tid": SideMenuDataTids.footer, "data-visual-state-fixed": isFixed, className: cx(styles.root(theme), (_b = {},
|
|
65
|
+
_b[styles.rootLarge(theme)] = isLarge,
|
|
66
|
+
_b[sideMenuStyles.itemsContainerCollapsed(theme)] = !context.isOpened,
|
|
67
|
+
_b[sideMenuStyles.itemsContainerCollapsedLarge(theme)] = !context.isOpened && isLarge,
|
|
40
68
|
_b[styles.rootFixed(theme)] = isFixed,
|
|
69
|
+
_b[styles.rootFixedCollapsed(theme)] = isFixed && !context.isOpened,
|
|
70
|
+
_b[styles.rootFixedCollapsedLarge(theme)] = isFixed && !context.isOpened && isLarge,
|
|
41
71
|
_b[styles.rootTransitionedTabletAndMobile()] = context.isBeingTransitioned && isTabletOrMobile,
|
|
42
72
|
_b), className), ref: mergeRefs(footerRef, ref) }, rest),
|
|
43
73
|
leadingItems.length > 0 && React.createElement("ul", { className: cx(sideMenuStyles.list(), styles.list()) }, leadingItems),
|
|
44
74
|
(trailingItem || showCollapseToggle) && (React.createElement("div", { className: cx(styles.trailingRow()) },
|
|
45
|
-
trailingItem && (React.createElement("ul", { className: cx(sideMenuStyles.list(), styles.list(), styles.trailingItem(theme)
|
|
46
|
-
|
|
75
|
+
trailingItem && (React.createElement("ul", { className: cx(sideMenuStyles.list(), styles.list(), styles.trailingItem(theme), (_c = {},
|
|
76
|
+
_c[styles.trailingItemLarge(theme)] = isLarge,
|
|
77
|
+
_c)) }, trailingItem)),
|
|
78
|
+
showCollapseToggle && (React.createElement("span", { ref: context.collapseToggleRef, className: cx(styles.collapseToggleSlot(theme), (_d = {},
|
|
79
|
+
_d[styles.collapseToggleSlotOpened(theme)] = context.isOpened,
|
|
80
|
+
_d[styles.collapseToggleSlotLarge(theme)] = isLarge,
|
|
81
|
+
_d[styles.collapseToggleSlotOpenedLarge(theme)] = context.isOpened && isLarge,
|
|
82
|
+
_d)) }))))));
|
|
47
83
|
}
|
|
48
84
|
return null;
|
|
49
85
|
});
|
|
@@ -1,10 +1,17 @@
|
|
|
1
1
|
import type { SideMenuTheme } from '../../lib/theming/ThemeTypes.js';
|
|
2
2
|
export declare const getStyles: import("../../lib/theming/ThemeHelpers.js").StylesGetter<{
|
|
3
3
|
root(t: SideMenuTheme): string;
|
|
4
|
+
rootLarge(t: SideMenuTheme): string;
|
|
4
5
|
list(): string;
|
|
5
6
|
trailingRow(): string;
|
|
6
7
|
trailingItem(t: SideMenuTheme): string;
|
|
8
|
+
trailingItemLarge(t: SideMenuTheme): string;
|
|
7
9
|
collapseToggleSlot(t: SideMenuTheme): string;
|
|
10
|
+
collapseToggleSlotOpened(t: SideMenuTheme): string;
|
|
11
|
+
collapseToggleSlotLarge(t: SideMenuTheme): string;
|
|
12
|
+
collapseToggleSlotOpenedLarge(t: SideMenuTheme): string;
|
|
8
13
|
rootFixed(t: SideMenuTheme): string;
|
|
14
|
+
rootFixedCollapsed(t: SideMenuTheme): string;
|
|
15
|
+
rootFixedCollapsedLarge(t: SideMenuTheme): string;
|
|
9
16
|
rootTransitionedTabletAndMobile(): string;
|
|
10
17
|
}>;
|
|
@@ -4,26 +4,48 @@ export var getStyles = memoizeGetStyles(function (_a) {
|
|
|
4
4
|
var css = _a.css;
|
|
5
5
|
return ({
|
|
6
6
|
root: function (t) {
|
|
7
|
-
return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n flex-direction: column;\n flex-grow: 0;\n position: sticky;\n bottom: 0;\n padding-bottom: ", ";\n padding-top: ", ";\n margin: 0 ", ";\n background-color: inherit;\n "], ["\n display: flex;\n flex-direction: column;\n flex-grow: 0;\n position: sticky;\n bottom: 0;\n padding-bottom: ", ";\n padding-top: ", ";\n margin: 0 ", ";\n background-color: inherit;\n "])), t.sideMenuFooterPaddingBottom, t.sideMenuFooterPaddingTop, t.
|
|
7
|
+
return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n flex-direction: column;\n flex-grow: 0;\n position: sticky;\n bottom: 0;\n padding-bottom: ", ";\n padding-top: ", ";\n margin: 0 ", ";\n background-color: inherit;\n "], ["\n display: flex;\n flex-direction: column;\n flex-grow: 0;\n position: sticky;\n bottom: 0;\n padding-bottom: ", ";\n padding-top: ", ";\n margin: 0 ", ";\n background-color: inherit;\n "])), t.sideMenuFooterPaddingBottom, t.sideMenuFooterPaddingTop, t.sideMenuItemsMarginX);
|
|
8
|
+
},
|
|
9
|
+
rootLarge: function (t) {
|
|
10
|
+
return css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n padding-bottom: ", ";\n "], ["\n padding-bottom: ", ";\n "])), t.sideMenuFooterPaddingBottomLarge);
|
|
8
11
|
},
|
|
9
12
|
list: function () {
|
|
10
|
-
return css(
|
|
13
|
+
return css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n display: flex;\n flex-direction: column;\n min-width: 0;\n "], ["\n display: flex;\n flex-direction: column;\n min-width: 0;\n "])));
|
|
11
14
|
},
|
|
12
15
|
trailingRow: function () {
|
|
13
|
-
return css(
|
|
16
|
+
return css(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n min-width: 0;\n "], ["\n display: flex;\n align-items: center;\n min-width: 0;\n "])));
|
|
14
17
|
},
|
|
15
18
|
trailingItem: function (t) {
|
|
16
|
-
return css(
|
|
19
|
+
return css(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n flex: 1 1 auto;\n min-width: 0;\n --side-menu-footer-trailing-reserved-width: calc(\n ", " + ", "\n );\n "], ["\n flex: 1 1 auto;\n min-width: 0;\n --side-menu-footer-trailing-reserved-width: calc(\n ", " + ", "\n );\n "])), t.sideMenuCollapseToggleSize, t.sideMenuCollapseToggleOffsetRight);
|
|
20
|
+
},
|
|
21
|
+
trailingItemLarge: function (t) {
|
|
22
|
+
return css(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n --side-menu-footer-trailing-reserved-width: calc(\n ", " + ", "\n );\n "], ["\n --side-menu-footer-trailing-reserved-width: calc(\n ", " + ", "\n );\n "])), t.sideMenuCollapseToggleSizeLarge, t.sideMenuCollapseToggleOffsetRight);
|
|
17
23
|
},
|
|
18
24
|
collapseToggleSlot: function (t) {
|
|
19
|
-
return css(
|
|
25
|
+
return css(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n width: ", ";\n height: ", ";\n flex-shrink: 0;\n "], ["\n width: ", ";\n height: ", ";\n flex-shrink: 0;\n "])), t.sideMenuCollapseToggleSize, t.sideMenuCollapseToggleSize);
|
|
26
|
+
},
|
|
27
|
+
collapseToggleSlotOpened: function (t) {
|
|
28
|
+
return css(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n width: calc(", " + ", ");\n "], ["\n width: calc(", " + ", ");\n "])), t.sideMenuCollapseToggleSize, t.sideMenuCollapseToggleOffsetRight);
|
|
29
|
+
},
|
|
30
|
+
collapseToggleSlotLarge: function (t) {
|
|
31
|
+
return css(templateObject_9 || (templateObject_9 = __makeTemplateObject(["\n width: ", ";\n height: ", ";\n "], ["\n width: ", ";\n height: ", ";\n "])), t.sideMenuCollapseToggleSizeLarge, t.sideMenuCollapseToggleSizeLarge);
|
|
20
32
|
},
|
|
33
|
+
collapseToggleSlotOpenedLarge: function (t) {
|
|
34
|
+
return css(templateObject_10 || (templateObject_10 = __makeTemplateObject(["\n width: calc(", " + ", ");\n "], ["\n width: calc(", " + ", ");\n "])), t.sideMenuCollapseToggleSizeLarge, t.sideMenuCollapseToggleOffsetRight);
|
|
35
|
+
},
|
|
36
|
+
// Разделитель выравнивается по разделителю шапки, а не по краям пунктов
|
|
21
37
|
rootFixed: function (t) {
|
|
22
|
-
return css(
|
|
38
|
+
return css(templateObject_11 || (templateObject_11 = __makeTemplateObject(["\n &::before {\n content: '';\n position: absolute;\n top: 0;\n left: calc(", " - ", ");\n right: calc(", " - ", ");\n height: 1px;\n background: ", ";\n }\n "], ["\n &::before {\n content: '';\n position: absolute;\n top: 0;\n left: calc(", " - ", ");\n right: calc(", " - ", ");\n height: 1px;\n background: ", ";\n }\n "])), t.sideMenuMarginX, t.sideMenuItemsMarginX, t.sideMenuMarginX, t.sideMenuItemsMarginX, t.sideMenuFooterDividerColor);
|
|
39
|
+
},
|
|
40
|
+
rootFixedCollapsed: function (t) {
|
|
41
|
+
return css(templateObject_12 || (templateObject_12 = __makeTemplateObject(["\n &::before {\n left: calc(", " - ", ");\n right: calc(", " - ", ");\n }\n "], ["\n &::before {\n left: calc(", " - ", ");\n right: calc(", " - ", ");\n }\n "])), t.sideMenuMarginX, t.sideMenuItemsMarginXCollapsed, t.sideMenuMarginX, t.sideMenuItemsMarginXCollapsed);
|
|
42
|
+
},
|
|
43
|
+
rootFixedCollapsedLarge: function (t) {
|
|
44
|
+
return css(templateObject_13 || (templateObject_13 = __makeTemplateObject(["\n &::before {\n left: calc(", " - ", ");\n right: calc(", " - ", ");\n }\n "], ["\n &::before {\n left: calc(", " - ", ");\n right: calc(", " - ", ");\n }\n "])), t.sideMenuMarginX, t.sideMenuItemsMarginXCollapsedLarge, t.sideMenuMarginX, t.sideMenuItemsMarginXCollapsedLarge);
|
|
23
45
|
},
|
|
24
46
|
rootTransitionedTabletAndMobile: function () {
|
|
25
|
-
return css(
|
|
47
|
+
return css(templateObject_14 || (templateObject_14 = __makeTemplateObject(["\n position: static;\n "], ["\n position: static;\n "])));
|
|
26
48
|
},
|
|
27
49
|
});
|
|
28
50
|
});
|
|
29
|
-
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7;
|
|
51
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9, templateObject_10, templateObject_11, templateObject_12, templateObject_13, templateObject_14;
|
|
@@ -14,7 +14,7 @@ var SideMenuSubItemHeaderInner = forwardRef(function (_a, ref) {
|
|
|
14
14
|
var styles = useStyles(getStyles);
|
|
15
15
|
return (React.createElement("p", __assign({ className: cx(styles.root(theme), (_b = {},
|
|
16
16
|
_b[styles.rootInDropdown()] = !context.isOpened && !context.isSeparatedMenu,
|
|
17
|
-
_b[styles.rootInSeparatedSubMenu()] = context.isSeparatedMenu,
|
|
17
|
+
_b[styles.rootInSeparatedSubMenu(theme)] = context.isSeparatedMenu,
|
|
18
18
|
_b), className), ref: ref }, rest), children));
|
|
19
19
|
});
|
|
20
20
|
SideMenuSubItemHeaderInner.displayName = 'SideMenuSubItemHeader';
|
|
@@ -2,5 +2,5 @@ import type { SideMenuTheme } from '../../lib/theming/ThemeTypes.js';
|
|
|
2
2
|
export declare const getStyles: import("../../lib/theming/ThemeHelpers.js").StylesGetter<{
|
|
3
3
|
root(t: SideMenuTheme): string;
|
|
4
4
|
rootInDropdown(): string;
|
|
5
|
-
rootInSeparatedSubMenu(): string;
|
|
5
|
+
rootInSeparatedSubMenu(t: SideMenuTheme): string;
|
|
6
6
|
}>;
|
|
@@ -9,8 +9,8 @@ export var getStyles = memoizeGetStyles(function (_a) {
|
|
|
9
9
|
rootInDropdown: function () {
|
|
10
10
|
return css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n padding: 12px 8px 4px 8px;\n "], ["\n padding: 12px 8px 4px 8px;\n "])));
|
|
11
11
|
},
|
|
12
|
-
rootInSeparatedSubMenu: function () {
|
|
13
|
-
return css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n padding-
|
|
12
|
+
rootInSeparatedSubMenu: function (t) {
|
|
13
|
+
return css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n padding: ", ";\n line-height: 16px;\n color: ", ";\n "], ["\n padding: ", ";\n line-height: 16px;\n color: ", ";\n "])), t.sideMenuSubItemHeaderPaddingInSeparatedSubMenu, t.sideMenuSubItemHeaderColorInSeparatedSubMenu);
|
|
14
14
|
},
|
|
15
15
|
});
|
|
16
16
|
});
|
|
@@ -219,6 +219,7 @@ var ClickableElement = forwardRef(function (_a, ref) {
|
|
|
219
219
|
onKeyDown === null || onKeyDown === void 0 ? void 0 : onKeyDown(e);
|
|
220
220
|
};
|
|
221
221
|
var newProps = __assign({ className: cx(styles.root(theme), (_b = {},
|
|
222
|
+
_b[styles.rootLarge(theme)] = context.size === 'large' && !(_isSubMenu && isDesktopCollapsedMode),
|
|
222
223
|
_b[styles.rootButton(theme)] = !disabled,
|
|
223
224
|
_b[styles.rootFocus(theme)] = isFocusedByTab,
|
|
224
225
|
_b[styles.rootDisabled(theme)] = disabled,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { SideMenuTheme } from '../../lib/theming/ThemeTypes.js';
|
|
2
2
|
export declare const getStyles: import("../../lib/theming/ThemeHelpers.js").StylesGetter<{
|
|
3
3
|
root(t: SideMenuTheme): string;
|
|
4
|
+
rootLarge(t: SideMenuTheme): string;
|
|
4
5
|
rootButton(t: SideMenuTheme): string;
|
|
5
6
|
rootSubItemInSeparatedSubMenu(t: SideMenuTheme): string;
|
|
6
7
|
rootSubItemInSeparatedSubMenuButton(t: SideMenuTheme): string;
|
|
@@ -7,36 +7,41 @@ export var getStyles = memoizeGetStyles(function (_a) {
|
|
|
7
7
|
root: function (t) {
|
|
8
8
|
return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n user-select: text;\n ", ";\n color: ", ";\n width: 100%;\n border-radius: ", ";\n cursor: pointer;\n box-sizing: border-box;\n scroll-margin-top: var(--side-menu-scroll-margin-top, 0);\n scroll-margin-bottom: var(--side-menu-scroll-margin-bottom, 0);\n transition: background ", " ease-out;\n\n &:hover {\n background: ", ";\n }\n "], ["\n user-select: text;\n ", ";\n color: ", ";\n width: 100%;\n border-radius: ", ";\n cursor: pointer;\n box-sizing: border-box;\n scroll-margin-top: var(--side-menu-scroll-margin-top, 0);\n scroll-margin-bottom: var(--side-menu-scroll-margin-bottom, 0);\n transition: background ", " ease-out;\n\n &:hover {\n background: ", ";\n }\n "])), resetButton(), t.sideMenuItemColor, t.sideMenuItemBorderRadius, t.transitionDuration, t.sideMenuItemBgHover);
|
|
9
9
|
},
|
|
10
|
+
rootLarge: function (t) {
|
|
11
|
+
return css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n border-radius: ", ";\n "], ["\n border-radius: ", ";\n "])), t.sideMenuItemBorderRadiusLarge);
|
|
12
|
+
},
|
|
10
13
|
rootButton: function (t) {
|
|
11
|
-
return css(
|
|
14
|
+
return css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n &:active {\n background: ", ";\n }\n "], ["\n &:active {\n background: ", ";\n }\n "])), t.sideMenuItemBgPressed);
|
|
12
15
|
},
|
|
13
16
|
rootSubItemInSeparatedSubMenu: function (t) {
|
|
14
|
-
return css(
|
|
17
|
+
return css(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n &:hover {\n background: ", ";\n }\n "], ["\n &:hover {\n background: ", ";\n }\n "])), t.sideMenuSubItemWithSeparatedSubMenuBgHover);
|
|
15
18
|
},
|
|
16
19
|
rootSubItemInSeparatedSubMenuButton: function (t) {
|
|
17
|
-
|
|
20
|
+
// :hover:active — чтобы нажатие не перебивалось :hover из rootSubItemInSeparatedSubMenu,
|
|
21
|
+
// который в итоговом классе идёт позже (одинаковое правило :active из rootButton emotion не дублирует)
|
|
22
|
+
return css(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n &:hover:active,\n &:active {\n background: ", ";\n }\n "], ["\n &:hover:active,\n &:active {\n background: ", ";\n }\n "])), t.sideMenuSubItemWithSeparatedSubMenuBgPressed);
|
|
18
23
|
},
|
|
19
24
|
rootFocus: function (t) {
|
|
20
|
-
return css(
|
|
25
|
+
return css(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n box-shadow: ", ";\n "], ["\n box-shadow: ", ";\n "])), t.sideMenuItemBoxShadowFocus);
|
|
21
26
|
},
|
|
22
27
|
rootDisabled: function (t) {
|
|
23
|
-
return css(
|
|
28
|
+
return css(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n color: ", ";\n pointer-events: none;\n "], ["\n color: ", ";\n pointer-events: none;\n "])), t.sideMenuItemColorDisabled);
|
|
24
29
|
},
|
|
25
30
|
rootActive: function (t) {
|
|
26
|
-
return css(
|
|
31
|
+
return css(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n background: ", " !important;\n "], ["\n background: ", " !important;\n "])), t.sideMenuItemBgActive);
|
|
27
32
|
},
|
|
28
33
|
rootDropdownOpen: function (t) {
|
|
29
|
-
return css(
|
|
34
|
+
return css(templateObject_9 || (templateObject_9 = __makeTemplateObject(["\n background: ", " !important;\n "], ["\n background: ", " !important;\n "])), t.sideMenuItemBgHover);
|
|
30
35
|
},
|
|
31
36
|
rootSubItemInDropdownActive: function (t) {
|
|
32
|
-
return css(
|
|
37
|
+
return css(templateObject_10 || (templateObject_10 = __makeTemplateObject(["\n background: ", " !important;\n "], ["\n background: ", " !important;\n "])), t.sideMenuItemBgHover);
|
|
33
38
|
},
|
|
34
39
|
rootSubItemInDropdownButton: function (t) {
|
|
35
|
-
return css(
|
|
40
|
+
return css(templateObject_11 || (templateObject_11 = __makeTemplateObject(["\n &:active {\n background: ", ";\n }\n "], ["\n &:active {\n background: ", ";\n }\n "])), t.sideMenuItemBgPressed);
|
|
36
41
|
},
|
|
37
42
|
rootSubItemInSeparatedSubMenuActive: function (t) {
|
|
38
|
-
return css(
|
|
43
|
+
return css(templateObject_12 || (templateObject_12 = __makeTemplateObject(["\n background: ", " !important;\n\n &:hover {\n background: ", " !important;\n }\n\n &:active {\n background: ", " !important;\n }\n "], ["\n background: ", " !important;\n\n &:hover {\n background: ", " !important;\n }\n\n &:active {\n background: ", " !important;\n }\n "])), t.sideMenuSubItemWithSeparatedSubMenuBgActive, t.sideMenuSubItemWithSeparatedSubMenuBgActiveHover, t.sideMenuSubItemWithSeparatedSubMenuBgActivePressed);
|
|
39
44
|
},
|
|
40
45
|
});
|
|
41
46
|
});
|
|
42
|
-
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9, templateObject_10, templateObject_11;
|
|
47
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9, templateObject_10, templateObject_11, templateObject_12;
|
|
@@ -13,12 +13,13 @@ var SideMenuCollapseIcon = function () {
|
|
|
13
13
|
React.createElement("path", { stroke: "currentColor", strokeWidth: 1.5, d: "M8.5 19V5M6 19h12a3 3 0 0 0 3-3V8a3 3 0 0 0-3-3H6a3 3 0 0 0-3 3v8a3 3 0 0 0 3 3Z" })));
|
|
14
14
|
};
|
|
15
15
|
export var CollapseToggle = function () {
|
|
16
|
+
var _a;
|
|
16
17
|
var context = useContext(SideMenuContext);
|
|
17
18
|
var theme = getSideMenuTheme(useContext(ThemeContext));
|
|
18
19
|
var styles = useStyles(getStyles);
|
|
19
20
|
var cx = useEmotion().cx;
|
|
20
21
|
var slotRef = context.collapseToggleRef;
|
|
21
|
-
var
|
|
22
|
+
var _b = __read(useState(false), 2), mounted = _b[0], setMounted = _b[1];
|
|
22
23
|
// The slot lives in the Footer, which mounts in the same commit. Refs are assigned
|
|
23
24
|
// before layout effects run, so after this effect the portal target is ready.
|
|
24
25
|
useLayoutEffect(function () {
|
|
@@ -31,7 +32,10 @@ export var CollapseToggle = function () {
|
|
|
31
32
|
(_a = context.setMenuOpened) === null || _a === void 0 ? void 0 : _a.call(context, !isOpened);
|
|
32
33
|
};
|
|
33
34
|
var button = (React.createElement(ClickableElementWithHint, { hint: hintText, isOpened: false },
|
|
34
|
-
React.createElement("button", { type: 'button', className: cx(styles.root(theme)
|
|
35
|
+
React.createElement("button", { type: 'button', className: cx(styles.root(theme), (_a = {},
|
|
36
|
+
_a[styles.rootOpened(theme)] = isOpened,
|
|
37
|
+
_a[styles.rootLarge(theme)] = context.size === 'large',
|
|
38
|
+
_a)), "aria-label": hintText, "aria-expanded": isOpened, "data-tid": SideMenuDataTids.collapseToggle, onClick: handleClick },
|
|
35
39
|
React.createElement(SideMenuCollapseIcon, null))));
|
|
36
40
|
if (!mounted || !(slotRef === null || slotRef === void 0 ? void 0 : slotRef.current)) {
|
|
37
41
|
return null;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import type { SideMenuTheme } from '../../lib/theming/ThemeTypes.js';
|
|
2
2
|
export declare const getStyles: import("../../lib/theming/ThemeHelpers.js").StylesGetter<{
|
|
3
3
|
root(t: SideMenuTheme): string;
|
|
4
|
+
rootOpened(t: SideMenuTheme): string;
|
|
5
|
+
rootLarge(t: SideMenuTheme): string;
|
|
4
6
|
}>;
|
|
@@ -8,6 +8,12 @@ export var getStyles = memoizeGetStyles(function (_a) {
|
|
|
8
8
|
root: function (t) {
|
|
9
9
|
return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n ", ";\n display: flex;\n align-items: center;\n justify-content: center;\n width: ", ";\n height: ", ";\n flex-shrink: 0;\n border-radius: ", ";\n color: ", ";\n cursor: pointer;\n transition: background ", " ease-out;\n\n &:hover {\n color: ", ";\n }\n\n &:focus-visible {\n box-shadow: ", ";\n }\n\n svg {\n transition: opacity ", ";\n }\n "], ["\n ", ";\n display: flex;\n align-items: center;\n justify-content: center;\n width: ", ";\n height: ", ";\n flex-shrink: 0;\n border-radius: ", ";\n color: ", ";\n cursor: pointer;\n transition: background ", " ease-out;\n\n &:hover {\n color: ", ";\n }\n\n &:focus-visible {\n box-shadow: ", ";\n }\n\n svg {\n transition: opacity ", ";\n }\n "])), resetButton(), t.sideMenuCollapseToggleSize, t.sideMenuCollapseToggleSize, t.sideMenuItemBorderRadius, t.sideMenuRightBorderIconColor, t.transitionDuration, t.sideMenuRightBorderIconColorHover, t.sideMenuItemBoxShadowFocus, transitionDuration);
|
|
10
10
|
},
|
|
11
|
+
rootOpened: function (t) {
|
|
12
|
+
return css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n box-sizing: content-box;\n padding-right: ", ";\n "], ["\n box-sizing: content-box;\n padding-right: ", ";\n "])), t.sideMenuCollapseToggleOffsetRight);
|
|
13
|
+
},
|
|
14
|
+
rootLarge: function (t) {
|
|
15
|
+
return css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n width: ", ";\n height: ", ";\n border-radius: ", ";\n "], ["\n width: ", ";\n height: ", ";\n border-radius: ", ";\n "])), t.sideMenuCollapseToggleSizeLarge, t.sideMenuCollapseToggleSizeLarge, t.sideMenuItemBorderRadiusLarge);
|
|
16
|
+
},
|
|
11
17
|
});
|
|
12
18
|
});
|
|
13
|
-
var templateObject_1;
|
|
19
|
+
var templateObject_1, templateObject_2, templateObject_3;
|
|
@@ -58,6 +58,7 @@ export var Caption = forwardRef(function (_a, ref) {
|
|
|
58
58
|
React.createElement(Component, { className: cx(styles.caption(theme), (_c = {},
|
|
59
59
|
_c[styles.captionDropdown()] = _isDropdown,
|
|
60
60
|
_c[styles.captionTruncated()] = isCaptionPlainText && _isDropdown,
|
|
61
|
+
_c[styles.captionWithoutMarker(theme)] = !hasMarker && !_isSubMenu,
|
|
61
62
|
_c[styles.captionSubItem(theme)] = _isSubMenu,
|
|
62
63
|
_c[styles.captionSubItemSeparatedMenuTopLevel()] = isSeparatedMenu && !isNestedSubMenu && _isSubMenu && !hasIcon,
|
|
63
64
|
_c[styles.captionNestedItemSeparatedMenu()] = isSeparatedMenu && isNestedSubMenu && !hasIcon,
|
|
@@ -8,6 +8,7 @@ export declare const getStyles: import("../../../lib/theming/ThemeHelpers.js").S
|
|
|
8
8
|
rootMultiline(t: SideMenuTheme): string;
|
|
9
9
|
caption(t: SideMenuTheme): string;
|
|
10
10
|
captionTouchScreen(t: SideMenuTheme): string;
|
|
11
|
+
captionWithoutMarker(t: SideMenuTheme): string;
|
|
11
12
|
captionSubItem(t: SideMenuTheme): string;
|
|
12
13
|
captionSubItemTouchScreen(t: SideMenuTheme): string;
|
|
13
14
|
captionSubItemSeparatedMenuTopLevel(): string;
|
|
@@ -19,42 +19,45 @@ export var getStyles = memoizeGetStyles(function (_a) {
|
|
|
19
19
|
captionTouchScreen: function (t) {
|
|
20
20
|
return css(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n font-size: ", ";\n line-height: ", ";\n "], ["\n font-size: ", ";\n line-height: ", ";\n "])), t.sideMenuCaptionFontSizeTouchScreen, t.sideMenuCaptionLineHeightTouchScreen);
|
|
21
21
|
},
|
|
22
|
+
captionWithoutMarker: function (t) {
|
|
23
|
+
return css(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n margin-right: ", ";\n "], ["\n margin-right: ", ";\n "])), t.sideMenuItemPaddingRight);
|
|
24
|
+
},
|
|
22
25
|
captionSubItem: function (t) {
|
|
23
|
-
return css(
|
|
26
|
+
return css(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n margin-left: ", ";\n "], ["\n margin-left: ", ";\n "])), t.sideMenuCaptionSubItemMarginLeft);
|
|
24
27
|
},
|
|
25
28
|
captionSubItemTouchScreen: function (t) {
|
|
26
|
-
return css(
|
|
29
|
+
return css(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n font-size: ", ";\n line-height: ", ";\n "], ["\n font-size: ", ";\n line-height: ", ";\n "])), t.sideMenuCaptionSubItemFontSizeTouchScreen, t.sideMenuCaptionSubItemLineHeightTouchScreen);
|
|
27
30
|
},
|
|
28
31
|
captionSubItemSeparatedMenuTopLevel: function () {
|
|
29
|
-
return css(
|
|
32
|
+
return css(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n margin: 0 8px 0 12px;\n "], ["\n margin: 0 8px 0 12px;\n "])));
|
|
30
33
|
},
|
|
31
34
|
captionNestedItemSeparatedMenu: function () {
|
|
32
|
-
return css(
|
|
35
|
+
return css(templateObject_9 || (templateObject_9 = __makeTemplateObject(["\n margin-left: 28px;\n "], ["\n margin-left: 28px;\n "])));
|
|
33
36
|
},
|
|
34
37
|
captionWithoutItemIcon: function () {
|
|
35
|
-
return css(
|
|
38
|
+
return css(templateObject_10 || (templateObject_10 = __makeTemplateObject(["\n margin-left: 48px;\n "], ["\n margin-left: 48px;\n "])));
|
|
36
39
|
},
|
|
37
40
|
captionSubItemWithoutColumnIcons: function () {
|
|
38
|
-
return css(
|
|
41
|
+
return css(templateObject_11 || (templateObject_11 = __makeTemplateObject(["\n margin-left: 12px;\n "], ["\n margin-left: 12px;\n "])));
|
|
39
42
|
},
|
|
40
43
|
captionLarge: function (t) {
|
|
41
|
-
return css(
|
|
44
|
+
return css(templateObject_12 || (templateObject_12 = __makeTemplateObject(["\n font-size: ", " !important;\n line-height: ", " !important;\n "], ["\n font-size: ", " !important;\n line-height: ", " !important;\n "])), t.sideMenuCaptionFontSizeLarge, t.sideMenuCaptionLineHeightLarge);
|
|
42
45
|
},
|
|
43
46
|
captionInBackButton: function (t) {
|
|
44
|
-
return css(
|
|
47
|
+
return css(templateObject_13 || (templateObject_13 = __makeTemplateObject(["\n font-weight: ", ";\n font-size: ", ";\n line-height: ", ";\n padding-top: ", ";\n padding-bottom: ", ";\n "], ["\n font-weight: ", ";\n font-size: ", ";\n line-height: ", ";\n padding-top: ", ";\n padding-bottom: ", ";\n "])), t.sideMenuBackButtonCaptionFontWeight, t.sideMenuBackButtonCaptionFontSize, t.sideMenuBackButtonCaptionLineHeight, t.sideMenuBackButtonCaptionPaddingY, t.sideMenuBackButtonCaptionPaddingY);
|
|
45
48
|
},
|
|
46
49
|
captionDropdown: function () {
|
|
47
|
-
return css(
|
|
50
|
+
return css(templateObject_14 || (templateObject_14 = __makeTemplateObject(["\n white-space: nowrap;\n overflow: hidden;\n "], ["\n white-space: nowrap;\n overflow: hidden;\n "])));
|
|
48
51
|
},
|
|
49
52
|
captionTruncated: function () {
|
|
50
|
-
return css(
|
|
53
|
+
return css(templateObject_15 || (templateObject_15 = __makeTemplateObject(["\n text-overflow: ellipsis;\n &::before {\n float: right;\n content: attr(data-tail);\n }\n "], ["\n text-overflow: ellipsis;\n &::before {\n float: right;\n content: attr(data-tail);\n }\n "])));
|
|
51
54
|
},
|
|
52
55
|
captionNoWrap: function () {
|
|
53
|
-
return css(
|
|
56
|
+
return css(templateObject_16 || (templateObject_16 = __makeTemplateObject(["\n text-overflow: ellipsis;\n white-space: nowrap;\n overflow: hidden;\n "], ["\n text-overflow: ellipsis;\n white-space: nowrap;\n overflow: hidden;\n "])));
|
|
54
57
|
},
|
|
55
58
|
captionNoWrapWithMarker: function (t) {
|
|
56
|
-
return css(
|
|
59
|
+
return css(templateObject_17 || (templateObject_17 = __makeTemplateObject(["\n margin: 0 ", " 0 0;\n "], ["\n margin: 0 ", " 0 0;\n "])), t.sideMenuCaptionNoWrapWithMarkerMarginRight);
|
|
57
60
|
},
|
|
58
61
|
});
|
|
59
62
|
});
|
|
60
|
-
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9, templateObject_10, templateObject_11, templateObject_12, templateObject_13, templateObject_14, templateObject_15, templateObject_16;
|
|
63
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9, templateObject_10, templateObject_11, templateObject_12, templateObject_13, templateObject_14, templateObject_15, templateObject_16, templateObject_17;
|
|
@@ -36,6 +36,8 @@ export var Icon = function (_a) {
|
|
|
36
36
|
return (React.createElement("span", { className: cx(styles.root(theme), (_b = {},
|
|
37
37
|
_b[styles.rootMultiline()] = isMultiline && (isOpened || _isSubMenu),
|
|
38
38
|
_b[styles.rootLarge(theme)] = isLarge,
|
|
39
|
+
_b[styles.rootCollapsed(theme)] = !isOpened && !_isSubMenu,
|
|
40
|
+
_b[styles.rootCollapsedLarge(theme)] = !isOpened && !_isSubMenu && isLarge,
|
|
39
41
|
_b[styles.rootSubItem(theme)] = _isSubMenu,
|
|
40
42
|
_b[styles.rootSubItemDropdown()] = _isSubMenu && !isOpened && !isSeparatedMenu,
|
|
41
43
|
_b[styles.rootSubItemSeparatedMenu(theme)] = isSeparatedMenu && _isSubMenu,
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import type { SideMenuTheme } from '../../../lib/theming/ThemeTypes.js';
|
|
2
2
|
export declare const getStyles: import("../../../lib/theming/ThemeHelpers.js").StylesGetter<{
|
|
3
3
|
root(t: SideMenuTheme): string;
|
|
4
|
+
rootCollapsed(t: SideMenuTheme): string;
|
|
5
|
+
rootCollapsedLarge(t: SideMenuTheme): string;
|
|
4
6
|
rootMultiline(): string;
|
|
5
7
|
rootLarge(t: SideMenuTheme): string;
|
|
6
8
|
rootSubItemLarge(t: SideMenuTheme): string;
|