import { __decorate, __metadata } from "tslib";
import { Component, Input, Output, EventEmitter, HostBinding } from '@angular/core';
var BannerComponent = /** @class */ (function () {
    function BannerComponent() {
        /** hidden hides the banner */
        this.hidden = false;
        /**The ID of the component, rendered into the HTML to make it more accessible to automation */
        this.id = '';
        /**The type of banner which is used to determine the styling */
        this.type = 'warning';
        /**Show an x to allow hiding the banner */
        this.showCloseBtn = false;
        /**Event to hide the banner */
        this.closed = new EventEmitter();
    }
    /** On close, explicitly hide the banner one time. If the input changes afterward then it can reappear*/
    BannerComponent.prototype.close = function () {
        this.hidden = true;
        this.closed.emit();
    };
    __decorate([
        HostBinding('hidden'),
        Input(),
        __metadata("design:type", Object)
    ], BannerComponent.prototype, "hidden", void 0);
    __decorate([
        Input(),
        __metadata("design:type", String)
    ], BannerComponent.prototype, "id", void 0);
    __decorate([
        Input(),
        __metadata("design:type", String)
    ], BannerComponent.prototype, "type", void 0);
    __decorate([
        Input(),
        __metadata("design:type", String)
    ], BannerComponent.prototype, "title", void 0);
    __decorate([
        Input(),
        __metadata("design:type", String)
    ], BannerComponent.prototype, "text", void 0);
    __decorate([
        Input(),
        __metadata("design:type", Array)
    ], BannerComponent.prototype, "list", void 0);
    __decorate([
        Input(),
        __metadata("design:type", Object)
    ], BannerComponent.prototype, "showCloseBtn", void 0);
    __decorate([
        Output(),
        __metadata("design:type", EventEmitter)
    ], BannerComponent.prototype, "closed", void 0);
    BannerComponent = __decorate([
        Component({
            selector: 'ec-banner',
            template: "<div class=\"banner {{type}}\">\r\n  <ec-button id=\"banner{{id}}_close\"\r\n             *ngIf=\"showCloseBtn\"\r\n             type=\"icon\"\r\n             icon=\"ec-icon-sm icon-action-cancel\"\r\n             (clicked)=\"close()\">\r\n  </ec-button>\r\n  <div class=\"banner-content\">\r\n    <p class=\"title mb-0\" *ngIf=\"title\">{{title}}</p>\r\n    <p class=\"text mb-0\" *ngIf=\"text\">{{text}}</p>\r\n\r\n    <ul class=\"list mb-0\" *ngIf=\"list?.length\">\r\n      <li *ngFor=\"let item of list\">{{item}}</li>\r\n    </ul>\r\n\r\n    <ng-content></ng-content>\r\n  </div>\r\n</div>\r\n",
            styles: ["@-webkit-keyframes spin{from{transform:rotate(0)}to{transform:rotate(1turn)}}@keyframes spin{from{transform:rotate(0)}to{transform:rotate(1turn)}}:host{color:rgba(26,26,35,.7);display:flex;font-size:.875rem;line-height:1.285714286}:host(.border-bottom-0) .banner{border-bottom:0}.banner{display:flex;flex-direction:column;flex:1 1;min-height:2.5rem;border-bottom:1px solid rgba(26,26,35,.08);position:relative;overflow-y:auto}.banner-content{padding:.5rem 1rem;flex:none;margin:auto 0}ec-button{position:absolute;top:.25rem;right:.25rem}ec-button+.banner-content{padding-right:2.5rem}.title{font-weight:700;line-height:1.428571429}.list{margin:0;padding-left:1rem}.text+.list{margin-top:1em}.info{background-color:#dae4e9}.warning{background-color:#fff8cc}.success{background-color:#dff0d8}.error{background-color:#ecc4c5}"]
        })
    ], BannerComponent);
    return BannerComponent;
}());
export { BannerComponent };
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYmFubmVyLmNvbXBvbmVudC5qcyIsInNvdXJjZVJvb3QiOiJuZzovL0BlbmVyZ3ljYXAvY29tcG9uZW50cy8iLCJzb3VyY2VzIjpbImxpYi9jb250cm9scy9iYW5uZXIvYmFubmVyLmNvbXBvbmVudC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUEsT0FBTyxFQUFFLFNBQVMsRUFBRSxLQUFLLEVBQUUsTUFBTSxFQUFFLFlBQVksRUFBRSxXQUFXLEVBQUUsTUFBTSxlQUFlLENBQUM7QUFRcEY7SUFBQTtRQUNFLDhCQUE4QjtRQUVkLFdBQU0sR0FBRyxLQUFLLENBQUM7UUFFL0IsOEZBQThGO1FBQzlFLE9BQUUsR0FBVyxFQUFFLENBQUM7UUFFaEMsK0RBQStEO1FBQy9DLFNBQUksR0FBZSxTQUFTLENBQUM7UUFXN0MsMENB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