import React from 'react'; import { TimeoutType } from '~/common/utilities/UnifyCSSTransition'; export declare type MEvent = React.MouseEvent; export interface PopupActionItemType { action?: React.MouseEventHandler | string; content?: React.ReactNode | string; href?: string; target?: '_blank' | '_parent' | '_self' | '_top'; text?: string; onClick?: (e: MEvent) => void; } export declare type PopupActionType = [PopupActionItemType, PopupActionItemType?]; export interface DelayType { enter: number; exit: number; } export interface PopupType { children?: any; /** * Readjust position of active component when the window is resized and the component is currently active */ autoAdjust?: boolean; /** * Set the container boundary of the component, defaulted to window */ container?: string | any; /** * Set the content of the component, use this if you not using `target` and wrapped your element in the component itself */ content?: React.ReactNode | string; /** * Set if the component is automatically closed when you clicking the component when the `trigger` is `click` */ closeOnClick?: boolean; /** * Set if the component is automatically closed when you clicking outside the component when the `trigger` is `click` */ closeOnClickOutside?: boolean; /** * Set the wait time before enter and exit phases is executed and only available in `trigger` `hover` mode, if you wanted to set the delay between enter and exit separately use object type, see the detail of **DelayType** below */ delay?: number | DelayType; /** * Set the component is visible by default or not */ display?: boolean; /** * Set the placement direction of the component. The component itself will auto adjust it's position based on it's container */ placement?: 'top' | 'right' | 'bottom' | 'left'; /** * Set the spacing between the components children or it's target. */ spacing?: number; /** * Select the target where the component should be placed. Use this property if you're not wrap your target element with the component itself */ target?: object | string; /** * Toggle on and off for component transition animation */ transition?: boolean; /** * Set the trigger mechanism for the component */ trigger?: 'click' | 'hover'; /** * Set the transition duration of each phases (enter, and exit), if you wanted to set the transition duration between enter and exit separately use object type, see the detail of **TimeoutType** below */ timeout?: number | TimeoutType; /** * Set the zIndex of the component */ zIndex?: number; /** * Run a function when the component started transition to appear, only available if `transition` is `true` */ onEnter?: (node: Node) => void; /** * Run a function while the component is still in the middle of transitioning to appear, only available if `transition` is `true` */ onEntering?: (node: Node) => void; /** * Run a function when the component transition to appear is finished, only available if `transition` is `true` */ onEntered?: (node: Node) => void; /** * Run a function when the component started transition to disappear, only available if `transition` is `true` */ onExit?: (node: Node) => void; /** * Run a function while the component is still in the middle of transitioning to disappear, only available if `transition` is `true` */ onExiting?: (node: Node) => void; /** * Run a function when the component transition to disappear is finished, only available if `transition` is `true` */ onExited?: (node: Node) => void; }