|
1 | | -import * as React from 'react'; |
2 | | -import { Admin, AutocompleteInput } from 'react-admin'; |
| 1 | +import { Box, Button, Card, Link as MuiLink, Typography } from '@mui/material'; |
3 | 2 | import { |
4 | 3 | CustomRoutes, |
| 4 | + DataProvider, |
5 | 5 | Resource, |
6 | | - useListContext, |
7 | 6 | TestMemoryRouter, |
8 | | - DataProvider, |
| 7 | + useListContext, |
9 | 8 | } from 'ra-core'; |
10 | 9 | import fakeRestDataProvider from 'ra-data-fakerest'; |
11 | | -import { Box, Card, Typography, Button, Link as MuiLink } from '@mui/material'; |
| 10 | +import * as React from 'react'; |
| 11 | +import { Admin, AutocompleteInput } from 'react-admin'; |
12 | 12 |
|
13 | | -import { List } from './List'; |
14 | | -import { SimpleList } from './SimpleList'; |
15 | | -import { ListActions } from './ListActions'; |
16 | | -import { Datagrid } from './datagrid'; |
17 | | -import { TextField } from '../field'; |
18 | | -import { SearchInput, TextInput } from '../input'; |
19 | 13 | import { Route } from 'react-router'; |
20 | 14 | import { Link } from 'react-router-dom'; |
21 | 15 | import { BulkDeleteButton, ListButton, SelectAllButton } from '../button'; |
22 | 16 | import { ShowGuesser } from '../detail'; |
| 17 | +import { TextField } from '../field'; |
| 18 | +import { SearchInput, TextInput } from '../input'; |
23 | 19 | import TopToolbar from '../layout/TopToolbar'; |
24 | 20 | import { BulkActionsToolbar } from './BulkActionsToolbar'; |
| 21 | +import { List } from './List'; |
| 22 | +import { ListActions } from './ListActions'; |
| 23 | +import { SimpleList } from './SimpleList'; |
| 24 | +import { Datagrid } from './datagrid'; |
25 | 25 |
|
26 | 26 | export default { title: 'ra-ui-materialui/list/List' }; |
27 | 27 |
|
@@ -801,3 +801,46 @@ export const ResponseMetadata = () => ( |
801 | 801 | </Admin> |
802 | 802 | </TestMemoryRouter> |
803 | 803 | ); |
| 804 | + |
| 805 | +export const slots = () => ( |
| 806 | + <TestMemoryRouter initialEntries={['/books']}> |
| 807 | + <Admin dataProvider={defaultDataProvider}> |
| 808 | + <Resource |
| 809 | + name="books" |
| 810 | + list={() => ( |
| 811 | + <List |
| 812 | + slots={{ |
| 813 | + actions: ( |
| 814 | + <Box sx={{ backgroundColor: 'info.main' }}> |
| 815 | + Actions |
| 816 | + </Box> |
| 817 | + ), |
| 818 | + aside: ( |
| 819 | + <Box sx={{ backgroundColor: 'info.main' }}> |
| 820 | + Aside |
| 821 | + </Box> |
| 822 | + ), |
| 823 | + filters: ( |
| 824 | + <Box sx={{ backgroundColor: 'info.main' }}> |
| 825 | + Filter |
| 826 | + </Box> |
| 827 | + ), |
| 828 | + pagination: ( |
| 829 | + <Box sx={{ backgroundColor: 'info.main' }}> |
| 830 | + List |
| 831 | + </Box> |
| 832 | + ), |
| 833 | + empty: ( |
| 834 | + <Box sx={{ backgroundColor: 'info.main' }}> |
| 835 | + Empty |
| 836 | + </Box> |
| 837 | + ), |
| 838 | + }} |
| 839 | + > |
| 840 | + <BookList /> |
| 841 | + </List> |
| 842 | + )} |
| 843 | + /> |
| 844 | + </Admin> |
| 845 | + </TestMemoryRouter> |
| 846 | +); |
0 commit comments