react-widget-popup
Version:
``` npm install --save react-widget-popup ```
87 lines (86 loc) • 3.58 kB
TypeScript
import React from "react";
import { TransitionStatus } from "react-transition-group/Transition";
import { CSSTransitionProps } from "react-transition-group/CSSTransition";
export declare const version = "%VERSION%";
export interface PopupProps extends React.HTMLAttributes<any> {
/** 样式前缀 */
prefixCls?: string;
/** popup元素样式 */
style?: React.CSSProperties;
/** popupCSS样式名 */
className?: string;
/** popup根节点CSS样式名 */
rootClassName?: string;
/** popup根节点样式 */
rootStyle?: React.CSSProperties;
/** popup元素属性 */
rootProps?: React.HTMLAttributes<any>;
/** 否显示popup(受控) */
visible?: boolean;
/** 使用fixed定位popup */
fixed?: boolean;
/** 初始不显示的情况下不渲染组件 */
lazy?: boolean;
/** 当destroyOnClose=false时,组件刷新时强制更新 */
forceRender?: boolean;
/** CSSTransition参数,参考:react-transition-group */
transition?: Partial<CSSTransitionProps>;
/** 隐藏销毁弹组件 */
destroyOnClose?: boolean;
/** popup显示用于获取元素显示位置信息,大部分情况下建议直接用style */
getPosition?: (dom: HTMLElement) => {
top?: number | string;
left?: number | string;
right?: number | string;
bottom?: number | string;
};
/** 禁用mask */
disableMask?: boolean;
/** 是否开启遮罩层 */
mask?: boolean;
/** 遮罩层样式 */
maskStyle?: React.CSSProperties;
/** 遮罩层组件属性 */
maskProps?: React.HTMLAttributes<any>;
/** 遮罩层样式名称 */
maskClassName?: string;
/** CSSTransition参数,参考:react-transition-group */
maskTransition?: Partial<CSSTransitionProps>;
/** 内部使用 */
component?: React.ElementType;
/** 内部使用 */
maskComponent?: React.ElementType;
/** 内部使用 */
rootComponent?: React.ElementType;
/** 内部使用 */
wrapContent?: (node: React.ReactNode) => React.ReactNode;
}
export declare class Popup extends React.Component<PopupProps, {}> {
static defaultProps: PopupProps;
protected transitionStatus: TransitionStatus;
protected inTransition: boolean;
protected inMaskTransition: boolean;
protected rootInstance: React.ReactInstance;
protected popupInstance: React.ReactInstance;
protected maskInstance: React.ReactInstance;
protected refHandlers: {
root: (node: React.ReactInstance) => React.ReactInstance;
popup: (node: React.ReactInstance) => React.ReactInstance;
mask: (node: React.ReactInstance) => React.ReactInstance;
};
getRootDOM(): HTMLElement | null;
getPopupDOM(): HTMLElement | null;
getMaskDOM(): HTMLElement | null;
shouldComponentUpdate(nextProps: PopupProps): boolean;
componentDidMount(): void;
protected onEnter({ onEnter }: CSSTransitionProps, isMask: boolean, node: HTMLElement, appearing: boolean): void;
protected onEntered({ onEntered }: {
onEntered: any;
}, isMask: boolean, node: HTMLElement, appearing: boolean): void;
protected onExit({ onExit }: CSSTransitionProps, isMask: boolean, node: HTMLElement): void;
protected onExited({ onExited }: CSSTransitionProps, isMask: boolean, node: HTMLElement): void;
protected renderPopupMask(): JSX.Element;
addEndListener: (_: any, cb: () => void) => void;
render(): JSX.Element;
}
export default Popup;