import { Direction } from '@angular/cdk/bidi'; import * as i0 from '@angular/core'; import { TemplateRef, EventEmitter, Type, ViewContainerRef, ChangeDetectorRef, NgZone, ElementRef, Renderer2, DestroyRef, ComponentRef, EmbeddedViewRef, OnDestroy, InjectionToken, OnChanges, SimpleChanges, OnInit } from '@angular/core'; import { NzButtonType, NzButtonShape, NzButtonSize } from 'ng-zorro-antd/button'; import { NzSafeAny } from 'ng-zorro-antd/core/types'; import { Observable, Subject } from 'rxjs'; import * as i1 from '@angular/cdk/overlay'; import { OverlayRef } from '@angular/cdk/overlay'; import { AnimationEvent, AnimationTriggerMetadata } from '@angular/animations'; import { FocusTrapFactory } from '@angular/cdk/a11y'; import { BasePortalOutlet, CdkPortalOutlet, ComponentPortal, TemplatePortal } from '@angular/cdk/portal'; import { NzConfigService, NzConfigKey } from 'ng-zorro-antd/core/config'; import { NzModalI18nInterface } from 'ng-zorro-antd/i18n'; /** * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE */ type OnClickCallback = (instance: T) => (false | void | {}) | Promise; type ModalTypes = 'default' | 'confirm'; type ConfirmType = 'confirm' | 'info' | 'success' | 'error' | 'warning'; interface StyleObjectLike { [key: string]: string; } declare class ModalOptions { nzCentered?: boolean; nzClosable?: boolean; nzOkLoading?: boolean; nzOkDisabled?: boolean; nzCancelDisabled?: boolean; nzCancelLoading?: boolean; nzDraggable?: boolean; nzNoAnimation?: boolean; nzAutofocus?: 'ok' | 'cancel' | 'auto' | null; nzMask?: boolean; nzMaskClosable?: boolean; nzKeyboard?: boolean; nzZIndex?: number; nzWidth?: number | string; nzCloseIcon?: string | TemplateRef; nzOkType?: NzButtonType; nzOkDanger?: boolean; nzModalType?: ModalTypes; nzOnCancel?: EventEmitter | OnClickCallback; nzOnOk?: EventEmitter | OnClickCallback; nzData?: D; nzMaskStyle?: StyleObjectLike; nzBodyStyle?: StyleObjectLike; nzWrapClassName?: string; nzClassName?: string; nzStyle?: object; nzTitle?: string | TemplateRef<{}>; nzFooter?: string | TemplateRef<{}> | Array> | null; nzCancelText?: string | null; nzOkText?: string | null; nzContent?: string | TemplateRef | Type; nzCloseOnNavigation?: boolean; nzViewContainerRef?: ViewContainerRef; nzAfterOpen?: EventEmitter; nzAfterClose?: EventEmitter; nzIconType?: string; nzDirection?: Direction; } interface ModalButtonOptions { label: string; type?: NzButtonType; danger?: boolean; shape?: NzButtonShape; ghost?: boolean; size?: NzButtonSize; autoLoading?: boolean; show?: boolean | ((this: ModalButtonOptions, contentComponentInstance?: T) => boolean); loading?: boolean | ((this: ModalButtonOptions, contentComponentInstance?: T) => boolean); disabled?: boolean | ((this: ModalButtonOptions, contentComponentInstance?: T) => boolean); onClick?(this: ModalButtonOptions, contentComponentInstance?: T): NzSafeAny | Promise; [key: string]: NzSafeAny; } /** * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE */ declare function throwNzModalContentAlreadyAttachedError(): never; declare class BaseModalContainerComponent extends BasePortalOutlet { readonly document: Document; readonly cdr: ChangeDetectorRef; readonly config: ModalOptions; protected ngZone: NgZone; protected host: ElementRef; protected focusTrapFactory: FocusTrapFactory; protected render: Renderer2; protected overlayRef: OverlayRef; protected nzConfigService: NzConfigService; protected animationType: "NoopAnimations" | "BrowserAnimations" | null; protected destroyRef: DestroyRef; portalOutlet: CdkPortalOutlet; modalElementRef: ElementRef; animationStateChanged: EventEmitter; containerClick: EventEmitter; cancelTriggered: EventEmitter; okTriggered: EventEmitter; state: 'void' | 'enter' | 'exit'; modalRef: NzModalRef; isStringContent: boolean; dir: Direction; private elementFocusedBeforeModalWasOpened; private focusTrap; private mouseDown; private oldMaskStyle; get showMask(): boolean; get maskClosable(): boolean; constructor(); onContainerClick(e: MouseEvent): void; onCloseClick(): void; onOkClick(): void; attachComponentPortal(portal: ComponentPortal): ComponentRef; attachTemplatePortal(portal: TemplatePortal): EmbeddedViewRef; attachStringContent(): void; getNativeElement(): HTMLElement; private animationDisabled; private setModalTransformOrigin; private savePreviouslyFocusedElement; private trapFocus; private restoreFocus; private setEnterAnimationClass; private setExitAnimationClass; private setMaskExitAnimationClass; private cleanAnimationClass; private setZIndexForBackdrop; bindBackdropStyle(): void; updateMaskClassname(): void; onAnimationDone(event: AnimationEvent): void; onAnimationStart(event: AnimationEvent): void; startExitAnimation(): void; protected setupMouseListeners(modalContainer: ElementRef): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵdir: i0.ɵɵDirectiveDeclaration; } /** * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE */ declare abstract class NzModalLegacyAPI { abstract afterOpen: Observable; abstract afterClose: Observable; abstract close(result?: R): void; abstract destroy(result?: R): void; /** * Trigger the nzOnOk/nzOnCancel by manual */ abstract triggerOk(): void; abstract triggerCancel(): void; /** * Return the component instance of nzContent when specify nzContent as a Component */ abstract getContentComponent(): T | void; /** * Get the dom element of this Modal */ abstract getElement(): HTMLElement | void; } /** * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE */ declare const NzModalState: { readonly OPEN: 0; readonly CLOSING: 1; readonly CLOSED: 2; }; type NzModalState = (typeof NzModalState)[keyof typeof NzModalState]; declare const NzTriggerAction: { readonly CANCEL: "cancel"; readonly OK: "ok"; }; type NzTriggerAction = (typeof NzTriggerAction)[keyof typeof NzTriggerAction]; declare class NzModalRef implements NzModalLegacyAPI { private overlayRef; private config; containerInstance: BaseModalContainerComponent; componentInstance: T | null; componentRef: ComponentRef | null; result?: R; state: NzModalState; afterClose: Subject; afterOpen: Subject; private closeTimeout?; private destroy$; constructor(overlayRef: OverlayRef, config: ModalOptions, containerInstance: BaseModalContainerComponent); getContentComponent(): T; getContentComponentRef(): Readonly | null>; getElement(): HTMLElement; destroy(result?: R): void; triggerOk(): Promise; triggerCancel(): Promise; close(result?: R): void; updateConfig(config: ModalOptions): void; getState(): NzModalState; getConfig(): ModalOptions; getBackdropElement(): HTMLElement | null; private trigger; private closeWhitResult; _finishDialogClose(): void; } declare class NzModalService implements OnDestroy { private overlay; private injector; private nzConfigService; private directionality; private parentModal; private openModalsAtThisLevel; private readonly afterAllClosedAtThisLevel; get openModals(): NzModalRef[]; get _afterAllClosed(): Subject; readonly afterAllClose: Observable; create(config: ModalOptions): NzModalRef; closeAll(): void; confirm(options?: ModalOptions, confirmType?: ConfirmType): NzModalRef; info(options?: ModalOptions): NzModalRef; success(options?: ModalOptions): NzModalRef; error(options?: ModalOptions): NzModalRef; warning(options?: ModalOptions): NzModalRef; private open; private removeOpenModal; private closeModals; private createOverlay; private attachModalContainer; private attachModalContent; private createInjector; private confirmFactory; ngOnDestroy(): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } /** * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE */ declare const ZOOM_CLASS_NAME_MAP: { enter: string; enterActive: string; leave: string; leaveActive: string; }; declare const FADE_CLASS_NAME_MAP: { enter: string; enterActive: string; leave: string; leaveActive: string; }; declare const MODAL_MASK_CLASS_NAME = "ant-modal-mask"; declare const NZ_CONFIG_MODULE_NAME: NzConfigKey; declare const NZ_MODAL_DATA: InjectionToken; /** * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE */ declare class NzModalComponent implements OnChanges, NzModalLegacyAPI { private cdr; private modal; private viewContainerRef; private destroyRef; nzMask?: boolean; nzMaskClosable?: boolean; nzCloseOnNavigation?: boolean; nzVisible: boolean; nzClosable: boolean; nzOkLoading: boolean; nzOkDisabled: boolean; nzCancelDisabled: boolean; nzCancelLoading: boolean; nzKeyboard: boolean; nzNoAnimation: boolean; nzCentered: boolean; nzDraggable: boolean; nzContent?: string | TemplateRef<{}> | Type; nzFooter?: string | TemplateRef<{}> | Array> | null; nzZIndex: number; nzWidth: number | string; nzWrapClassName?: string; nzClassName?: string; nzStyle?: object; nzTitle?: string | TemplateRef<{}>; nzCloseIcon: string | TemplateRef; nzMaskStyle?: StyleObjectLike; nzBodyStyle?: StyleObjectLike; nzOkText?: string | null; nzCancelText?: string | null; nzOkType: NzButtonType; nzOkDanger: boolean; nzIconType: string; nzModalType: ModalTypes; nzAutofocus: 'ok' | 'cancel' | 'auto' | null; readonly nzOnOk: EventEmitter | OnClickCallback | NzSafeAny; readonly nzOnCancel: EventEmitter | OnClickCallback | NzSafeAny; readonly nzAfterOpen: EventEmitter; readonly nzAfterClose: EventEmitter; readonly nzVisibleChange: EventEmitter; set modalTitle(value: TemplateRef); contentFromContentChild: TemplateRef; set modalFooter(value: TemplateRef); private modalRef; get afterOpen(): Observable; get afterClose(): Observable; constructor(); open(): void; close(result?: R): void; destroy(result?: R): void; triggerOk(): void; triggerCancel(): void; getContentComponent(): T | void; getElement(): HTMLElement | void; getModalRef(): NzModalRef | null; private setTitleWithTemplate; private setFooterWithTemplate; private getConfig; ngOnChanges(changes: SimpleChanges): void; static ɵfac: i0.ɵɵFactoryDeclaration, never>; static ɵcmp: i0.ɵɵComponentDeclaration, "nz-modal", ["nzModal"], { "nzMask": { "alias": "nzMask"; "required": false; }; "nzMaskClosable": { "alias": "nzMaskClosable"; "required": false; }; "nzCloseOnNavigation": { "alias": "nzCloseOnNavigation"; "required": false; }; "nzVisible": { "alias": "nzVisible"; "required": false; }; "nzClosable": { "alias": "nzClosable"; "required": false; }; "nzOkLoading": { "alias": "nzOkLoading"; "required": false; }; "nzOkDisabled": { "alias": "nzOkDisabled"; "required": false; }; "nzCancelDisabled": { "alias": "nzCancelDisabled"; "required": false; }; "nzCancelLoading": { "alias": "nzCancelLoading"; "required": false; }; "nzKeyboard": { "alias": "nzKeyboard"; "required": false; }; "nzNoAnimation": { "alias": "nzNoAnimation"; "required": false; }; "nzCentered": { "alias": "nzCentered"; "required": false; }; "nzDraggable": { "alias": "nzDraggable"; "required": false; }; "nzContent": { "alias": "nzContent"; "required": false; }; "nzFooter": { "alias": "nzFooter"; "required": false; }; "nzZIndex": { "alias": "nzZIndex"; "required": false; }; "nzWidth": { "alias": "nzWidth"; "required": false; }; "nzWrapClassName": { "alias": "nzWrapClassName"; "required": false; }; "nzClassName": { "alias": "nzClassName"; "required": false; }; "nzStyle": { "alias": "nzStyle"; "required": false; }; "nzTitle": { "alias": "nzTitle"; "required": false; }; "nzCloseIcon": { "alias": "nzCloseIcon"; "required": false; }; "nzMaskStyle": { "alias": "nzMaskStyle"; "required": false; }; "nzBodyStyle": { "alias": "nzBodyStyle"; "required": false; }; "nzOkText": { "alias": "nzOkText"; "required": false; }; "nzCancelText": { "alias": "nzCancelText"; "required": false; }; "nzOkType": { "alias": "nzOkType"; "required": false; }; "nzOkDanger": { "alias": "nzOkDanger"; "required": false; }; "nzIconType": { "alias": "nzIconType"; "required": false; }; "nzModalType": { "alias": "nzModalType"; "required": false; }; "nzAutofocus": { "alias": "nzAutofocus"; "required": false; }; "nzOnOk": { "alias": "nzOnOk"; "required": false; }; "nzOnCancel": { "alias": "nzOnCancel"; "required": false; }; }, { "nzOnOk": "nzOnOk"; "nzOnCancel": "nzOnCancel"; "nzAfterOpen": "nzAfterOpen"; "nzAfterClose": "nzAfterClose"; "nzVisibleChange": "nzVisibleChange"; }, ["modalTitle", "contentFromContentChild", "modalFooter"], never, true, never>; static ngAcceptInputType_nzMask: unknown; static ngAcceptInputType_nzMaskClosable: unknown; static ngAcceptInputType_nzCloseOnNavigation: unknown; static ngAcceptInputType_nzVisible: unknown; static ngAcceptInputType_nzClosable: unknown; static ngAcceptInputType_nzOkLoading: unknown; static ngAcceptInputType_nzOkDisabled: unknown; static ngAcceptInputType_nzCancelDisabled: unknown; static ngAcceptInputType_nzCancelLoading: unknown; static ngAcceptInputType_nzKeyboard: unknown; static ngAcceptInputType_nzNoAnimation: unknown; static ngAcceptInputType_nzCentered: unknown; static ngAcceptInputType_nzDraggable: unknown; static ngAcceptInputType_nzZIndex: unknown; static ngAcceptInputType_nzOkDanger: unknown; } /** * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE */ declare class NzModalTitleDirective { readonly templateRef: TemplateRef<{}>; private nzModalRef; constructor(); static ɵfac: i0.ɵɵFactoryDeclaration; static ɵdir: i0.ɵɵDirectiveDeclaration; } /** * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE */ declare class NzModalFooterDirective { readonly templateRef: TemplateRef<{}>; private nzModalRef; constructor(); static ɵfac: i0.ɵɵFactoryDeclaration; static ɵdir: i0.ɵɵDirectiveDeclaration; } /** * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE */ declare class NzModalContentDirective { readonly templateRef: TemplateRef<{}>; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵdir: i0.ɵɵDirectiveDeclaration; } declare class NzModalCloseComponent { readonly config: ModalOptions; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } /** * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE */ declare class NzModalFooterComponent { private i18n; readonly config: ModalOptions; buttonsFooter: boolean; buttons: ModalButtonOptions[]; locale: NzModalI18nInterface; readonly cancelTriggered: EventEmitter; readonly okTriggered: EventEmitter; modalRef: NzModalRef; constructor(); onCancel(): void; onOk(): void; /** * Returns the value of the specified key. * If it is a function, run and return the return value of the function. */ getButtonCallableProp(options: ModalButtonOptions, prop: keyof ModalButtonOptions): boolean; /** * Run function based on the type and set its `loading` prop if needed. */ onButtonClick(options: ModalButtonOptions): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } declare class NzModalTitleComponent { config: ModalOptions; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } declare class NzModalContainerComponent extends BaseModalContainerComponent implements OnInit { set _portalOutlet(portalOutlet: CdkPortalOutlet); set _modalElementRef(elementRef: ElementRef); ngOnInit(): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } declare class NzModalConfirmContainerComponent extends BaseModalContainerComponent implements OnInit { private i18n; set _portalOutlet(portalOutlet: CdkPortalOutlet); set _modalElementRef(elementRef: ElementRef); readonly cancelTriggered: EventEmitter; readonly okTriggered: EventEmitter; locale: NzModalI18nInterface; constructor(); ngOnInit(): void; onCancel(): void; onOk(): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } declare class NzModalModule { static ɵfac: i0.ɵɵFactoryDeclaration; static ɵmod: i0.ɵɵNgModuleDeclaration; static ɵinj: i0.ɵɵInjectorDeclaration; } /** * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE */ declare const nzModalAnimations: { readonly modalContainer: AnimationTriggerMetadata; }; /** * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE */ declare function applyConfigDefaults(config: ModalOptions, defaultOptions: ModalOptions): ModalOptions; declare function getValueWithConfig(userValue: T | undefined, configValue: T | undefined, defaultValue: T): T | undefined; declare function getConfigFromComponent(component: T): ModalOptions; export { BaseModalContainerComponent, FADE_CLASS_NAME_MAP, MODAL_MASK_CLASS_NAME, ModalOptions, NZ_CONFIG_MODULE_NAME, NZ_MODAL_DATA, NzModalCloseComponent, NzModalComponent, NzModalConfirmContainerComponent, NzModalContainerComponent, NzModalContentDirective, NzModalFooterComponent, NzModalFooterDirective, NzModalLegacyAPI, NzModalModule, NzModalRef, NzModalService, NzModalState, NzModalTitleComponent, NzModalTitleDirective, NzTriggerAction, ZOOM_CLASS_NAME_MAP, applyConfigDefaults, getConfigFromComponent, getValueWithConfig, nzModalAnimations, throwNzModalContentAlreadyAttachedError }; export type { ConfirmType, ModalButtonOptions, ModalTypes, OnClickCallback, StyleObjectLike };