@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/README.md
CHANGED
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
|
|
47
47
|
Several quick start options are available:
|
|
48
48
|
|
|
49
|
-
- [Download the latest release](https://github.com/coreui/coreui-react/archive/v4.9.
|
|
49
|
+
- [Download the latest release](https://github.com/coreui/coreui-react/archive/v4.9.2.zip)
|
|
50
50
|
- Clone the repo: `git clone https://github.com/coreui/coreui-react.git`
|
|
51
51
|
- Install with [npm](https://www.npmjs.com/): `npm install @coreui/react`
|
|
52
52
|
- Install with [yarn](https://yarnpkg.com/): `yarn add @coreui/react`
|
package/dist/index.es.js
CHANGED
|
@@ -6175,14 +6175,19 @@ CSidebarNav.propTypes = {
|
|
|
6175
6175
|
};
|
|
6176
6176
|
CSidebarNav.displayName = 'CSidebarNav';
|
|
6177
6177
|
|
|
6178
|
+
var isInVisibleGroup = function (el1, el2) {
|
|
6179
|
+
var array1 = el1.toString().split('.');
|
|
6180
|
+
var array2 = el2.toString().split('.');
|
|
6181
|
+
return array2.every(function (item, index) { return item === array1[index]; });
|
|
6182
|
+
};
|
|
6178
6183
|
var CNavGroup = forwardRef(function (_a, ref) {
|
|
6179
6184
|
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"]);
|
|
6180
6185
|
var _b = useState(), height = _b[0], setHeight = _b[1];
|
|
6181
6186
|
var navItemsRef = useRef(null);
|
|
6182
6187
|
var _c = useContext(CNavContext), visibleGroup = _c.visibleGroup, setVisibleGroup = _c.setVisibleGroup;
|
|
6183
|
-
var _d = useState(Boolean(visible || (idx && visibleGroup && visibleGroup
|
|
6188
|
+
var _d = useState(Boolean(visible || (idx && visibleGroup && isInVisibleGroup(visibleGroup, idx)))), _visible = _d[0], setVisible = _d[1];
|
|
6184
6189
|
useEffect(function () {
|
|
6185
|
-
setVisible(Boolean(idx && visibleGroup && visibleGroup
|
|
6190
|
+
setVisible(Boolean(idx && visibleGroup && isInVisibleGroup(visibleGroup, idx)));
|
|
6186
6191
|
}, [visibleGroup]);
|
|
6187
6192
|
var handleTogglerOnCLick = function (event) {
|
|
6188
6193
|
event.preventDefault();
|