UNPKG

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