choerodon-ui
Version:
An enterprise-class UI design language and React-based implementation
57 lines (56 loc) • 2.23 kB
TypeScript
import { Component, CSSProperties } from 'react';
import { ModalContainerState } from 'choerodon-ui/shared/modal-manager';
import ConfigContext, { ConfigContextValue } from '../../../lib/config-provider/ConfigContext';
import { DrawerOffsets, IModalContainer } from '../modal-manager';
import { ModalProps } from '../modal/Modal';
import { ModalProxy } from '../modal/interface';
export { ModalContainerState };
declare function getRoot(): HTMLElement | null;
export interface ModalContainerProps {
location?: {
pathname: string;
};
getContainer?: HTMLElement | null | (() => HTMLElement | undefined) | false;
}
export default class ModalContainer extends Component<ModalContainerProps> implements IModalContainer {
static get contextType(): typeof ConfigContext;
static displayName: string;
static defaultProps: {
getContainer: typeof getRoot;
};
context: ConfigContextValue;
state: ModalContainerState;
saveMount: (mount: any) => void;
maskHidden: boolean;
active: boolean;
drawerOffsets: DrawerOffsets;
maskStyle?: CSSProperties | undefined;
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: () => void;
handleModalTopChange: (key?: string | number | undefined) => 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(): HTMLElement | undefined;
getOffsetContainer(): HTMLElement;
render(): JSX.Element | null;
}
export declare function getContainer(): Promise<IModalContainer>;
export declare function open(props: ModalProps): ModalProxy;