UNPKG

2.39 kBTypeScriptView Raw
1import React from 'react';
2import { ActionType, AlignType, BuildInPlacements, TransitionNameType, AnimationType, MotionType } from './interface';
3export interface TriggerProps {
4 children: React.ReactElement;
5 action?: ActionType | ActionType[];
6 showAction?: ActionType[];
7 hideAction?: ActionType[];
8 getPopupClassNameFromAlign?: (align: AlignType) => string;
9 onPopupVisibleChange?: (visible: boolean) => void;
10 afterPopupVisibleChange?: (visible: boolean) => void;
11 popup: React.ReactNode | (() => React.ReactNode);
12 popupStyle?: React.CSSProperties;
13 prefixCls?: string;
14 popupClassName?: string;
15 className?: string;
16 popupPlacement?: string;
17 builtinPlacements?: BuildInPlacements;
18 mouseEnterDelay?: number;
19 mouseLeaveDelay?: number;
20 zIndex?: number;
21 focusDelay?: number;
22 blurDelay?: number;
23 getPopupContainer?: (node: HTMLElement) => HTMLElement;
24 getDocument?: () => HTMLDocument;
25 forceRender?: boolean;
26 destroyPopupOnHide?: boolean;
27 mask?: boolean;
28 maskClosable?: boolean;
29 onPopupAlign?: (element: HTMLElement, align: AlignType) => void;
30 popupAlign?: AlignType;
31 popupVisible?: boolean;
32 defaultPopupVisible?: boolean;
33 autoDestroy?: boolean;
34 stretch?: string;
35 alignPoint?: boolean;
36 /** Set popup motion. You can ref `rc-animate` for more info. */
37 popupMotion?: MotionType;
38 /** Set mask motion. You can ref `rc-animate` for more info. */
39 maskMotion?: MotionType;
40 /** @deprecated Please us `popupMotion` instead. */
41 popupTransitionName?: TransitionNameType;
42 /** @deprecated Please us `popupMotion` instead. */
43 popupAnimation?: AnimationType;
44 /** @deprecated Please us `maskMotion` instead. */
45 maskTransitionName?: TransitionNameType;
46 /** @deprecated Please us `maskMotion` instead. */
47 maskAnimation?: string;
48 /**
49 * @private Get trigger DOM node.
50 * Used for some component is function component which can not access by `findDOMNode`
51 */
52 getTriggerDOMNode?: (node: React.ReactInstance) => HTMLElement;
53}
54/**
55 * Internal usage. Do not use in your code since this will be removed.
56 */
57export declare function generateTrigger(PortalComponent: any): React.ComponentClass<TriggerProps>;
58export { BuildInPlacements };
59declare const _default: React.ComponentClass<TriggerProps, any>;
60export default _default;