import { Component, ContentChildren, Input, QueryList } from '@angular/core';
import { MatMenuItem } from '@angular/material/menu';
import * as i0 from "@angular/core";
import * as i1 from "@angular/common";
import * as i2 from "@angular/material/menu";
import * as i3 from "@aztrix/components/button";
import * as i4 from "@aztrix/icons";
export 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]
            }] } });
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibWVudS1idXR0b24uY29tcG9uZW50LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vbGlicy9jb21wb25lbnRzL21lbnUtYnV0dG9uL21lbnUtYnV0dG9uLmNvbXBvbmVudC50cyIsIi4uLy4uLy4uLy4uLy4uL2xpYnMvY29tcG9uZW50cy9tZW51LWJ1dHRvbi9tZW51LWJ1dHRvbi5jb21wb25lbnQuaHRtbCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUMsU0FBUyxFQUFFLGVBQWUsRUFBRSxLQUFLLEVBQUUsU0FBUyxFQUFDLE1BQU0sZUFBZSxDQUFDO0FBQzNFLE9BQU8sRUFBQyxXQUFXLEVBQUMsTUFBTSx3QkFBd0IsQ0FBQzs7Ozs7O0FBT25ELE1BQU0sT0FBTyxtQkFBbUI7SUFMaEM7UUFNVyxTQUFJLEdBQUcsZUFBZSxDQUFDO1FBQ3ZCLFlBQU8sR0FBRyxLQUFLLENBQUM7UUFDaEIsV0FBTSxHQUFHLEtBQUssQ0FBQztRQUNmLGFBQVEsR0FBRyxLQUFLLENBQUM7UUFDakIsZUFBVSxHQUFHLElBQUksQ0FBQztRQUNsQixjQUFTLEdBQUcsS0FBSyxDQUFDO1FBQ2xCLGNBQVMsR0FBRyxLQUFLLENBQUM7UUFHM0IsVUFBSyxHQUFHLEtBQUssQ0FBQztLQU9mO0lBSEMsSUFBSSxTQUFTO1FBQ1gsT0FBTyxJQUFJLENBQUMsU0FBUyxFQUFFLE1BQU0sSUFBSSxJQUFJLENBQUMsUUFBUSxDQUFDO0lBQ2pELENBQUM7K0dBaEJVLG1CQUFtQjttR0FBbkIsbUJBQW1CLGdRQVliLFdBQVcsNkJDcEI5QixrakJBc0JBOzs0RkRkYSx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