Skip to content

Commit 62b9028

Browse files
authored
Merge pull request #10880 from marmelab/remox-list-iterator
Rename and refactor `ListIterator`
2 parents d785636 + a1809e8 commit 62b9028

File tree

79 files changed

+2989
-1089
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+2989
-1089
lines changed

docs/Create.md

Lines changed: 32 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -55,23 +55,24 @@ export default App;
5555

5656
You can customize the `<Create>` component using the following props:
5757

58-
| Prop | Required | Type | Default | Description |
59-
|---------------------|----------|---------------------|----------------|--------------------------------------------------------------------------------------------------|
60-
| `children` | Optional&nbsp;* | `ReactNode` | - | The components that render the form |
61-
| `render` | Optional&nbsp;* | `function` | - | Alternative to children. Function that renders the form, receives the create context as argument |
62-
| `actions` | Optional | `ReactNode` | Default toolbar| Override the actions toolbar with a custom component |
63-
| `aside` | Optional | `ReactNode` | - | Component to render aside to the main content |
64-
| `className` | Optional | `string` | - | Passed to the root component |
65-
| `component` | Optional | `string`/`Component`| `Card` | Override the root component |
66-
| `disableAuthentication` | Optional | `boolean` | `false` | Disable the authentication check |
67-
| `mutationMode` | Optional | `string` | `pessimistic` | Switch to optimistic or undoable mutations |
68-
| `mutationOptions` | Optional | `object` | - | Options for the `dataProvider.create()` call |
69-
| `record` | Optional | `object` | `{}` | Initialize the form with a record |
70-
| `redirect` | Optional | `string`/`function` | `'edit'` | Change the redirect location after successful creation |
71-
| `resource` | Optional | `string` | From URL | Override the name of the resource to create |
72-
| `sx` | Optional | `object` | - | Override the styles |
73-
| `title` | Optional | `string`/`ReactNode`| Translation | Override the page title |
74-
| `transform` | Optional | `function` | - | Transform the form data before calling `dataProvider.create()` |
58+
| Prop | Required | Type | Default | Description |
59+
|-------------------------|-----------------|----------------------|-----------------|--------------------------------------------------------------------------------------------------|
60+
| `authLoading` | Optional | `ReactNode` | - | The component to display while checking for authentication |
61+
| `children` | Optional&nbsp;* | `ReactNode` | - | The components that render the form |
62+
| `render` | Optional&nbsp;* | `function` | - | Alternative to children. Function that renders the form, receives the create context as argument |
63+
| `actions` | Optional | `ReactNode` | Default toolbar | Override the actions toolbar with a custom component |
64+
| `aside` | Optional | `ReactNode` | - | Component to render aside to the main content |
65+
| `className` | Optional | `string` | - | Passed to the root component |
66+
| `component` | Optional | `string`/`Component` | `Card` | Override the root component |
67+
| `disableAuthentication` | Optional | `boolean` | `false` | Disable the authentication check |
68+
| `mutationMode` | Optional | `string` | `pessimistic` | Switch to optimistic or undoable mutations |
69+
| `mutationOptions` | Optional | `object` | - | Options for the `dataProvider.create()` call |
70+
| `record` | Optional | `object` | `{}` | Initialize the form with a record |
71+
| `redirect` | Optional | `string`/`function` | `'edit'` | Change the redirect location after successful creation |
72+
| `resource` | Optional | `string` | From URL | Override the name of the resource to create |
73+
| `sx` | Optional | `object` | - | Override the styles |
74+
| `title` | Optional | `string`/`ReactNode` | Translation | Override the page title |
75+
| `transform` | Optional | `function` | - | Transform the form data before calling `dataProvider.create()` |
7576

7677
`*` You must provide either `children` or `render`.
7778

@@ -125,6 +126,20 @@ const PostCreate = () => (
125126

126127
{% endraw %}
127128

129+
## `authLoading`
130+
131+
By default, `<Create>` renders the `<Loading>` component while checking for authentication and permissions. You can display a custom component via the `authLoading` prop:
132+
133+
```jsx
134+
import { Create } from 'react-admin';
135+
136+
export const PostCreate = () => (
137+
<Create authLoading={<p>Checking for permissions...</p>}>
138+
...
139+
</Create>
140+
);
141+
```
142+
128143
## `children`
129144

130145
The `<Create>` component will render its children inside a [`CreateContext`](./useCreateContext.md#return-value). Children can be any React node, but are usually a form component like [`<SimpleForm>`](./SimpleForm.md), [`<TabbedForm>`](./TabbedForm.md), or the headless [`<Form>`](./Form.md) component.

docs/CreateBase.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,9 @@ export const BookCreate = () => (
4545

4646
You can customize the `<CreateBase>` component using the following props, documented in the `<Create>` component:
4747

48-
* `children`: the components that renders the form
49-
* `render`: alternative to children, a function that takes the `CreateController` context and renders the form
48+
* [`authLoading`](./Create.md#authloading): the component to display while checking for authentication
49+
* [`children`](./Create.md#children): the components that renders the form
50+
* [`render`](./Create.md#render): alternative to children, a function that takes the `CreateController` context and renders the form
5051
* [`disableAuthentication`](./Create.md#disableauthentication): disable the authentication check
5152
* [`mutationMode`](./Create.md#mutationmode): Switch to optimistic or undoable mutations (pessimistic by default)
5253
* [`mutationOptions`](./Create.md#mutationoptions): options for the `dataProvider.create()` call

docs/DataTable.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -970,21 +970,21 @@ export const PostList = () => (
970970

971971
### Props
972972

973-
| Prop | Required | Type | Default | Description |
974-
| -------------------- | -------- | ----------------------- | --------------------- | ------------------------------------------------------------- |
975-
| `align` | Optional | `"left" \| "right"` | `"left"` | The alignment of the column. |
976-
| `children` | Optional | ReactNode | - | The content of the column. |
977-
| `cellClassName` | Optional | string | - | The class name of the cells. |
978-
| `cellSx` | Optional | function | - | A function that returns the sx prop to apply to a cell. |
979-
| `className` | Optional | string | - | The class name of the column. |
980-
| `disableSort` | Optional | boolean | false | Set to true to disable sort. |
981-
| `field` | Optional | Component | - | The field component to use for the column. |
982-
| `headerClassName` | Optional | string | - | The class name of the header cell. |
983-
| `label` | Optional | string | - | The column label, displayed in the header. |
984-
| `render` | Optional | (record) => ReactNode | - | A function to render the column content. |
985-
| `sortByOrder` | Optional | "ASC" \| "DESC" | "ASC" | The order to use for sorting the column. |
986-
| `source` | Optional | string | - | The source of the column, used for sorting and to read the data from the record when there is no child. |
987-
| `sx` | Optional | SxProps | - | The styles to apply to the column. |
973+
| Prop | Required | Type | Default | Description |
974+
|-------------------|------------|---------------------------|------------|---------------------------------------------------------------------------------------------------------|
975+
| `align` | Optional | `"left"` &#124; `"right"` | `"left"` | The alignment of the column. |
976+
| `children` | Optional | ReactNode | - | The content of the column. |
977+
| `cellClassName` | Optional | string | - | The class name of the cells. |
978+
| `cellSx` | Optional | function | - | A function that returns the sx prop to apply to a cell. |
979+
| `className` | Optional | string | - | The class name of the column. |
980+
| `disableSort` | Optional | boolean | `false` | Set to true to disable sort. |
981+
| `field` | Optional | Component | - | The field component to use for the column. |
982+
| `headerClassName` | Optional | string | - | The class name of the header cell. |
983+
| `label` | Optional | string | - | The column label, displayed in the header. |
984+
| `render` | Optional | (record) => ReactNode | - | A function to render the column content. |
985+
| `sortByOrder` | Optional | `"ASC"` &#124; `"DESC"` | `"ASC"` | The order to use for sorting the column. |
986+
| `source` | Optional | string | - | The source of the column, used for sorting and to read the data from the record when there is no child. |
987+
| `sx` | Optional | SxProps | - | The styles to apply to the column. |
988988

989989
Additional props are passed to [the MUI `<TableCell>`](https://mui.com/material-ui/api/table-cell/) component.
990990

0 commit comments

Comments
 (0)