@skbkontur/side-menu 0.11.0 → 0.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +25 -0
- package/package.json +2 -2
- package/src/SideMenu/SideMenu.js +2 -1
- package/src/internal/Burger.js +2 -2
- package/src/internal/InnerSubMenu.d.ts +1 -2
- package/src/internal/InnerSubMenu.js +1 -2
- package/src/internal/ItemContent/Icon.js +1 -1
- package/src/internal/SeparatedSubMenu.d.ts +1 -2
- package/src/internal/SeparatedSubMenu.js +1 -2
- package/src/internal/SeparatedSubMenu.styles.js +1 -1
- package/src/internal/SubMenu.d.ts +1 -2
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,31 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [0.12.0](https://git.skbkontur.ru/ui/ui-parking/compare/@skbkontur/side-menu@0.11.1...@skbkontur/side-menu@0.12.0) (2023-06-05)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* **icons:** new icons, renaming icons, new API ([8d55b8d](https://git.skbkontur.ru/ui/ui-parking/commits/8d55b8d0459ea3e6af329813cbfe7b85ee239b51))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### BREAKING CHANGES
|
|
15
|
+
|
|
16
|
+
* **icons:** prop `disableCompensation` replaced with prop `align`
|
|
17
|
+
* **icons:** icons now use numbers instead of letters for representing numbers
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
## [0.11.1](https://git.skbkontur.ru/ui/ui-parking/compare/@skbkontur/side-menu@0.11.0...@skbkontur/side-menu@0.11.1) (2023-06-02)
|
|
24
|
+
|
|
25
|
+
**Note:** Version bump only for package @skbkontur/side-menu
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
6
31
|
# [0.11.0](https://git.skbkontur.ru/ui/ui-parking/compare/@skbkontur/side-menu@0.10.1...@skbkontur/side-menu@0.11.0) (2023-05-30)
|
|
7
32
|
|
|
8
33
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@skbkontur/side-menu",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.12.0",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public",
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"@skbkontur/react-ui": "4.13.0"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@skbkontur/icons": "^0.
|
|
25
|
+
"@skbkontur/icons": "^0.17.0",
|
|
26
26
|
"@skbkontur/react-ui-addons": "^4.7.0",
|
|
27
27
|
"tslib": "^1"
|
|
28
28
|
}
|
package/src/SideMenu/SideMenu.js
CHANGED
|
@@ -161,6 +161,7 @@ var SideMenuInner = forwardRef(function (_a, ref) {
|
|
|
161
161
|
}, {
|
|
162
162
|
opacity: 0,
|
|
163
163
|
}), shouldShowBackdrop = _x[0], backdropStyle = _x[1];
|
|
164
|
+
var isSideMenuOverflowing = (isTabletOrMobile && isShown) || (isNarrowDesktop && !isMinimized);
|
|
164
165
|
return (React.createElement(SideMenuContext.Provider, { value: {
|
|
165
166
|
isMinimized: isMinimized,
|
|
166
167
|
setIsMinimized: showMinimizedRoot,
|
|
@@ -188,7 +189,7 @@ var SideMenuInner = forwardRef(function (_a, ref) {
|
|
|
188
189
|
headerHeight: headerHeight,
|
|
189
190
|
setHeaderHeight: setHeaderHeight,
|
|
190
191
|
} },
|
|
191
|
-
React.createElement(ZIndex, { priority:
|
|
192
|
+
React.createElement(ZIndex, { priority: isSideMenuOverflowing ? 8 : 0, className: cx((_b = {},
|
|
192
193
|
_b[jsStyles.root()] = true,
|
|
193
194
|
_b[customStyles.rootForTabletsOrMobiles(headerHeight)] = isTabletOrMobile,
|
|
194
195
|
_b[jsStyles.shownRootForTabletsOrMobiles()] = isShown && isTabletOrMobile,
|
package/src/internal/Burger.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { useContext } from 'react';
|
|
2
2
|
import { jsStyles } from './Burger.styles';
|
|
3
3
|
import { SideMenuContext } from '../SideMenuContext';
|
|
4
|
-
import {
|
|
4
|
+
import { UiMenuBars3HIcon24Regular } from '@skbkontur/icons';
|
|
5
5
|
import { SideMenuDataTids } from '../../SideMenuDataTids';
|
|
6
6
|
import { getSideMenuTheme } from '../../lib/theming/ThemeHelpers';
|
|
7
7
|
import { ThemeContext } from '@skbkontur/react-ui';
|
|
@@ -9,5 +9,5 @@ export var Burger = function () {
|
|
|
9
9
|
var context = useContext(SideMenuContext);
|
|
10
10
|
var theme = getSideMenuTheme(useContext(ThemeContext));
|
|
11
11
|
return (React.createElement("button", { className: jsStyles.rootForTabletsOrMobiles(theme), onClick: context.toggleIsShown, "data-tid": SideMenuDataTids.burger },
|
|
12
|
-
React.createElement(
|
|
12
|
+
React.createElement(UiMenuBars3HIcon24Regular, null)));
|
|
13
13
|
};
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { ZIndex } from '@skbkontur/react-ui/internal/ZIndex';
|
|
3
2
|
interface InnerSubMenuProps {
|
|
4
3
|
children?: React.ReactNode;
|
|
5
4
|
generatedId?: string;
|
|
6
5
|
}
|
|
7
|
-
declare const InnerSubMenuWithStaticFields: React.ForwardRefExoticComponent<InnerSubMenuProps & React.RefAttributes<
|
|
6
|
+
declare const InnerSubMenuWithStaticFields: React.ForwardRefExoticComponent<InnerSubMenuProps & React.RefAttributes<HTMLDivElement>> & {
|
|
8
7
|
__KONTUR_REACT_UI__: string;
|
|
9
8
|
};
|
|
10
9
|
export { InnerSubMenuWithStaticFields as InnerSubMenu };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import React, { forwardRef } from 'react';
|
|
2
2
|
import { isClickableSubElement } from '../../lib/utils/scripts';
|
|
3
|
-
import { ZIndex } from '@skbkontur/react-ui/internal/ZIndex';
|
|
4
3
|
/**
|
|
5
4
|
* Подменю, раскрывающееся внутри основного меню
|
|
6
5
|
*
|
|
@@ -9,7 +8,7 @@ import { ZIndex } from '@skbkontur/react-ui/internal/ZIndex';
|
|
|
9
8
|
var InnerSubMenu = forwardRef(function (_a, ref) {
|
|
10
9
|
var children = _a.children, generatedId = _a.generatedId;
|
|
11
10
|
var levelIndex = 0;
|
|
12
|
-
return (React.createElement(
|
|
11
|
+
return (React.createElement("div", { ref: ref }, React.Children.map(children, function (child) {
|
|
13
12
|
if (React.isValidElement(child)) {
|
|
14
13
|
if (
|
|
15
14
|
// @ts-expect-error: accessing private property
|
|
@@ -21,7 +21,7 @@ export var Icon = function (_a) {
|
|
|
21
21
|
return React.cloneElement(icon, {
|
|
22
22
|
size: getIconSize(theme, _isSubMenu, _isBackButton),
|
|
23
23
|
color: _isSubMenu ? theme.sideMenuIconSubItemColor : undefined,
|
|
24
|
-
|
|
24
|
+
align: _isBackButton ? 'baseline' : 'none',
|
|
25
25
|
className: cx((_b = {},
|
|
26
26
|
_b[jsStyles.root(theme)] = true,
|
|
27
27
|
_b[jsStyles.rootMultiline()] = isMultiline && (!context.isMinimized || _isSubMenu),
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { ZIndex } from '@skbkontur/react-ui/internal/ZIndex';
|
|
3
2
|
interface SeparatedSubMenuProps {
|
|
4
3
|
children?: React.ReactNode;
|
|
5
4
|
generatedId?: string;
|
|
@@ -7,7 +6,7 @@ interface SeparatedSubMenuProps {
|
|
|
7
6
|
href?: string;
|
|
8
7
|
caption?: string;
|
|
9
8
|
}
|
|
10
|
-
declare const SeparatedSubMenuWithStaticFields: React.ForwardRefExoticComponent<SeparatedSubMenuProps & React.RefAttributes<
|
|
9
|
+
declare const SeparatedSubMenuWithStaticFields: React.ForwardRefExoticComponent<SeparatedSubMenuProps & React.RefAttributes<HTMLDivElement>> & {
|
|
11
10
|
__KONTUR_REACT_UI__: string;
|
|
12
11
|
};
|
|
13
12
|
export { SeparatedSubMenuWithStaticFields as SeparatedSubMenu };
|
|
@@ -11,7 +11,6 @@ import { SideMenuDataTids } from '../../SideMenuDataTids';
|
|
|
11
11
|
import { ScrollContainer } from '@skbkontur/react-ui';
|
|
12
12
|
import { getSideMenuTheme } from '../../lib/theming/ThemeHelpers';
|
|
13
13
|
import { isIE11 } from '@skbkontur/react-ui/lib/client';
|
|
14
|
-
import { ZIndex } from '@skbkontur/react-ui/internal/ZIndex';
|
|
15
14
|
/**
|
|
16
15
|
* Отдельностоящее подменю
|
|
17
16
|
*
|
|
@@ -37,7 +36,7 @@ var SeparatedSubMenu = forwardRef(function (_a, ref) {
|
|
|
37
36
|
var levelIndex = 0;
|
|
38
37
|
var isDesktopOverlayMenu = (context.isDesktop || context.isNarrowDesktop) && !context.separatedMenuWithoutOverlay;
|
|
39
38
|
var isSeparatedSubMenuOverContent = (context.isTablet || isDesktopOverlayMenu) && !isIE11;
|
|
40
|
-
return (React.createElement(
|
|
39
|
+
return (React.createElement("div", { className: cx((_b = {},
|
|
41
40
|
_b[jsStyles.container(theme)] = true,
|
|
42
41
|
_b[jsStyles.containerForTouchScreens(theme)] = context.isTouchScreen,
|
|
43
42
|
_b[jsStylesForSeparatedSubMenu.root(theme)] = true,
|
|
@@ -3,7 +3,7 @@ import { css } from '@skbkontur/react-ui/lib/theming/Emotion';
|
|
|
3
3
|
import { memoizeStyle } from '../../lib/theming/ThemeHelpers';
|
|
4
4
|
var styles = {
|
|
5
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 "], ["\n position: absolute;\n top: 0;\n background: ", ";\n left: 100%;\n justify-content: flex-start;\n border-right: 1px solid ", ";\n "])), t.sideMenuSeparatedSubMenuBgColor, t.sideMenuSeparatedSubMenuBorderRightColor);
|
|
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
7
|
},
|
|
8
8
|
rootWithoutOverlayForNarrowDesktop: function (t) {
|
|
9
9
|
return css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n left: ", ";\n z-index: -1;\n "], ["\n left: ", ";\n z-index: -1;\n "])), t.sideMenuMinimizedWidth);
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { ZIndex } from '@skbkontur/react-ui/internal/ZIndex';
|
|
3
2
|
interface SubMenuProps {
|
|
4
3
|
children?: React.ReactNode;
|
|
5
4
|
generatedId?: string;
|
|
@@ -11,7 +10,7 @@ interface SubMenuProps {
|
|
|
11
10
|
href?: string;
|
|
12
11
|
caption?: string;
|
|
13
12
|
}
|
|
14
|
-
declare const SubMenuWithStaticFields: React.ForwardRefExoticComponent<SubMenuProps & React.RefAttributes<
|
|
13
|
+
declare const SubMenuWithStaticFields: React.ForwardRefExoticComponent<SubMenuProps & React.RefAttributes<HTMLDivElement>> & {
|
|
15
14
|
__KONTUR_REACT_UI__: string;
|
|
16
15
|
};
|
|
17
16
|
export { SubMenuWithStaticFields as SubMenu };
|