UNPKG

ng-zorro-antd

Version:

An enterprise-class UI components based on Ant Design and Angular

10 lines 26 kB
!function(n,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/cdk/a11y"),require("@angular/cdk/keycodes"),require("@angular/cdk/overlay"),require("@angular/common"),require("@angular/core"),require("rxjs"),require("rxjs/operators"),require("ng-zorro-antd/core"),require("ng-zorro-antd/i18n"),require("ng-zorro-antd/button"),require("ng-zorro-antd/icon"),require("@angular/cdk/portal")):"function"==typeof define&&define.amd?define("ng-zorro-antd/modal",["exports","@angular/cdk/a11y","@angular/cdk/keycodes","@angular/cdk/overlay","@angular/common","@angular/core","rxjs","rxjs/operators","ng-zorro-antd/core","ng-zorro-antd/i18n","ng-zorro-antd/button","ng-zorro-antd/icon","@angular/cdk/portal"],e):e(((n=n||self)["ng-zorro-antd"]=n["ng-zorro-antd"]||{},n["ng-zorro-antd"].modal={}),n.ng.cdk.a11y,n.ng.cdk.keycodes,n.ng.cdk.overlay,n.ng.common,n.ng.core,n.rxjs,n.rxjs.operators,n["ng-zorro-antd"].core,n["ng-zorro-antd"].i18n,n["ng-zorro-antd"].button,n["ng-zorro-antd"].icon,n.ng.cdk.portal)}(this,function(n,e,t,o,i,a,r,l,s,c,p,u,d){"use strict";var f=function(n,e){return(f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,e){n.__proto__=e}||function(n,e){for(var t in e)e.hasOwnProperty(t)&&(n[t]=e[t])})(n,e)};var y=function(){return(y=Object.assign||function(n){for(var e,t=1,o=arguments.length;t<o;t++)for(var i in e=arguments[t])Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i]);return n}).apply(this,arguments)};function g(n,e,t,o){var i,a=arguments.length,r=a<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,t):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(n,e,t,o);else for(var l=n.length-1;l>=0;l--)(i=n[l])&&(r=(a<3?i(r):a>3?i(e,t,r):i(e,t))||r);return a>3&&r&&Object.defineProperty(e,t,r),r}function h(n,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(n,e)}var m=new a.InjectionToken("NZ_MODAL_CONFIG"),C=function(){function n(){}return n.decorators=[{type:a.NgModule}],n}();var z=function(){function n(n){this.parentService=n,this.rootOpenModals=this.parentService?null:[],this.rootAfterAllClose=this.parentService?null:new r.Subject,this.rootRegisteredMetaMap=this.parentService?null:new Map}return Object.defineProperty(n.prototype,"afterAllClose",{get:function(){return this.parentService?this.parentService.afterAllClose:this.rootAfterAllClose},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"openModals",{get:function(){return this.parentService?this.parentService.openModals:this.rootOpenModals},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"registeredMetaMap",{get:function(){return this.parentService?this.parentService.registeredMetaMap:this.rootRegisteredMetaMap},enumerable:!0,configurable:!0}),n.prototype.registerModal=function(n){var e=this;if(!this.hasRegistered(n)){var t=n.afterOpen.subscribe(function(){return e.openModals.push(n)}),o=n.afterClose.subscribe(function(){return e.removeOpenModal(n)});this.registeredMetaMap.set(n,{modalRef:n,afterOpenSubscription:t,afterCloseSubscription:o})}},n.prototype.deregisterModal=function(n){var e=this.registeredMetaMap.get(n);e&&(this.removeOpenModal(e.modalRef),e.afterOpenSubscription.unsubscribe(),e.afterCloseSubscription.unsubscribe(),this.registeredMetaMap.delete(n))},n.prototype.hasRegistered=function(n){return this.registeredMetaMap.has(n)},n.prototype.closeAll=function(){for(var n=this.openModals.length;n--;)this.openModals[n].close()},n.prototype.removeOpenModal=function(n){var e=this.openModals.indexOf(n);e>-1&&(this.openModals.splice(e,1),this.openModals.length||this.afterAllClose.next())},n.decorators=[{type:a.Injectable,args:[{providedIn:C}]}],n.ctorParameters=function(){return[{type:n,decorators:[{type:a.Optional},{type:a.SkipSelf}]}]},n.ngInjectableDef=a.ɵɵdefineInjectable({factory:function(){return new n(a.ɵɵinject(n,12))},token:n,providedIn:C}),n}(); /** * @license * Copyright Alibaba.com All Rights Reserved. * * 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 */ var b=function(){};var v=function(){function n(n,e){this.nzModalRef=n,this.templateRef=e,this.nzModalRef&&this.nzModalRef.getInstance().setFooterWithTemplate(this.templateRef)}return n.decorators=[{type:a.Directive,args:[{selector:"[nzModalFooter]",exportAs:"nzModalFooter"}]}],n.ctorParameters=function(){return[{type:b,decorators:[{type:a.Optional}]},{type:a.TemplateRef}]},n}();var O=function(n){function p(e,t,o,i,l,c,p,u,d,f,y,g){var h=n.call(this)||this;return h.nzConfigService=e,h.overlay=t,h.overlayKeyboardDispatcher=o,h.i18n=i,h.cfr=l,h.elementRef=c,h.viewContainer=p,h.modalControl=u,h.focusTrapFactory=d,h.cdr=f,h.nzModalGlobalConfig=y,h.document=g,h.nzVisible=!1,h.nzClosable=!0,h.nzOkLoading=!1,h.nzOkDisabled=!1,h.nzCancelDisabled=!1,h.nzCancelLoading=!1,h.nzKeyboard=!0,h.nzNoAnimation=!1,h.nzGetContainer=function(){return h.overlay.create()},h.nzZIndex=1e3,h.nzWidth=520,h.nzCloseIcon="close",h.nzOkType="primary",h.nzIconType="question-circle",h.nzModalType="default",h.nzOnOk=new a.EventEmitter,h.nzOnCancel=new a.EventEmitter,h.nzAfterOpen=new a.EventEmitter,h.nzAfterClose=new a.EventEmitter,h.nzVisibleChange=new a.EventEmitter,h.locale={},h.transformOrigin="0px 0px 0px",h.unsubscribe$=new r.Subject,h.dialogMouseDown=!1,h.scrollStrategy=h.overlay.scrollStrategies.block(),h.nzModalGlobalConfig&&s.warnDeprecation("`NZ_MODAL_CONFIG` has been deprecated and will be removed in 9.0.0. Please use global config instead."),h}return function(n,e){function t(){this.constructor=n}f(n,e),n.prototype=null===e?Object.create(e):(t.prototype=e.prototype,new t)}(p,n),Object.defineProperty(p.prototype,"modalFooter",{set:function(n){n&&n.templateRef&&this.setFooterWithTemplate(n.templateRef)},enumerable:!0,configurable:!0}),Object.defineProperty(p.prototype,"afterOpen",{get:function(){return this.nzAfterOpen.asObservable()},enumerable:!0,configurable:!0}),Object.defineProperty(p.prototype,"afterClose",{get:function(){return this.nzAfterClose.asObservable()},enumerable:!0,configurable:!0}),Object.defineProperty(p.prototype,"cancelText",{get:function(){return this.nzCancelText||this.locale.cancelText},enumerable:!0,configurable:!0}),Object.defineProperty(p.prototype,"okText",{get:function(){return this.nzOkText||this.locale.okText},enumerable:!0,configurable:!0}),Object.defineProperty(p.prototype,"hidden",{get:function(){return!this.nzVisible&&!this.animationState},enumerable:!0,configurable:!0}),Object.defineProperty(p.prototype,"mask",{get:function(){return null!=this.nzMask?this.nzMask:!this.nzModalGlobalConfig||null==this.nzModalGlobalConfig.nzMask||this.nzModalGlobalConfig.nzMask},enumerable:!0,configurable:!0}),Object.defineProperty(p.prototype,"maskClosable",{get:function(){return null!=this.nzMaskClosable?this.nzMaskClosable:!this.nzModalGlobalConfig||null==this.nzModalGlobalConfig.nzMaskClosable||this.nzModalGlobalConfig.nzMaskClosable},enumerable:!0,configurable:!0}),p.prototype.ngOnInit=function(){var n=this;this.i18n.localeChange.pipe(l.takeUntil(this.unsubscribe$)).subscribe(function(){n.locale=n.i18n.getLocaleData("Modal")}),this.isComponent(this.nzContent)&&this.createDynamicComponent(this.nzContent),this.isModalButtons(this.nzFooter)&&(this.nzFooter=this.formatModalButtons(this.nzFooter)),this.container="function"==typeof this.nzGetContainer?this.nzGetContainer():this.nzGetContainer,this.container instanceof HTMLElement?(this.container.appendChild(this.elementRef.nativeElement),r.fromEvent(this.document.body,"keydown").pipe(l.takeUntil(this.unsubscribe$)).subscribe(function(e){return n.keydownListener(e)})):this.container instanceof o.OverlayRef&&(this.setOverlayRef(this.container),this.container.overlayElement.appendChild(this.elementRef.nativeElement)),this.overlayRef&&this.overlayRef.keydownEvents().pipe(l.takeUntil(this.unsubscribe$)).subscribe(function(e){return n.keydownListener(e)}),this.modalControl.registerModal(this)},p.prototype.ngOnChanges=function(n){n.nzVisible&&this.handleVisibleStateChange(this.nzVisible,!n.nzVisible.firstChange)},p.prototype.ngAfterViewInit=function(){this.contentComponentRef&&this.bodyContainer.insert(this.contentComponentRef.hostView),this.autoFocusButtonOk&&this.autoFocusButtonOk.nativeElement.focus()},p.prototype.ngOnDestroy=function(){var n=this;this.changeVisibleFromInside(!1).then(function(){n.modalControl.deregisterModal(n),n.container instanceof o.OverlayRef&&n.container.dispose(),n.unsubscribe$.next(),n.unsubscribe$.complete()}),clearTimeout(this.timeoutId)},p.prototype.setFooterWithTemplate=function(n){this.nzFooter=n,this.cdr.markForCheck()},p.prototype.setOverlayRef=function(n){this.overlayRef=n},p.prototype.keydownListener=function(n){n.keyCode===t.ESCAPE&&this.nzKeyboard&&this.onClickOkCancel("cancel")},p.prototype.open=function(){this.changeVisibleFromInside(!0)},p.prototype.close=function(n){this.changeVisibleFromInside(!1,n)},p.prototype.destroy=function(n){this.close(n)},p.prototype.triggerOk=function(){this.onClickOkCancel("ok")},p.prototype.triggerCancel=function(){this.onClickOkCancel("cancel")},p.prototype.getInstance=function(){return this},p.prototype.getContentComponentRef=function(){return this.contentComponentRef},p.prototype.getContentComponent=function(){return this.contentComponentRef&&this.contentComponentRef.instance},p.prototype.getElement=function(){return this.elementRef&&this.elementRef.nativeElement},p.prototype.onMaskDialogDown=function(){this.dialogMouseDown=!0},p.prototype.onDialogUp=function(){var n=this;this.dialogMouseDown&&(this.timeoutId=setTimeout(function(){n.dialogMouseDown=!1},0))},p.prototype.onClickMask=function(n){this.mask&&this.maskClosable&&n.target.classList.contains("ant-modal-wrap")&&this.nzVisible&&!this.dialogMouseDown&&this.onClickOkCancel("cancel")},p.prototype.isModalType=function(n){return this.nzModalType===n},p.prototype.onClickCloseBtn=function(){this.nzVisible&&this.onClickOkCancel("cancel")},p.prototype.onClickOkCancel=function(n){var e=this,t={ok:this.nzOnOk,cancel:this.nzOnCancel}[n],o={ok:"nzOkLoading",cancel:"nzCancelLoading"}[n];if(t instanceof a.EventEmitter)t.emit(this.getContentComponent());else if("function"==typeof t){var i=t(this.getContentComponent()),r=function(n){return!1!==n&&e.close(n)};if(s.isPromise(i)){this[o]=!0;var l=function(n){e[o]=!1,r(n)};i.then(l).catch(l)}else r(i)}},p.prototype.isNonEmptyString=function(n){return"string"==typeof n&&""!==n},p.prototype.isTemplateRef=function(n){return n instanceof a.TemplateRef},p.prototype.isComponent=function(n){return n instanceof a.Type},p.prototype.isModalButtons=function(n){return Array.isArray(n)&&n.length>0},p.prototype.handleVisibleStateChange=function(n,e,t){var i=this;return void 0===e&&(e=!0),n?(this.scrollStrategy.enable(),this.savePreviouslyFocusedElement(),this.trapFocus(),this.container instanceof o.OverlayRef&&this.overlayKeyboardDispatcher.add(this.overlayRef)):this.container instanceof o.OverlayRef&&this.overlayKeyboardDispatcher.remove(this.overlayRef),Promise.resolve(e?this.animateTo(n):void 0).then(function(){n?i.nzAfterOpen.emit():(i.nzAfterClose.emit(t),i.restoreFocus(),i.scrollStrategy.disable(),i.cdr.markForCheck())})},p.prototype.getButtonCallableProp=function(n,e){var t=n[e],o=[];return this.contentComponentRef&&o.push(this.contentComponentRef.instance),"function"==typeof t?t.apply(n,o):t},p.prototype.onButtonClick=function(n){var e=this.getButtonCallableProp(n,"onClick");s.isPromise(e)&&(n.loading=!0,e.then(function(){return n.loading=!1}).catch(function(){return n.loading=!1}))},p.prototype.changeVisibleFromInside=function(n,e){return this.nzVisible!==n?(this.nzVisible=n,this.nzVisibleChange.emit(n),this.handleVisibleStateChange(n,!0,e)):Promise.resolve()},p.prototype.changeAnimationState=function(n){var e,t;this.animationState=n,n?(this.maskAnimationClassMap=((e={})["fade-"+n]=!0,e["fade-"+n+"-active"]=!0,e),this.modalAnimationClassMap=((t={})["zoom-"+n]=!0,t["zoom-"+n+"-active"]=!0,t)):this.maskAnimationClassMap=this.modalAnimationClassMap=null},p.prototype.animateTo=function(n){var e=this;return n&&setTimeout(function(){return e.updateTransformOrigin()}),this.changeAnimationState(n?"enter":"leave"),new Promise(function(n){return setTimeout(function(){e.changeAnimationState(null),n()},e.nzNoAnimation?0:200)})},p.prototype.formatModalButtons=function(n){return n.map(function(n){return y({type:"default",size:"default",autoLoading:!0,show:!0,loading:!1,disabled:!1},n)})},p.prototype.createDynamicComponent=function(n){var e=this.cfr.resolveComponentFactory(n),t=a.Injector.create({providers:[{provide:b,useValue:this}],parent:this.viewContainer.parentInjector});this.contentComponentRef=e.create(t),this.nzComponentParams&&Object.assign(this.contentComponentRef.instance,this.nzComponentParams),this.contentComponentRef.changeDetectorRef.detectChanges()},p.prototype.updateTransformOrigin=function(){var n=this.modalContainer.nativeElement;if(this.previouslyFocusedElement){var e=this.previouslyFocusedElement.getBoundingClientRect(),t=s.getElementOffset(this.previouslyFocusedElement),o=t.left+e.width/2,i=t.top+e.height/2;this.transformOrigin=o-n.offsetLeft+"px "+(i-n.offsetTop)+"px 0px"}},p.prototype.savePreviouslyFocusedElement=function(){this.document&&(this.previouslyFocusedElement=this.document.activeElement)},p.prototype.trapFocus=function(){this.focusTrap||(this.focusTrap=this.focusTrapFactory.create(this.elementRef.nativeElement)),this.focusTrap.focusInitialElementWhenReady()},p.prototype.restoreFocus=function(){this.previouslyFocusedElement&&"function"==typeof this.previouslyFocusedElement.focus&&this.previouslyFocusedElement.focus(),this.focusTrap&&this.focusTrap.destroy()},p.decorators=[{type:a.Component,args:[{selector:"nz-modal",exportAs:"nzModal",template:'<ng-template #tplOriginContent><ng-content></ng-content></ng-template> \x3c!-- Compatible: the <ng-content> can appear only once --\x3e\n\n<div [nzNoAnimation]="nzNoAnimation">\n <div *ngIf="mask"\n class="ant-modal-mask"\n [ngClass]="maskAnimationClassMap"\n [class.ant-modal-mask-hidden]="hidden"\n [ngStyle]="nzMaskStyle"\n [style.zIndex]="nzZIndex"\n ></div>\n <div\n (click)="onClickMask($event)"\n (mouseup)="onDialogUp()"\n class="ant-modal-wrap {{ nzWrapClassName }}"\n [style.zIndex]="nzZIndex"\n [style.visibility]="hidden ? \'hidden\' : null"\n tabindex="-1"\n role="dialog"\n >\n <div #modalContainer\n class="ant-modal {{ nzClassName }}"\n (mousedown)="onMaskDialogDown()"\n [ngClass]="modalAnimationClassMap"\n [ngStyle]="nzStyle"\n [style.width]="nzWidth | nzToCssUnit"\n [style.transform-origin]="transformOrigin"\n role="document"\n >\n <div class="ant-modal-content">\n <button *ngIf="nzClosable" (click)="onClickCloseBtn()" class="ant-modal-close" aria-label="Close">\n <span class="ant-modal-close-x">\n <ng-container *nzStringTemplateOutlet="nzCloseIcon">\n <i nz-icon [nzType]="nzCloseIcon" class="ant-modal-close-icon"></i>\n </ng-container>\n </span>\n </button>\n <ng-container *ngIf="!hidden" [ngSwitch]="true">\n <ng-container *ngSwitchCase="isModalType(\'default\')" [ngTemplateOutlet]="tplContentDefault"></ng-container>\n <ng-container *ngSwitchCase="isModalType(\'confirm\')" [ngTemplateOutlet]="tplContentConfirm"></ng-container>\n </ng-container>\n </div>\n </div>\n </div>\n</div>\n\n\x3c!-- [Predefined] Default Modal Content --\x3e\n<ng-template #tplContentDefault>\n <div *ngIf="nzTitle" class="ant-modal-header">\n <div class="ant-modal-title">\n <ng-container [ngSwitch]="true">\n <ng-container *ngSwitchCase="isTemplateRef(nzTitle)" [ngTemplateOutlet]="nzTitle"></ng-container>\n <ng-container *ngSwitchCase="isNonEmptyString(nzTitle)"><div [innerHTML]="nzTitle"></div></ng-container>\n </ng-container>\n </div>\n </div>\n <div class="ant-modal-body" [ngStyle]="nzBodyStyle">\n <ng-container #bodyContainer>\n <ng-container *ngIf="!isComponent(nzContent)" [ngSwitch]="true">\n <ng-container *ngSwitchCase="isTemplateRef(nzContent)" [ngTemplateOutlet]="nzContent"></ng-container>\n <ng-container *ngSwitchCase="isNonEmptyString(nzContent)"><div [innerHTML]="nzContent"></div></ng-container>\n <ng-container *ngSwitchDefault [ngTemplateOutlet]="tplOriginContent"></ng-container>\n </ng-container>\n </ng-container>\n </div>\n <div *ngIf="nzFooter !== null" class="ant-modal-footer">\n <ng-container [ngSwitch]="true">\n <ng-container *ngSwitchCase="isTemplateRef(nzFooter)" [ngTemplateOutlet]="nzFooter"></ng-container>\n <ng-container *ngSwitchCase="isNonEmptyString(nzFooter)"><div [innerHTML]="nzFooter"></div></ng-container>\n <ng-container *ngSwitchCase="isModalButtons(nzFooter)">\n <button *ngFor="let button of nzFooter" nz-button\n (click)="onButtonClick(button)"\n [hidden]="!getButtonCallableProp(button, \'show\')"\n [nzLoading]="getButtonCallableProp(button, \'loading\')"\n [disabled]="getButtonCallableProp(button, \'disabled\')"\n [nzType]="button.type"\n [nzShape]="button.shape"\n [nzSize]="button.size"\n [nzGhost]="button.ghost"\n >{{ button.label }}</button>\n </ng-container>\n <ng-container *ngSwitchDefault>\n <button *ngIf="nzCancelText!==null" nz-button (click)="onClickOkCancel(\'cancel\')" [nzLoading]="nzCancelLoading" [disabled]="nzCancelDisabled">\n {{ cancelText }}\n </button>\n <button *ngIf="nzOkText!==null" nz-button [nzType]="nzOkType" (click)="onClickOkCancel(\'ok\')" [nzLoading]="nzOkLoading" [disabled]="nzOkDisabled">\n {{ okText }}\n </button>\n </ng-container>\n </ng-container>\n </div>\n</ng-template>\n\x3c!-- /[Predefined] Default Modal Content --\x3e\n\n\x3c!-- [Predefined] Confirm Modal Content --\x3e\n<ng-template #tplContentConfirm>\n <div class="ant-modal-body" [ngStyle]="nzBodyStyle">\n <div class="ant-modal-confirm-body-wrapper">\n <div class="ant-modal-confirm-body">\n <i nz-icon [nzType]="nzIconType"></i>\n <span class="ant-modal-confirm-title">\n <ng-container [ngSwitch]="true">\n <ng-container *ngSwitchCase="isTemplateRef(nzTitle)" [ngTemplateOutlet]="nzTitle"></ng-container>\n <ng-container *ngSwitchCase="isNonEmptyString(nzTitle)"><span [innerHTML]="nzTitle"></span></ng-container>\n </ng-container>\n </span>\n <div class="ant-modal-confirm-content">\n <ng-container #bodyContainer>\n <ng-container *ngIf="!isComponent(nzContent)" [ngSwitch]="true">\n <ng-container *ngSwitchCase="isTemplateRef(nzContent)" [ngTemplateOutlet]="nzContent"></ng-container>\n <ng-container *ngSwitchCase="isNonEmptyString(nzContent)"><div [innerHTML]="nzContent"></div></ng-container>\n <ng-container *ngSwitchDefault [ngTemplateOutlet]="tplOriginContent"></ng-container>\n </ng-container>\n </ng-container>\n </div>\n </div>\n <div class="ant-modal-confirm-btns">\n <button *ngIf="nzCancelText!==null"\n nz-button\n (click)="onClickOkCancel(\'cancel\')"\n [nzLoading]="nzCancelLoading"\n [disabled]="nzCancelDisabled">\n {{ cancelText }}\n </button>\n <button #autoFocusButtonOk\n *ngIf="nzOkText!==null"\n nz-button\n (click)="onClickOkCancel(\'ok\')"\n [nzType]="nzOkType"\n [nzLoading]="nzOkLoading"\n [disabled]="nzOkDisabled">\n {{ okText }}\n </button>\n </div>\n </div> \x3c!-- /.ant-modal-confirm-body-wrapper --\x3e\n </div>\n</ng-template>\n\x3c!-- /[Predefined] Confirm Modal Content --\x3e\n',changeDetection:a.ChangeDetectionStrategy.Default}]}],p.ctorParameters=function(){return[{type:s.NzConfigService},{type:o.Overlay},{type:o.OverlayKeyboardDispatcher},{type:c.NzI18nService},{type:a.ComponentFactoryResolver},{type:a.ElementRef},{type:a.ViewContainerRef},{type:z},{type:e.FocusTrapFactory},{type:a.ChangeDetectorRef},{type:void 0,decorators:[{type:a.Optional},{type:a.Inject,args:[m]}]},{type:void 0,decorators:[{type:a.Inject,args:[i.DOCUMENT]}]}]},p.propDecorators={nzVisible:[{type:a.Input}],nzClosable:[{type:a.Input}],nzOkLoading:[{type:a.Input}],nzOkDisabled:[{type:a.Input}],nzCancelDisabled:[{type:a.Input}],nzCancelLoading:[{type:a.Input}],nzKeyboard:[{type:a.Input}],nzNoAnimation:[{type:a.Input}],nzMask:[{type:a.Input}],nzMaskClosable:[{type:a.Input}],nzContent:[{type:a.Input}],nzComponentParams:[{type:a.Input}],nzFooter:[{type:a.Input}],nzGetContainer:[{type:a.Input}],nzZIndex:[{type:a.Input}],nzWidth:[{type:a.Input}],nzWrapClassName:[{type:a.Input}],nzClassName:[{type:a.Input}],nzStyle:[{type:a.Input}],nzTitle:[{type:a.Input}],nzCloseIcon:[{type:a.Input}],nzMaskStyle:[{type:a.Input}],nzBodyStyle:[{type:a.Input}],nzOkText:[{type:a.Input}],nzCancelText:[{type:a.Input}],nzOkType:[{type:a.Input}],nzIconType:[{type:a.Input}],nzModalType:[{type:a.Input}],nzOnOk:[{type:a.Input},{type:a.Output}],nzOnCancel:[{type:a.Input},{type:a.Output}],nzAfterOpen:[{type:a.Output}],nzAfterClose:[{type:a.Output}],nzVisibleChange:[{type:a.Output}],modalContainer:[{type:a.ViewChild,args:["modalContainer",{static:!0}]}],bodyContainer:[{type:a.ViewChild,args:["bodyContainer",{static:!1,read:a.ViewContainerRef}]}],autoFocusButtonOk:[{type:a.ViewChild,args:["autoFocusButtonOk",{static:!1,read:a.ElementRef}]}],modalFooter:[{type:a.ContentChild,args:[v,{static:!1}]}]},g([s.InputBoolean(),h("design:type",Boolean)],p.prototype,"nzVisible",void 0),g([s.InputBoolean(),h("design:type",Boolean)],p.prototype,"nzClosable",void 0),g([s.InputBoolean(),h("design:type",Boolean)],p.prototype,"nzOkLoading",void 0),g([s.InputBoolean(),h("design:type",Boolean)],p.prototype,"nzOkDisabled",void 0),g([s.InputBoolean(),h("design:type",Boolean)],p.prototype,"nzCancelDisabled",void 0),g([s.InputBoolean(),h("design:type",Boolean)],p.prototype,"nzCancelLoading",void 0),g([s.InputBoolean(),h("design:type",Boolean)],p.prototype,"nzKeyboard",void 0),g([s.InputBoolean(),h("design:type",Object)],p.prototype,"nzNoAnimation",void 0),g([s.WithConfig(),s.InputBoolean(),h("design:type",Boolean)],p.prototype,"nzMask",void 0),g([s.WithConfig(),s.InputBoolean(),h("design:type",Boolean)],p.prototype,"nzMaskClosable",void 0),p}(b);var k=function(){function n(){}return n.decorators=[{type:a.NgModule}],n}(),M=function(){function n(){}return n.decorators=[{type:a.NgModule,args:[{imports:[i.CommonModule,o.OverlayModule,s.NzAddOnModule,c.NzI18nModule,p.NzButtonModule,u.NzIconModule,s.NzPipesModule,s.NzNoAnimationModule,k,C],exports:[O,v],declarations:[O,v],entryComponents:[O]}]}],n}(),I=function(){function n(n,e){var t=this;void 0===e&&(e={}),this.overlay=n,this.createModal(),"nzGetContainer"in e||(e.nzGetContainer=void 0),this.changeProps(e),this.modalRef.instance.setOverlayRef(this.overlayRef),this.modalRef.instance.open(),this.modalRef.instance.nzAfterClose.subscribe(function(){return t.destroyModal()})}return n.prototype.getInstance=function(){return this.modalRef&&this.modalRef.instance},n.prototype.destroyModal=function(){this.modalRef&&(this.overlayRef.dispose(),this.modalRef=null)},n.prototype.changeProps=function(n){this.modalRef&&Object.assign(this.modalRef.instance,n)},n.prototype.createModal=function(){this.overlayRef=this.overlay.create(),this.modalRef=this.overlayRef.attach(new d.ComponentPortal(O))},n}();var T=function(){function n(n,e){this.overlay=n,this.modalControl=e}return Object.defineProperty(n.prototype,"openModals",{get:function(){return this.modalControl.openModals},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"afterAllClose",{get:function(){return this.modalControl.afterAllClose.asObservable()},enumerable:!0,configurable:!0}),n.prototype.closeAll=function(){this.modalControl.closeAll()},n.prototype.create=function(n){return void 0===n&&(n={}),"function"!=typeof n.nzOnCancel&&(n.nzOnCancel=function(){}),new I(this.overlay,n).getInstance()},n.prototype.confirm=function(n,e){return void 0===n&&(n={}),void 0===e&&(e="confirm"),"nzFooter"in n&&s.warn('The Confirm-Modal doesn\'t support "nzFooter", this property will be ignored.'),"nzWidth"in n||(n.nzWidth=416),"function"!=typeof n.nzOnOk&&(n.nzOnOk=function(){}),n.nzModalType="confirm",n.nzClassName="ant-modal-confirm ant-modal-confirm-"+e+" "+(n.nzClassName||""),n.nzMaskClosable=!1,this.create(n)},n.prototype.info=function(n){return void 0===n&&(n={}),this.simpleConfirm(n,"info")},n.prototype.success=function(n){return void 0===n&&(n={}),this.simpleConfirm(n,"success")},n.prototype.error=function(n){return void 0===n&&(n={}),this.simpleConfirm(n,"error")},n.prototype.warning=function(n){return void 0===n&&(n={}),this.simpleConfirm(n,"warning")},n.prototype.simpleConfirm=function(n,e){void 0===n&&(n={});return"nzIconType"in n||(n.nzIconType={info:"info-circle",success:"check-circle",error:"close-circle",warning:"exclamation-circle"}[e]),"nzCancelText"in n||(n.nzCancelText=null),this.confirm(n,e)},n.decorators=[{type:a.Injectable,args:[{providedIn:k}]}],n.ctorParameters=function(){return[{type:o.Overlay},{type:z}]},n.ngInjectableDef=a.ɵɵdefineInjectable({factory:function(){return new n(a.ɵɵinject(o.Overlay),a.ɵɵinject(z))},token:n,providedIn:k}),n}();n.NZ_MODAL_CONFIG=m,n.NzModalComponent=O,n.NzModalControlService=z,n.NzModalControlServiceModule=C,n.NzModalFooterDirective=v,n.NzModalModule=M,n.NzModalRef=b,n.NzModalService=T,n.NzModalServiceModule=k,Object.defineProperty(n,"__esModule",{value:!0})}); //# sourceMappingURL=ng-zorro-antd-modal.umd.min.js.map