UNPKG

ng-zorro-antd

Version:

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

224 lines (222 loc) 25.3 kB
import { CdkPortalOutlet, PortalModule } from '@angular/cdk/portal'; import { DOCUMENT, NgClass, NgStyle } from '@angular/common'; import { ChangeDetectionStrategy, Component, EventEmitter, Inject, Optional, Output, ViewChild } from '@angular/core'; import { ANIMATION_MODULE_TYPE } from '@angular/platform-browser/animations'; import { takeUntil } from 'rxjs/operators'; import { NzButtonModule } from 'ng-zorro-antd/button'; import { NzOutletModule } from 'ng-zorro-antd/core/outlet'; import { NzIconModule } from 'ng-zorro-antd/icon'; import { NzPipesModule } from 'ng-zorro-antd/pipes'; import { nzModalAnimations } from './modal-animations'; import { NzModalCloseComponent } from './modal-close.component'; import { BaseModalContainerComponent } from './modal-container.directive'; import * as i0 from "@angular/core"; import * as i1 from "ng-zorro-antd/i18n"; import * as i2 from "@angular/cdk/a11y"; import * as i3 from "@angular/cdk/overlay"; import * as i4 from "ng-zorro-antd/core/config"; import * as i5 from "./modal-types"; import * as i6 from "ng-zorro-antd/pipes"; import * as i7 from "ng-zorro-antd/icon"; import * as i8 from "ng-zorro-antd/core/outlet"; import * as i9 from "@angular/cdk/portal"; import * as i10 from "ng-zorro-antd/button"; import * as i11 from "ng-zorro-antd/core/transition-patch"; import * as i12 from "ng-zorro-antd/core/wave"; export class NzModalConfirmContainerComponent extends BaseModalContainerComponent { constructor(ngZone, i18n, host, focusTrapFactory, cdr, render, overlayRef, nzConfigService, config, document, animationType) { super(ngZone, host, focusTrapFactory, cdr, render, overlayRef, nzConfigService, config, document, animationType); this.i18n = i18n; this.config = config; this.cancelTriggered = new EventEmitter(); this.okTriggered = new EventEmitter(); this.i18n.localeChange.pipe(takeUntil(this.destroy$)).subscribe(() => { this.locale = this.i18n.getLocaleData('Modal'); }); } ngOnInit() { this.setupMouseListeners(this.modalElementRef); } onCancel() { this.cancelTriggered.emit(); } onOk() { this.okTriggered.emit(); } static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: NzModalConfirmContainerComponent, deps: [{ token: i0.NgZone }, { token: i1.NzI18nService }, { token: i0.ElementRef }, { token: i2.FocusTrapFactory }, { token: i0.ChangeDetectorRef }, { token: i0.Renderer2 }, { token: i3.OverlayRef }, { token: i4.NzConfigService }, { token: i5.ModalOptions }, { token: DOCUMENT, optional: true }, { token: ANIMATION_MODULE_TYPE, optional: true }], target: i0.ɵɵFactoryTarget.Component }); } static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.3.4", type: NzModalConfirmContainerComponent, isStandalone: true, selector: "nz-modal-confirm-container", outputs: { cancelTriggered: "cancelTriggered", okTriggered: "okTriggered" }, host: { attributes: { "tabindex": "-1", "role": "dialog" }, listeners: { "@modalContainer.start": "onAnimationStart($event)", "@modalContainer.done": "onAnimationDone($event)", "click": "onContainerClick($event)" }, properties: { "class": "config.nzWrapClassName ? \"ant-modal-wrap \" + config.nzWrapClassName : \"ant-modal-wrap\"", "class.ant-modal-wrap-rtl": "dir === 'rtl'", "class.ant-modal-centered": "config.nzCentered", "style.zIndex": "config.nzZIndex", "@.disabled": "config.nzNoAnimation", "@modalContainer": "state" } }, viewQueries: [{ propertyName: "portalOutlet", first: true, predicate: CdkPortalOutlet, descendants: true, static: true }, { propertyName: "modalElementRef", first: true, predicate: ["modalElement"], descendants: true, static: true }], exportAs: ["nzModalConfirmContainer"], usesInheritance: true, ngImport: i0, template: ` <div #modalElement role="document" class="ant-modal" [ngClass]="config.nzClassName!" [ngStyle]="config.nzStyle!" [style.width]="config?.nzWidth! | nzToCssUnit" > <div class="ant-modal-content"> @if (config.nzClosable) { <button nz-modal-close (click)="onCloseClick()"></button> } <div class="ant-modal-body" [ngStyle]="config.nzBodyStyle!"> <div class="ant-modal-confirm-body-wrapper"> <div class="ant-modal-confirm-body"> <span nz-icon [nzType]="config.nzIconType!"></span> <span class="ant-modal-confirm-title"> <ng-container *nzStringTemplateOutlet="config.nzTitle"> <span [innerHTML]="config.nzTitle"></span> </ng-container> </span> <div class="ant-modal-confirm-content"> <ng-template cdkPortalOutlet></ng-template> @if (isStringContent) { <div [innerHTML]="config.nzContent"></div> } </div> </div> <div class="ant-modal-confirm-btns"> @if (config.nzCancelText !== null) { <button [attr.cdkFocusInitial]="config.nzAutofocus === 'cancel' || null" nz-button (click)="onCancel()" [nzLoading]="config.nzCancelLoading" [disabled]="config.nzCancelDisabled" > {{ config.nzCancelText || locale.cancelText }} </button> } @if (config.nzOkText !== null) { <button [attr.cdkFocusInitial]="config.nzAutofocus === 'ok' || null" nz-button [nzType]="config.nzOkType!" (click)="onOk()" [nzLoading]="config.nzOkLoading" [disabled]="config.nzOkDisabled" [nzDanger]="config.nzOkDanger" > {{ config.nzOkText || locale.okText }} </button> } </div> </div> </div> </div> </div> `, isInline: true, dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "ngmodule", type: NzPipesModule }, { kind: "pipe", type: i6.NzToCssUnitPipe, name: "nzToCssUnit" }, { kind: "ngmodule", type: NzIconModule }, { kind: "directive", type: i7.NzIconDirective, selector: "[nz-icon]", inputs: ["nzSpin", "nzRotate", "nzType", "nzTheme", "nzTwotoneColor", "nzIconfont"], exportAs: ["nzIcon"] }, { kind: "component", type: NzModalCloseComponent, selector: "button[nz-modal-close]", exportAs: ["NzModalCloseBuiltin"] }, { kind: "ngmodule", type: NzOutletModule }, { kind: "directive", type: i8.NzStringTemplateOutletDirective, selector: "[nzStringTemplateOutlet]", inputs: ["nzStringTemplateOutletContext", "nzStringTemplateOutlet"], exportAs: ["nzStringTemplateOutlet"] }, { kind: "ngmodule", type: PortalModule }, { kind: "directive", type: i9.CdkPortalOutlet, selector: "[cdkPortalOutlet]", inputs: ["cdkPortalOutlet"], outputs: ["attached"], exportAs: ["cdkPortalOutlet"] }, { kind: "ngmodule", type: NzButtonModule }, { kind: "component", type: i10.NzButtonComponent, selector: "button[nz-button], a[nz-button]", inputs: ["nzBlock", "nzGhost", "nzSearch", "nzLoading", "nzDanger", "disabled", "tabIndex", "nzType", "nzShape", "nzSize"], exportAs: ["nzButton"] }, { kind: "directive", type: i11.ɵNzTransitionPatchDirective, selector: "[nz-button], nz-button-group, [nz-icon], [nz-menu-item], [nz-submenu], nz-select-top-control, nz-select-placeholder, nz-input-group", inputs: ["hidden"] }, { kind: "directive", type: i12.NzWaveDirective, selector: "[nz-wave],button[nz-button]:not([nzType=\"link\"]):not([nzType=\"text\"])", inputs: ["nzWaveExtraNode"], exportAs: ["nzWave"] }], animations: [nzModalAnimations.modalContainer], changeDetection: i0.ChangeDetectionStrategy.Default }); } } i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: NzModalConfirmContainerComponent, decorators: [{ type: Component, args: [{ selector: 'nz-modal-confirm-container', exportAs: 'nzModalConfirmContainer', template: ` <div #modalElement role="document" class="ant-modal" [ngClass]="config.nzClassName!" [ngStyle]="config.nzStyle!" [style.width]="config?.nzWidth! | nzToCssUnit" > <div class="ant-modal-content"> @if (config.nzClosable) { <button nz-modal-close (click)="onCloseClick()"></button> } <div class="ant-modal-body" [ngStyle]="config.nzBodyStyle!"> <div class="ant-modal-confirm-body-wrapper"> <div class="ant-modal-confirm-body"> <span nz-icon [nzType]="config.nzIconType!"></span> <span class="ant-modal-confirm-title"> <ng-container *nzStringTemplateOutlet="config.nzTitle"> <span [innerHTML]="config.nzTitle"></span> </ng-container> </span> <div class="ant-modal-confirm-content"> <ng-template cdkPortalOutlet></ng-template> @if (isStringContent) { <div [innerHTML]="config.nzContent"></div> } </div> </div> <div class="ant-modal-confirm-btns"> @if (config.nzCancelText !== null) { <button [attr.cdkFocusInitial]="config.nzAutofocus === 'cancel' || null" nz-button (click)="onCancel()" [nzLoading]="config.nzCancelLoading" [disabled]="config.nzCancelDisabled" > {{ config.nzCancelText || locale.cancelText }} </button> } @if (config.nzOkText !== null) { <button [attr.cdkFocusInitial]="config.nzAutofocus === 'ok' || null" nz-button [nzType]="config.nzOkType!" (click)="onOk()" [nzLoading]="config.nzOkLoading" [disabled]="config.nzOkDisabled" [nzDanger]="config.nzOkDanger" > {{ config.nzOkText || locale.okText }} </button> } </div> </div> </div> </div> </div> `, animations: [nzModalAnimations.modalContainer], // Using OnPush for modal caused footer can not to detect changes. we can fix it when 8.x. changeDetection: ChangeDetectionStrategy.Default, host: { tabindex: '-1', role: 'dialog', '[class]': 'config.nzWrapClassName ? "ant-modal-wrap " + config.nzWrapClassName : "ant-modal-wrap"', '[class.ant-modal-wrap-rtl]': `dir === 'rtl'`, '[class.ant-modal-centered]': 'config.nzCentered', '[style.zIndex]': 'config.nzZIndex', '[@.disabled]': 'config.nzNoAnimation', '[@modalContainer]': 'state', '(@modalContainer.start)': 'onAnimationStart($event)', '(@modalContainer.done)': 'onAnimationDone($event)', '(click)': 'onContainerClick($event)' }, imports: [ NgClass, NgStyle, NzPipesModule, NzIconModule, NzModalCloseComponent, NzOutletModule, PortalModule, NzButtonModule ], standalone: true }] }], ctorParameters: () => [{ type: i0.NgZone }, { type: i1.NzI18nService }, { type: i0.ElementRef }, { type: i2.FocusTrapFactory }, { type: i0.ChangeDetectorRef }, { type: i0.Renderer2 }, { type: i3.OverlayRef }, { type: i4.NzConfigService }, { type: i5.ModalOptions }, { type: undefined, decorators: [{ type: Optional }, { type: Inject, args: [DOCUMENT] }] }, { type: undefined, decorators: [{ type: Optional }, { type: Inject, args: [ANIMATION_MODULE_TYPE] }] }], propDecorators: { portalOutlet: [{ type: ViewChild, args: [CdkPortalOutlet, { static: true }] }], modalElementRef: [{ type: ViewChild, args: ['modalElement', { static: true }] }], cancelTriggered: [{ type: Output }], okTriggered: [{ type: Output }] } }); //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibW9kYWwtY29uZmlybS1jb250YWluZXIuY29tcG9uZW50Lmp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b2RhbC1ib2R5XCIgW25nU3R5bGVdPVwiY29uZmlnLm56Qm9keVN0eWxlIVwiPlxuICAgICAgICAgIDxkaXYgY2xhc3M9XCJhbnQtbW9kYWwtY29uZmlybS1ib2R5LXdyYXBwZXJcIj5cbiAgICAgICAgICAgIDxkaXYgY2xhc3M9XCJhbnQtbW9kYWwtY29uZmlybS1ib2R5XCI+XG4gICAgICAgICAgICAgIDxzcGFuIG56LWljb24gW256VHlwZV09XCJjb25maWcubnpJY29uVHlwZSFcIj48L3NwYW4+XG4gICAgICAgICAgICAgIDxzcGFuIGNsYXNzPVwiYW50LW1vZGFsLWNvbmZpcm0tdGl0bGVcIj5cbiAgICAgICAgICAgICAgICA8bmctY29udGFpbmVyICpuelN0cmluZ1RlbXBsYXRlT3V0bGV0PVwiY29uZmlnLm56VGl0bGVcIj5cbiAgICAgICAgICAgICAgICAgIDxzcGFuIFtpbm5lckhUTUxdPVwiY29uZmlnLm56VGl0bGVcIj48L3NwYW4+XG4gICAgICAgICAgICAgICAgPC9uZy1jb250YWluZXI+XG4gICAgICAgICAgICAgIDwvc3Bhbj5cbiAgICAgICAgICAgICAgPGRpdiBjbGFzcz1cImFudC1tb2RhbC1jb25maXJtLWNvbnRlbnRcIj5cbiAgICAgICAgICAgICAgICA8bmctdGVtcGxhdGUgY2RrUG9ydGFsT3V0bGV0PjwvbmctdGVtcGxhdGU+XG4gICAgICAgICAgICAgICAgQGlmIChpc1N0cmluZ0NvbnRlbnQpIHtcbiAgICAgICAgICAgICAgICAgIDxkaXYgW2lubmVySFRNTF09XCJjb25maWcubnpDb250ZW50XCI+PC9kaXY+XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICA8L2Rpdj5cbiAgICAgICAgICAgIDwvZGl2PlxuICAgICAgICAgICAgPGRpdiBjbGFzcz1cImFudC1tb2RhbC1jb25maXJtLWJ0bnNcIj5cbiAgICAgICAgICAgICAgQGlmIChjb25maWcubnpDYW5jZWxUZXh0ICE9PSBudWxsKSB7XG4gICAgICAgICAgICAgICAgPGJ1dHRvblxuICAgICAgICAgICAgICAgICAgW2F0dHIuY2RrRm9jdXNJbml0aWFsXT1cImNvbmZpZy5uekF1dG9mb2N1cyA9PT0gJ2NhbmNlbCcgfHwgbnVsbFwiXG4gICAgICAgICAgICAgICAgICBuei1idXR0b25cbiAgICAgICAgICAgICAgICAgIChjbGljayk9XCJvbkNhbmNlbCgpXCJcbiAgICAgICAgICAgICAgICAgIFtuekxvYWRpbmddPVwiY29uZmlnLm56Q2FuY2VsTG9hZGluZ1wiXG4gICAgICAgICAgICAgICAgICBbZGlzYWJsZWRdPVwiY29uZmlnLm56Q2FuY2VsRGlzYWJsZWRcIlxuICAgICAgICAgICAgICAgID5cbiAgICAgICAgICAgICAgICAgIHt7IGNvbmZpZy5uekNhbmNlbFRleHQgfHwgbG9jYWxlLmNhbmNlbFRleHQgfX1cbiAgICAgICAgICAgICAgICA8L2J1dHRvbj5cbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICBAaWYgKGNvbmZpZy5uek9rVGV4dCAhPT0gbnVsbCkge1xuICAgICAgICAgICAgICAgIDxidXR0b25cbiAgICAgICAgICAgICAgICAgIFthdHRyLmNka0ZvY3VzSW5pdGlhbF09XCJjb25maWcubnpBdXRvZm9jdXMgPT09ICdvaycgfHwgbnVsbFwiXG4gICAgICAgICAgICAgICAgICBuei1idXR0b25cbiAgICAgICAgICAgICAgICAgIFtuelR5cGVdPVwiY29uZmlnLm56T2tUeXBlIVwiXG4gICAgICAgICAgICAgICAgICAoY2xpY2spPVwib25PaygpXCJcbiAgICAgICAgICAgICAgICAgIFtuekxvYWRpbmddPVwiY29uZmlnLm56T2tMb2FkaW5nXCJcbiAgICAgICAgICAgICAgICAgIFtkaXNhYmxlZF09XCJjb25maWcubnpPa0Rpc2FibGVkXCJcbiAgICAgICAgICAgICAgICAgIFtuekRhbmdlcl09XCJjb25maWcubnpPa0RhbmdlclwiXG4gICAgICAgICAgICAgICAgPlxuICAgICAg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