// © 2022 SolarWinds Worldwide, LLC. All rights reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
//  of this software and associated documentation files (the "Software"), to
//  deal in the Software without restriction, including without limitation the
//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
//  sell copies of the Software, and to permit persons to whom the Software is
//  furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
//  all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
//  THE SOFTWARE.
import { ChangeDetectorRef, Component, ElementRef, forwardRef, Input, Optional, ViewChild, ViewEncapsulation, } from "@angular/core";
import { MenuGroupComponent } from "../menu-group/menu-group.component";
import { MenuItemBaseComponent } from "../menu-item/menu-item-base";
import * as i0 from "@angular/core";
import * as i1 from "../menu-group/menu-group.component";
import * as i2 from "@angular/common";
import * as i3 from "../../../icon/icon.component";
/**
 * @ignore
 */
/**
 * Represents menu link item of nui-menu component with additional bindings and style
 */
export class MenuLinkComponent extends MenuItemBaseComponent {
    constructor(group, cd) {
        super(group, cd);
        this.group = group;
        /**
         * Sets inner "target" attribute of anchor tag
         */
        this.target = "";
        this.disabled = false;
    }
    handleClick(event) {
        if (this.disabled) {
            event.preventDefault();
            event.stopPropagation();
        }
        this.actionDone.emit();
    }
    doAction() {
        this.menuItem.nativeElement.click();
        this.actionDone.emit();
    }
}
MenuLinkComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: MenuLinkComponent, deps: [{ token: i1.MenuGroupComponent, optional: true }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
MenuLinkComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1.5", type: MenuLinkComponent, selector: "nui-menu-link", inputs: { url: "url", target: "target", icon: "icon" }, host: { attributes: { "role": "menuitem" } }, providers: [
        {
            provide: MenuItemBaseComponent,
            useExisting: forwardRef(() => MenuLinkComponent),
        },
    ], viewQueries: [{ propertyName: "menuItem", first: true, predicate: ["menuLink"], descendants: true }], usesInheritance: true, ngImport: i0, template: `
        <a
            class="nui-menu-item__link"
            role="link"
            [href]="url"
            [target]="target"
            (click)="handleClick($event)"
            #menuLink
            title
        >
            <nui-icon *ngIf="icon" [icon]="icon"></nui-icon>
            <ng-content></ng-content>
        </a>
    `, isInline: true, styles: [".nui-menu .nui-menu-item .nui-menu-item__link,.nui-menu-popup-host .nui-menu-item .nui-menu-item__link,.nui-menu-popup .nui-menu-item .nui-menu-item__link{line-height:18px}.nui-menu .nui-menu-item.nui-menu-item--disabled>.nui-menu-item__link,.nui-menu-popup-host .nui-menu-item.nui-menu-item--disabled>.nui-menu-item__link,.nui-menu-popup .nui-menu-item.nui-menu-item--disabled>.nui-menu-item__link{color:var(--nui-color-off,#4d4d4d)}.nui-menu .nui-menu-item.nui-menu-item--disabled>.nui-menu-item__link:focus,.nui-menu-popup-host .nui-menu-item.nui-menu-item--disabled>.nui-menu-item__link:focus,.nui-menu-popup .nui-menu-item.nui-menu-item--disabled>.nui-menu-item__link:focus{outline:0}.nui-menu .nui-menu-item.nui-menu-item--disabled>.nui-menu-item__link:hover,.nui-menu-popup-host .nui-menu-item.nui-menu-item--disabled>.nui-menu-item__link:hover,.nui-menu-popup .nui-menu-item.nui-menu-item--disabled>.nui-menu-item__link:hover{cursor:not-allowed}\n"], dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i3.IconComponent, selector: "nui-icon", inputs: ["iconColor", "brushType", "iconHoverColor", "iconSize", "cssClass", "fillContainer", "status", "childStatus", "icon", "counter"] }], encapsulation: i0.ViewEncapsulation.None });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: MenuLinkComponent, decorators: [{
            type: Component,
            args: [{ selector: "nui-menu-link", template: `
        <a
            class="nui-menu-item__link"
            role="link"
            [href]="url"
            [target]="target"
            (click)="handleClick($event)"
            #menuLink
            title
        >
            <nui-icon *ngIf="icon" [icon]="icon"></nui-icon>
            <ng-content></ng-content>
        </a>
    `, providers: [
                        {
                            provide: MenuItemBaseComponent,
                            useExisting: forwardRef(() => MenuLinkComponent),
                        },
                    ], encapsulation: ViewEncapsulation.None, host: { role: "menuitem" }, styles: [".nui-menu .nui-menu-item .nui-menu-item__link,.nui-menu-popup-host .nui-menu-item .nui-menu-item__link,.nui-menu-popup .nui-menu-item .nui-menu-item__link{line-height:18px}.nui-menu .nui-menu-item.nui-menu-item--disabled>.nui-menu-item__link,.nui-menu-popup-host .nui-menu-item.nui-menu-item--disabled>.nui-menu-item__link,.nui-menu-popup .nui-menu-item.nui-menu-item--disabled>.nui-menu-item__link{color:var(--nui-color-off,#4d4d4d)}.nui-menu .nui-menu-item.nui-menu-item--disabled>.nui-menu-item__link:focus,.nui-menu-popup-host .nui-menu-item.nui-menu-item--disabled>.nui-menu-item__link:focus,.nui-menu-popup .nui-menu-item.nui-menu-item--disabled>.nui-menu-item__link:focus{outline:0}.nui-menu .nui-menu-item.nui-menu-item--disabled>.nui-menu-item__link:hover,.nui-menu-popup-host .nui-menu-item.nui-menu-item--disabled>.nui-menu-item__link:hover,.nui-menu-popup .nui-menu-item.nui-menu-item--disabled>.nui-menu-item__link:hover{cursor:not-allowed}\n"] }]
        }], ctorParameters: function () { return [{ type: i1.MenuGroupComponent, decorators: [{
                    type: Optional
                }] }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { url: [{
                type: Input
            }], target: [{
                type: Input
            }], icon: [{
                type: Input
            }], menuItem: [{
                type: ViewChild,
                args: ["menuLink"]
            }] } });
//# sourceMappingURL=data:application/json;base64, 