import { Component, Input, ViewChild } from '@angular/core';
import { DomSanitizer } from '@angular/platform-browser';
import { ModalComponent } from './modal.component';
import { ModalContentDirective } from './modal.directive';
import * as i0 from "@angular/core";
import * as i1 from "@angular/platform-browser";
import * as i2 from "./modal.component";
import * as i3 from "@angular/common";
import * as i4 from "./modal.directive";
import * as i5 from "./modal-header.component";
import * as i6 from "./modal-footer.component";
export class ModalContainerComponent {
    constructor(sanitizer, modalInstance) {
        this.sanitizer = sanitizer;
        this.modalInstance = modalInstance;
        this.dialogtype = 'standard';
    }
    ngOnInit() {
        if (this.html) {
            this.content = this.sanitizer.bypassSecurityTrustHtml(this.content);
        }
    }
    close(event) {
        this.onClose(event);
    }
    updateButtonOptions(buttonOptions = []) {
        this.buttons = this.buttons.map((button, index) => {
            return { ...button, ...buttonOptions[index] };
        });
    }
}
ModalContainerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: ModalContainerComponent, deps: [{ token: i1.DomSanitizer }, { token: i2.ModalComponent }], target: i0.ɵɵFactoryTarget.Component });
ModalContainerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.0", type: ModalContainerComponent, selector: "d-modal-container", inputs: { maxHeight: "maxHeight", data: "data", title: "title", content: "content", buttons: "buttons", html: "html", onClose: "onClose", dialogtype: "dialogtype", showCloseBtn: "showCloseBtn" }, viewQueries: [{ propertyName: "modalContentHost", first: true, predicate: ModalContentDirective, descendants: true, static: true }], ngImport: i0, template: "<div>\n  <d-modal-header\n    id=\"d-modal-header\"\n    [title]=\"title\"\n    (closeEvent)=\"close($event)\"\n    [dialogtype]=\"dialogtype\"\n    [showCloseBtn]=\"showCloseBtn\"\n  ></d-modal-header>\n  <div\n    class=\"modal-body devui-scrollbar\"\n    [ngClass]=\"{\n      'flex-content': dialogtype === 'warning' || dialogtype === 'failed' || dialogtype === 'success' || dialogtype === 'info'\n    }\"\n    [ngStyle]=\"{ maxHeight: maxHeight }\"\n  >\n    <div\n      [ngClass]=\"{\n        'display-flex': dialogtype !== '' && dialogtype !== 'standard'\n      }\"\n    >\n      <div class=\"content\" [style.max-height]=\"maxHeight\" *ngIf=\"!!content && !html\">{{ content }}</div>\n      <div class=\"content\" [style.max-height]=\"maxHeight\" *ngIf=\"!!content && html\" [innerHTML]=\"content\"></div>\n      <div class=\"content\" *ngIf=\"contentTemplate\">\n        <ng-template\n          [ngTemplateOutlet]=\"contentTemplate\"\n          [ngTemplateOutletContext]=\"{ modalInstance: modalInstance, modalContentInstance: this }\"\n        ></ng-template>\n      </div>\n      <ng-template dModalContentHost></ng-template>\n    </div>\n  </div>\n\n  <d-modal-footer [buttons]=\"buttons\"></d-modal-footer>\n</div>\n", styles: [".devui-font-size-base{font-size:12px;font-size:var(--devui-font-size, 12px)}.devui-font-base{font-size:12px;font-size:var(--devui-font-size, 12px);font-weight:400;line-height:1.5}.devui-font-size-modal-title{font-size:18px;font-size:var(--devui-font-size-modal-title, 18px)}.devui-font-modal-title{font-size:18px;font-size:var(--devui-font-size-modal-title, 18px);font-weight:700;line-height:1.5}.devui-font-size-page-title{font-size:16px;font-size:var(--devui-font-size-page-title, 16px)}.devui-font-page-title{font-size:16px;font-size:var(--devui-font-size-page-title, 16px);font-weight:700;line-height:1.5}.devui-font-size-secondary-title{font-size:14px;font-size:var(--devui-font-size-card-title, 14px)}.devui-font-secondary-title{font-size:14px;font-size:var(--devui-font-size-card-title, 14px);font-weight:700;line-height:1.5}.modal-body{padding:12px 32px;overflow-y:hidden}.modal-body:hover{overflow-y:auto;overflow-y:overlay}.display-flex{display:flex;display:-ms-flexbox;align-items:center;-ms-flex-align:center;max-width:100%}div.content{word-break:normal;word-wrap:break-word;width:100%}.flex-content ::ng-deep div.content{font-size:12px;font-size:var(--devui-font-size, 12px);word-break:normal;word-wrap:break-word;white-space:pre-wrap}.flex-content{display:flex;justify-content:left;align-items:center}\n"], dependencies: [{ kind: "directive", type: i3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i3.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i4.ModalContentDirective, selector: "[dModalContentHost]" }, { kind: "component", type: i5.ModalHeaderComponent, selector: "d-modal-header", inputs: ["title", "dialogtype", "showCloseBtn"], outputs: ["closeEvent"] }, { kind: "component", type: i6.ModalFooterComponent, selector: "d-modal-footer", inputs: ["buttons"] }] });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: ModalContainerComponent, decorators: [{
            type: Component,
            args: [{ selector: 'd-modal-container', preserveWhitespaces: false, template: "<div>\n  <d-modal-header\n    id=\"d-modal-header\"\n    [title]=\"title\"\n    (closeEvent)=\"close($event)\"\n    [dialogtype]=\"dialogtype\"\n    [showCloseBtn]=\"showCloseBtn\"\n  ></d-modal-header>\n  <div\n    class=\"modal-body devui-scrollbar\"\n    [ngClass]=\"{\n      'flex-content': dialogtype === 'warning' || dialogtype === 'failed' || dialogtype === 'success' || dialogtype === 'info'\n    }\"\n    [ngStyle]=\"{ maxHeight: maxHeight }\"\n  >\n    <div\n      [ngClass]=\"{\n        'display-flex': dialogtype !== '' && dialogtype !== 'standard'\n      }\"\n    >\n      <div class=\"content\" [style.max-height]=\"maxHeight\" *ngIf=\"!!content && !html\">{{ content }}</div>\n      <div class=\"content\" [style.max-height]=\"maxHeight\" *ngIf=\"!!content && html\" [innerHTML]=\"content\"></div>\n      <div class=\"content\" *ngIf=\"contentTemplate\">\n        <ng-template\n          [ngTemplateOutlet]=\"contentTemplate\"\n          [ngTemplateOutletContext]=\"{ modalInstance: modalInstance, modalContentInstance: this }\"\n        ></ng-template>\n      </div>\n      <ng-template dModalContentHost></ng-template>\n    </div>\n  </div>\n\n  <d-modal-footer [buttons]=\"buttons\"></d-modal-footer>\n</div>\n", styles: [".devui-font-size-base{font-size:12px;font-size:var(--devui-font-size, 12px)}.devui-font-base{font-size:12px;font-size:var(--devui-font-size, 12px);font-weight:400;line-height:1.5}.devui-font-size-modal-title{font-size:18px;font-size:var(--devui-font-size-modal-title, 18px)}.devui-font-modal-title{font-size:18px;font-size:var(--devui-font-size-modal-title, 18px);font-weight:700;line-height:1.5}.devui-font-size-page-title{font-size:16px;font-size:var(--devui-font-size-page-title, 16px)}.devui-font-page-title{font-size:16px;font-size:var(--devui-font-size-page-title, 16px);font-weight:700;line-height:1.5}.devui-font-size-secondary-title{font-size:14px;font-size:var(--devui-font-size-card-title, 14px)}.devui-font-secondary-title{font-size:14px;font-size:var(--devui-font-size-card-title, 14px);font-weight:700;line-height:1.5}.modal-body{padding:12px 32px;overflow-y:hidden}.modal-body:hover{overflow-y:auto;overflow-y:overlay}.display-flex{display:flex;display:-ms-flexbox;align-items:center;-ms-flex-align:center;max-width:100%}div.content{word-break:normal;word-wrap:break-word;width:100%}.flex-content ::ng-deep div.content{font-size:12px;font-size:var(--devui-font-size, 12px);word-break:normal;word-wrap:break-word;white-space:pre-wrap}.flex-content{display:flex;justify-content:left;align-items:center}\n"] }]
        }], ctorParameters: function () { return [{ type: i1.DomSanitizer }, { type: i2.ModalComponent }]; }, propDecorators: { maxHeight: [{
                type: Input
            }], data: [{
                type: Input
            }], title: [{
                type: Input
            }], content: [{
                type: Input
            }], buttons: [{
                type: Input
            }], html: [{
                type: Input
            }], onClose: [{
                type: Input
            }], modalContentHost: [{
                type: ViewChild,
                args: [ModalContentDirective, { static: true }]
            }], dialogtype: [{
                type: Input
            }], showCloseBtn: [{
                type: Input
            }] } });
//# sourceMappingURL=data:application/json;base64, 