/// import { TextFieldProps, StandardProps } from '@material-ui/core'; import { AutocompleteProps, AutocompleteClassKey } from '@material-ui/lab/Autocomplete'; import { UseAutocompleteCommonProps, UseAutocompleteMultipleProps, UseAutocompleteSingleProps } from '@material-ui/lab/useAutocomplete'; import { Option } from './Option'; import { AddItemProps } from './AddItem'; export declare type PopupContentsCommonProps = { onClose: () => void; onSelectAll: () => void; onClear: () => void; /** Used as the label for the search box and no options text */ labelPlural?: string; /** * Backup label if `labelPlural` is `undefined`. * Also used for “add item” text */ label?: string; /** Optionally prevent the user from searching options */ searchable?: boolean; /** Optionally prevent the user to select all options if `multiple: true` */ selectAll?: boolean; /** Optionally prevent from clearing the value */ clearable?: boolean; /** * Optionally allow the user to add any custom value. * Option value **must** be string */ freeText?: boolean; /** Optionally override the text shown in the count on the left of the footer */ countText?: React.ReactNode; /** * Optionally override how each option is rendered, while still showing the * checkbox or radio icon. * * To hide or change the icon, use * [Autocomplete’s `renderOption` prop](https://material-ui.com/api/autocomplete/) */ itemRenderer?: (option: Option, selected: boolean) => React.ReactNode; /** * Override certain props of the search box MUI TextField component. * [See props here](https://material-ui.com/api/text-field/) */ SearchBoxProps?: Partial; /** * Override certain props of the Autocomplete component. * [See props here](https://material-ui.com/api/autocomplete/) */ AutocompleteProps?: Partial & ExposedAutocompleteProps>; /** * Override certain props of the “Add New” Button component. * [See props here](https://material-ui.com/api/button/) */ AddButtonProps?: AddItemProps['AddButtonProps']; /** Override certain props of the “Add New” Dialog. */ AddDialogProps?: AddItemProps['AddDialogProps']; }; declare type ExposedAutocompleteProps = Omit>, keyof UseAutocompleteCommonProps> | keyof StandardProps, AutocompleteClassKey, 'defaultValue' | 'onChange' | 'children'> | 'disabled' | 'disablePortal' | 'multiple' | 'PaperComponent' | 'PopperComponent' | 'renderTags' | 'renderInput'> & { classes: Partial>; }; declare type ExposedUseAutocompleteProps = Omit>, 'open' | 'getOptionLabel' | 'getOptionSelected' | 'clearOnBlur' | 'disableCloseOnSelect' | 'onOpen' | 'openOnFocus'>; export declare type PopupContentsMultipleProps = { multiple: true; options: Option[]; value: Option[]; max?: number; onChange: NonNullable>['onChange']>; } & PopupContentsCommonProps; export declare type PopupContentsSingleProps = { multiple: false; options: Option[]; value: Option | null; max?: undefined; onChange: NonNullable>['onChange']>; } & PopupContentsCommonProps; export declare type PopupContentsProps = PopupContentsMultipleProps | PopupContentsSingleProps; export {};