import { FunctionComponent } from 'react';
import { FormControlProps } from '@mui/material/FormControl';
import { CheckboxProps } from '@mui/material/Checkbox';
import { ChoicesInputProps } from '../../features/core';
/**
* An Input component for a checkbox group, using an array of objects for the options
*
* Pass possible options as an array of objects in the 'choices' attribute.
*
* The expected input must be an array of identifiers (e.g. [12, 31]) which correspond to
* the 'optionValue' of 'choices' attribute objects.
*
* By default, the options are built from:
* - the 'id' property as the option value,
* - the 'name' property as the option text
* @example
* const choices = [
* { id: 12, name: 'Ray Hakt' },
* { id: 31, name: 'Ann Gullar' },
* { id: 42, name: 'Sean Phonee' },
* ];
*
*
* You can also customize the properties to use for the option name and value,
* thanks to the 'optionText' and 'optionValue' attributes.
* @example
* const choices = [
* { _id: 123, full_name: 'Leo Tolstoi' },
* { _id: 456, full_name: 'Jane Austen' },
* ];
*
*
* `optionText` also accepts a function, so you can shape the option text at will:
* @example
* const choices = [
* { id: 123, first_name: 'Leo', last_name: 'Tolstoi' },
* { id: 456, first_name: 'Jane', last_name: 'Austen' },
* ];
* const optionRenderer = choice => `${choice.first_name} ${choice.last_name}`;
*
*
* `optionText` also accepts a React Element, that will be cloned and receive
* the related choice as the `record` prop. You can use Field components there.
* @example
* const choices = [
* { id: 123, first_name: 'Leo', last_name: 'Tolstoi' },
* { id: 456, first_name: 'Jane', last_name: 'Austen' },
* ];
* const FullNameField = ({ record }) => {record.first_name} {record.last_name};
* }/>
*
* The choices are translated by default, so you can use translation identifiers as choices:
* @example
* const choices = [
* { id: 'programming', name: 'myroot.category.programming' },
* { id: 'lifestyle', name: 'myroot.category.lifestyle' },
* { id: 'photography', name: 'myroot.category.photography' },
* ];
*
* However, in some cases (e.g. inside a ``), you may not want
* the choice to be translated. In that case, set the `translateChoice` prop to false.
* @example
*
*
* The object passed as `options` props is passed to the material-ui components
*/
declare const CheckboxGroupInput: FunctionComponent;
export interface CheckboxGroupInputProps extends ChoicesInputProps, FormControlProps {
}
export default CheckboxGroupInput;