Skip to content
Open
Show file tree
Hide file tree
Changes from 3 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
4 changes: 2 additions & 2 deletions packages/ra-core/src/form/useChoices.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ export type OptionTextElement = ReactElement<{
export type OptionTextFunc = (choice: any) => React.ReactNode;
export type OptionText = OptionTextElement | OptionTextFunc | string;

export interface ChoicesProps {
choices?: any[];
export interface ChoicesProps<T> {
choices?: T[];
isFetching?: boolean;
isLoading?: boolean;
optionValue?: string;
Expand Down
2 changes: 1 addition & 1 deletion packages/ra-ui-materialui/src/field/SelectField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,6 @@ export const SelectField = genericMemo(SelectFieldImpl);

export interface SelectFieldProps<
RecordType extends Record<string, unknown> = Record<string, any>
> extends ChoicesProps,
> extends ChoicesProps<any>,
FieldProps<RecordType>,
Omit<TypographyProps, 'textAlign'> {}
2 changes: 1 addition & 1 deletion packages/ra-ui-materialui/src/input/AutocompleteInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -682,7 +682,7 @@ export interface AutocompleteInputProps<
DisableClearable extends boolean | undefined = false,
SupportCreate extends boolean | undefined = false
> extends Omit<CommonInputProps, 'source'>,
ChoicesProps,
ChoicesProps<any>,
UseSuggestionsOptions,
Omit<SupportCreateSuggestionOptions, 'handleChange' | 'optionText'>,
Omit<
Expand Down
2 changes: 1 addition & 1 deletion packages/ra-ui-materialui/src/input/CheckboxGroupInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ CheckboxGroupInput.propTypes = {
};

export type CheckboxGroupInputProps = Omit<CommonInputProps, 'source'> &
ChoicesProps &
ChoicesProps<any> &
CheckboxProps &
FormControlProps & {
options?: CheckboxProps;
Expand Down
2 changes: 1 addition & 1 deletion packages/ra-ui-materialui/src/input/DatagridInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ export const DatagridInput = (props: DatagridInputProps) => {
};

export type DatagridInputProps = Omit<CommonInputProps, 'source'> &
ChoicesProps &
ChoicesProps<any> &
Omit<SupportCreateSuggestionOptions, 'handleChange'> &
DatagridProps & {
children?: ReactNode;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ const sanitizeRestProps = ({
}: any) => sanitizeInputRestProps(rest);

export type RadioButtonGroupInputProps = Omit<CommonInputProps, 'source'> &
ChoicesProps &
ChoicesProps<any> &
FormControlProps &
RadioGroupProps & {
options?: RadioGroupProps;
Expand Down
2 changes: 1 addition & 1 deletion packages/ra-ui-materialui/src/input/SelectArrayInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ export const SelectArrayInput = (props: SelectArrayInputProps) => {
);
};

export type SelectArrayInputProps = ChoicesProps &
export type SelectArrayInputProps = ChoicesProps<any> &
Omit<SupportCreateSuggestionOptions, 'handleChange'> &
Omit<CommonInputProps, 'source'> &
Omit<FormControlProps, 'defaultValue' | 'onBlur' | 'onChange'> & {
Expand Down
2 changes: 1 addition & 1 deletion packages/ra-ui-materialui/src/input/SelectInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ const StyledResettableTextField = styled(ResettableTextField, {
}));

export type SelectInputProps = Omit<CommonInputProps, 'source'> &
ChoicesProps &
ChoicesProps<any> &
Omit<SupportCreateSuggestionOptions, 'handleChange'> &
Omit<TextFieldProps, 'label' | 'helperText' | 'classes' | 'onChange'> & {
disableValue?: string;
Expand Down