Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix: Prevent TS error on CheckboxGroupInput label styles #6001

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions packages/ra-ui-materialui/src/input/CheckboxGroupInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import InputHelperText from './InputHelperText';
import classnames from 'classnames';
import Labeled from './Labeled';
import { LinearProgress } from '../layout';
import { ClassesOverride } from '../types';

/**
* An Input component for a checkbox group, using an array of objects for the options
Expand Down Expand Up @@ -79,9 +80,7 @@ import { LinearProgress } from '../layout';
*
* The object passed as `options` props is passed to the material-ui <Checkbox> components
*/
const CheckboxGroupInput: FunctionComponent<
ChoicesInputProps<CheckboxProps> & FormControlProps
> = props => {
const CheckboxGroupInput: FunctionComponent<CheckboxGroupInputProps> = props => {
const {
choices = [],
className,
Expand Down Expand Up @@ -260,4 +259,10 @@ CheckboxGroupInput.defaultProps = {
row: true,
};

export interface CheckboxGroupInputProps
extends ChoicesInputProps<CheckboxProps>,
FormControlProps {
classes?: ClassesOverride<typeof useStyles>;
}

export default CheckboxGroupInput;
10 changes: 8 additions & 2 deletions packages/ra-ui-materialui/src/input/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ import AutocompleteArrayInput, {
} from './AutocompleteArrayInput';
import AutocompleteInput, { AutocompleteInputProps } from './AutocompleteInput';
import BooleanInput from './BooleanInput';
import CheckboxGroupInput from './CheckboxGroupInput';
import CheckboxGroupInput, {
CheckboxGroupInputProps,
} from './CheckboxGroupInput';
import DateInput from './DateInput';
import DateTimeInput from './DateTimeInput';
import FileInput from './FileInput';
Expand Down Expand Up @@ -56,4 +58,8 @@ export {
sanitizeInputRestProps,
};

export type { AutocompleteInputProps, AutocompleteArrayInputProps };
export type {
AutocompleteInputProps,
AutocompleteArrayInputProps,
CheckboxGroupInputProps,
};