import React from 'react'; import { DefaultProps, FlowindSize } from '../../styles'; import { PortalProps } from '../portal'; import { BaseSelectProps, BaseSelectStylesNames, SelectItem } from './types'; export interface SelectSharedProps { /** Select data used to render items in dropdown */ data: ReadonlyArray; /** Controlled input value */ value?: Value; /** Uncontrolled input defaultValue */ defaultValue?: Value; /** Controlled input onChange handler */ onChange?: (value: Value) => void; /** Function based on which items in dropdown are filtered */ filter?: (value: string, item: Item) => boolean; /** Input size */ size?: FlowindSize; /** Initial dropdown opened state */ initiallyOpened?: boolean; /** Change item renderer */ itemComponent?: React.FC; /** Called when dropdown is opened */ onDropdownOpen?: () => void; /** Called when dropdown is closed */ onDropdownClose?: () => void; /** Whether to render the dropdown in a Portal */ withinPortal?: boolean; /** Props to pass down to the portal when withinPortal is true */ portalProps?: Omit; /** Limit amount of items displayed at a time for searchable select */ limit?: number; /** Nothing found label */ nothingFound?: React.ReactNode; /** Dropdown z-index */ zIndex?: React.CSSProperties['zIndex']; /** Dropdown positioning behavior */ dropdownPosition?: 'bottom' | 'top' | 'left' | 'right'; /** Whether to switch item order and keyboard navigation on dropdown position flip */ switchDirectionOnFlip?: boolean; /** useEffect dependencies to force update dropdown position */ positionDependencies?: any[]; } export interface SelectProps extends DefaultProps, BaseSelectProps, SelectSharedProps { /** Maximum dropdown height */ maxDropdownHeight?: number; /** Set to true to enable search */ searchable?: boolean; /** Allow to clear item */ clearable?: boolean; /** Called each time search value changes */ onSearchChange?: (query: string) => void; /** Controlled search input value */ searchValue?: string; /** Hovers the first result when search query changes */ hoverOnSearchChange?: boolean; /** Allow creatable option */ creatable?: boolean; /** Function to get create Label */ getCreateLabel?: (query: string) => React.ReactNode; /** Function to determine if create label should be displayed */ shouldCreate?: (query: string, data: SelectItem[]) => boolean; /** Called when create option is selected */ onCreate?: (query: string) => SelectItem | string | null | undefined; /** Change dropdown component, can be used to add native scrollbars */ dropdownComponent?: any; /** Select highlighted item on blur */ selectOnBlur?: boolean; /** Allow deselecting items on click */ allowDeselect?: boolean; /** Should data be filtered when search value exactly matches selected item */ filterDataOnExactSearchMatch?: boolean; /** Props added to clear button */ clearButtonProps?: React.ComponentPropsWithoutRef<'button'>; } export declare function defaultFilter(value: string, item: SelectItem): boolean; export declare function defaultShouldCreate(query: string, data: SelectItem[]): boolean; export declare const Select: React.ForwardRefExoticComponent>;