import React, { Component } from "react"; import "element-closest-polyfill"; export declare const POSITION_SAME_AS_TARGET = "sameAsTarget"; export interface IAlignPoint { align: string; offset?: { x?: number; y?: number; }; } export declare type SameAsTargetPosition = "sameAsTarget"; export declare type OverlayPositionType = "absolute" | "fixed" | SameAsTargetPosition; export interface IOverlayProps { className?: string; containerClassName?: string; children?: React.ReactNode; alignPoints?: IAlignPoint[]; alignTo?: HTMLElement | string; isModal?: boolean; closeOnEscape?: boolean; closeOnMouseDrag?: boolean; closeOnOutsideClick?: boolean; closeOnParentScroll?: boolean; /** * Array of refs where user clicks should be ignored * and overlay should not be closed by clicking on them */ ignoreClicksOn?: HTMLElement[]; ignoreClicksOnByClass?: string[]; /** * positionType: sameAsTarget * Overlay's position is calculated based on the target's position type * If target's position is fixed, * - the overlay will also be in fixed position (position: fixed) * - the overlay's offsets (top, left) will be calculated based on * target's offsets (top, left), without scroll offsets */ positionType?: OverlayPositionType; shouldCloseOnClick?: (event: any) => boolean; onClick?: (event: any) => void; onMouseOver?: (event: any) => void; onMouseUp?: (event: any) => void; onAlign?: (alignment?: { top: number; left: number; right: number; align: string; }) => void; onClose?: () => void; zIndex: number; } interface IOverlayState { alignment: { align: string; left: number; top: number; right: number; }; } export default class Overlay extends Component { static defaultProps: Partial; private overlayRef; private containerRef; private resizeHandler; private portalNode; private isComponentMounted; private clickedInside; constructor(props: any); render(): JSX.Element; componentDidMount(): void; componentWillReceiveProps(nextProps: any): void; shouldComponentUpdate(nextProps: any, nextState: any): boolean; componentDidUpdate(): void; componentWillUnmount(): void; align: () => void; private createPortalNode; private removePortalNodeAfterAllTreeUnmount; private onDocumentMouseDown; private closeOnEscape; private closeOnParentScroll; private closeOnMouseDrag; private closeOnOutsideClick; private onMaskClick; private getOverlayStyles; private getOverlayClasses; /** * Add CSS classes to overlay wrapper, so they can be used * for position of arrows and stuff */ private getAlignClasses; private isSameAsTargetPosition; private isEventOnParent; private shouldCloseOnClick; private hasClickedOnIgnoredNode; private isElementInChildOverlay; private updateListeners; private addListeners; private removeListeners; private renderMask; } export {};