import { CommonModule } from '@angular/common';
import { NgModule, Component, ChangeDetectionStrategy, HostBinding, ViewEncapsulation, Input } from '@angular/core';
import { MatMenuModule } from '@angular/material/menu';
import { consumeEvent } from '@eui/core';
import { EuiDropdownContentModule } from './components/eui-dropdown-content.component';
import { BaseDirective } from '../../base.directive';
import * as i0 from "@angular/core";
import * as i1 from "@angular/material/menu";
import * as i2 from "@angular/common";
function EuiDropdownComponent_div_4_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "div", 3);
    i0.ɵɵprojection(1, 1);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r1 = i0.ɵɵnextContext();
    i0.ɵɵstyleProp("min-width", ctx_r1.width);
} }
const _c0 = ["*", [["eui-dropdown-content"]]];
const _c1 = ["*", "eui-dropdown-content"];
export class EuiDropdownComponent extends BaseDirective {
    constructor() {
        super();
        this.e2eAttr = 'eui-dropdown';
        this.tabIndex = -1; // Skip it for tab navigation
        this.width = 'auto';
    }
    get cssClasses() {
        return [
            super.getCssClasses('eui-dropdown'),
        ].join(' ').trim();
    }
    onClicked(event) {
        consumeEvent(event);
    }
}
/** @nocollapse */ EuiDropdownComponent.ɵfac = function EuiDropdownComponent_Factory(t) { return new (t || EuiDropdownComponent)(); };
/** @nocollapse */ EuiDropdownComponent.ɵcmp = i0.ɵɵdefineComponent({ type: EuiDropdownComponent, selectors: [["eui-dropdown"]], hostVars: 2, hostBindings: function EuiDropdownComponent_HostBindings(rf, ctx) { if (rf & 2) {
        i0.ɵɵclassMap(ctx.cssClasses);
    } }, inputs: { e2eAttr: "e2eAttr", tabIndex: "tabIndex", width: "width" }, features: [i0.ɵɵInheritDefinitionFeature], ngContentSelectors: _c1, decls: 5, vars: 2, consts: [[3, "matMenuTriggerFor", "click"], ["dropdownContent", "matMenu"], ["class", "eui-dropdown-content-wrapper", 3, "min-width", 4, "ngIf"], [1, "eui-dropdown-content-wrapper"]], template: function EuiDropdownComponent_Template(rf, ctx) { if (rf & 1) {
        i0.ɵɵprojectionDef(_c0);
        i0.ɵɵelementStart(0, "div", 0);
        i0.ɵɵlistener("click", function EuiDropdownComponent_Template_div_click_0_listener($event) { return ctx.onClicked($event); });
        i0.ɵɵprojection(1);
        i0.ɵɵelementEnd();
        i0.ɵɵelementStart(2, "mat-menu", null, 1);
        i0.ɵɵtemplate(4, EuiDropdownComponent_div_4_Template, 2, 2, "div", 2);
        i0.ɵɵelementEnd();
    } if (rf & 2) {
        const _r0 = i0.ɵɵreference(3);
        i0.ɵɵproperty("matMenuTriggerFor", _r0);
        i0.ɵɵadvance(4);
        i0.ɵɵproperty("ngIf", !ctx._euiDisabled);
    } }, directives: [i1.MatMenuTrigger, i1._MatMenu, i2.NgIf], styles: [".eui-dropdown{display:inline-flex;position:relative}.eui-dropdown-content-wrapper{font-size:var(--eui-font-size);padding:0;width:auto}.eui-dropdown .mat-menu-trigger{cursor:pointer}.eui-dropdown--disabled,.eui-dropdown--disabled button,.eui-dropdown:disabled,.eui-dropdown:disabled button{pointer-events:none}"], encapsulation: 2, changeDetection: 0 });
/*@__PURE__*/ (function () { i0.ɵsetClassMetadata(EuiDropdownComponent, [{
        type: Component,
        args: [{
                selector: 'eui-dropdown',
                templateUrl: './eui-dropdown.component.html',
                styleUrls: ['./styles/_index.scss'],
                changeDetection: ChangeDetectionStrategy.OnPush,
                encapsulation: ViewEncapsulation.None,
            }]
    }], function () { return []; }, { e2eAttr: [{
            type: Input
        }], tabIndex: [{
            type: Input
        }], width: [{
            type: Input
        }], cssClasses: [{
            type: HostBinding,
            args: ['class']
        }] }); })();
/* ***************************************** */
/* MODULE EXPORT */
/* ***************************************** */
export class EuiDropdownModule {
}
/** @nocollapse */ EuiDropdownModule.ɵmod = i0.ɵɵdefineNgModule({ type: EuiDropdownModule });
/** @nocollapse */ EuiDropdownModule.ɵinj = i0.ɵɵdefineInjector({ factory: function EuiDropdownModule_Factory(t) { return new (t || EuiDropdownModule)(); }, imports: [[
            CommonModule,
            MatMenuModule,
            EuiDropdownContentModule,
        ], EuiDropdownContentModule] });
(function () { (typeof ngJitMode === "undefined" || ngJitMode) && i0.ɵɵsetNgModuleScope(EuiDropdownModule, { declarations: [EuiDropdownComponent], imports: [CommonModule,
        MatMenuModule,
        EuiDropdownContentModule], exports: [EuiDropdownComponent, EuiDropdownContentModule] }); })();
/*@__PURE__*/ (function () { i0.ɵsetClassMetadata(EuiDropdownModule, [{
        type: NgModule,
        args: [{
                imports: [
                    CommonModule,
                    MatMenuModule,
                    EuiDropdownContentModule,
                ],
                declarations: [
                    EuiDropdownComponent,
                ],
                exports: [
                    EuiDropdownComponent,
                    EuiDropdownContentModule,
                ],
            }]
    }], null, null); })();
//# sourceMappingURL=data:application/json;base64, 