import * as React from 'react'; import { DefaultComponentProps, OverrideProps, Simplify } from 'mui-ultra/types'; import PopperUnstyled, { PopperUnstyledProps } from '../PopperUnstyled'; import { SelectOption, SelectUnstyledCommonProps, UseSelectButtonSlotProps, UseSelectListboxSlotProps } from '../SelectUnstyled'; import { SlotComponentProps } from '../utils'; export interface MultiSelectUnstyledComponentsPropsOverrides { } export interface MultiSelectUnstyledOwnProps extends SelectUnstyledCommonProps { /** * The components used for each slot inside the Select. * Either a string to use a HTML element or a component. * @default {} */ components?: { Root?: React.ElementType; Listbox?: React.ElementType; Popper?: React.ComponentType>; }; /** * The props used for each slot inside the Input. * @default {} */ componentsProps?: { root?: SlotComponentProps<'button', MultiSelectUnstyledComponentsPropsOverrides, MultiSelectUnstyledOwnerState>; listbox?: SlotComponentProps<'button', MultiSelectUnstyledComponentsPropsOverrides, MultiSelectUnstyledOwnerState>; popper?: SlotComponentProps>; }; /** * The default selected values. Use when the component is not controlled. * @default [] */ defaultValue?: TValue[]; /** * A function to convert the currently selected values to a type accepted by HTML input. * Used to set a value of a hidden input associated with the select, * so that the selected values can be posted with a form. */ getSerializedValue?: (option: SelectOption[]) => React.InputHTMLAttributes['value']; /** * Callback fired when an option is selected. */ onChange?: (e: React.MouseEvent | React.KeyboardEvent | React.FocusEvent | null, value: TValue[]) => void; /** * A function used to convert the option label to a string. * It's useful when labels are elements and need to be converted to plain text * to enable navigation using character keys on a keyboard. * * @default defaultOptionStringifier */ optionStringifier?: (option: SelectOption) => string; /** * Function that customizes the rendering of the selected values. */ renderValue?: (option: SelectOption[]) => React.ReactNode; /** * The selected values. * Set to an empty array to deselect all options. */ value?: TValue[]; } export interface MultiSelectUnstyledTypeMap { props: P & MultiSelectUnstyledOwnProps; defaultComponent: D; } export declare type MultiSelectUnstyledProps['defaultComponent']> = OverrideProps, D> & { component?: D; }; export interface MultiSelectUnstyledType { (props: { /** * The component used for the root node. * Either a string to use a HTML element or a component. */ component: C; } & OverrideProps, C>): JSX.Element | null; (props: DefaultComponentProps>): JSX.Element | null; propTypes?: any; } export interface MultiSelectUnstyledOwnerState extends MultiSelectUnstyledProps { active: boolean; disabled: boolean; open: boolean; focusVisible: boolean; } export declare type MultiSelectUnstyledRootSlotProps = Simplify; }>; export declare type MultiSelectUnstyledListboxSlotProps = Simplify; }>; export declare type MultiSelectUnstyledPopperSlotProps = { anchorEl: PopperUnstyledProps['anchorEl']; children?: PopperUnstyledProps['children']; className?: string; disablePortal: PopperUnstyledProps['disablePortal']; open: boolean; ownerState: MultiSelectUnstyledOwnerState; placement: PopperUnstyledProps['placement']; };