choerodon-ui
Version:
An enterprise-class UI design language and React-based implementation
58 lines (57 loc) • 1.96 kB
TypeScript
import { Component } from 'react';
import { DrawerOffsets, IModalContainer } from '../modal-manager';
import { ModalProps } from '../modal/Modal';
declare function getRoot(): HTMLDivElement | undefined;
export interface ModalContainerProps {
location?: {
pathname: string;
};
getContainer?: HTMLElement | (() => HTMLElement) | false;
}
export interface ModalContainerState {
modals: ModalProps[];
mount?: HTMLElement;
}
export default class ModalContainer extends Component<ModalContainerProps> implements IModalContainer {
static displayName: string;
static defaultProps: {
getContainer: typeof getRoot;
};
state: ModalContainerState;
saveMount: (mount: any) => void;
maskHidden: boolean;
drawerOffsets: DrawerOffsets;
get baseOffsets(): {
'slide-up': number;
'slide-right': number;
'slide-down': number;
'slide-left': number;
};
get isTop(): boolean;
constructor(props: any, context: any);
handleAnimationEnd: (modalKey: any, isEnter: any) => void;
handleMaskClick: () => Promise<void>;
top(): IModalContainer;
componentDidUpdate(prevProps: any): void;
componentWillUnmount(): void;
updateModals(modals: ModalProps[]): void;
mergeModals(newModals: ModalProps[]): void;
findIndex(modalKey: any): number;
open(props: ModalProps): void;
close(props: ModalProps): void;
update(props: ModalProps): void;
clear(closeByLocationChange: any): void;
getModalWidth(modal: any): any;
getComponent(mount?: HTMLElement): JSX.Element;
getContainer(): false | HTMLElement | undefined;
render(): JSX.Element | null;
}
export declare function getContainer(loop?: boolean): any;
export declare function open(props: ModalProps & {
children?: any;
}): {
close: (destroy?: boolean | undefined) => Promise<void>;
open: (newProps: any) => void;
update: (newProps: any) => void;
};
export {};