@applica-software-guru/react-admin 1.5.304 → 1.5.306
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/components/Layout/Header/Profile/index.d.ts +1 -0
- package/dist/components/Layout/Header/Profile/index.d.ts.map +1 -1
- package/dist/components/Layout/Sidebar/Content.d.ts.map +1 -1
- package/dist/components/Layout/Sidebar/Drawer.d.ts +1 -0
- package/dist/components/Layout/Sidebar/Drawer.d.ts.map +1 -1
- package/dist/components/Layout/Sidebar/Header.d.ts +2 -0
- package/dist/components/Layout/Sidebar/Header.d.ts.map +1 -1
- package/dist/components/Layout/index.d.ts +1 -1
- package/dist/components/Layout/index.d.ts.map +1 -1
- package/dist/react-admin.cjs.js +52 -52
- package/dist/react-admin.cjs.js.gz +0 -0
- package/dist/react-admin.cjs.js.map +1 -1
- package/dist/react-admin.es.js +4212 -4185
- package/dist/react-admin.es.js.gz +0 -0
- package/dist/react-admin.es.js.map +1 -1
- package/dist/react-admin.umd.js +48 -48
- package/dist/react-admin.umd.js.gz +0 -0
- package/dist/react-admin.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/components/Layout/Header/Profile/index.ts +1 -0
- package/src/components/Layout/Sidebar/Content.tsx +3 -1
- package/src/components/Layout/Sidebar/Drawer.tsx +7 -4
- package/src/components/Layout/Sidebar/Header.tsx +4 -1
- package/src/components/Layout/index.ts +1 -1
package/package.json
CHANGED
|
@@ -7,7 +7,9 @@ type ContentProps = {
|
|
|
7
7
|
|
|
8
8
|
function Content(props: ContentProps) {
|
|
9
9
|
const { sx } = props;
|
|
10
|
-
return
|
|
10
|
+
return (
|
|
11
|
+
<Box sx={{ ...sx, flex: '1 1 auto', backgroundColor: 'background.paper', overflowY: 'auto' }}>{props.children}</Box>
|
|
12
|
+
);
|
|
11
13
|
}
|
|
12
14
|
|
|
13
15
|
export { Content };
|
|
@@ -10,21 +10,24 @@ type DrawerProps = {
|
|
|
10
10
|
variant?: 'temporary' | 'persistent' | 'permanent';
|
|
11
11
|
children: React.ReactNode;
|
|
12
12
|
open?: boolean;
|
|
13
|
+
onClose?: () => void;
|
|
13
14
|
};
|
|
14
15
|
|
|
15
16
|
function Drawer(props: DrawerProps) {
|
|
16
|
-
const { PaperProps, anchor = 'right', variant = 'temporary', open = false } = props;
|
|
17
|
+
const { PaperProps, anchor = 'right', variant = 'temporary', open = false, onClose } = props;
|
|
17
18
|
const theme = useTheme();
|
|
18
19
|
const isMobile = useMediaQuery(theme.breakpoints.down('sm'));
|
|
19
20
|
const anchorPosition = isMobile ? 'bottom' : anchor;
|
|
20
21
|
const { setSidebarOpen } = useListViewContext();
|
|
21
22
|
const handleClose = useCallback(() => {
|
|
22
|
-
if (isFunction(
|
|
23
|
+
if (isFunction(onClose)) {
|
|
24
|
+
onClose();
|
|
25
|
+
} else if (isFunction(setSidebarOpen)) {
|
|
23
26
|
setSidebarOpen(false);
|
|
24
27
|
}
|
|
25
|
-
}, [setSidebarOpen]);
|
|
28
|
+
}, [onClose, setSidebarOpen]);
|
|
26
29
|
const sx = useSx(PaperProps ?? {}, {
|
|
27
|
-
|
|
30
|
+
backgroundImage: 'none',
|
|
28
31
|
boxShadow: '-10px 4px 42px 0px rgba(0, 0, 0, 0.25)',
|
|
29
32
|
width: {
|
|
30
33
|
xs: window.innerWidth,
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
import { Box, Divider, Stack, Typography } from '@mui/material';
|
|
1
|
+
import { Box, Divider, Stack, SxProps, Typography } from '@mui/material';
|
|
2
2
|
|
|
3
3
|
interface HeaderProps {
|
|
4
|
+
sx?: SxProps;
|
|
4
5
|
children: React.ReactNode;
|
|
5
6
|
}
|
|
6
7
|
|
|
7
8
|
function Header(props: HeaderProps) {
|
|
9
|
+
const { sx } = props;
|
|
8
10
|
return (
|
|
9
11
|
<Box>
|
|
10
12
|
<Stack
|
|
@@ -15,6 +17,7 @@ function Header(props: HeaderProps) {
|
|
|
15
17
|
py={2}
|
|
16
18
|
spacing={2}
|
|
17
19
|
minHeight={'64px'}
|
|
20
|
+
sx={sx}
|
|
18
21
|
>
|
|
19
22
|
{props.children}
|
|
20
23
|
</Stack>
|
|
@@ -9,7 +9,7 @@ export * from './MenuProvider';
|
|
|
9
9
|
export * from './NavMenu';
|
|
10
10
|
export * from './Navigation';
|
|
11
11
|
export * from './Provider';
|
|
12
|
-
export *
|
|
12
|
+
export * from './Sidebar';
|
|
13
13
|
export * from './ThemeColor';
|
|
14
14
|
export * from './ThemeProvider';
|
|
15
15
|
export * from './ThemeToggler';
|