Files
icehrm/web/node_modules/antd/lib/dropdown/dropdown.d.ts
2020-05-20 18:47:29 +02:00

51 lines
2.0 KiB
TypeScript

import * as React from 'react';
import DropdownButton from './dropdown-button';
import { ConfigConsumerProps } from '../config-provider';
declare const Placements: ["topLeft", "topCenter", "topRight", "bottomLeft", "bottomCenter", "bottomRight"];
declare type Placement = typeof Placements[number];
declare type OverlayFunc = () => React.ReactElement;
declare type Align = {
points?: [string, string];
offset?: [number, number];
targetOffset?: [number, number];
overflow?: {
adjustX?: boolean;
adjustY?: boolean;
};
useCssRight?: boolean;
useCssBottom?: boolean;
useCssTransform?: boolean;
};
export interface DropDownProps {
trigger?: ('click' | 'hover' | 'contextMenu')[];
overlay: React.ReactElement | OverlayFunc;
onVisibleChange?: (visible: boolean) => void;
visible?: boolean;
disabled?: boolean;
align?: Align;
getPopupContainer?: (triggerNode: HTMLElement) => HTMLElement;
prefixCls?: string;
className?: string;
transitionName?: string;
placement?: Placement;
overlayClassName?: string;
overlayStyle?: React.CSSProperties;
forceRender?: boolean;
mouseEnterDelay?: number;
mouseLeaveDelay?: number;
openClassName?: string;
}
export default class Dropdown extends React.Component<DropDownProps, any> {
static Button: typeof DropdownButton;
static defaultProps: {
mouseEnterDelay: number;
mouseLeaveDelay: number;
};
getTransitionName(): string;
renderOverlay: (prefixCls: string) => React.ReactElement<any, string | ((props: any) => React.ReactElement<any, string | any | (new (props: any) => React.Component<any, any, any>)> | null) | (new (props: any) => React.Component<any, any, any>)>;
getPlacement(direction?: string): "topLeft" | "topCenter" | "topRight" | "bottomLeft" | "bottomCenter" | "bottomRight";
renderDropDown: ({ getPopupContainer: getContextPopupContainer, getPrefixCls, direction, }: ConfigConsumerProps) => JSX.Element;
render(): JSX.Element;
}
export {};