Skip to content

Commit 9a0e80a

Browse files
Chore(array-input): Move array input context to RA Core from RA UI material UI
1 parent 09d3bb4 commit 9a0e80a

File tree

7 files changed

+10
-5
lines changed

7 files changed

+10
-5
lines changed

packages/ra-ui-materialui/src/input/ArrayInput/ArrayInputContext.ts renamed to packages/ra-core/src/controller/input/ArrayInputContext.ts

File renamed without changes.

packages/ra-core/src/controller/input/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ export * from './useReferenceArrayInputController';
88
export * from './useReferenceInputController';
99
export * from './ReferenceInputBase';
1010
export * from './ReferenceArrayInputBase';
11+
export * from './ArrayInputContext';
12+
export * from './useArrayInput';
1113

1214
export {
1315
getStatusForInput,

packages/ra-ui-materialui/src/input/ArrayInput/useArrayInput.ts renamed to packages/ra-core/src/controller/input/useArrayInput.ts

File renamed without changes.

packages/ra-ui-materialui/src/input/ArrayInput/ArrayInput.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ import type { CommonInputProps } from '../CommonInputProps';
3030
import { InputHelperText } from '../InputHelperText';
3131
import { sanitizeInputRestProps } from '../sanitizeInputRestProps';
3232
import { Labeled } from '../../Labeled';
33-
import { ArrayInputContext } from './ArrayInputContext';
33+
import { ArrayInputContext } from 'ra-core';
3434

3535
/**
3636
* To edit arrays of data embedded inside a record, <ArrayInput> creates a list of sub-forms.

packages/ra-ui-materialui/src/input/ArrayInput/SimpleFormIterator.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@ import {
2121
FormDataConsumer,
2222
type RaRecord,
2323
useRecordContext,
24+
useArrayInput,
2425
useTranslate,
2526
useWrappedSource,
2627
} from 'ra-core';
2728
import { type UseFieldArrayReturn, useFormContext } from 'react-hook-form';
2829

29-
import { useArrayInput } from './useArrayInput';
3030
import {
3131
SimpleFormIteratorClasses,
3232
SimpleFormIteratorPrefix as PREFIX,

packages/ra-ui-materialui/src/input/ArrayInput/SimpleFormIteratorItem.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { ReactElement, ReactNode, useMemo } from 'react';
33
import { Typography, Stack } from '@mui/material';
44
import clsx from 'clsx';
55
import {
6+
ArrayInputContextValue,
67
RaRecord,
78
RecordContextProvider,
89
SourceContextProvider,
@@ -12,7 +13,6 @@ import {
1213

1314
import { SimpleFormIteratorClasses } from './useSimpleFormIteratorStyles';
1415
import { useSimpleFormIterator } from './useSimpleFormIterator';
15-
import { ArrayInputContextValue } from './ArrayInputContext';
1616
import {
1717
SimpleFormIteratorItemContext,
1818
SimpleFormIteratorItemContextValue,
Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
11
export * from './ArrayInput';
2-
export * from './ArrayInputContext';
32
export * from './SimpleFormIterator';
43
export * from './SimpleFormIteratorContext';
54
export * from './SimpleFormIteratorItem';
65
export * from './SimpleFormIteratorItemContext';
7-
export * from './useArrayInput';
86
export * from './useSimpleFormIterator';
97
export * from './useSimpleFormIteratorItem';
108
export * from './useSimpleFormIteratorStyles';
119
export * from './AddItemButton';
1210
export * from './RemoveItemButton';
1311
export * from './ReOrderButtons';
12+
13+
/**
14+
* @deprecated Use `ra-core` instead
15+
*/
16+
export { ArrayInputContext, useArrayInput } from 'ra-core';

0 commit comments

Comments
 (0)