/**
 * @fileoverview added by tsickle
 * Generated from: lib/dialog/common-dialog/index.component.ts
 * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
 */
import { Component, Input, ContentChild, Output, EventEmitter, } from "@angular/core";
import { MatDialogRef } from "@angular/material/dialog";
import { getTranslation } from "../../utils/utils";
var CommonDialogComponent = /** @class */ (function () {
    function CommonDialogComponent(dialogRef) {
        this.dialogRef = dialogRef;
        // 隐藏元素相关属性
        this.hideHeader = false;
        this.hideCloseIcon = false;
        this.hideCloseBtn = false;
        this.hideSaveBtn = false;
        this.hideDiscardBtn = true;
        this.saveBtnLabel = "";
        this.cancelBtnLabel = "";
        this.discardBtnLabel = "";
        this.showErrorIcon = false;
        this.showZoomBtn = false;
        this.customSave = false;
        this.customPageTitle = false;
        // 显示相关属性
        this.dialogStyle = {};
        this.size = "";
        this.title = "Dialog";
        this.loading = false;
        this.saveEmit = new EventEmitter();
        this.closeEmit = new EventEmitter();
        this.defaultSize = "";
        this.customFooter = false;
    }
    /**
     * @return {?}
     */
    CommonDialogComponent.prototype.ngAfterContentInit = /**
     * @return {?}
     */
    function () {
        this.customFooter = !!this.footerContent;
    };
    /**
     * @return {?}
     */
    CommonDialogComponent.prototype.ngOnInit = /**
     * @return {?}
     */
    function () {
        this.getInfo();
    };
    /**
     * @return {?}
     */
    CommonDialogComponent.prototype.onClose = /**
     * @return {?}
     */
    function () {
        var _this = this;
        if (this.onCloseRequest) {
            this.onCloseRequest().then((/**
             * @param {?} confirmed
             * @return {?}
             */
            function (confirmed) {
                if (confirmed) {
                    _this.dialogRef.close("close");
                }
            }));
        }
        else {
            this.dialogRef.close("close");
        }
    };
    /**
     * @return {?}
     */
    CommonDialogComponent.prototype.onZoom = /**
     * @return {?}
     */
    function () {
        if (this.size === "largest") {
            this.size = this.defaultSize; // 恢复到原始大小
        }
        else {
            this.size = "largest"; // 设置为最大化
        }
    };
    /**
     * @return {?}
     */
    CommonDialogComponent.prototype.onSave = /**
     * @return {?}
     */
    function () {
        if (this.customSave) {
            this.saveEmit.emit();
        }
        else {
            this.dialogRef.close("save");
        }
    };
    /**
     * @return {?}
     */
    CommonDialogComponent.prototype.onDiscard = /**
     * @return {?}
     */
    function () {
        this.dialogRef.close("discard");
    };
    /**
     * @private
     * @return {?}
     */
    CommonDialogComponent.prototype.getInfo = /**
     * @private
     * @return {?}
     */
    function () {
        this.translation = getTranslation();
        this.saveBtnLabel = this.saveBtnLabel || this.translation.SAVE || ".SAVE";
        this.cancelBtnLabel =
            this.cancelBtnLabel || this.translation.CANCEL || ".CANCEL";
        this.defaultSize = this.size;
    };
    CommonDialogComponent.decorators = [
        { type: Component, args: [{
                    selector: "rs-common-dialog",
                    template: "<div class=\"dialog\" [ngClass]=\"size\" [ngStyle]=\"dialogStyle\">\r\n  <!-- \u5934\u90E8 -->\r\n  <div *ngIf=\"!hideHeader\" mat-dialog-title class=\"dialog__header\">\r\n    <ng-container *ngIf=\"customPageTitle; else defaultTitle\">\r\n      <ng-content select=\"[titleSlot]\"></ng-content>\r\n    </ng-container>\r\n    <ng-template #defaultTitle>\r\n      <div class=\"header__title\">\r\n        <img\r\n          src=\"../../../assets/img/notification-status-warning.svg\"\r\n          alt=\"\"\r\n          *ngIf=\"showErrorIcon\"\r\n        />\r\n        {{ title }}\r\n      </div>\r\n    </ng-template>\r\n    <!-- <div class=\"header__title\">\r\n      <img\r\n        src=\"../../../assets/img/notification-status-warning.svg\"\r\n        alt=\"\"\r\n        *ngIf=\"showErrorIcon\"\r\n      />\r\n      {{ title }}\r\n      <ng-content select=\"[titleSlot]\"></ng-content>\r\n    </div> -->\r\n    <div class=\"header__actions\">\r\n      <div *ngIf=\"showZoomBtn\" class=\"header-btn\" (click)=\"onZoom()\">\r\n        <img\r\n          class=\"header-icon\"\r\n          *ngIf=\"size === 'largest'\"\r\n          src=\"../../../assets/img/dialog-shrink.svg\"\r\n        />\r\n        <img\r\n          class=\"header-icon\"\r\n          *ngIf=\"size !== 'largest'\"\r\n          src=\"../../../assets/img/dialog-grow.svg\"\r\n        />\r\n      </div>\r\n      <div *ngIf=\"!hideCloseIcon\" class=\"header-btn\" (click)=\"onClose()\">\r\n        <img class=\"header-icon\" src=\"../../../assets/img/dialog-close.svg\" />\r\n      </div>\r\n    </div>\r\n  </div>\r\n  <!-- \u5185\u5BB9 -->\r\n  <div class=\"dialog__content\" mat-dialog-content>\r\n    <ng-content></ng-content>\r\n  </div>\r\n  <!-- \u5E95\u90E8\u6309\u94AE -->\r\n  <div mat-dialog-actions class=\"dialog__footer\">\r\n    <ng-content select=\"[footerSlot]\"></ng-content>\r\n    <!-- \u9ED8\u8BA4\u5C55\u793A\u4FDD\u5B58/\u5173\u95ED\u6309\u94AE -->\r\n    <ng-container *ngIf=\"!customFooter\">\r\n      <ng-template [ngTemplateOutlet]=\"defaultTemplate\"></ng-template>\r\n    </ng-container>\r\n    <ng-template #defaultTemplate>\r\n      <button *ngIf=\"!hideCloseBtn\" class=\"e-btn\" (click)=\"onClose()\">\r\n        {{ cancelBtnLabel }}\r\n      </button>\r\n      <button *ngIf=\"!hideDiscardBtn\" class=\"e-btn\" (click)=\"onDiscard()\">\r\n        {{ discardBtnLabel }}\r\n      </button>\r\n      <button *ngIf=\"!hideSaveBtn\" class=\"e-btn e-primary\" (click)=\"onSave()\">\r\n        {{ saveBtnLabel }}\r\n      </button>\r\n    </ng-template>\r\n  </div>\r\n  <!-- loading -->\r\n  <div class=\"dialog__loading\" [hidden]=\"!loading\">\r\n    <img src=\"../../../assets/img/raise_loading.gif\" alt=\"\" />\r\n  </div>\r\n</div>\r\n",
                    styles: [":host::ng-deep .dialog{position:relative;max-height:90vh;font-weight:400;padding:20px;overflow:hidden;display:flex;flex-direction:column}:host::ng-deep .dialog.largest{width:96vw!important;height:88vh!important;max-width:2100px;padding:20px}:host::ng-deep .dialog.medium{width:500px;padding:20px}:host::ng-deep .dialog.small{width:350px;padding:20px 16px}:host::ng-deep .dialog.small .dialog__header{color:#002c4f;margin-bottom:16px}:host::ng-deep .dialog.small .dialog__header .header__title{font-size:13px;line-height:16px}:host::ng-deep .dialog.small .dialog__content{font-size:12px;line-height:16px}:host::ng-deep .dialog.small .dialog__footer{min-height:42px;padding:16px 0 0;font-size:12px;line-height:14px}:host::ng-deep .dialog.small .dialog__footer button{padding:6px 12px;min-width:60px}:host::ng-deep .dialog.large{width:800px;padding:20px}:host::ng-deep .dialog .dialog__header{width:100%;display:flex;justify-content:space-between;align-items:center;padding:0}:host::ng-deep .dialog .dialog__header::before{display:none}:host::ng-deep .dialog .dialog__header .header__title{color:#002c4f;font-family:Arial;font-size:15px;font-weight:700;line-height:18px;flex:1;overflow:hidden;display:flex;align-items:center;gap:8px}:host::ng-deep .dialog .dialog__header .header__actions{display:flex;align-items:center;gap:20px}:host::ng-deep .dialog .dialog__header .header-icon{display:block}:host::ng-deep .dialog .dialog__header .header-btn{cursor:pointer;padding:2px;display:flex;justify-content:center;align-items:center}:host::ng-deep .dialog .dialog__content{width:100%;min-height:38px;position:relative;overflow-y:auto;overflow-x:hidden;margin:0;padding:0;font-size:13px;line-height:19px;flex:1;height:0}:host::ng-deep .dialog .dialog__footer{position:relative;display:flex;align-items:center;justify-content:flex-end;gap:12px;padding:20px 0 0;font-size:13px;line-height:16px;margin-bottom:0}:host::ng-deep .dialog .dialog__loading{height:100%;background:0 0;position:fixed;top:0;left:0;right:0;bottom:0;z-index:9999}:host::ng-deep .dialog .dialog__loading img{position:absolute;left:50%;top:50%;width:40px;height:40px;transform:translate(-50%,-50%)}"]
                }] }
    ];
    /** @nocollapse */
    CommonDialogComponent.ctorParameters = function () { return [
        { type: MatDialogRef }
    ]; };
    CommonDialogComponent.propDecorators = {
        hideHeader: [{ type: Input }],
        hideCloseIcon: [{ type: Input }],
        hideCloseBtn: [{ type: Input }],
        hideSaveBtn: [{ type: Input }],
        hideDiscardBtn: [{ type: Input }],
        saveBtnLabel: [{ type: Input }],
        cancelBtnLabel: [{ type: Input }],
        discardBtnLabel: [{ type: Input }],
        showErrorIcon: [{ type: Input }],
        showZoomBtn: [{ type: Input }],
        customSave: [{ type: Input }],
        customPageTitle: [{ type: Input }],
        onCloseRequest: [{ type: Input }],
        dialogStyle: [{ type: Input }],
        size: [{ type: Input }],
        title: [{ type: Input }],
        loading: [{ type: Input }],
        saveEmit: [{ type: Output }],
        closeEmit: [{ type: Output }],
        footerContent: [{ type: ContentChild, args: ["footerSlot", { static: false },] }]
    };
    return CommonDialogComponent;
}());
export { CommonDialogComponent };
if (false) {
    /** @type {?} */
    CommonDialogComponent.prototype.translation;
    /** @type {?} */
    CommonDialogComponent.prototype.hideHeader;
    /** @type {?} */
    CommonDialogComponent.prototype.hideCloseIcon;
    /** @type {?} */
    CommonDialogComponent.prototype.hideCloseBtn;
    /** @type {?} */
    CommonDialogComponent.prototype.hideSaveBtn;
    /** @type {?} */
    CommonDialogComponent.prototype.hideDiscardBtn;
    /** @type {?} */
    CommonDialogComponent.prototype.saveBtnLabel;
    /** @type {?} */
    CommonDialogComponent.prototype.cancelBtnLabel;
    /** @type {?} */
    CommonDialogComponent.prototype.discardBtnLabel;
    /** @type {?} */
    CommonDialogComponent.prototype.showErrorIcon;
    /** @type {?} */
    CommonDialogComponent.prototype.showZoomBtn;
    /** @type {?} */
    CommonDialogComponent.prototype.customSave;
    /** @type {?} */
    CommonDialogComponent.prototype.customPageTitle;
    /** @type {?} */
    CommonDialogComponent.prototype.onCloseRequest;
    /** @type {?} */
    CommonDialogComponent.prototype.dialogStyle;
    /** @type {?} */
    CommonDialogComponent.prototype.size;
    /** @type {?} */
    CommonDialogComponent.prototype.title;
    /** @type {?} */
    CommonDialogComponent.prototype.loading;
    /** @type {?} */
    CommonDialogComponent.prototype.saveEmit;
    /** @type {?} */
    CommonDialogComponent.prototype.closeEmit;
    /** @type {?} */
    CommonDialogComponent.prototype.defaultSize;
    /** @type {?} */
    CommonDialogComponent.prototype.footerContent;
    /** @type {?} */
    CommonDialogComponent.prototype.customFooter;
    /** @type {?} */
    CommonDialogComponent.prototype.dialogRef;
}
//# sourceMappingURL=data:application/json;base64, 