import { SxProps } from '@mui/system'; import { RaRecord } from 'ra-core'; import { ElementType, ReactElement, ReactNode } from 'react'; import { ListTabToolbarConfig } from './ListTabsToolbar'; declare function ListView(props: ListViewProps): ReactElement | null; interface ListViewProps { /** * Tabs to display in the toolbar. Each tab is a filter object with a label, key, icon, filter, and an optional default property. * * @example * import { List, ListTabToolbarConfig } from 'react-admin'; * const tabs: ListTabToolbarConfig[] = [ * { label: 'Published', key: 'published', icon: , filter: { status: 'published' }, default: true }, * { label: 'Drafts', key: 'drafts', icon: , filter: { status: 'draft' } }, * ]; * const PostList = () => ( * * ... * * ); */ tabs?: ListTabToolbarConfig[]; /** * A unique key to identify the tab group. Used to persist the selected tab in session storage. * Must be stable across renders and unique among different List components. * * @example * import { List, ListTabToolbarConfig } from 'react-admin'; * const tabs: ListTabToolbarConfig[] = [ * { label: 'Published', key: 'published', icon: , filter: { status: 'published' }, default: true }, * { label: 'Drafts', key: 'drafts', icon: , filter: { status: 'draft' } }, * ]; * const PostList = () => ( * * ... * * ); */ tabGroupKey?: string; /** * The actions to display in the toolbar. defaults to Filter + Create + Export. * * @see https://marmelab.com/react-admin/List.html#actions * @example * import { * CreateButton, * DatagridConfigurable, * ExportButton, * FilterButton, * List, * SelectColumnsButton, * TopToolbar, * } from 'react-admin'; * import IconEvent from '@mui/icons-material/Event'; * * const ListActions = () => ( * * * * * * * ); * * export const PostList = () => ( * }> * * ... * * * ); */ actions?: ReactElement | false; /** * The content to render as a sidebar. * @see https://marmelab.com/react-admin/List.html#aside * @example * import { List, useListContext } from 'react-admin'; * import { Typography } from '@mui/material'; * * const Aside = () => { * const { data, isLoading } = useListContext(); * if (isLoading) return null; * return ( *
* Posts stats * * Total views: {data.reduce((sum, post) => sum + post.views, 0)} * *
* ); * }; * * const PostList = () => ( * }> * ... * * ); */ aside?: ReactElement; /** * @deprecated pass the bulkActionButtons prop to the List child (Datagrid or SimpleList) instead */ bulkActionButtons?: ReactElement | false; /** * A class name to apply to the root div element */ className?: string; /** * The components rendering the list of records. Usually a or . * * @see https://marmelab.com/react-admin/List.html#children * @example * import { List, Datagrid, TextField, DateField, NumberField, BooleanField, ReferenceManyCount } from 'react-admin'; * * export const BookList = () => ( * * * * * * * * * * * ); */ children: ReactNode; /** * The component used to display the list. Defaults to . * * @see https://marmelab.com/react-admin/List.html#component * @example * import { List } from 'react-admin'; * * const PostList = () => ( * * ... * * ); */ component?: ElementType; /** * The component to display when the list is empty. * * @see https://marmelab.com/react-admin/List.html#empty * @example * import { CreateButton, List } from 'react-admin'; * import { Box, Button, Typography } from '@mui/material'; * * const Empty = () => ( * * * No products available * * * Create one or import products from a file * * * * * ); * * const ProductList = () => ( * }> * ... * * ); */ empty?: ReactElement | false; /** * Set to true to return null while the list is loading. * * @see https://marmelab.com/react-admin/List.html#emptywhileloading * @example * import { List } from 'react-admin'; * import { SimpleBookList } from './BookList'; * * const BookList = () => ( * * * * ); */ emptyWhileLoading?: boolean; /** * The filter inputs to display in the toolbar. * * @see https://marmelab.com/react-admin/List.html#filters * @example * import { List, TextInput } from 'react-admin'; * * const postFilters = [ * , * , * ]; * * export const PostList = () => ( * * ... * * ); */ filters?: ReactElement | ReactElement[]; /** * Set to true to force a Create button in the toolbar, even if there is no create view declared in Resource * * @see https://marmelab.com/react-admin/List.html#hascreate * @example * import { List } from 'react-admin'; * * export const PostList = () => ( * * ... * * ); */ hasCreate?: boolean; /** * The pagination component to display. defaults to * * @see https://marmelab.com/react-admin/List.html#pagination * @example * import { Pagination, List } from 'react-admin'; * * const PostPagination = props => ; * * export const PostList = () => ( * }> * ... * * ); */ pagination?: ReactElement | false; /** * The page title (main title) to display above the data. Defaults to the humanized resource name. * * @see https://marmelab.com/react-admin/List.html#title * @example * import { List } from 'react-admin'; * * export const PostList = () => ( * * ... * * ); */ title?: string | ReactElement; /** * The CSS styles to apply to the component. * * @see https://marmelab.com/react-admin/List.html#sx-css-api * @example * const PostList = () => ( * * ... * * ); */ sx?: SxProps; } export { ListView }; export type { ListViewProps }; //# sourceMappingURL=ListView.d.ts.map