diff --git a/README.md b/README.md index 3525cc1077d..a6085b0f7d9 100644 --- a/README.md +++ b/README.md @@ -65,20 +65,22 @@ The `` component defines CRUD pages (`list`, `edit`, and `create`) for ```jsx // in posts.js import * as React from "react"; -import { List, Datagrid, Edit, Create, SimpleForm, DateField, TextField, EditButton, TextInput, DateInput, useRecordContext } from 'react-admin'; +import { List, DataTable, Edit, Create, SimpleForm, DateField, EditButton, TextInput, DateInput, useRecordContext } from 'react-admin'; import BookIcon from '@mui/icons-material/Book'; export const PostIcon = BookIcon; export const PostList = () => ( - - - - - - - - + + + + + + + + + + ); diff --git a/docs/Actions.md b/docs/Actions.md index 695e21ce89b..93c52b29e6b 100644 --- a/docs/Actions.md +++ b/docs/Actions.md @@ -156,17 +156,17 @@ See the [Success and Error Side Effects](#success-and-error-side-effects) below {% raw %} ```jsx -import { List, Datagrid, TextField } from 'react-admin'; +import { List, DataTable } from 'react-admin'; const PostList = () => ( console.log(data, error) }} > - - - - - + + + + + ); ``` @@ -319,8 +319,8 @@ To execute some logic after a query or a mutation is complete, use the `onSucces - [`useNotify`](./useNotify.md): Return a function to display a notification. - [`useRedirect`](./useRedirect.md): Return a function to redirect the user to another page. - [`useRefresh`](./useRefresh.md): Return a function to force a rerender of the current view (equivalent to pressing the Refresh button). -- [`useUnselect`](./useUnselect.md): Return a function to unselect lines in the current `Datagrid` based on the ids passed to it. -- [`useUnselectAll`](./useUnselectAll.md): Return a function to unselect all lines in the current `Datagrid`. +- [`useUnselect`](./useUnselect.md): Return a function to unselect lines in the current `` based on the ids passed to it. +- [`useUnselectAll`](./useUnselectAll.md): Return a function to unselect all lines in the current ``. ### `onSuccess` diff --git a/docs/AppTheme.md b/docs/AppTheme.md index 00a4595af91..96a14d31ad1 100644 --- a/docs/AppTheme.md +++ b/docs/AppTheme.md @@ -273,7 +273,7 @@ const ThemeToggler = () => { In a custom theme, you can override the style of a component for the entire application using the `components` key. -For instance, to create a custom theme that overrides the style of the `` component: +For instance, to create a custom theme that overrides the style of the `` component: ```jsx import { defaultTheme } from 'react-admin'; @@ -281,11 +281,11 @@ import { deepmerge } from '@mui/utils'; const theme = deepmerge(defaultTheme, { components: { - RaDatagrid: { + RaDataTable: { styleOverrides: { root: { backgroundColor: "Lavender", - "& .RaDatagrid-headerCell": { + "& .RaDataTable-headerCell": { backgroundColor: "MistyRose", }, } @@ -306,7 +306,7 @@ There are 2 important gotchas here: - Don't forget to merge your custom style overrides with the ones from react-admin's `defaultTheme`, otherwise the application will have the default Material UI theme (most notably, outlined text inputs) - Custom style overrides must live under a `root` key. Then, the style override syntax is the same as the one used for the [`sx`](./SX.md) prop. -To guess the name of the subclass to use (like `.RaDatagrid-headerCell` above) for customizing a component, you can use the developer tools of your browser, or check the react-admin documentation for individual components (e.g. the [Datagrid CSS documentation](./Datagrid.md#sx-css-api)). +To guess the name of the subclass to use (like `.RaDataTable-headerCell` above) for customizing a component, you can use the developer tools of your browser, or check the react-admin documentation for individual components (e.g. the [`` CSS documentation](./DataTable.md#sx-css-api)). **Tip**: As an alternative, you can also re-export styled components, and use them instead of the react-admin components. Check the [Reusable Components](./SX.md#reusable-components) documentation for an example. @@ -499,11 +499,11 @@ import { defaultTheme } from 'react-admin'; const theme = deepmerge(defaultTheme, { components: { - RaDatagrid: { + RaDataTable: { styleOverrides: { root: { backgroundColor: "Lavender", - "& .RaDatagrid-headerCell": { + "& .RaDataTable-headerCell": { backgroundColor: "MistyRose", }, } diff --git a/docs/ArrayField.md b/docs/ArrayField.md index 94eff1283a1..11fa69dbb1d 100644 --- a/docs/ArrayField.md +++ b/docs/ArrayField.md @@ -9,7 +9,7 @@ title: "The ArrayField Component" ![ArrayField](./img/array-field.webp) -`` creates a [`ListContext`](./useListContext.md) with the field value, and renders its children components - usually iterator components like [``](./Datagrid.md) or [``](./SingleFieldList.md). +`` creates a [`ListContext`](./useListContext.md) with the field value, and renders its children components - usually iterator components like [``](./DataTable.md) or [``](./SingleFieldList.md). ## Usage @@ -35,13 +35,13 @@ title: "The ArrayField Component" } ``` -Leverage `` e.g. in a Show view, to display the `tags` as a `` and the `backlinks` as a ``: +Leverage `` e.g. in a Show view, to display the `tags` as a `` and the `backlinks` as a ``: ```jsx import { ArrayField, ChipField, - Datagrid, + DataTable, Show, SimpleShowLayout, SingleFieldList, @@ -58,11 +58,11 @@ const PostShow = () => ( - - - - - + + + + + @@ -84,7 +84,7 @@ const PostShow = () => ( ## `children` -`` renders its `children` component wrapped in a [``](./useListContext.md). Commonly used child components are [``](./Datagrid.md), [``](./SingleFieldList.md), and [``](./SimpleList.md). +`` renders its `children` component wrapped in a [``](./useListContext.md). Commonly used child components are [``](./DataTable.md), [``](./SingleFieldList.md), and [``](./SimpleList.md). ```jsx {/* using SingleFieldList as child */} @@ -94,13 +94,13 @@ const PostShow = () => ( -{/* using Datagrid as child */} +{/* using DataTable as child */} - - - - - + + + + + {/* using SimpleList as child */} @@ -159,11 +159,11 @@ You can use the `filter` prop to display only a subset of the items in the array {% raw %} ```jsx - - - - - + + + + + ``` {% endraw %} @@ -179,7 +179,7 @@ As `` creates a [`ListContext`](./useListContext.md), you can use th ```jsx import { ArrayField, - Datagrid, + DataTable, Pagination, Show, SimpleShowLayout, @@ -191,11 +191,11 @@ const PostShow = () => ( - - - - - + + + + + diff --git a/docs/AuthRBAC.md b/docs/AuthRBAC.md index e4e73cda819..f436d1cacd8 100644 --- a/docs/AuthRBAC.md +++ b/docs/AuthRBAC.md @@ -100,17 +100,17 @@ An _action_ is a string, usually a verb, that represents an operation. Examples React-admin already does page-level access control with actions like "list", "show", "edit", "create", and "delete". RBAC checks additional actions in its components: -| Action | Description | Used In | -| -------- | -------------------------------- |---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| `list` | Allow to access the List page | [``](./List.md#access-control), [``](./Buttons.md#listbutton), [``](./Menu.md#access-control) | -| `show` | Allow to access the Show page | [``](./Show.md), [``](./Buttons.md#showbutton), [``](./Datagrid.md#access-control), [``](./Edit.md) | -| `create` | Allow to access the Create page | [``](./Create.md), [``](./Buttons.md#createbutton), [``](./List.md#access-control) | -| `edit` | Allow to access the Edit page | [``](./Edit.md), [``](./Buttons.md#editbutton), [``](./Datagrid.md#access-control), [``](./Show.md) | -| `delete` | Allow to delete data | [``](./Buttons.md#deletebutton), [``](./Buttons.md#bulkdeletebutton), [``](./Datagrid.md#access-control), [``](./SimpleForm.md#access-control), [``](./TabbedForm.md#access-control) | -| `export` | Allow to export data | [``](./Buttons.md#exportbutton), [``](./List.md#access-control) | -| `clone` | Allow to clone a record | [``](./Buttons.md#clonebutton), [``](./Edit.md) | -| `read` | Allow to view a field (or a tab) | [``](./Datagrid.md#access-control), [``](./SimpleShowLayout.md#access-control), [``](./TabbedShowLayout.md#access-control) | -| `write` | Allow to edit a field (or a tab) | [``](./SimpleForm.md#access-control), [``](./TabbedForm.md#access-control), [``](./WizardForm.md#enableaccesscontrol), [``](./LongForm.md#enableaccesscontrol), [``](./AccordionForm.md#enableaccesscontrol) | +| Action | Description | Used In | +| -------- | -------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `list` | Allow to access the List page | [``](./List.md#access-control), [``](./Buttons.md#listbutton), [``](./Menu.md#access-control) | +| `show` | Allow to access the Show page | [``](./Show.md), [``](./Buttons.md#showbutton), [``](./DataTable.md#access-control), [``](./Datagrid.md#access-control), [``](./Edit.md) | +| `create` | Allow to access the Create page | [``](./Create.md), [``](./Buttons.md#createbutton), [``](./List.md#access-control) | +| `edit` | Allow to access the Edit page | [``](./Edit.md), [``](./Buttons.md#editbutton), [``](./DataTable.md#access-control), [``](./Datagrid.md#access-control), [``](./Show.md) | +| `delete` | Allow to delete data | [``](./Buttons.md#deletebutton), [``](./Buttons.md#bulkdeletebutton), [``](./DataTable.md#access-control), [``](./Datagrid.md#access-control), [``](./SimpleForm.md#access-control), [``](./TabbedForm.md#access-control) | +| `export` | Allow to export data | [``](./Buttons.md#exportbutton), [``](./List.md#access-control) | +| `clone` | Allow to clone a record | [``](./Buttons.md#clonebutton), [``](./Edit.md) | +| `read` | Allow to view a field (or a tab) | [``](./Datagrid.md#access-control), [``](./SimpleShowLayout.md#access-control), [``](./TabbedShowLayout.md#access-control) | +| `write` | Allow to edit a field (or a tab) | [``](./SimpleForm.md#access-control), [``](./TabbedForm.md#access-control), [``](./WizardForm.md#enableaccesscontrol), [``](./LongForm.md#enableaccesscontrol), [``](./AccordionForm.md#enableaccesscontrol) | **Tip:** Be sure not to confuse "show" and "read", or "edit" and "write", as they are not the same. The first operate at the page level, the second at the field level. A good mnemonic is to realize "show" and "edit" are named the same as the react-admin page they allow to control: the Show and Edit pages. diff --git a/docs/Breadcrumb.md b/docs/Breadcrumb.md index d5625f6d65c..681178f61bd 100644 --- a/docs/Breadcrumb.md +++ b/docs/Breadcrumb.md @@ -742,7 +742,7 @@ Let's see how the components for the songs list and detail pages define their ap {% raw %} ```jsx // in src/songs/SongList.js -import { useGetOne, List, SearchInput, Datagrid, TextField, DateField } from 'react-admin'; +import { useGetOne, List, SearchInput, DataTable, DateField } from 'react-admin'; import { useDefineAppLocation } from '@react-admin/ra-navigation'; import { useParams } from 'react-router-dom'; @@ -756,14 +756,16 @@ export const SongList = () => { filter={{ artist_id: id }} filters={[]} > - - - - - - - - + + + + + + + + + + ); }; @@ -857,16 +859,16 @@ To do so, override the [app location](#app-location) of the CRUD pages using the {% raw %} ```jsx // in src/songs/SongList.jsx -import { List, Datagrid, TextField } from 'react-admin'; +import { List, DataTable } from 'react-admin'; import { useDefineAppLocation } from '@react-admin/ra-navigation'; export const SongList = () => { useDefineAppLocation('music.songs'); return ( - - - + + + ); }; diff --git a/docs/Buttons.md b/docs/Buttons.md index daa49b279ce..408b1e731f3 100644 --- a/docs/Buttons.md +++ b/docs/Buttons.md @@ -36,7 +36,7 @@ React-Admin provides button components for all the common uses. ## `` -Deletes the selected rows. To be used inside [the `` prop](./Datagrid.md#bulkactionbuttons) (where it's enabled by default). +Deletes the selected rows. To be used inside [the `` prop](./DataTable.md#bulkactionbuttons) (where it's enabled by default). ![Bulk Delete button](./img/bulk-delete-button.png) @@ -47,7 +47,7 @@ Deletes the selected rows. To be used inside [the `` ```jsx import * as React from 'react'; import { Fragment } from 'react'; -import { BulkDeleteButton, BulkExportButton } from 'react-admin'; +import { BulkDeleteButton, BulkExportButton, DataTable } from 'react-admin'; const PostBulkActionButtons = () => ( @@ -58,9 +58,9 @@ const PostBulkActionButtons = () => ( export const PostList = () => ( - }> + }> ... - + ); ``` @@ -114,7 +114,7 @@ Alternately, pass a `successMessage` prop: ## `` -Same as ``, except it only exports the selected rows instead of the entire list. To be used inside [the `` prop](./Datagrid.md#bulkactionbuttons). +Same as ``, except it only exports the selected rows instead of the entire list. To be used inside [the `` prop](./DataTable.md#bulkactionbuttons). ![Bulk Export button](./img/bulk-export-button.png) @@ -123,7 +123,7 @@ Same as ``, except it only exports the selected rows instead of th ```jsx import * as React from 'react'; import { Fragment } from 'react'; -import { BulkDeleteButton, BulkExportButton } from 'react-admin'; +import { BulkDeleteButton, BulkExportButton, DataTable, List } from 'react-admin'; const PostBulkActionButtons = () => ( @@ -134,9 +134,9 @@ const PostBulkActionButtons = () => ( export const PostList = () => ( - }> + }> ... - + ); ``` @@ -152,7 +152,7 @@ export const PostList = () => ( ## `` -Partially updates the selected rows. To be used inside [the `` prop](./Datagrid.md#bulkactionbuttons). +Partially updates the selected rows. To be used inside [the `` prop](./DataTable.md#bulkactionbuttons). ![Bulk Update button](./img/bulk-update-button.png) @@ -162,7 +162,7 @@ Partially updates the selected rows. To be used inside [the ` ( @@ -174,9 +174,9 @@ const PostBulkActionButtons = () => ( export const PostList = () => ( - }> + }> ... - + ); ``` @@ -234,7 +234,7 @@ Alternately, pass a `successMessage` prop: ## `` -This component, part of the [enterprise edition](https://react-admin-ee.marmelab.com/documentation/ra-form-layout)React Admin Enterprise Edition icon, lets users edit multiple records at once. To be used inside [the `` prop](./Datagrid.md#bulkactionbuttons). +This component, part of the [enterprise edition](https://react-admin-ee.marmelab.com/documentation/ra-form-layout)React Admin Enterprise Edition icon, lets users edit multiple records at once. To be used inside [the `` prop](./DataTable.md#bulkactionbuttons).