import { FocusTarget } from 'focus-trap'; import { Moment } from 'moment'; import React, { RefObject } from 'react'; import { IPopoverPosition } from '../../Popovers'; import { ISectionProps, Section } from './subcomponents/Section'; interface IDropdownMenuState { isDropdownOpen: boolean; dropdownId?: string; lastClosedTime?: Moment; } interface IDropdownMenuProps { /** What position on the parent to anchor relative to; 'auto' will find best position automatically */ parentAnchorPosition?: IPopoverPosition | 'auto'; /** What position on the dropdown itself to place at the anchor position; 'auto' will find best position automatically */ dropdownAnchorPosition?: IPopoverPosition | 'auto'; /** Any custom class names */ className?: string; /** The sections to render in the dropdown */ sections?: ISectionProps[]; /** * The parent component that opens the dropdown and positions it on the page. * The callback is given a toggle menu prop which can be used to toggle the menu as needed. */ toggleComponent?: (props: IDropdownMenuToggleComponentProps) => React.ReactElement; /** Whether to auto focus on an element when this menu is opened */ hasInitialFocus?: boolean; /** * The element to focus on when hasInitialFocus is true; if not provided then the first dom element will be chosen. * See focus-trap-react for details */ initialFocusElement?: FocusTarget; /** Children to display as custom content instead of sections */ children?: (props: IDropdownMenuChildrenProps) => React.ReactElement; /** The data-cy */ componentContext?: string; } interface IDropdownMenuToggleComponentProps { /** Callback to toggle opening/closing menu */ toggleMenu: () => void; /** Ref for the toggle component, to anchor on the page */ toggleComponentRef: RefObject; /** Aria props for opening the menu */ ariaProps: { role: 'button'; 'aria-expanded': boolean; 'aria-owns'?: string; 'aria-haspopup': boolean; }; } interface IDropdownMenuChildrenProps { /** Callback to close the menu */ closeMenu: () => void; } declare class DropdownMenu extends React.Component { static Section: typeof Section; static DefaultDropdownButton: import("../../../../styled-components").StyledComponent<"button", any, {}, never>; static defaultProps: Partial; state: IDropdownMenuState; private toggleComponentRef; render(): JSX.Element; private openMenu; private close; private get toggleComponent(); private get initialFocusProp(); private get dropdownPopover(); private get dropdownContent(); } export { IDropdownMenuProps, IDropdownMenuToggleComponentProps, DropdownMenu };