import { Component, Input } from '@angular/core';
import * as i0 from "@angular/core";
import * as i1 from "../avatar/avatar.service";
import * as i2 from "@angular/common";
import * as i3 from "../../controls/dropdown/dropdown.component";
import * as i4 from "../avatar/avatar.component";
export class AppBarComponent {
    constructor(avatarService) {
        this.avatarService = avatarService;
        this.userMenuItems = [];
        this.userMenuWidth = 0;
        this.userMenuMinWidth = 160;
        this.userMenuTabindex = 0;
        this.iconPath = '/assets/images/icon.svg';
        this.menuItems = [];
        this.userItem = [];
    }
    ngOnChanges() {
        if (this.user) {
            this.userItem[0] = { label: this.avatarService.getAvatarLabels(this.user).full || '', display: 'heading' };
        }
        else {
            this.userItem = [];
        }
        this.menuItems = [...this.userItem, ...this.userMenuItems];
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: AppBarComponent, deps: [{ token: i1.AvatarService }], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: AppBarComponent, selector: "ec-app-bar", inputs: { user: "user", userMenuItems: "userMenuItems", userMenuWidth: "userMenuWidth", userMenuMinWidth: "userMenuMinWidth", userMenuTabindex: "userMenuTabindex", iconPath: "iconPath" }, usesOnChanges: true, ngImport: i0, template: "<section class=\"logo-container\">\r\n  <img src=\"{{iconPath}}\"\r\n       alt=\"EnergyCAP Platform\">\r\n</section>\r\n\r\n<section class=\"title-container\">\r\n  <ng-content select=\".app-bar-title\"></ng-content>\r\n</section>\r\n\r\n<section class=\"actions-container\">\r\n  <ng-content select=\".app-bar-actions\"></ng-content>\r\n  <ec-dropdown id=\"AppBarUserMenu\"\r\n               *ngIf=\"userMenuItems.length; else avatar\"\r\n               [items]=\"menuItems\"\r\n               [buttonCustomTemplate]=\"avatar\"\r\n               [showArrow]=\"false\"\r\n               [menuWidth]=\"userMenuWidth\"\r\n               [menuMinWidth]=\"userMenuMinWidth\"\r\n               [tabindex]=\"userMenuTabindex\"></ec-dropdown>\r\n</section>\r\n\r\n<ng-template #avatar>\r\n  <ec-avatar [user]=\"user\"></ec-avatar>\r\n</ng-template>", styles: [":host{display:flex;height:3rem;align-items:center;width:100%;padding:0 .75rem 0 1rem;background-color:var(--ec-background-color);position:relative;z-index:var(--ec-z-index-navbar)}:host ::ng-deep .app-bar-actions{display:flex;align-items:center;justify-content:flex-end;margin-right:.25rem}section{flex:1 1}.logo-container img{width:2rem;height:2rem}.title-container{text-align:center}.actions-container{display:flex;justify-content:flex-end}#AppBarUserMenu ::ng-deep ec-button{--ec-border-radius: 50%}#AppBarUserMenu ::ng-deep ec-button.active>.ec-button-custom{background-color:transparent;border-color:var(--ec-color-primary-light)}#AppBarUserMenu ::ng-deep ec-button .ec-button-custom:focus{background-color:var(--ec-background-color)}\n"], dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i3.DropdownComponent, selector: "ec-dropdown", inputs: ["id", "autofocus", "status", "disabled", "label", "icon", "buttonType", "buttonAlignment", "buttonTitle", "tabindex", "showArrow", "items", "menuTemplateType", "menuTitle", "menuHeight", "menuWidth", "menuMinWidth", "menuPosition", "menuFooter", "popupFixed", "buttonCustomTemplate", "pending"], outputs: ["itemSelected", "popupOpened"] }, { kind: "component", type: i4.AvatarComponent, selector: "ec-avatar", inputs: ["user"] }] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: AppBarComponent, decorators: [{
            type: Component,
            args: [{ selector: 'ec-app-bar', template: "<section class=\"logo-container\">\r\n  <img src=\"{{iconPath}}\"\r\n       alt=\"EnergyCAP Platform\">\r\n</section>\r\n\r\n<section class=\"title-container\">\r\n  <ng-content select=\".app-bar-title\"></ng-content>\r\n</section>\r\n\r\n<section class=\"actions-container\">\r\n  <ng-content select=\".app-bar-actions\"></ng-content>\r\n  <ec-dropdown id=\"AppBarUserMenu\"\r\n               *ngIf=\"userMenuItems.length; else avatar\"\r\n               [items]=\"menuItems\"\r\n               [buttonCustomTemplate]=\"avatar\"\r\n               [showArrow]=\"false\"\r\n               [menuWidth]=\"userMenuWidth\"\r\n               [menuMinWidth]=\"userMenuMinWidth\"\r\n               [tabindex]=\"userMenuTabindex\"></ec-dropdown>\r\n</section>\r\n\r\n<ng-template #avatar>\r\n  <ec-avatar [user]=\"user\"></ec-avatar>\r\n</ng-template>", styles: [":host{display:flex;height:3rem;align-items:center;width:100%;padding:0 .75rem 0 1rem;background-color:var(--ec-background-color);position:relative;z-index:var(--ec-z-index-navbar)}:host ::ng-deep .app-bar-actions{display:flex;align-items:center;justify-content:flex-end;margin-right:.25rem}section{flex:1 1}.logo-container img{width:2rem;height:2rem}.title-container{text-align:center}.actions-container{display:flex;justify-content:flex-end}#AppBarUserMenu ::ng-deep ec-button{--ec-border-radius: 50%}#AppBarUserMenu ::ng-deep ec-button.active>.ec-button-custom{background-color:transparent;border-color:var(--ec-color-primary-light)}#AppBarUserMenu ::ng-deep ec-button .ec-button-custom:focus{background-color:var(--ec-background-color)}\n"] }]
        }], ctorParameters: () => [{ type: i1.AvatarService }], propDecorators: { user: [{
                type: Input
            }], userMenuItems: [{
                type: Input
            }], userMenuWidth: [{
                type: Input
            }], userMenuMinWidth: [{
                type: Input
            }], userMenuTabindex: [{
                type: Input
            }], iconPath: [{
                type: Input
            }] } });
//# sourceMappingURL=data:application/json;base64, 