import { ChangeDetectionStrategy, Component, input } from '@angular/core';
import { toSignal, toObservable } from '@angular/core/rxjs-interop';
import { AbstractDbxPresetFilterMenuDirective } from './filter.preset.directive';
import { dbxPresetFilterMenuButtonIconObservable, dbxPresetFilterMenuButtonTextObservable } from './filter.menu';
import { MatButtonModule } from '@angular/material/button';
import { MatMenuModule } from '@angular/material/menu';
import { MatIconModule } from '@angular/material/icon';
import { DbxAnchorComponent } from '../../router/layout/anchor/anchor.component';
import { NgClass } from '@angular/common';
import * as i0 from "@angular/core";
import * as i1 from "@angular/material/button";
import * as i2 from "@angular/material/menu";
import * as i3 from "@angular/material/icon";
/**
 * Displays a button and menu for filtering presets.
 */
export class DbxPresetFilterMenuComponent extends AbstractDbxPresetFilterMenuDirective {
    config = input({});
    config$ = toObservable(this.config);
    buttonText$ = dbxPresetFilterMenuButtonTextObservable(this.config$, this.selectedPreset$);
    buttonIcon$ = dbxPresetFilterMenuButtonIconObservable(this.config$, this.selectedPreset$);
    buttonTextSignal = toSignal(this.buttonText$);
    buttonIconSignal = toSignal(this.buttonIcon$);
    static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: DbxPresetFilterMenuComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
    static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.13", type: DbxPresetFilterMenuComponent, isStandalone: true, selector: "dbx-preset-filter-menu", inputs: { config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: false, transformFunction: null } }, usesInheritance: true, ngImport: i0, template: "<button mat-button [matMenuTriggerFor]=\"menu\" class=\"dbx-preset-filter-menu-button\" aria-label=\"open filter\">\n  @if (buttonIconSignal()) {\n    <mat-icon class=\"dbx-icon-spacer\">{{ buttonIconSignal() }}</mat-icon>\n  }\n  <span>{{ buttonTextSignal() }}</span>\n</button>\n<mat-menu #menu class=\"dbx-preset-filter-menu\">\n  @for (anchor of presetAnchorsSignal(); track $index) {\n    <dbx-anchor [anchor]=\"anchor\">\n      <button mat-menu-item [ngClass]=\"anchor.selected ? 'active' : ''\">\n        @if (anchor.icon) {\n          <mat-icon>{{ anchor.icon }}</mat-icon>\n        }\n        {{ anchor.title }}\n      </button>\n    </dbx-anchor>\n  }\n</mat-menu>\n", dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i1.MatButton, selector: "    button[mat-button], button[mat-raised-button], button[mat-flat-button],    button[mat-stroked-button]  ", exportAs: ["matButton"] }, { kind: "ngmodule", type: MatMenuModule }, { 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: "component", type: i2.MatMenuItem, selector: "[mat-menu-item]", inputs: ["role", "disabled", "disableRipple"], exportAs: ["matMenuItem"] }, { 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: "ngmodule", type: MatIconModule }, { kind: "component", type: i3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: DbxAnchorComponent, selector: "dbx-anchor, [dbx-anchor]", inputs: ["block"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: DbxPresetFilterMenuComponent, decorators: [{
            type: Component,
            args: [{ selector: 'dbx-preset-filter-menu', imports: [NgClass, MatButtonModule, MatMenuModule, MatIconModule, DbxAnchorComponent], changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, template: "<button mat-button [matMenuTriggerFor]=\"menu\" class=\"dbx-preset-filter-menu-button\" aria-label=\"open filter\">\n  @if (buttonIconSignal()) {\n    <mat-icon class=\"dbx-icon-spacer\">{{ buttonIconSignal() }}</mat-icon>\n  }\n  <span>{{ buttonTextSignal() }}</span>\n</button>\n<mat-menu #menu class=\"dbx-preset-filter-menu\">\n  @for (anchor of presetAnchorsSignal(); track $index) {\n    <dbx-anchor [anchor]=\"anchor\">\n      <button mat-menu-item [ngClass]=\"anchor.selected ? 'active' : ''\">\n        @if (anchor.icon) {\n          <mat-icon>{{ anchor.icon }}</mat-icon>\n        }\n        {{ anchor.title }}\n      </button>\n    </dbx-anchor>\n  }\n</mat-menu>\n" }]
        }] });
//# sourceMappingURL=data:application/json;base64, 