@skbkontur/side-menu 1.11.0 → 1.11.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/CHANGELOG.md CHANGED
@@ -3,6 +3,25 @@
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
+ ## [1.11.2](https://git.skbkontur.ru/ui/ui-parking/compare/@skbkontur/side-menu@1.11.1...@skbkontur/side-menu@1.11.2) (2024-02-28)
7
+
8
+ **Note:** Version bump only for package @skbkontur/side-menu
9
+
10
+
11
+
12
+
13
+
14
+ ## [1.11.1](https://git.skbkontur.ru/ui/ui-parking/compare/@skbkontur/side-menu@1.11.0...@skbkontur/side-menu@1.11.1) (2024-02-22)
15
+
16
+
17
+ ### Bug Fixes
18
+
19
+ * **SideMenu:** fix scroll ([69eb116](https://git.skbkontur.ru/ui/ui-parking/commits/69eb1160d268dae9d3ba821229f0c7eb8e73ab0d))
20
+
21
+
22
+
23
+
24
+
6
25
  # [1.11.0](https://git.skbkontur.ru/ui/ui-parking/compare/@skbkontur/side-menu@1.10.1...@skbkontur/side-menu@1.11.0) (2024-02-20)
7
26
 
8
27
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skbkontur/side-menu",
3
- "version": "1.11.0",
3
+ "version": "1.11.2",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
6
  "registry": "https://registry.npmjs.org/"
@@ -23,7 +23,7 @@
23
23
  },
24
24
  "dependencies": {
25
25
  "@skbkontur/icons": "^1.7.3",
26
- "@skbkontur/react-ui-addons": "^4.10.0",
26
+ "@skbkontur/react-ui-addons": "^4.10.1",
27
27
  "tslib": "^1"
28
28
  }
29
29
  }
@@ -35,6 +35,7 @@ var SideMenuInner = forwardRef(function (_a, ref) {
35
35
  var transitionTimer = useRef(null);
36
36
  var sideMenuRef = useRef(null);
37
37
  var contentWrapperRef = useRef(null);
38
+ var scrollContainerRef = useRef(null);
38
39
  var theme = getSideMenuTheme(useContext(ThemeContext));
39
40
  var customMediaQueries = {
40
41
  isMobileQuery: mobileMediaQuery || theme.sideMenuMobileMediaQuery,
@@ -69,13 +70,15 @@ var SideMenuInner = forwardRef(function (_a, ref) {
69
70
  };
70
71
  }, []);
71
72
  useEffect(function () {
72
- if (!contentWrapperRef.current)
73
- return;
74
73
  if (isMobile && isSeparatedMenuShown)
75
74
  return;
76
75
  setTimeout(function () {
76
+ var _a;
77
77
  var contentWrapper = contentWrapperRef.current;
78
- contentWrapper && setHasScrollBar(contentWrapper.clientHeight < contentWrapper.scrollHeight);
78
+ var scrollContainer = (_a = scrollContainerRef.current) === null || _a === void 0 ? void 0 : _a.inner;
79
+ if (!contentWrapper || !scrollContainer)
80
+ return;
81
+ setHasScrollBar(scrollContainer.clientHeight < contentWrapper.scrollHeight);
79
82
  }, 50);
80
83
  }, [activeMenuItem, isOpened, isBeingTransitioned]);
81
84
  var handleIsOpened = function (newIsOpened, shouldSetState) {
@@ -235,7 +238,7 @@ var SideMenuInner = forwardRef(function (_a, ref) {
235
238
  _d)) },
236
239
  React.createElement(ScrollContainer, { onScrollStateChangeY: function (state) {
237
240
  setScrollState === null || setScrollState === void 0 ? void 0 : setScrollState(state);
238
- }, showScrollBar: setScrollBar() },
241
+ }, showScrollBar: setScrollBar(), ref: scrollContainerRef },
239
242
  React.createElement("div", { className: cx((_e = {},
240
243
  _e[jsStylesForSideMenu.contentWrapper(theme)] = true,
241
244
  _e[jsStylesForSideMenu.contentWrapperForTouchScreens(theme)] = isTouchScreen,
@@ -37,7 +37,7 @@ var styles = {
37
37
  return css(templateObject_11 || (templateObject_11 = __makeTemplateObject(["\n background: ", ";\n "], ["\n background: ", ";\n "])), t.sideMenuSeparatedSubMenuBgColor);
38
38
  },
39
39
  contentWrapper: function (t) {
40
- return css(templateObject_12 || (templateObject_12 = __makeTemplateObject(["\n height: 100%;\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n width: ", ";\n "], ["\n height: 100%;\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n width: ", ";\n "])), t.sideMenuWidth);
40
+ return css(templateObject_12 || (templateObject_12 = __makeTemplateObject(["\n min-height: 100%;\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n width: ", ";\n "], ["\n min-height: 100%;\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n width: ", ";\n "])), t.sideMenuWidth);
41
41
  },
42
42
  contentWrapperForTouchScreens: function (t) {
43
43
  return css(templateObject_13 || (templateObject_13 = __makeTemplateObject(["\n width: ", ";\n "], ["\n width: ", ";\n "])), t.sideMenuWidthForTouchScreens);
@@ -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 flex-grow: 1;\n margin: 0 ", ";\n height: 100%;\n "], ["\n flex-grow: 1;\n margin: 0 ", ";\n height: 100%;\n "])), t.sideMenuMarginX);
6
+ 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.sideMenuMarginX);
7
7
  },
8
8
  wrapper: function (t) {
9
9
  return css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n padding-bottom: ", ";\n "], ["\n padding-bottom: ", ";\n "])), t.sideMenuBodyPaddingBottom);