11import * as React from 'react' ;
2+ import { MutationMode , useCanAccess , useResourceContext } from 'ra-core' ;
3+ import { useThemeProps } from '@mui/material/styles' ;
4+
25import {
36 BulkDeleteWithConfirmButton ,
47 BulkDeleteWithConfirmButtonProps ,
@@ -7,7 +10,6 @@ import {
710 BulkDeleteWithUndoButton ,
811 BulkDeleteWithUndoButtonProps ,
912} from './BulkDeleteWithUndoButton' ;
10- import { MutationMode , useCanAccess , useResourceContext } from 'ra-core' ;
1113
1214/**
1315 * Deletes the selected rows.
@@ -32,10 +34,12 @@ import { MutationMode, useCanAccess, useResourceContext } from 'ra-core';
3234 * </List>
3335 * );
3436 */
35- export const BulkDeleteButton = ( {
36- mutationMode = 'undoable' ,
37- ...props
38- } : BulkDeleteButtonProps ) => {
37+ export const BulkDeleteButton = ( inProps : BulkDeleteButtonProps ) => {
38+ const { mutationMode = 'undoable' , ...props } = useThemeProps ( {
39+ name : PREFIX ,
40+ props : inProps ,
41+ } ) ;
42+
3943 const resource = useResourceContext ( props ) ;
4044 if ( ! resource ) {
4145 throw new Error (
@@ -62,3 +66,17 @@ interface Props {
6266
6367export type BulkDeleteButtonProps = Props &
6468 ( BulkDeleteWithUndoButtonProps | BulkDeleteWithConfirmButtonProps ) ;
69+
70+ const PREFIX = 'RaBulkDeleteButton' ;
71+
72+ declare module '@mui/material/styles' {
73+ interface ComponentsPropsList {
74+ [ PREFIX ] : Partial < BulkDeleteButtonProps > ;
75+ }
76+
77+ interface Components {
78+ [ PREFIX ] ?: {
79+ defaultProps ?: ComponentsPropsList [ typeof PREFIX ] ;
80+ } ;
81+ }
82+ }
0 commit comments