import { __decorate, __param } from "tslib";
import { Component, Inject, ViewEncapsulation } from '@angular/core';
import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
var DialogConfirmComponent = /** @class */ (function () {
    function DialogConfirmComponent(dialogRef, data) {
        this.dialogRef = dialogRef;
        this.data = data;
    }
    DialogConfirmComponent.prototype.onNoClick = function () {
        this.dialogRef.close();
    };
    DialogConfirmComponent.ctorParameters = function () { return [
        { type: MatDialogRef },
        { type: undefined, decorators: [{ type: Inject, args: [MAT_DIALOG_DATA,] }] }
    ]; };
    DialogConfirmComponent = __decorate([
        Component({
            selector: 'sd-dialog-confirm',
            template: "<h1 mat-dialog-title class=\"\">\r\n  <mat-icon *ngIf=\"data?.icon\" [ngClass]=\"data?.icon\">\r\n    {{data?.icon}}\r\n  </mat-icon>{{data?.title || 'Confirm'}}\r\n</h1>\r\n<div mat-dialog-content>\r\n  <div [innerHtml]=\"data?.message\">\r\n  </div>\r\n  <div *ngIf=\"data?.input\">\r\n    <sd-textarea-control [(model)]=\"value\" [required]=\"data.input?.required\" [maxlength]=\"data.input?.maxlength\"\r\n      [placeholder]=\"data.input?.placeholder\">\r\n    </sd-textarea-control>\r\n  </div>\r\n</div>\r\n<div mat-dialog-actions align=\"end\">\r\n  <button *ngIf=\"data?.noTitle\" mat-button (click)=\"onNoClick()\">{{data?.noTitle}}</button>\r\n  <button *ngIf=\"data?.yesTitle\" mat-raised-button [mat-dialog-close]=\"value || 'ACCEPT'\" color=\"primary\"\r\n    [disabled]=\"data.input?.required && !value\" cdkFocusInitial>{{data?.yesTitle}}</button>\r\n</div>",
            encapsulation: ViewEncapsulation.None,
            styles: ["sd-dialog-confirm{padding:12px 16px;display:block}sd-dialog-confirm .mat-dialog-title{display:flex;align-items:center}sd-dialog-confirm .mat-dialog-title .mat-icon{margin-right:5px}sd-dialog-confirm .mat-dialog-content{margin:0 -16px 16px!important}sd-dialog-confirm .mat-button{background-color:#f5f5f5}"]
        }),
        __param(1, Inject(MAT_DIALOG_DATA))
    ], DialogConfirmComponent);
    return DialogConfirmComponent;
}());
export { DialogConfirmComponent };
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZGlhbG9nLWNvbmZpcm0uY29tcG9uZW50LmpzIiwic291cmNlUm9vdCI6Im5nOi8vc3VwZXJkZXYtYW5ndWxhci1jb3JlLyIsInNvdXJjZXMiOlsibGliL2NvbXBvbmVudHMvZGlhbG9nLWNvbmZpcm0vZGlhbG9nLWNvbmZpcm0uY29tcG9uZW50LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQSxPQUFPLEVBQUMsU0FBUyxFQUFFLE1BQU0sRUFBRSxpQkFBaUIsRUFBQyxNQUFNLGVBQWUsQ0FBQztBQUNuRSxPQUFPLEVBQUMsU0FBUyxFQUFFLFlBQVksRUFBRSxlQUFlLEVBQUMsTUFBTSwwQkFBMEIsQ0FBQztBQXdCbEY7SUFFRSxnQ0FDUyxTQUErQyxFQUN0QixJQUFnQjtRQUR6QyxjQUFTLEdBQVQsU0FBUyxDQUFzQztRQUN0QixTQUFJLEdBQUosSUFBSSxDQUFZO0lBQUcsQ0FBQztJQUV0RCwwQ0FBUyxHQUFUO1FBQ0UsSUFBSSxDQUFDLFNBQVMsQ0FBQyxLQUFLLEVBQUUsQ0FBQztJQUN6QixDQUFDOztnQkFMbUIsWUFBWTtnREFDN0IsTUFBTSxTQUFDLGVBQWU7O0lBSmQsc0JBQXNCO1FBUmxDLFNBQVMsQ0FBQztZQUNULFFBQVEsRUFBRSxtQkFBbUI7WUFDN0IscTNCQUE0QztZQUk1QyxhQUFhLEVBQUUsaUJBQWlCLENBQUMsSUFBSTs7U0FDdEMsQ0FBQztRQUtHLFdBQUEsTUFBTSxDQUFDLGVBQWUsQ0FBQyxDQUFBO09BSmYsc0JBQXNCLENBU2xDO0lBQUQsNkJBQUM7Q0FBQSxBQVRELElBU0M7U0FUWSxzQkFBc0IiLCJzb3VyY2VzQ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