import * as tslib_1 from "tslib";
/* tslint:disable:no-access-missing-member */
import { Component, Input, Output, EventEmitter, ViewEncapsulation, ChangeDetectionStrategy } from '@angular/core';
import { OnChange } from '../core/decorators';
import { slideAnimation } from '../core/animation/slide-animations';
import { OverlayComponent } from '../overlay';
var DialogComponent = /** @class */ (function (_super) {
    tslib_1.__extends(DialogComponent, _super);
    function DialogComponent() {
        var _this = _super !== null && _super.apply(this, arguments) || this;
        /**
         * 是否为模态对话框
         * @default false
         */
        _this.modalable = false;
        /**
         * 是否有关闭功能
         * @default true
         */
        _this.closable = true;
        /**
         * 点击对话框的确认按钮时事件 emit
         */
        _this.confirmEvent = new EventEmitter();
        return _this;
    }
    /**
     * 覆盖overlay的OnInit方法，不响应document click事件
     */
    DialogComponent.prototype.ngOnInit = function () {
    };
    /**
     * Dialog确定按钮的点击响应
     */
    DialogComponent.prototype.confirm = function () {
        this.confirmEvent.emit();
        this.hide();
    };
    tslib_1.__decorate([
        OnChange(true),
        Input(),
        tslib_1.__metadata("design:type", Boolean)
    ], DialogComponent.prototype, "modalable", void 0);
    tslib_1.__decorate([
        OnChange(true),
        Input(),
        tslib_1.__metadata("design:type", Boolean)
    ], DialogComponent.prototype, "closable", void 0);
    tslib_1.__decorate([
        Output(),
        tslib_1.__metadata("design:type", EventEmitter)
    ], DialogComponent.prototype, "confirmEvent", void 0);
    DialogComponent = tslib_1.__decorate([
        Component({
            selector: 'nb-dialog',
            exportAs: 'nbDialog',
            template: "<div class=\"nb-dialog-box\" [class.invisible]=\"!visibility\"><div class=\"nb-dialog-mask\" *ngIf=\"modalable\"></div><div class=\"nb-dialog\" [@slideAnimation]=\"visibility\"><div class=\"nb-dialog-header-wrapper\"><h4 class=\"nb-dialog-header-title\"><ng-content select=\"nb-dialog-header\"></ng-content></h4><a href=\"javascript:void(0)\" class=\"nb-dialog-header-close\" *ngIf=\"closable\" (click)=\"hide()\"><i class=\"iconfont icon-close\"></i></a></div><div class=\"nb-dialog-body\"><ng-content select=\"nb-dialog-body\"></ng-content></div><div class=\"nb-dialog-footer\"><div #ref><ng-content select=\"nb-dialog-footer\"></ng-content></div><ng-container *ngIf=\"ref.children.length == 0\"><button nb-button class=\"nb-dialog-footer-control-button\" (click)=\"confirm()\">确定</button> <button nb-button class=\"nb-dialog-footer-control-button\" (click)=\"hide()\" theme=\"default\">取消</button></ng-container></div></div></div>",
            encapsulation: ViewEncapsulation.None,
            changeDetection: ChangeDetectionStrategy.OnPush,
            preserveWhitespaces: false,
            animations: [slideAnimation],
            host: {
                'class': 'nb-widget'
            }
        })
    ], DialogComponent);
    return DialogComponent;
}(OverlayComponent));
export { DialogComponent };
//# sourceMappingURL=dialog.js.map