//@ts-ignore import { AppContextType, BasicAlignment, Coordinates, FalsyJSX, Icon, PropsWithDefaults, Size, StaticDefaultProps } from '@grapecity/core-ui'; /// //@ts-ignore import * as React from 'react'; import { ARIALabels } from './essentials'; export type DropdownButton = { type: 'button'; key?: React.Key; icon?: Icon; text?: string; title?: string; value?: any; selected?: boolean; disabled?: boolean; onClick?: (value?: any, XYCoord?: Coordinates) => void; }; export type DropdownGroup = { type: 'group'; key?: React.Key; icon?: Icon; text?: string; title?: string; value?: any; selected?: boolean; disabled?: boolean; items?: DropdownItem[]; menuCustomCSS?: string; onClick?: (value?: any) => void; }; export type DropdownSplitter = { type: 'splitter'; }; export type DropdownHeader = { type: 'header'; header: string; }; export type DropdownCustomItem = { type: 'custom'; customContent: React.ReactChild; }; export type DropdownItem = DropdownButton | DropdownSplitter | DropdownHeader | DropdownGroup | DropdownCustomItem | FalsyJSX; export type DropdownMenuWidth = 'default' | '100%' | 'auto' | number; export type DropdownMenuMaxHeight = 'none' | 'default' | number; type ParentElement = { type: 'element'; element: HTMLDivElement; }; type ParentMouse = { type: 'mouse'; position: Coordinates; }; export type DropdownMenuProps = { dataAid?: string; parent: ParentElement | ParentMouse; items?: DropdownItem[]; content?: any; multiselect?: boolean; width?: DropdownMenuWidth; align?: BasicAlignment; dropup?: boolean; dropOnSide?: boolean; offset?: boolean | number; size?: Size; maxHeight?: DropdownMenuMaxHeight; edgeSnapOffset?: number; scrollToSelection?: boolean; customCSS?: string; onItemClick?: (item: DropdownItem) => void; generateItemPreview?: (value: any, selected?: boolean) => JSX.Element | null; customButtonRenderer?: (item: DropdownButton) => JSX.Element | null; onTransitionEnd?: () => void; customScroll?: boolean; ariaRole?: string; } & ARIALabels; type DropdownMenuDefaultProps = keyof Pick; type DropdownMenuState = { focusedItemId: string | null; expandGroupDropDownItemId: number | null; inTransitionDropDownId: number | null; }; declare const scrollElement: string; declare const headerElement: string; declare const itemElement: string, itemModifier: (modifierName: string) => string; declare const itemPreviewElement: string; export { scrollElement as ddMenuScrollClass, itemElement as ddMenuItemClass, itemModifier as ddMenuItemModifier, itemPreviewElement as ddMenuItemPreviewClass, headerElement as ddMenuHeaderClass, }; export declare class DropdownMenu extends React.Component { //@ts-ignore static contextType: React.Context; context: AppContextType; static defaultProps: StaticDefaultProps; props: PropsWithDefaults; private _root; private _menu; private _positioner; private _scrollContainer; private _itemsCollection; constructor(props: DropdownMenuProps, context: AppContextType); state: DropdownMenuState; componentDidMount(): void; componentDidUpdate(prevProps: DropdownMenuProps): void; private onToggleGroupItem; private setEndTransition; private getRoot; private storeItems; private resetFocusedItem; getFocusedItemId: () => string | null; updatePosition: () => void; focusNextItem: () => void; focusPrevItem: () => void; selectFocusedItem: () => void; getMenuNode: () => HTMLDivElement | null; getPositionerNode: () => HTMLDivElement | null | undefined; onItemClick: (item: DropdownItem) => () => void; private generatePreview; private getMenuRect; private getMenuAlign; private forseUpdateScrollContainer; private renderContent; render(): React.ReactPortal; }