UNPKG

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