UNPKG

@acusti/dropdown

Version:

React component that renders a dropdown with a trigger and supports searching, keyboard access, and more

27 lines (26 loc) 1.15 kB
import { type SyntheticEvent } from 'react'; import { type Item } from './Dropdown.js'; export declare const ITEM_SELECTOR = "[data-ukt-item], [data-ukt-value]"; export declare const getItemElements: (dropdownElement: HTMLElement | null) => HTMLCollection | NodeListOf<Element> | null; export declare const getActiveItemElement: (dropdownElement: HTMLElement | null) => HTMLElement | null; type BaseSetActiveItemPayload = { dropdownElement: HTMLElement; element?: null; event: Event | SyntheticEvent<HTMLElement>; index?: null; indexAddend?: null; isExactMatch?: null; onActiveItem?: (payload: Item) => void; text?: null; }; export declare const setActiveItem: ({ dropdownElement, element, event, index, indexAddend, isExactMatch, onActiveItem, text, }: ({ element: HTMLElement; } & Omit<BaseSetActiveItemPayload, 'element'>) | ({ index: number; } & Omit<BaseSetActiveItemPayload, 'index'>) | ({ indexAddend: number; } & Omit<BaseSetActiveItemPayload, 'indexAddend'>) | ({ isExactMatch?: boolean; text: string; } & Omit<BaseSetActiveItemPayload, 'isExactMatch' | 'text'>)) => void; export {};