@skbkontur/side-menu 1.8.7 → 1.8.9

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,33 @@
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.8.9](https://git.skbkontur.ru/ui/ui-parking/compare/@skbkontur/side-menu@1.8.8...@skbkontur/side-menu@1.8.9) (2023-12-12)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **SideMenu:** fix default opened state for narrow desktops ([97a75fe](https://git.skbkontur.ru/ui/ui-parking/commits/97a75fe4196a1e58639af39227660d6f35e7989e))
12
+
13
+
14
+ ### Reverts
15
+
16
+ * remove screenshots in ie11 and obsolete packages ([57a6e89](https://git.skbkontur.ru/ui/ui-parking/commits/57a6e8962089825b6c71c1b96f4d09bc8a5a4ef7))
17
+
18
+
19
+
20
+
21
+
22
+ ## [1.8.8](https://git.skbkontur.ru/ui/ui-parking/compare/@skbkontur/side-menu@1.8.7...@skbkontur/side-menu@1.8.8) (2023-12-01)
23
+
24
+
25
+ ### Bug Fixes
26
+
27
+ * **SideMenu:** dynamic change menu item ([ada46cb](https://git.skbkontur.ru/ui/ui-parking/commits/ada46cbb71f80cdc282095d4c4fd4a0a5a0c0462))
28
+
29
+
30
+
31
+
32
+
6
33
  ## [1.8.7](https://git.skbkontur.ru/ui/ui-parking/compare/@skbkontur/side-menu@1.8.6...@skbkontur/side-menu@1.8.7) (2023-11-30)
7
34
 
8
35
  **Note:** Version bump only for package @skbkontur/side-menu
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skbkontur/side-menu",
3
- "version": "1.8.7",
3
+ "version": "1.8.9",
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.2",
26
- "@skbkontur/react-ui-addons": "^4.9.3",
26
+ "@skbkontur/react-ui-addons": "^4.10.0",
27
27
  "tslib": "^1"
28
28
  }
29
29
  }
@@ -48,7 +48,7 @@ var SideMenuInner = forwardRef(function (_a, ref) {
48
48
  var isTabletOrMobile = isTablet || isMobile;
49
49
  var isTouchScreen = isTouchDevice() || isMobile || isTablet;
50
50
  var manual = isOpen !== undefined;
51
- var _l = useState(isDesktopQuery || isNarrowDesktop), isOpened = _l[0], setIsOpened = _l[1];
51
+ var _l = useState(isDesktopQuery), isOpened = _l[0], setIsOpened = _l[1];
52
52
  var _m = useState(false), isBeingTransitioned = _m[0], setIsBeingTransitioned = _m[1];
53
53
  var _o = useState(value), activeMenuItem = _o[0], setActiveMenuItem = _o[1];
54
54
  var _p = useState(false), isSeparatedMenuShown = _p[0], setIsSeparatedMenuShown = _p[1];
@@ -1,7 +1,8 @@
1
1
  import React from 'react';
2
2
  import { CommonClickableElementProps } from '../internal/ClickableElement';
3
- export interface SideMenuLinkProps extends React.AnchorHTMLAttributes<HTMLAnchorElement>, CommonClickableElementProps {
3
+ export interface SideMenuLinkProps<T = string> extends Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, 'href'>, CommonClickableElementProps {
4
4
  component?: React.ComponentType<any>;
5
+ href: T;
5
6
  }
6
7
  /**
7
8
  * Ссылка для `SideMenu`
@@ -12,6 +13,4 @@ export interface SideMenuLinkProps extends React.AnchorHTMLAttributes<HTMLAnchor
12
13
  *
13
14
  * @visibleName SideMenu.Link
14
15
  */
15
- export declare const SideMenuLink: React.ForwardRefExoticComponent<SideMenuLinkProps & React.RefAttributes<HTMLAnchorElement>> & {
16
- __KONTUR_REACT_UI__: string;
17
- };
16
+ export declare const SideMenuLink: <T = string>(props: SideMenuLinkProps<T>) => React.ReactElement;
@@ -0,0 +1,5 @@
1
+ Тип пропа `href` можно изменить через дженерик:
2
+
3
+ `
4
+ <SideMenu.Link<Action> href={item.action()} .../>
5
+ `
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import { SideMenuLinkProps } from '../SideMenuLink/SideMenuLink';
3
- export interface SideMenuSubLinkProps extends Omit<SideMenuLinkProps, 'icon'>, Partial<Pick<SideMenuLinkProps, 'icon'>> {
3
+ export interface SideMenuSubLinkProps<T = string> extends Omit<SideMenuLinkProps<T>, 'icon'>, Partial<Pick<SideMenuLinkProps, 'icon'>> {
4
4
  }
5
5
  /**
6
6
  * Ссылка в подменю для `SideMenu`
@@ -11,6 +11,4 @@ export interface SideMenuSubLinkProps extends Omit<SideMenuLinkProps, 'icon'>, P
11
11
  *
12
12
  * @visibleName SideMenu.SubLink
13
13
  */
14
- export declare const SideMenuSubLink: React.ForwardRefExoticComponent<SideMenuSubLinkProps & React.RefAttributes<HTMLLIElement>> & {
15
- __KONTUR_REACT_UI__: string;
16
- };
14
+ export declare const SideMenuSubLink: <T = string>(props: SideMenuSubLinkProps<T>) => React.ReactElement;
@@ -0,0 +1,5 @@
1
+ Тип пропа `href` можно изменить через дженерик:
2
+
3
+ `
4
+ <SideMenu.SubLink<Action> href={item.action()} .../>
5
+ `
@@ -62,7 +62,7 @@ var InnerBody = function (_a) {
62
62
  };
63
63
  useEffect(function () {
64
64
  getFlattedArrayOfAllElements();
65
- }, []);
65
+ }, [children]);
66
66
  useEffect(function () {
67
67
  getOpenedParents();
68
68
  setSeparatedMenuIsShown();