// © 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, Optional, ViewChild, ViewEncapsulation, } from "@angular/core";
import { MenuGroupComponent } from "../menu-group/menu-group.component";
import { MenuItemBaseComponent } from "./menu-item-base";
import * as i0 from "@angular/core";
import * as i1 from "../menu-group/menu-group.component";
/**
 * @ignore
 */
/**
 * Represents default menu item if type of menu-item is not set.
 */
export class MenuItemComponent extends MenuItemBaseComponent {
    constructor(group, cd) {
        super(group, cd);
        this.group = group;
        this.disabled = false;
    }
    handleClick(event) {
        event.preventDefault();
        if (this.disabled) {
            event.stopPropagation();
        }
        this.actionDone.emit();
    }
    doAction(event) {
        this.handleClick(event);
    }
}
MenuItemComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: MenuItemComponent, deps: [{ token: i1.MenuGroupComponent, optional: true }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
MenuItemComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: MenuItemComponent, selector: "nui-menu-item", host: { attributes: { "role": "menuitem" } }, providers: [
        {
            provide: MenuItemBaseComponent,
            useExisting: forwardRef(() => MenuItemComponent),
        },
    ], viewQueries: [{ propertyName: "menuItem", first: true, predicate: ["menuItemDefault"], descendants: true }], usesInheritance: true, ngImport: i0, template: `
        <span
            class="nui-menu-item__default"
            (click)="handleClick($event)"
            #menuItemDefault
            tabIndex="-1"
        >
            <ng-content></ng-content>
        </span>
    `, isInline: true, styles: [".nui-menu-item{display:list-item;list-style-type:none;white-space:nowrap;margin-bottom:1px;font-size:13px;background-color:var(--nui-color-bg-transparent,transparent)}.nui-menu-item:not(.nui-menu-item--header){min-height:30px}.nui-menu-item .nui-icon{margin-right:5px}.nui-menu-item:not(.nui-menu-item--header):hover{background-color:var(--nui-color-bg-transparent-hover,rgba(17, 17, 17, .05))}.nui-menu-item:not(.nui-menu-item--header):hover .nui-checkbox__label{background-color:var(--transparent,transparent)}.nui-menu-item.nui-menu-item--header{padding:5px 10px;text-transform:uppercase;cursor:default;font-size:11px;color:var(--nui-color-text-secondary,rgba(17, 17, 17, .6));line-height:14px}.nui-menu-item.nui-menu-item__default,.nui-menu-item .nui-checkbox__transclude,.nui-menu-item>.nui-menu-item__link,.nui-menu-item>.nui-menu-item__switch,.nui-menu-item>.nui-menu-item__option{overflow:hidden;text-overflow:ellipsis}.nui-menu-item>.nui-menu-item__link,.nui-menu-item>.nui-menu-item__switch,.nui-menu-item>.nui-menu-item__option,.nui-menu-item>.nui-menu-item__default{display:flex;align-items:center;padding:5px 10px;text-decoration:none}.nui-menu-item>.nui-menu-item__link:active,.nui-menu-item>.nui-menu-item__switch:active,.nui-menu-item>.nui-menu-item__option:active,.nui-menu-item>.nui-menu-item__default:active,.nui-menu-item>.nui-menu-item__link:focus,.nui-menu-item>.nui-menu-item__switch:focus,.nui-menu-item>.nui-menu-item__option:focus,.nui-menu-item>.nui-menu-item__default:focus{outline:none;z-index:500;box-shadow:inset 0 0 0 2px #00c4d280}.nui-menu-item.checked{background-color:var(--nui-color-selected,rgba(0, 196, 210, .1));font-weight:600}.nui-menu-item.checked:hover{background-color:var(--nui-color-selected-hover,rgba(0, 196, 210, .2));font-weight:600;cursor:pointer}.nui-menu-item .nui-menu-item__default{padding:5px 10px;cursor:pointer;color:var(--nui-color-text-default,#111)}.nui-menu-item .nui-menu-item__default:hover{color:var(--nui-color-text-default-hover,#000000)}.nui-menu-item--active{background-color:var(--nui-color-bg-light-hover,#f2f2f2);outline:none;z-index:500;box-shadow:inset 0 0 0 2px #00c4d280}.nui-menu-item--active.nui-menu-item--selected,.nui-menu-item--active.nui-menu-item.checked{background-color:var(--nui-color-selected-hover,rgba(0, 196, 210, .2))}.nui-menu-item.nui-menu-item--selected{background-color:var(--nui-color-selected,rgba(0, 196, 210, .1));font-weight:600}.nui-menu-item.nui-menu-item--selected:hover{background-color:var(--nui-color-selected-hover,rgba(0, 196, 210, .2))}\n"], encapsulation: i0.ViewEncapsulation.None });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: MenuItemComponent, decorators: [{
            type: Component,
            args: [{ selector: "nui-menu-item", template: `
        <span
            class="nui-menu-item__default"
            (click)="handleClick($event)"
            #menuItemDefault
            tabIndex="-1"
        >
            <ng-content></ng-content>
        </span>
    `, providers: [
                        {
                            provide: MenuItemBaseComponent,
                            useExisting: forwardRef(() => MenuItemComponent),
                        },
                    ], encapsulation: ViewEncapsulation.None, host: { role: "menuitem" }, styles: [".nui-menu-item{display:list-item;list-style-type:none;white-space:nowrap;margin-bottom:1px;font-size:13px;background-color:var(--nui-color-bg-transparent,transparent)}.nui-menu-item:not(.nui-menu-item--header){min-height:30px}.nui-menu-item .nui-icon{margin-right:5px}.nui-menu-item:not(.nui-menu-item--header):hover{background-color:var(--nui-color-bg-transparent-hover,rgba(17, 17, 17, .05))}.nui-menu-item:not(.nui-menu-item--header):hover .nui-checkbox__label{background-color:var(--transparent,transparent)}.nui-menu-item.nui-menu-item--header{padding:5px 10px;text-transform:uppercase;cursor:default;font-size:11px;color:var(--nui-color-text-secondary,rgba(17, 17, 17, .6));line-height:14px}.nui-menu-item.nui-menu-item__default,.nui-menu-item .nui-checkbox__transclude,.nui-menu-item>.nui-menu-item__link,.nui-menu-item>.nui-menu-item__switch,.nui-menu-item>.nui-menu-item__option{overflow:hidden;text-overflow:ellipsis}.nui-menu-item>.nui-menu-item__link,.nui-menu-item>.nui-menu-item__switch,.nui-menu-item>.nui-menu-item__option,.nui-menu-item>.nui-menu-item__default{display:flex;align-items:center;padding:5px 10px;text-decoration:none}.nui-menu-item>.nui-menu-item__link:active,.nui-menu-item>.nui-menu-item__switch:active,.nui-menu-item>.nui-menu-item__option:active,.nui-menu-item>.nui-menu-item__default:active,.nui-menu-item>.nui-menu-item__link:focus,.nui-menu-item>.nui-menu-item__switch:focus,.nui-menu-item>.nui-menu-item__option:focus,.nui-menu-item>.nui-menu-item__default:focus{outline:none;z-index:500;box-shadow:inset 0 0 0 2px #00c4d280}.nui-menu-item.checked{background-color:var(--nui-color-selected,rgba(0, 196, 210, .1));font-weight:600}.nui-menu-item.checked:hover{background-color:var(--nui-color-selected-hover,rgba(0, 196, 210, .2));font-weight:600;cursor:pointer}.nui-menu-item .nui-menu-item__default{padding:5px 10px;cursor:pointer;color:var(--nui-color-text-default,#111)}.nui-menu-item .nui-menu-item__default:hover{color:var(--nui-color-text-default-hover,#000000)}.nui-menu-item--active{background-color:var(--nui-color-bg-light-hover,#f2f2f2);outline:none;z-index:500;box-shadow:inset 0 0 0 2px #00c4d280}.nui-menu-item--active.nui-menu-item--selected,.nui-menu-item--active.nui-menu-item.checked{background-color:var(--nui-color-selected-hover,rgba(0, 196, 210, .2))}.nui-menu-item.nui-menu-item--selected{background-color:var(--nui-color-selected,rgba(0, 196, 210, .1));font-weight:600}.nui-menu-item.nui-menu-item--selected:hover{background-color:var(--nui-color-selected-hover,rgba(0, 196, 210, .2))}\n"] }]
        }], ctorParameters: function () { return [{ type: i1.MenuGroupComponent, decorators: [{
                    type: Optional
                }] }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { menuItem: [{
                type: ViewChild,
                args: ["menuItemDefault"]
            }] } });
//# sourceMappingURL=data:application/json;base64, 