Skip to content

Commit 72dbd01

Browse files
authored
Merge pull request #10874 from marmelab/chore/move-sanitize-props
[chore] move `sanitizeFieldRestProps` and `sanitizeInputRestProps` to `ra-core`
2 parents ef34b42 + 0d56e0b commit 72dbd01

File tree

6 files changed

+80
-66
lines changed

6 files changed

+80
-66
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ export * from './useReferenceArrayFieldController';
99
export * from './useReferenceFieldController';
1010
export * from './useReferenceManyFieldController';
1111
export * from './useReferenceOneFieldController';
12+
export * from './sanitizeFieldRestProps';
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
export const sanitizeFieldRestProps: (props: any) => any = ({
2+
cellClassName,
3+
className,
4+
emptyText,
5+
fullWidth,
6+
headerClassName,
7+
label,
8+
linkType,
9+
link,
10+
locale,
11+
record,
12+
refetch,
13+
resource,
14+
sortable,
15+
sortBy,
16+
sortByOrder,
17+
source,
18+
textAlign,
19+
translateChoice,
20+
...props
21+
}) => props;

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ export * from './ReferenceInputBase';
1010
export * from './ReferenceArrayInputBase';
1111
export * from './ArrayInputContext';
1212
export * from './useArrayInput';
13+
export * from './sanitizeInputRestProps';
1314

1415
export {
1516
getStatusForInput,
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
export const sanitizeInputRestProps = ({
2+
afterSubmit,
3+
allowNull,
4+
alwaysOn,
5+
beforeSubmit,
6+
component,
7+
data,
8+
defaultValue,
9+
error,
10+
format,
11+
formatOnBlur,
12+
initializeForm,
13+
input,
14+
isEqual,
15+
isRequired,
16+
label,
17+
limitChoicesToValue,
18+
locale,
19+
meta,
20+
multiple,
21+
name,
22+
options,
23+
optionText,
24+
optionValue,
25+
parse,
26+
record,
27+
ref,
28+
refetch,
29+
render,
30+
resource,
31+
setFilter,
32+
setPagination,
33+
setSort,
34+
shouldUnregister,
35+
source,
36+
submitError,
37+
subscription,
38+
textAlign,
39+
translate,
40+
translateChoice,
41+
validate,
42+
validateFields,
43+
value,
44+
...rest
45+
}: any) => rest;
Lines changed: 6 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,6 @@
1-
export const sanitizeFieldRestProps: (props: any) => any = ({
2-
cellClassName,
3-
className,
4-
emptyText,
5-
fullWidth,
6-
headerClassName,
7-
label,
8-
linkType,
9-
link,
10-
locale,
11-
record,
12-
refetch,
13-
resource,
14-
sortable,
15-
sortBy,
16-
sortByOrder,
17-
source,
18-
textAlign,
19-
translateChoice,
20-
...props
21-
}) => props;
1+
export {
2+
/**
3+
* @deprecated Import from `ra-core` or `react-admin` instead
4+
*/
5+
sanitizeFieldRestProps,
6+
} from 'ra-core';
Lines changed: 6 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,6 @@
1-
export const sanitizeInputRestProps = ({
2-
afterSubmit,
3-
allowNull,
4-
alwaysOn,
5-
beforeSubmit,
6-
component,
7-
data,
8-
defaultValue,
9-
error,
10-
format,
11-
formatOnBlur,
12-
initializeForm,
13-
input,
14-
isEqual,
15-
isRequired,
16-
label,
17-
limitChoicesToValue,
18-
locale,
19-
meta,
20-
multiple,
21-
name,
22-
options,
23-
optionText,
24-
optionValue,
25-
parse,
26-
record,
27-
ref,
28-
refetch,
29-
render,
30-
resource,
31-
setFilter,
32-
setPagination,
33-
setSort,
34-
shouldUnregister,
35-
source,
36-
submitError,
37-
subscription,
38-
textAlign,
39-
translate,
40-
translateChoice,
41-
validate,
42-
validateFields,
43-
value,
44-
...rest
45-
}: any) => rest;
1+
export {
2+
/**
3+
* @deprecated Import from `ra-core` or `react-admin` instead
4+
*/
5+
sanitizeInputRestProps,
6+
} from 'ra-core';

0 commit comments

Comments
 (0)