@skbkontur/side-menu 3.0.1 → 3.0.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 +11 -0
- package/package.json +2 -2
- package/src/Navigation.d.ts +1 -0
- package/src/Navigation.js +6 -0
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,17 @@
|
|
|
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
|
+
## [3.0.2](https://git.skbkontur.ru/ui/ui-parking/compare/@skbkontur/side-menu@3.0.1...@skbkontur/side-menu@3.0.2) (2024-10-31)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **SideMenu:** speed up SideMenu when there are many items ([2346ea1](https://git.skbkontur.ru/ui/ui-parking/commits/2346ea1ea253513aabb80f073dcb88a64da95c28))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
6
17
|
## [3.0.1](https://git.skbkontur.ru/ui/ui-parking/compare/@skbkontur/side-menu@3.0.0...@skbkontur/side-menu@3.0.1) (2024-10-25)
|
|
7
18
|
|
|
8
19
|
**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": "3.0.
|
|
3
|
+
"version": "3.0.2",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public",
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"@skbkontur/react-ui": "5.0.0"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@skbkontur/icons": "^1.13.
|
|
25
|
+
"@skbkontur/icons": "^1.13.1",
|
|
26
26
|
"@skbkontur/react-ui-addons": "^5.0.0",
|
|
27
27
|
"tslib": "^1"
|
|
28
28
|
}
|
package/src/Navigation.d.ts
CHANGED
|
@@ -36,6 +36,7 @@ export declare class MenuNavigation {
|
|
|
36
36
|
private readonly isDesktop?;
|
|
37
37
|
private readonly isMobile?;
|
|
38
38
|
isCollapsable?: boolean;
|
|
39
|
+
private menuItemsIds;
|
|
39
40
|
constructor(options: MenuNavigationOptions);
|
|
40
41
|
updateNavigationTree(): void;
|
|
41
42
|
addValue(id: string, value: NavigableElement): void;
|
package/src/Navigation.js
CHANGED
|
@@ -7,6 +7,7 @@ export var navigationAttributeBackButton = 'data-navigation-back-button';
|
|
|
7
7
|
var MenuNavigation = /** @class */ (function () {
|
|
8
8
|
function MenuNavigation(options) {
|
|
9
9
|
this.navigationTree = null;
|
|
10
|
+
this.menuItemsIds = '';
|
|
10
11
|
this.navigationTree = new Tree(MENU_ROOT_ID);
|
|
11
12
|
this.activeMenuItemTreeNode = this.navigationTree.find(options.activeMenuItem);
|
|
12
13
|
this.rootRef = options.rootRef;
|
|
@@ -25,6 +26,11 @@ var MenuNavigation = /** @class */ (function () {
|
|
|
25
26
|
var _a;
|
|
26
27
|
if ((_a = this.rootRef) === null || _a === void 0 ? void 0 : _a.current) {
|
|
27
28
|
var menuItems = Array.from(this.rootRef.current.querySelectorAll("[" + navigationAttribute + "]")).filter(function (item) { return !item.querySelector("[" + navigationAttributeBackButton + "]"); });
|
|
29
|
+
var newItemsIds = menuItems.map(function (node) { return node.getAttribute(navigationAttribute); }).join('');
|
|
30
|
+
if (this.menuItemsIds === newItemsIds) {
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
this.menuItemsIds = newItemsIds;
|
|
28
34
|
menuItems.forEach(function (menuItem) {
|
|
29
35
|
var _a, _b, _c;
|
|
30
36
|
var id = menuItem.getAttribute(navigationAttribute);
|