UNPKG

rsuite

Version:

A suite of react components

57 lines (56 loc) 2.68 kB
import React from 'react'; import PropTypes from 'prop-types'; import { ListProps } from './VirtualizedList'; import { StandardProps, ItemDataType } from '../@types/common'; export interface DropdownMenuProps<Multiple = false> extends StandardProps, Omit<React.HTMLAttributes<HTMLDivElement>, 'onSelect'> { classPrefix: string; data?: ItemDataType[]; group?: boolean; disabledItemValues?: any[]; activeItemValues?: any[]; focusItemValue?: any; maxHeight?: number; valueKey?: string; labelKey?: string; className?: string; style?: React.CSSProperties; dropdownMenuItemAs: React.ElementType | string; dropdownMenuItemClassPrefix?: string; rowHeight?: number; rowGroupHeight?: number; virtualized?: boolean; listProps?: ListProps; /** Custom selected option */ renderMenuItem?: (itemLabel: React.ReactNode, item: any) => React.ReactNode; renderMenuGroup?: (title: React.ReactNode, item: any) => React.ReactNode; onSelect?: Multiple extends true ? (value: any, item: any, event: React.MouseEvent, checked: boolean) => void : Multiple extends false ? (value: any, item: any, event: React.MouseEvent) => void : any; onGroupTitleClick?: (event: React.MouseEvent) => void; } export declare type DropdownMenuComponent = React.ForwardRefExoticComponent<DropdownMenuProps> & { <Multiple = false>(props: DropdownMenuProps<Multiple>): React.ReactElement | null; }; declare const DropdownMenu: DropdownMenuComponent; export declare const dropdownMenuPropTypes: { classPrefix: PropTypes.Validator<string>; className: PropTypes.Requireable<string>; dropdownMenuItemAs: PropTypes.Validator<PropTypes.ReactComponentLike>; dropdownMenuItemClassPrefix: PropTypes.Requireable<string>; data: PropTypes.Requireable<any[]>; group: PropTypes.Requireable<boolean>; disabledItemValues: PropTypes.Requireable<any[]>; activeItemValues: PropTypes.Requireable<any[]>; focusItemValue: PropTypes.Requireable<any>; maxHeight: PropTypes.Requireable<number>; valueKey: PropTypes.Requireable<string>; labelKey: PropTypes.Requireable<string>; style: PropTypes.Requireable<object>; renderMenuItem: PropTypes.Requireable<(...args: any[]) => any>; renderMenuGroup: PropTypes.Requireable<(...args: any[]) => any>; onSelect: PropTypes.Requireable<(...args: any[]) => any>; onGroupTitleClick: PropTypes.Requireable<(...args: any[]) => any>; virtualized: PropTypes.Requireable<boolean>; listProps: PropTypes.Requireable<any>; rowHeight: PropTypes.Requireable<number>; rowGroupHeight: PropTypes.Requireable<number>; }; export default DropdownMenu;