@coreui/react 4.9.1 → 4.9.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/README.md +1 -1
- package/dist/index.es.js +7 -2
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +7 -2
- package/dist/index.js.map +1 -1
- package/package.json +10 -10
- package/src/components/nav/CNavGroup.tsx +9 -2
package/dist/index.js
CHANGED
|
@@ -6177,14 +6177,19 @@ CSidebarNav.propTypes = {
|
|
|
6177
6177
|
};
|
|
6178
6178
|
CSidebarNav.displayName = 'CSidebarNav';
|
|
6179
6179
|
|
|
6180
|
+
var isInVisibleGroup = function (el1, el2) {
|
|
6181
|
+
var array1 = el1.toString().split('.');
|
|
6182
|
+
var array2 = el2.toString().split('.');
|
|
6183
|
+
return array2.every(function (item, index) { return item === array1[index]; });
|
|
6184
|
+
};
|
|
6180
6185
|
var CNavGroup = React.forwardRef(function (_a, ref) {
|
|
6181
6186
|
var children = _a.children, className = _a.className, compact = _a.compact, idx = _a.idx, toggler = _a.toggler, visible = _a.visible, rest = __rest(_a, ["children", "className", "compact", "idx", "toggler", "visible"]);
|
|
6182
6187
|
var _b = React.useState(), height = _b[0], setHeight = _b[1];
|
|
6183
6188
|
var navItemsRef = React.useRef(null);
|
|
6184
6189
|
var _c = React.useContext(CNavContext), visibleGroup = _c.visibleGroup, setVisibleGroup = _c.setVisibleGroup;
|
|
6185
|
-
var _d = React.useState(Boolean(visible || (idx && visibleGroup && visibleGroup
|
|
6190
|
+
var _d = React.useState(Boolean(visible || (idx && visibleGroup && isInVisibleGroup(visibleGroup, idx)))), _visible = _d[0], setVisible = _d[1];
|
|
6186
6191
|
React.useEffect(function () {
|
|
6187
|
-
setVisible(Boolean(idx && visibleGroup && visibleGroup
|
|
6192
|
+
setVisible(Boolean(idx && visibleGroup && isInVisibleGroup(visibleGroup, idx)));
|
|
6188
6193
|
}, [visibleGroup]);
|
|
6189
6194
|
var handleTogglerOnCLick = function (event) {
|
|
6190
6195
|
event.preventDefault();
|