import * as i0 from '@angular/core';
import { Component, Input, ContentChildren, NgModule } from '@angular/core';
import * as i2 from '@angular/material/menu';
import { MatMenuItem, MatMenuModule } from '@angular/material/menu';
import * as i1 from '@angular/common';
import { CommonModule } from '@angular/common';
import * as i3 from '@aztrix/components/button';
import { ButtonModule } from '@aztrix/components/button';
import * as i4 from '@aztrix/icons';
import { IconsModule } from '@aztrix/icons';

class MenuButtonComponent {
    constructor() {
        this.icon = 'dots-vertical';
        this.outline = false;
        this.filled = false;
        this.hasItems = false;
        this.iconButton = true;
        this.fullWidth = false;
        this.bigButton = false;
        this._open = false;
    }
    get _hasItems() {
        return this.menuItems?.length || this.hasItems;
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: MenuButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: MenuButtonComponent, selector: "ax-menu-button", inputs: { icon: "icon", outline: "outline", filled: "filled", hasItems: "hasItems", iconButton: "iconButton", fullWidth: "fullWidth", bigButton: "bigButton", color: "color" }, queries: [{ propertyName: "menuItems", predicate: MatMenuItem }], ngImport: i0, template: "<mat-menu #menu=\"matMenu\">\n  <ng-content></ng-content>\n</mat-menu>\n\n<button\n  *ngIf=\"_hasItems\"\n  axButton\n  class=\"menu-button cy-menu\"\n  [icon-button]=\"iconButton\"\n  [fullWidth]=\"fullWidth\"\n  [ngClass]=\"{open: _open}\"\n  [outline]=\"outline\"\n  [filled]=\"filled\"\n  [bigButton]=\"bigButton\"\n  [color]=\"color\"\n  [matMenuTriggerFor]=\"menu\"\n  (menuOpened)=\"_open = true\"\n  (menuClosed)=\"_open = false\"\n>\n  <ax-icon class=\"icon\" [name]=\"icon\"></ax-icon>\n  <ng-content select=\".menu-label\"></ng-content>\n</button>\n", styles: [""], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i2.MatMenu, selector: "mat-menu", inputs: ["backdropClass", "aria-label", "aria-labelledby", "aria-describedby", "xPosition", "yPosition", "overlapTrigger", "hasBackdrop", "class", "classList"], outputs: ["closed", "close"], exportAs: ["matMenu"] }, { kind: "directive", type: i2.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", inputs: ["mat-menu-trigger-for", "matMenuTriggerFor", "matMenuTriggerData", "matMenuTriggerRestoreFocus"], outputs: ["menuOpened", "onMenuOpen", "menuClosed", "onMenuClose"], exportAs: ["matMenuTrigger"] }, { kind: "directive", type: i3.ButtonDirective, selector: "[axButton]", inputs: ["color", "labelHideMobile", "smallButton", "bigButton", "fullWidth", "filled", "outline", "icon-button", "hoverLabel", "hover", "lowercase", "disabled"] }, { kind: "component", type: i4.IconComponent, selector: "ax-icon", inputs: ["name", "inline"] }] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: MenuButtonComponent, decorators: [{
            type: Component,
            args: [{ selector: 'ax-menu-button', template: "<mat-menu #menu=\"matMenu\">\n  <ng-content></ng-content>\n</mat-menu>\n\n<button\n  *ngIf=\"_hasItems\"\n  axButton\n  class=\"menu-button cy-menu\"\n  [icon-button]=\"iconButton\"\n  [fullWidth]=\"fullWidth\"\n  [ngClass]=\"{open: _open}\"\n  [outline]=\"outline\"\n  [filled]=\"filled\"\n  [bigButton]=\"bigButton\"\n  [color]=\"color\"\n  [matMenuTriggerFor]=\"menu\"\n  (menuOpened)=\"_open = true\"\n  (menuClosed)=\"_open = false\"\n>\n  <ax-icon class=\"icon\" [name]=\"icon\"></ax-icon>\n  <ng-content select=\".menu-label\"></ng-content>\n</button>\n" }]
        }], propDecorators: { icon: [{
                type: Input
            }], outline: [{
                type: Input
            }], filled: [{
                type: Input
            }], hasItems: [{
                type: Input
            }], iconButton: [{
                type: Input
            }], fullWidth: [{
                type: Input
            }], bigButton: [{
                type: Input
            }], color: [{
                type: Input
            }], menuItems: [{
                type: ContentChildren,
                args: [MatMenuItem]
            }] } });

class MenuButtonModule {
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: MenuButtonModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
    static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.3.12", ngImport: i0, type: MenuButtonModule, declarations: [MenuButtonComponent], imports: [CommonModule, MatMenuModule, ButtonModule, IconsModule], exports: [MenuButtonComponent, MatMenuModule] }); }
    static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: MenuButtonModule, imports: [CommonModule, MatMenuModule, ButtonModule, IconsModule, MatMenuModule] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: MenuButtonModule, decorators: [{
            type: NgModule,
            args: [{
                    imports: [CommonModule, MatMenuModule, ButtonModule, IconsModule],
                    declarations: [MenuButtonComponent],
                    exports: [MenuButtonComponent, MatMenuModule],
                }]
        }] });

/**
 * Generated bundle index. Do not edit.
 */

export { MenuButtonComponent, MenuButtonModule };
//# sourceMappingURL=aztrix-components-menu-button.mjs.map
