import { Component, Inject } from '@angular/core';
import { MAT_DIALOG_DATA } from '@angular/material/dialog';
export class ZUIDialogCommonComponent {
    constructor(data) {
        this.data = data;
        this.dialogData = {
            actionAlign: 'end',
            width: '400px',
        };
        this.action = (item) => {
            if (item === null || item === void 0 ? void 0 : item.action)
                item.action();
        };
        this.dialogData = Object.assign(Object.assign({}, this.dialogData), data);
    }
}
ZUIDialogCommonComponent.decorators = [
    { type: Component, args: [{
                selector: 'zui-dialog-common',
                template: "<div [ngStyle]=\"{width: dialogData?.width}\">\n  <div mat-dialog-title>\n    <div class=\"d-flex align-items-center\">\n      <mat-icon *ngIf=\"dialogData?.icon\" class=\"mr-5\" [ngStyle]=\"{color: dialogData.icon?.color}\">{{ dialogData.icon.content }}</mat-icon>\n      <div class=\"d-flex-1\" *ngIf=\"dialogData?.title\">\n        {{ dialogData.title }}\n      </div>\n      <div class=\"d-flex-1\" *ngIf=\"dialogData?.titleHtml\" [innerHtml]=\"dialogData.titleHtml\"></div>\n      <mat-icon class=\"zui-pointer\" mat-dialog-close>close</mat-icon>\n    </div>\n  </div>\n  <mat-dialog-content *ngIf=\"dialogData?.message\">{{ dialogData.message }}</mat-dialog-content>\n  <mat-dialog-content *ngIf=\"dialogData?.messageHtml\" [innerHtml]=\"dialogData.messageHtml\"></mat-dialog-content>\n  <mat-dialog-actions>\n    <div class=\"d-flex w-100\" [ngStyle]=\"{'justify-content': dialogData?.actionAlign}\">\n      <ng-container *ngFor=\"let item of dialogData?.actions\">\n        <zui-button *ngIf=\"item?.close\" [label]=\"item?.title\" [type]=\"item?.type ? item.type : 'basic'\" (action)=\"action(item)\" mat-dialog-close [color]=\"item?.color\" class=\"ml-5\"></zui-button>\n        <zui-button *ngIf=\"!item?.close\" [label]=\"item?.title\" [type]=\"item?.type ? item.type : 'basic'\" (action)=\"action(item)\" [color]=\"item?.color\" class=\"ml-5\"></zui-button>\n      </ng-container>\n    </div>\n  </mat-dialog-actions>\n</div>\n",
                styles: [""]
            },] }
];
ZUIDialogCommonComponent.ctorParameters = () => [
    { type: undefined, decorators: [{ type: Inject, args: [MAT_DIALOG_DATA,] }] }
];
//# sourceMappingURL=index.component.js.map