@applica-software-guru/react-admin 1.5.305 → 1.5.307-alpha.0
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/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/i18n/messages.json.gz +0 -0
- package/dist/react-admin.cjs.js +50 -50
- package/dist/react-admin.cjs.js.gz +0 -0
- package/dist/react-admin.cjs.js.map +1 -1
- package/dist/react-admin.es.js +5494 -5470
- package/dist/react-admin.es.js.gz +0 -0
- package/dist/react-admin.es.js.map +1 -1
- package/dist/react-admin.umd.js +43 -43
- package/dist/react-admin.umd.js.gz +0 -0
- package/dist/react-admin.umd.js.map +1 -1
- package/dist/style.css.gz +0 -0
- package/package.json +1 -1
- package/src/components/Layout/Sidebar/Content.tsx +3 -1
- package/src/components/Layout/Sidebar/Drawer.tsx +6 -7
- package/src/components/Layout/Sidebar/Header.tsx +4 -1
- package/src/components/Layout/index.ts +1 -1
- package/src/components/ra-lists/FilterSidebar/FilterSidebar.tsx +1 -1
package/dist/style.css.gz
CHANGED
|
Binary file
|
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 };
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { Drawer as MUIDrawer, useMediaQuery, useTheme } from '@mui/material';
|
|
2
2
|
import { useCallback } from 'react';
|
|
3
3
|
import { useSx } from '@/hooks';
|
|
4
|
-
import { useListViewContext } from '@/components/ra-lists';
|
|
5
4
|
import { isFunction } from 'lodash';
|
|
6
5
|
|
|
7
6
|
type DrawerProps = {
|
|
@@ -10,21 +9,21 @@ type DrawerProps = {
|
|
|
10
9
|
variant?: 'temporary' | 'persistent' | 'permanent';
|
|
11
10
|
children: React.ReactNode;
|
|
12
11
|
open?: boolean;
|
|
12
|
+
onClose?: () => void;
|
|
13
13
|
};
|
|
14
14
|
|
|
15
15
|
function Drawer(props: DrawerProps) {
|
|
16
|
-
const { PaperProps, anchor = 'right', variant = 'temporary', open = false } = props;
|
|
16
|
+
const { PaperProps, anchor = 'right', variant = 'temporary', open = false, onClose } = props;
|
|
17
17
|
const theme = useTheme();
|
|
18
18
|
const isMobile = useMediaQuery(theme.breakpoints.down('sm'));
|
|
19
19
|
const anchorPosition = isMobile ? 'bottom' : anchor;
|
|
20
|
-
const { setSidebarOpen } = useListViewContext();
|
|
21
20
|
const handleClose = useCallback(() => {
|
|
22
|
-
if (isFunction(
|
|
23
|
-
|
|
21
|
+
if (isFunction(onClose)) {
|
|
22
|
+
onClose();
|
|
24
23
|
}
|
|
25
|
-
}, [
|
|
24
|
+
}, [onClose]);
|
|
26
25
|
const sx = useSx(PaperProps ?? {}, {
|
|
27
|
-
|
|
26
|
+
backgroundImage: 'none',
|
|
28
27
|
boxShadow: '-10px 4px 42px 0px rgba(0, 0, 0, 0.25)',
|
|
29
28
|
width: {
|
|
30
29
|
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';
|
|
@@ -115,7 +115,7 @@ function FilterSidebar(props: FilterSidebarProps): ReactElement {
|
|
|
115
115
|
}, [values, getValues, watchValues]);
|
|
116
116
|
|
|
117
117
|
return (
|
|
118
|
-
<Sidebar PaperProps={{ sx: { height: '100%' } }} open={sidebarOpen}>
|
|
118
|
+
<Sidebar PaperProps={{ sx: { height: '100%' } }} open={sidebarOpen} onClose={closeSidebar}>
|
|
119
119
|
<Sidebar.Header>
|
|
120
120
|
<Sidebar.HeaderText primary={translate('ra.action.add_filter')} />
|
|
121
121
|
<Sidebar.HeaderAction>
|