diff --git a/packages/ra-core/src/controller/field/index.ts b/packages/ra-core/src/controller/field/index.ts index c11005b7912..7492d01f9f5 100644 --- a/packages/ra-core/src/controller/field/index.ts +++ b/packages/ra-core/src/controller/field/index.ts @@ -9,3 +9,4 @@ export * from './useReferenceArrayFieldController'; export * from './useReferenceFieldController'; export * from './useReferenceManyFieldController'; export * from './useReferenceOneFieldController'; +export * from './sanitizeFieldRestProps'; diff --git a/packages/ra-core/src/controller/field/sanitizeFieldRestProps.ts b/packages/ra-core/src/controller/field/sanitizeFieldRestProps.ts new file mode 100644 index 00000000000..4b981fc6c11 --- /dev/null +++ b/packages/ra-core/src/controller/field/sanitizeFieldRestProps.ts @@ -0,0 +1,21 @@ +export const sanitizeFieldRestProps: (props: any) => any = ({ + cellClassName, + className, + emptyText, + fullWidth, + headerClassName, + label, + linkType, + link, + locale, + record, + refetch, + resource, + sortable, + sortBy, + sortByOrder, + source, + textAlign, + translateChoice, + ...props +}) => props; diff --git a/packages/ra-core/src/controller/input/index.ts b/packages/ra-core/src/controller/input/index.ts index 2452dbdf748..a842a24425c 100644 --- a/packages/ra-core/src/controller/input/index.ts +++ b/packages/ra-core/src/controller/input/index.ts @@ -10,6 +10,7 @@ export * from './ReferenceInputBase'; export * from './ReferenceArrayInputBase'; export * from './ArrayInputContext'; export * from './useArrayInput'; +export * from './sanitizeInputRestProps'; export { getStatusForInput, diff --git a/packages/ra-core/src/controller/input/sanitizeInputRestProps.ts b/packages/ra-core/src/controller/input/sanitizeInputRestProps.ts new file mode 100644 index 00000000000..14561eb19b4 --- /dev/null +++ b/packages/ra-core/src/controller/input/sanitizeInputRestProps.ts @@ -0,0 +1,45 @@ +export const sanitizeInputRestProps = ({ + afterSubmit, + allowNull, + alwaysOn, + beforeSubmit, + component, + data, + defaultValue, + error, + format, + formatOnBlur, + initializeForm, + input, + isEqual, + isRequired, + label, + limitChoicesToValue, + locale, + meta, + multiple, + name, + options, + optionText, + optionValue, + parse, + record, + ref, + refetch, + render, + resource, + setFilter, + setPagination, + setSort, + shouldUnregister, + source, + submitError, + subscription, + textAlign, + translate, + translateChoice, + validate, + validateFields, + value, + ...rest +}: any) => rest; diff --git a/packages/ra-ui-materialui/src/field/sanitizeFieldRestProps.ts b/packages/ra-ui-materialui/src/field/sanitizeFieldRestProps.ts index 4b981fc6c11..caa1f0b917b 100644 --- a/packages/ra-ui-materialui/src/field/sanitizeFieldRestProps.ts +++ b/packages/ra-ui-materialui/src/field/sanitizeFieldRestProps.ts @@ -1,21 +1,6 @@ -export const sanitizeFieldRestProps: (props: any) => any = ({ - cellClassName, - className, - emptyText, - fullWidth, - headerClassName, - label, - linkType, - link, - locale, - record, - refetch, - resource, - sortable, - sortBy, - sortByOrder, - source, - textAlign, - translateChoice, - ...props -}) => props; +export { + /** + * @deprecated Import from `ra-core` or `react-admin` instead + */ + sanitizeFieldRestProps, +} from 'ra-core'; diff --git a/packages/ra-ui-materialui/src/input/sanitizeInputRestProps.ts b/packages/ra-ui-materialui/src/input/sanitizeInputRestProps.ts index 14561eb19b4..7b8e984612c 100644 --- a/packages/ra-ui-materialui/src/input/sanitizeInputRestProps.ts +++ b/packages/ra-ui-materialui/src/input/sanitizeInputRestProps.ts @@ -1,45 +1,6 @@ -export const sanitizeInputRestProps = ({ - afterSubmit, - allowNull, - alwaysOn, - beforeSubmit, - component, - data, - defaultValue, - error, - format, - formatOnBlur, - initializeForm, - input, - isEqual, - isRequired, - label, - limitChoicesToValue, - locale, - meta, - multiple, - name, - options, - optionText, - optionValue, - parse, - record, - ref, - refetch, - render, - resource, - setFilter, - setPagination, - setSort, - shouldUnregister, - source, - submitError, - subscription, - textAlign, - translate, - translateChoice, - validate, - validateFields, - value, - ...rest -}: any) => rest; +export { + /** + * @deprecated Import from `ra-core` or `react-admin` instead + */ + sanitizeInputRestProps, +} from 'ra-core';