import { ChangeDetectionStrategy, Component, EventEmitter, Input, Output } from '@angular/core';
import * as i0 from "@angular/core";
import * as i1 from "../../evo-dropdown/evo-dropdown.component";
import * as i2 from "../../../directives/evo-let/evo-let.directive";
import * as i3 from "@angular/common";
import * as i4 from "../../evo-dropdown/evo-dropdown-origin.directive";
import * as i5 from "@angular/router";
export class EvoNavbarItemComponent {
    constructor() {
        this.subMenuPositions = [
            {
                originX: 'start',
                originY: 'bottom',
                overlayX: 'start',
                overlayY: 'top',
            },
        ];
        this.openSubMenu = new EventEmitter();
        this.closeSubMenu = new EventEmitter();
    }
    toggle(origin) {
        if (origin.isDropdownOpen) {
            this.closeSubMenu.emit(origin);
        }
        else {
            this.openSubMenu.emit(origin);
        }
    }
    open(origin) {
        if (!origin.isDropdownOpen) {
            this.openSubMenu.emit(origin);
        }
    }
    close(origin) {
        if (origin.isDropdownOpen) {
            this.closeSubMenu.emit(origin);
        }
    }
}
EvoNavbarItemComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: EvoNavbarItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
EvoNavbarItemComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.4.0", type: EvoNavbarItemComponent, selector: "evo-navbar-item", inputs: { item: "item", isNested: "isNested", isMobileView: "isMobileView", subMenuPositions: "subMenuPositions" }, outputs: { openSubMenu: "openSubMenu", closeSubMenu: "closeSubMenu" }, ngImport: i0, template: "<!-- TODO: delete $any alias after update to ng12-->\n<ng-container *evoLet=\"$any(item) as linkItem\">\n    <a\n        *ngIf=\"linkItem.href; else routerLink\"\n        #origin=\"evoDropdownOrigin\"\n        evoDropdownOrigin\n        class=\"evo-navbar__link evo-navbar__link_external\"\n        [attr.href]=\"linkItem.href\"\n        [attr.target]=\"linkItem.target\"\n        [class.evo-navbar__link_nested]=\"isNested\"\n        [class.evo-navbar__link_highlighted]=\"origin.isDropdownOpen\"\n        (mouseenter)=\"open(origin)\"\n        (mouseleave)=\"close(origin)\"\n    >\n        <span class=\"evo-navbar__link-title\">{{ linkItem.title }}</span>\n\n        <ng-container *ngTemplateOutlet=\"subNav; context: {origin: origin}\"></ng-container>\n    </a>\n\n    <ng-template #routerLink>\n        <ng-container *evoLet=\"isMobileView && !!linkItem.subItems?.length as isRootItemJustOpenSubMenu\">\n            <span\n                *ngIf=\"isRootItemJustOpenSubMenu; else defaultRootItem\"\n                #origin=\"evoDropdownOrigin\"\n                evoDropdownOrigin\n                class=\"evo-navbar__link\"\n                [class.evo-navbar__link_highlighted]=\"origin.isDropdownOpen\"\n                (click)=\"toggle(origin)\"\n                (mouseleave)=\"close(origin)\"\n            >\n                <span class=\"evo-navbar__link-title\">{{ linkItem.title }}</span>\n\n                <ng-container *ngTemplateOutlet=\"subNav; context: {origin: origin}\"></ng-container>\n            </span>\n\n            <ng-template #defaultRootItem>\n                <a\n                    #origin=\"evoDropdownOrigin\"\n                    evoDropdownOrigin\n                    class=\"evo-navbar__link\"\n                    [class.evo-navbar__link_nested]=\"isNested\"\n                    [class.evo-navbar__link_highlighted]=\"origin.isDropdownOpen\"\n                    [routerLink]=\"linkItem.routerLink\"\n                    [routerLinkActive]=\"isNested ? ['evo-navbar__link_active'] : []\"\n                    [routerLinkActiveOptions]=\"{exact: !!linkItem.isExactPath}\"\n                    [preserveFragment]=\"!!linkItem.preserveFragment\"\n                    [queryParamsHandling]=\"linkItem.queryParamsHandling\"\n                    [fragment]=\"linkItem.fragment\"\n                    [queryParams]=\"linkItem.queryParams\"\n                    [skipLocationChange]=\"linkItem.skipLocationChange\"\n                    [replaceUrl]=\"linkItem.replaceUrl\"\n                    [state]=\"linkItem.state\"\n                    (mouseenter)=\"open(origin)\"\n                    (mouseleave)=\"close(origin)\"\n                >\n                    <span class=\"evo-navbar__link-title\">{{ linkItem.title }}</span>\n\n                    <ng-container *ngTemplateOutlet=\"subNav; context: {origin: origin}\"></ng-container>\n                </a>\n            </ng-template>\n        </ng-container>\n    </ng-template>\n\n    <ng-template #subNav let-origin=\"origin\">\n        <evo-dropdown\n            *ngIf=\"linkItem.subItems?.length\"\n            [positions]=\"subMenuPositions\"\n            [dropdownOrigin]=\"origin\"\n            [(isOpen)]=\"origin.isDropdownOpen\"\n        >\n            <section\n                class=\"evo-navbar__sub\"\n                (mouseenter)=\"open(origin)\"\n                (mouseleave)=\"close(origin)\"\n            >\n                <div class=\"evo-navbar__sub-content\">\n                    <evo-navbar-item\n                        *ngFor=\"let subItem of linkItem.subItems\"\n                        [item]=\"subItem\"\n                        [isNested]=\"true\"\n                        [isMobileView]=\"isMobileView\"\n                        (click)=\"close(origin)\"\n                    ></evo-navbar-item>\n                </div>\n            </section>\n        </evo-dropdown>\n    </ng-template>\n</ng-container>\n", styles: [":host{display:block;flex-shrink:0}.evo-navbar__link{display:block;flex-shrink:0;padding:9px 8px;color:#212121;font-size:14px;line-height:22px;-webkit-user-select:none;user-select:none}@media (min-width: 768px){.evo-navbar__link:not(.evo-navbar__link_nested):hover .evo-navbar__link-title{background:#FFFFFF}}.evo-navbar__link_nested{padding:12px 16px}.evo-navbar__link_nested .evo-navbar__link-title{padding:0;font-weight:400;border-radius:0}.evo-navbar__link_nested:hover{background:#F4F6F8}.evo-navbar__link_nested.evo-navbar__link_active{color:#fff;background:#F05023}.evo-navbar__link_highlighted .evo-navbar__link-title{background:#FFFFFF}.evo-navbar__link-title{display:block;max-width:100%;padding:4px 8px;overflow:hidden;font-weight:600;white-space:nowrap;text-overflow:ellipsis;border-radius:4px}.evo-navbar__sub{--evo-navbar-dropdown-max-width: 85vw;--evo-navbar-dropdown-max-height: 310px;flex-shrink:0;max-width:85vw;max-width:var(--evo-navbar-dropdown-max-width)}.evo-navbar__sub-content{display:flex;flex-flow:column;max-height:310px;max-height:var(--evo-navbar-dropdown-max-height);margin-top:4px;overflow:auto;background:#FFFFFF;border-radius:8px;box-shadow:0 8px 10px #00000024,0 3px 14px #0000001f}\n"], components: [{ type: i1.EvoDropdownComponent, selector: "evo-dropdown", inputs: ["closeOnOutsideClick", "scrollStrategy", "dropdownOrigin", "isOpen", "positions"], outputs: ["isOpenChange", "outsideClick"] }, { type: EvoNavbarItemComponent, selector: "evo-navbar-item", inputs: ["item", "isNested", "isMobileView", "subMenuPositions"], outputs: ["openSubMenu", "closeSubMenu"] }], directives: [{ type: i2.EvoLetDirective, selector: "[evoLet]", inputs: ["evoLet"] }, { type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i4.EvoDropdownOriginDirective, selector: "[evoDropdownOrigin]", exportAs: ["evoDropdownOrigin"] }, { type: i3.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i5.RouterLinkWithHref, selector: "a[routerLink],area[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "preserveFragment", "skipLocationChange", "replaceUrl", "state", "relativeTo", "routerLink"] }, { type: i5.RouterLinkActive, selector: "[routerLinkActive]", inputs: ["routerLinkActiveOptions", "routerLinkActive"], outputs: ["isActiveChange"], exportAs: ["routerLinkActive"] }, { type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: EvoNavbarItemComponent, decorators: [{
            type: Component,
            args: [{ selector: 'evo-navbar-item', changeDetection: ChangeDetectionStrategy.OnPush, template: "<!-- TODO: delete $any alias after update to ng12-->\n<ng-container *evoLet=\"$any(item) as linkItem\">\n    <a\n        *ngIf=\"linkItem.href; else routerLink\"\n        #origin=\"evoDropdownOrigin\"\n        evoDropdownOrigin\n        class=\"evo-navbar__link evo-navbar__link_external\"\n        [attr.href]=\"linkItem.href\"\n        [attr.target]=\"linkItem.target\"\n        [class.evo-navbar__link_nested]=\"isNested\"\n        [class.evo-navbar__link_highlighted]=\"origin.isDropdownOpen\"\n        (mouseenter)=\"open(origin)\"\n        (mouseleave)=\"close(origin)\"\n    >\n        <span class=\"evo-navbar__link-title\">{{ linkItem.title }}</span>\n\n        <ng-container *ngTemplateOutlet=\"subNav; context: {origin: origin}\"></ng-container>\n    </a>\n\n    <ng-template #routerLink>\n        <ng-container *evoLet=\"isMobileView && !!linkItem.subItems?.length as isRootItemJustOpenSubMenu\">\n            <span\n                *ngIf=\"isRootItemJustOpenSubMenu; else defaultRootItem\"\n                #origin=\"evoDropdownOrigin\"\n                evoDropdownOrigin\n                class=\"evo-navbar__link\"\n                [class.evo-navbar__link_highlighted]=\"origin.isDropdownOpen\"\n                (click)=\"toggle(origin)\"\n                (mouseleave)=\"close(origin)\"\n            >\n                <span class=\"evo-navbar__link-title\">{{ linkItem.title }}</span>\n\n                <ng-container *ngTemplateOutlet=\"subNav; context: {origin: origin}\"></ng-container>\n            </span>\n\n            <ng-template #defaultRootItem>\n                <a\n                    #origin=\"evoDropdownOrigin\"\n                    evoDropdownOrigin\n                    class=\"evo-navbar__link\"\n                    [class.evo-navbar__link_nested]=\"isNested\"\n                    [class.evo-navbar__link_highlighted]=\"origin.isDropdownOpen\"\n                    [routerLink]=\"linkItem.routerLink\"\n                    [routerLinkActive]=\"isNested ? ['evo-navbar__link_active'] : []\"\n                    [routerLinkActiveOptions]=\"{exact: !!linkItem.isExactPath}\"\n                    [preserveFragment]=\"!!linkItem.preserveFragment\"\n                    [queryParamsHandling]=\"linkItem.queryParamsHandling\"\n                    [fragment]=\"linkItem.fragment\"\n                    [queryParams]=\"linkItem.queryParams\"\n                    [skipLocationChange]=\"linkItem.skipLocationChange\"\n                    [replaceUrl]=\"linkItem.replaceUrl\"\n                    [state]=\"linkItem.state\"\n                    (mouseenter)=\"open(origin)\"\n                    (mouseleave)=\"close(origin)\"\n                >\n                    <span class=\"evo-navbar__link-title\">{{ linkItem.title }}</span>\n\n                    <ng-container *ngTemplateOutlet=\"subNav; context: {origin: origin}\"></ng-container>\n                </a>\n            </ng-template>\n        </ng-container>\n    </ng-template>\n\n    <ng-template #subNav let-origin=\"origin\">\n        <evo-dropdown\n            *ngIf=\"linkItem.subItems?.length\"\n            [positions]=\"subMenuPositions\"\n            [dropdownOrigin]=\"origin\"\n            [(isOpen)]=\"origin.isDropdownOpen\"\n        >\n            <section\n                class=\"evo-navbar__sub\"\n                (mouseenter)=\"open(origin)\"\n                (mouseleave)=\"close(origin)\"\n            >\n                <div class=\"evo-navbar__sub-content\">\n                    <evo-navbar-item\n                        *ngFor=\"let subItem of linkItem.subItems\"\n                        [item]=\"subItem\"\n                        [isNested]=\"true\"\n                        [isMobileView]=\"isMobileView\"\n                        (click)=\"close(origin)\"\n                    ></evo-navbar-item>\n                </div>\n            </section>\n        </evo-dropdown>\n    </ng-template>\n</ng-container>\n", styles: [":host{display:block;flex-shrink:0}.evo-navbar__link{display:block;flex-shrink:0;padding:9px 8px;color:#212121;font-size:14px;line-height:22px;-webkit-user-select:none;user-select:none}@media (min-width: 768px){.evo-navbar__link:not(.evo-navbar__link_nested):hover .evo-navbar__link-title{background:#FFFFFF}}.evo-navbar__link_nested{padding:12px 16px}.evo-navbar__link_nested .evo-navbar__link-title{padding:0;font-weight:400;border-radius:0}.evo-navbar__link_nested:hover{background:#F4F6F8}.evo-navbar__link_nested.evo-navbar__link_active{color:#fff;background:#F05023}.evo-navbar__link_highlighted .evo-navbar__link-title{background:#FFFFFF}.evo-navbar__link-title{display:block;max-width:100%;padding:4px 8px;overflow:hidden;font-weight:600;white-space:nowrap;text-overflow:ellipsis;border-radius:4px}.evo-navbar__sub{--evo-navbar-dropdown-max-width: 85vw;--evo-navbar-dropdown-max-height: 310px;flex-shrink:0;max-width:85vw;max-width:var(--evo-navbar-dropdown-max-width)}.evo-navbar__sub-content{display:flex;flex-flow:column;max-height:310px;max-height:var(--evo-navbar-dropdown-max-height);margin-top:4px;overflow:auto;background:#FFFFFF;border-radius:8px;box-shadow:0 8px 10px #00000024,0 3px 14px #0000001f}\n"] }]
        }], propDecorators: { item: [{
                type: Input
            }], isNested: [{
                type: Input
            }], isMobileView: [{
                type: Input
            }], subMenuPositions: [{
                type: Input
            }], openSubMenu: [{
                type: Output
            }], closeSubMenu: [{
                type: Output
            }] } });
//# sourceMappingURL=data:application/json;base64, 