@pdg/react-admin-layout 1.0.45 → 1.0.47
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/dist/index.esm.js +3 -3
- package/dist/index.js +3 -3
- package/package.json +1 -2
package/dist/index.esm.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {Grid,styled,ListItemIcon,ListItemButton,Icon,ListItemText,Badge,Collapse,List,useTheme,alpha,Box,Toolbar,Typography,AppBar,Drawer,IconButton}from'@mui/material';import React,{useState,useEffect,useCallback,useMemo}from'react';import {useLocation,useNavigate}from'react-router';import {ExpandMore,Menu}from'@mui/icons-material';import
|
|
1
|
+
import {Grid,styled,ListItemIcon,ListItemButton,Icon,ListItemText,Badge,Collapse,List,useTheme,alpha,Box,Toolbar,Typography,AppBar,Drawer,IconButton}from'@mui/material';import React,{useState,useEffect,useCallback,useMemo}from'react';import {useLocation,useNavigate}from'react-router';import {ExpandMore,Menu}from'@mui/icons-material';import SimpleBar from'simplebar-react';function insertStyle(css) {
|
|
2
2
|
if (typeof window === 'undefined')
|
|
3
3
|
return;
|
|
4
4
|
const style = document.createElement('style');
|
|
@@ -63,7 +63,7 @@ var templateObject_1$4, templateObject_2$2;var SideMenuListItem = function (_a)
|
|
|
63
63
|
* Effect
|
|
64
64
|
* ******************************************************************************************************************/
|
|
65
65
|
useEffect(function () {
|
|
66
|
-
setIsExpandable(
|
|
66
|
+
setIsExpandable(!!info.items && info.items.length > 0);
|
|
67
67
|
if (info.items && info.items.find(function (info) { return location.pathname === info.uri; })) {
|
|
68
68
|
setIsExpand(true);
|
|
69
69
|
}
|
|
@@ -207,7 +207,7 @@ var DefaultLayout = function (_a) {
|
|
|
207
207
|
var menuTitles = {};
|
|
208
208
|
if (menu) {
|
|
209
209
|
menu.forEach(function (info) {
|
|
210
|
-
if (
|
|
210
|
+
if ((info.uri == null || info.uri === '') && info.items && info.items.length > 0) {
|
|
211
211
|
info.items.map(function (subInfo) {
|
|
212
212
|
menuTitles[subInfo.uri] = { name: subInfo.name, parentName: info.name, parentIcon: info.icon };
|
|
213
213
|
});
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
'use strict';var material=require('@mui/material'),React=require('react'),reactRouter=require('react-router'),iconsMaterial=require('@mui/icons-material'),
|
|
1
|
+
'use strict';var material=require('@mui/material'),React=require('react'),reactRouter=require('react-router'),iconsMaterial=require('@mui/icons-material'),SimpleBar=require('simplebar-react');function insertStyle(css) {
|
|
2
2
|
if (typeof window === 'undefined')
|
|
3
3
|
return;
|
|
4
4
|
const style = document.createElement('style');
|
|
@@ -63,7 +63,7 @@ var templateObject_1$4, templateObject_2$2;var SideMenuListItem = function (_a)
|
|
|
63
63
|
* Effect
|
|
64
64
|
* ******************************************************************************************************************/
|
|
65
65
|
React.useEffect(function () {
|
|
66
|
-
setIsExpandable(
|
|
66
|
+
setIsExpandable(!!info.items && info.items.length > 0);
|
|
67
67
|
if (info.items && info.items.find(function (info) { return location.pathname === info.uri; })) {
|
|
68
68
|
setIsExpand(true);
|
|
69
69
|
}
|
|
@@ -207,7 +207,7 @@ var DefaultLayout = function (_a) {
|
|
|
207
207
|
var menuTitles = {};
|
|
208
208
|
if (menu) {
|
|
209
209
|
menu.forEach(function (info) {
|
|
210
|
-
if (
|
|
210
|
+
if ((info.uri == null || info.uri === '') && info.items && info.items.length > 0) {
|
|
211
211
|
info.items.map(function (subInfo) {
|
|
212
212
|
menuTitles[subInfo.uri] = { name: subInfo.name, parentName: info.name, parentIcon: info.icon };
|
|
213
213
|
});
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pdg/react-admin-layout",
|
|
3
3
|
"title": "React Admin Layout",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.47",
|
|
5
5
|
"description": "Admin Layout for React",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
@@ -50,7 +50,6 @@
|
|
|
50
50
|
"@emotion/styled": "^11.14.0",
|
|
51
51
|
"@mui/icons-material": "^7.1.0",
|
|
52
52
|
"@mui/material": "^7.1.0",
|
|
53
|
-
"@pdg/util": "^1.0.26",
|
|
54
53
|
"react-router": "^7.6.1",
|
|
55
54
|
"simplebar-react": "^3.3.1"
|
|
56
55
|
},
|