@arcblock/ux 2.1.35 → 2.1.36
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/lib/NavMenu/nav-menu.js
CHANGED
|
@@ -104,9 +104,13 @@ function NavMenu(_ref) {
|
|
|
104
104
|
});
|
|
105
105
|
}, [state, mode, activate, open, close]);
|
|
106
106
|
(0, _react.useEffect)(() => {
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
107
|
+
// NavMenu#activeId 和 Item#active prop 都可以用来控制激活状态 (一般不会混用这两种方式)
|
|
108
|
+
// 如果未传入 NavMenu#activeId, 应该避免设置一个空值的 activeId 状态 (会与 Item#active 冲突)
|
|
109
|
+
if (activeId !== undefined && activeId !== null) {
|
|
110
|
+
setState(prev => _objectSpread(_objectSpread({}, prev), {}, {
|
|
111
|
+
activeId
|
|
112
|
+
}));
|
|
113
|
+
}
|
|
110
114
|
}, [activeId]);
|
|
111
115
|
const classes = (0, _clsx.default)('navmenu', "navmenu--".concat(mode), rest.className);
|
|
112
116
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arcblock/ux",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.36",
|
|
4
4
|
"description": "Common used react components for arcblock products",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -52,10 +52,10 @@
|
|
|
52
52
|
"react": ">=18.1.0",
|
|
53
53
|
"react-ga": "^2.7.0"
|
|
54
54
|
},
|
|
55
|
-
"gitHead": "
|
|
55
|
+
"gitHead": "fc0e64437926f532b89f8e027da4df083a705fec",
|
|
56
56
|
"dependencies": {
|
|
57
|
-
"@arcblock/icons": "^2.1.
|
|
58
|
-
"@arcblock/react-hooks": "^2.1.
|
|
57
|
+
"@arcblock/icons": "^2.1.36",
|
|
58
|
+
"@arcblock/react-hooks": "^2.1.36",
|
|
59
59
|
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
|
|
60
60
|
"@emotion/react": "^11.9.0",
|
|
61
61
|
"@emotion/styled": "^11.8.1",
|
package/src/NavMenu/nav-menu.js
CHANGED
|
@@ -54,7 +54,11 @@ function NavMenu({ items, mode, children, activeId, textColor, activeTextColor,
|
|
|
54
54
|
}, [state, mode, activate, open, close]);
|
|
55
55
|
|
|
56
56
|
useEffect(() => {
|
|
57
|
-
|
|
57
|
+
// NavMenu#activeId 和 Item#active prop 都可以用来控制激活状态 (一般不会混用这两种方式)
|
|
58
|
+
// 如果未传入 NavMenu#activeId, 应该避免设置一个空值的 activeId 状态 (会与 Item#active 冲突)
|
|
59
|
+
if (activeId !== undefined && activeId !== null) {
|
|
60
|
+
setState((prev) => ({ ...prev, activeId }));
|
|
61
|
+
}
|
|
58
62
|
}, [activeId]);
|
|
59
63
|
|
|
60
64
|
const classes = clsx('navmenu', `navmenu--${mode}`, rest.className);
|