import { type ComponentType, type ReactElement, type ReactNode } from "react"; import { type IUiPagedVirtualListSkeletonItemProps } from "../@ui/UiPagedVirtualList/UiPagedVirtualList.js"; import { type ITab } from "../Tabs/Tabs.js"; import { type IAccessibilityConfigBase } from "../typings/accessibility.js"; /** * @internal */ export interface IDropdownListNoDataRenderProps { hasNoMatchingData: boolean; } /** * @internal */ export interface IRenderDropdownListItemProps { rowIndex: number; item: T; width: number; height: number; isFirst: boolean; isLast: boolean; focused?: boolean; isSelected?: boolean; } /** * @internal */ export interface IDropdownListProps { id?: string; items?: T[]; itemHeight?: number; itemsCount?: number; title?: string; className?: string; tabsClassName?: string; height?: number; width?: number; maxHeight?: number; containerPadding?: number; listPadding?: number; onKeyDownSelect?: (item: T) => void; onKeyDownConfirm?: (item: T) => void; isLoading?: boolean; showSearch?: boolean; disableAutofocus?: boolean; searchFieldSize?: "small" | "normal"; searchPlaceholder?: string; searchString?: string; searchLabel?: string; onSearch?: (searchString: string) => void; showTabs?: boolean; tabs?: ITab[]; selectedTabId?: string; onTabSelect?: (tab: ITab) => void; mobileItemHeight?: number; isMobile?: boolean; renderNoData?: (props: IDropdownListNoDataRenderProps) => ReactNode; /** * Text announced to screen readers when the search matches no items. * Provide the same text that the rendered "no matching data" state shows. * Defaults to a translated "No results match.". */ noMatchingDataText?: string; footer?: ReactNode | ((closeDropdown: () => void) => ReactNode); closeDropdown?: () => void; loadNextPage?: () => void; hasNextPage?: boolean; skeletonItemsCount?: number; shouldLoadNextPage?: (lastItemIndex: number, itemsCount: number, skeletonItemsCount: number) => boolean; isNextPageLoading?: boolean; SkeletonItem?: ComponentType; renderItem: (props: IRenderDropdownListItemProps) => ReactElement; itemHeightGetter?: (index: number) => number; itemTitleGetter?: (item: T) => string; /** * Predicate that returns true for the currently selected item. It drives the options' * `aria-selected` and the `isSelected` render prop. */ getIsItemSelected?: (item: T) => boolean; /** * Returns a key that is unique for each item. When it is provided together with the `listbox` role, * the options get unique ids, so that the active option can be exposed by `aria-activedescendant`. * * @remarks * If the search is shown as well, the search input becomes a combobox that drives the listbox: * ArrowDown and ArrowUp move the active option and Enter confirms it. Escape clears a typed filter * first and closes the dropdown when the filter is empty, as in the other dropdowns. * The listbox is then taken out of the Tab order. */ getItemKey?: (item: T) => string; accessibilityConfig?: Pick; body?: ReactNode | ((closeDropdown: () => void) => ReactNode); onScroll?: () => void; /** * An item in the list that should be scrolled into view when the component renders. * By default, items are compared by object identity (i.e., ===). * To customize how the target item is found (e.g., by ID), provide a `scrollToItemKeyExtractor` as well. */ scrollToItem?: T; /** * A function that extracts a unique key from each item for comparison with `scrollToItem`. * This is useful when the provided `scrollToItem` may not be the same object reference as items in the list. * If not provided, object identity (===) is used for comparison. */ scrollToItemKeyExtractor?: (item: T) => string | number; } /** * @internal */ export declare const LOADING_HEIGHT = 100; /** * @internal */ export declare const DEFAULT_ITEM_HEIGHT = 28; /** * @internal */ export declare const DEFAULT_MOBILE_ITEM_HEIGHT = 40; /** * Dropdown list component with paged virtual list implementation * @internal * */ export declare function DropdownList({ id, title, className, tabsClassName, width, height, maxHeight, onKeyDownSelect, onKeyDownConfirm, isMobile, isLoading, items, itemsCount, itemHeight, containerPadding, listPadding, mobileItemHeight, showSearch, disableAutofocus, searchString, searchLabel, searchPlaceholder, searchFieldSize, onSearch, showTabs, tabs, selectedTabId, onTabSelect, renderNoData, noMatchingDataText, footer, closeDropdown, accessibilityConfig, renderItem, body, itemHeightGetter, itemTitleGetter, getIsItemSelected, getItemKey, loadNextPage, hasNextPage, skeletonItemsCount, shouldLoadNextPage, isNextPageLoading, SkeletonItem, onScroll, scrollToItem, scrollToItemKeyExtractor, }: IDropdownListProps): ReactElement; //# sourceMappingURL=DropdownList.d.ts.map