1 | import * as React from 'react';
|
2 | import { PortalRef } from './Portal';
|
3 | import ScrollLocker from './Dom/scrollLocker';
|
4 |
|
5 | export declare function getOpenCount(): number;
|
6 | export type GetContainer = string | HTMLElement | (() => HTMLElement);
|
7 | export interface PortalWrapperProps {
|
8 | visible?: boolean;
|
9 | getContainer?: GetContainer;
|
10 | wrapperClassName?: string;
|
11 | forceRender?: boolean;
|
12 | children: (info: {
|
13 | getOpenCount: () => number;
|
14 | getContainer: () => HTMLElement;
|
15 | switchScrollingEffect: () => void;
|
16 | scrollLocker: ScrollLocker;
|
17 | ref?: (c: any) => void;
|
18 | }) => React.ReactNode;
|
19 | }
|
20 | declare class PortalWrapper extends React.Component<PortalWrapperProps> {
|
21 | container?: HTMLElement;
|
22 | componentRef: React.RefObject<PortalRef>;
|
23 | rafId?: number;
|
24 | scrollLocker: ScrollLocker;
|
25 | constructor(props: PortalWrapperProps);
|
26 | renderComponent?: (info: {
|
27 | afterClose: Function;
|
28 | onClose: Function;
|
29 | visible: boolean;
|
30 | }) => void;
|
31 | componentDidMount(): void;
|
32 | componentDidUpdate(prevProps: PortalWrapperProps): void;
|
33 | updateScrollLocker: (prevProps?: Partial<PortalWrapperProps>) => void;
|
34 | updateOpenCount: (prevProps?: Partial<PortalWrapperProps>) => void;
|
35 | componentWillUnmount(): void;
|
36 | attachToParent: (force?: boolean) => boolean;
|
37 | getContainer: () => HTMLElement;
|
38 | setWrapperClassName: () => void;
|
39 | removeCurrentContainer: () => void;
|
40 | /**
|
41 | * Enhance ./switchScrollingEffect
|
42 | * 1. Simulate document body scroll bar with
|
43 | * 2. Record body has overflow style and recover when all of PortalWrapper invisible
|
44 | * 3. Disable body scroll when PortalWrapper has open
|
45 | *
|
46 | * @memberof PortalWrapper
|
47 | */
|
48 | switchScrollingEffect: () => void;
|
49 | render(): any;
|
50 | }
|
51 | export default PortalWrapper;
|