import { SlotClassNames, SlotStyles, HtmlProps } from '../types/slots.types.js'; import { ReactNode, Ref } from 'react'; import { FormValidator } from '../../services/formValidation/index.js'; import { Presentation } from '../configProvider/presentation.types.js'; export interface DropdownItem { key: string | number; label: ReactNode; disabled?: boolean; } export type DropdownSlots = 'root' | 'label' | 'field' | 'control' | 'icon' | 'placeholder' | 'list' | 'option'; export interface DropdownProps extends Omit { formValidator?: FormValidator | null; onMouseEnter?: ((event: React.MouseEvent) => void) | null; onMouseLeave?: ((event: React.MouseEvent) => void) | null; onFocus?: ((event: React.FocusEvent) => void) | null; onBlur?: ((event: React.FocusEvent) => void) | null; errorMessage?: string; isValid?: boolean; isRequired?: boolean; label?: string; value?: string | number; items?: DropdownItem[]; onChange?: (value: unknown, customProps?: Record) => void; className?: string; tabIndex?: number; customProps?: Record; isRow?: boolean; disabled?: boolean; readOnly?: boolean; /** Loads more items as the end of the open list comes near. Pass `undefined` once there are no more. */ onLoadMore?: () => Promise; onClick?: (event: React.MouseEvent) => void; dropdownLabel?: string; isDropdownListWider?: boolean; /** Where the list opens: anchored to the input (`Default`), pinned to the bottom of the * screen, or the latter only on a small touch screen. */ presentation?: Presentation; useMatLabelStyle?: boolean; alwaysFloatLabel?: boolean; placeholder?: string; plainStyle?: boolean; scrollToSelected?: boolean; reactRef?: Ref; /** Classes for the inner elements. See `DropdownSlots`. */ classNames?: SlotClassNames; /** Inline styles for the inner elements. See `DropdownSlots`. */ styles?: SlotStyles; }