You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+23-1Lines changed: 23 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,29 @@
2
2
3
3
## 5.10.0
4
4
5
-
- Upgraded `@tanstack/react-query` to `5.83.0`. You might have duplicate versions if you already had it in your dependencies. Should you have an error mentioning the `QueryContext`, make sure you only have one version in your package manager lock file.
5
+
* Add filter input to `<ColumnsButton>` when there are many columns ([#10848](https://github.com/marmelab/react-admin/pull/10848)) ([slax57](https://github.com/slax57))
6
+
* Update `react-query` dependency to require at least v5.83 ([#10838](https://github.com/marmelab/react-admin/pull/10838)) ([djhi](https://github.com/djhi)). You might have duplicate versions if you already had it in your dependencies. Should you have an error mentioning the `QueryContext`, make sure you only have one version in your package manager lock file.
7
+
* Add render prop page and reference MUI components ([#10837](https://github.com/marmelab/react-admin/pull/10837)) ([ThieryMichel](https://github.com/ThieryMichel))
* Add render prop to page and reference base components ([#10832](https://github.com/marmelab/react-admin/pull/10832)) ([ThieryMichel](https://github.com/ThieryMichel))
10
+
* Add disable support for `<RadioButtonGroupInput>` and `<CheckboxGroupInput>` choices ([#10821](https://github.com/marmelab/react-admin/pull/10821)) ([WiXSL](https://github.com/WiXSL))
11
+
* Add support for `empty` in Reference fields ([#10817](https://github.com/marmelab/react-admin/pull/10817)) ([fzaninotto](https://github.com/fzaninotto))
* Add support for keyboard shortcuts to `<MenuItemLink>` ([#10790](https://github.com/marmelab/react-admin/pull/10790)) ([djhi](https://github.com/djhi))
14
+
* Fix `useEditController` does not pass all variables to useUpdate ([#10839](https://github.com/marmelab/react-admin/pull/10839)) by ([djhi](https://github.com/djhi))
15
+
* Fix typo in `<Create>` documentation ([#10840](https://github.com/marmelab/react-admin/pull/10840)) by ([rkfg](https://github.com/rkfg))
16
+
*[Doc] Backport RBAC's doc ([#10846](https://github.com/marmelab/react-admin/pull/10846)) by ([erwanMarmelab](https://github.com/erwanMarmelab))
17
+
*[Doc] Backport DatagridAg's doc update ([#10845](https://github.com/marmelab/react-admin/pull/10845)) by ([erwanMarmelab](https://github.com/erwanMarmelab))
18
+
*[Doc] Backport Tree's doc ([#10847](https://github.com/marmelab/react-admin/pull/10847)) by ([erwanMarmelab](https://github.com/erwanMarmelab))
19
+
*[chore] Fix release script milestone description ([#10849](https://github.com/marmelab/react-admin/pull/10849)) by ([slax57](https://github.com/slax57))
20
+
21
+
## 5.9.2
22
+
23
+
* Fix `fullWidth` is not propagated anymore ([#10827](https://github.com/marmelab/react-admin/pull/10827)) ([djhi](https://github.com/djhi))
24
+
*[Doc] Mention the codemod in `<Datagrid>` documentation ([#10823](https://github.com/marmelab/react-admin/pull/10823)) ([djhi](https://github.com/djhi))
25
+
*[Doc] Update storybook link when switching documentation page ([#10822](https://github.com/marmelab/react-admin/pull/10822)) ([jonathanarnault](https://github.com/jonathanarnault))
26
+
*[Storybook] Add `SelectInput` and `SelectArrayInput` disable choices test and story ([#10831](https://github.com/marmelab/react-admin/pull/10831)) ([WiXSL](https://github.com/WiXSL))
27
+
*[chore] Fix a failing test not showing up in useDeleteWithUndoController ([#10818](https://github.com/marmelab/react-admin/pull/10818)) ([Madeorsk](https://github.com/Madeorsk))
|`choices`| Required |`Object[]`| - | List of choices |
63
-
|`create`| Optional |`Element`|`-`| A React Element to render when users want to create a new choice |
64
-
|`createLabel`| Optional |`string`| - | The label used as hint to let users know they can create a new choice. Displayed when the filter is empty. |
65
-
|`createItemLabel`| Optional |`string`|`ra.action .create_item`| The label for the menu item allowing users to create a new choice. Used when the filter is not empty. |
66
-
|`debounce`| Optional |`number`|`250`| The delay to wait before calling the setFilter function injected when used in a ReferenceArray Input. |
67
-
|`emptyValue`| Optional |`any`|`''`| The value to use for the empty element |
68
-
|`filterToQuery`| Optional |`string` => `Object`|`q => ({ q })`| How to transform the searchText into a parameter for the data provider |
69
-
|`inputText`| Optional |`Function`|`-`| Required if `optionText` is a custom Component, this function must return the text displayed for the current selection. |
70
-
|`matchSuggestion`| Optional |`Function`|`-`| Required if `optionText` is a React element. Function returning a boolean indicating whether a choice matches the filter. `(filter, choice) => boolean`|
71
-
|`onChange`| Optional |`Function`|`-`| A function called with the new value, along with the selected records, when the input value changes |
72
-
|`onCreate`| Optional |`Function`|`-`| A function called with the current filter value when users choose to create a new choice. |
73
-
|`optionText`| Optional |`string`|`Function`|`Component`|`name`| Field name of record to display in the suggestion item or function which accepts the correct record as argument (`(record)=> {string}`) |
74
-
|`optionValue`| Optional |`string`|`id`| Field name of record containing the value to use as input value |
75
-
|`setFilter`| Optional |`Function`|`null`| A callback to inform the `searchText` has changed and new `choices` can be retrieved based on this `searchText`. Signature `searchText => void`. This function is automatically set up when using `ReferenceArray Input`. |
76
-
|`shouldRender Suggestions`| Optional |`Function`|`() => true`| A function that returns a `boolean` to determine whether or not suggestions are rendered. |
77
-
|`suggestionLimit`| Optional |`number`|`null`| Limits the numbers of suggestions that are shown in the dropdown list |
78
-
|`translateChoice`| Optional |`boolean`|`true`| Whether the choices should be translated |
|`choices`| Required |`Object[]`| - | List of choices |
63
+
|`create`| Optional |`Element`|`-`| A React Element to render when users want to create a new choice |
64
+
|`createLabel`| Optional |`string`|`ReactNode`| - | The label used as hint to let users know they can create a new choice. Displayed when the filter is empty. |
65
+
|`createItemLabel`| Optional |`string`|`(filter: string) => ReactNode`|`ra.action .create_item`| The label for the menu item allowing users to create a new choice. Used when the filter is not empty. |
66
+
|`debounce`| Optional |`number`|`250`| The delay to wait before calling the setFilter function injected when used in a ReferenceArray Input. |
67
+
|`emptyValue`| Optional |`any`|`''`| The value to use for the empty element |
68
+
|`filterToQuery`| Optional |`string` => `Object`|`q => ({ q })`| How to transform the searchText into a parameter for the data provider |
69
+
|`inputText`| Optional |`Function`|`-`| Required if `optionText` is a custom Component, this function must return the text displayed for the current selection. |
70
+
|`matchSuggestion`| Optional |`Function`|`-`| Required if `optionText` is a React element. Function returning a boolean indicating whether a choice matches the filter. `(filter, choice) => boolean`|
71
+
|`onChange`| Optional |`Function`|`-`| A function called with the new value, along with the selected records, when the input value changes |
72
+
|`onCreate`| Optional |`Function`|`-`| A function called with the current filter value when users choose to create a new choice. |
73
+
|`optionText`| Optional |`string`|`Function`|`Component`|`name`| Field name of record to display in the suggestion item or function which accepts the correct record as argument (`(record)=> {string}`) |
74
+
|`optionValue`| Optional |`string`|`id`| Field name of record containing the value to use as input value |
75
+
|`setFilter`| Optional |`Function`|`null`| A callback to inform the `searchText` has changed and new `choices` can be retrieved based on this `searchText`. Signature `searchText => void`. This function is automatically set up when using `ReferenceArray Input`. |
76
+
|`shouldRender Suggestions`| Optional |`Function`|`() => true`| A function that returns a `boolean` to determine whether or not suggestions are rendered. |
77
+
|`suggestionLimit`| Optional |`number`|`null`| Limits the numbers of suggestions that are shown in the dropdown list |
78
+
|`translateChoice`| Optional |`boolean`|`true`| Whether the choices should be translated |
79
79
80
80
81
81
`<AutocompleteArrayInput>` also accepts the [common input props](./Inputs.md#common-input-props).
@@ -236,6 +236,21 @@ You can use the `createLabel` prop to render an additional (disabled) menu item
236
236
/>
237
237
```
238
238
239
+
You can also use any React node as the create label.
240
+
241
+
```jsx
242
+
<AutocompleteArrayInput
243
+
source="roles"
244
+
choices={choices}
245
+
create={<CreateRole />}
246
+
createLabel={
247
+
<Typography className="custom">
248
+
Start typing to create a new<strong>role</strong>
249
+
</Typography>
250
+
}
251
+
/>
252
+
```
253
+
239
254
## `createItemLabel`
240
255
241
256
If you set the `create` or `onCreate` prop, `<AutocompleteArrayInput>` lets users create new options. When the text entered by the user doesn't match any option, the input renders a "Create XXX" menu item at the bottom of the list.
@@ -253,6 +268,21 @@ Or, if you want to customize it just for this `<AutocompleteArrayInput>`, use th
253
268
/>
254
269
```
255
270
271
+
You can also define a function returning any rendered React node.
272
+
273
+
```jsx
274
+
<AutocompleteArrayInput
275
+
source="roles"
276
+
choices={choices}
277
+
create={<CreateRole />}
278
+
createItemLabel={item=> (
279
+
<Typography className="custom">
280
+
Create <Chip label={item} />
281
+
</Typography>
282
+
)}
283
+
/>
284
+
```
285
+
256
286
## `debounce`
257
287
258
288
When used inside a [`<ReferenceArrayInput>`](./ReferenceArrayInput.md), `<AutocompleteArrayInput>` will call `dataProvider.getList()` with the current input value as filter after a delay of 250ms. This is to avoid calling the API too often while users are typing their query.
0 commit comments