import { ChangeDetectionStrategy, Component, EventEmitter, ViewChild } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { MatCheckboxModule } from '@angular/material/checkbox';
import { MatMenu, MatMenuModule } from '@angular/material/menu';
import { OTranslatePipe } from '../../../../pipes/o-translate.pipe';
import * as i0 from "@angular/core";
import * as i1 from "@angular/forms";
import * as i2 from "@angular/material/checkbox";
import * as i3 from "@angular/material/menu";
export class OTreeMenuComponent {
    constructor() {
        this.selectAllCheckbox = false;
        this.selectAllCheckboxVisible = false;
        this.onSelectCheckboxChange = new EventEmitter();
    }
    toggleShowCheckbox(event) {
        this.onSelectCheckboxChange.emit(event.checked);
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: OTreeMenuComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: OTreeMenuComponent, isStandalone: true, selector: "o-tree-menu", inputs: { selectAllCheckbox: ["select-all-checkbox", "selectAllCheckbox"], selectAllCheckboxVisible: ["select-all-checkbox-visible", "selectAllCheckboxVisible"] }, outputs: { onSelectCheckboxChange: "onSelectCheckboxChange" }, viewQueries: [{ propertyName: "matMenu", first: true, predicate: ["menu"], descendants: true, static: true }], ngImport: i0, template: "<mat-menu #menu=\"matMenu\" x-position=\"before\" class=\"o-tree-menu o-mat-menu\">\n  @if (selectAllCheckbox) {\n    <span mat-menu-item>\n      <mat-checkbox (change)=\"toggleShowCheckbox($event)\"  [(ngModel)]=\"selectAllCheckboxVisible\">\n        {{ 'TREE.BUTTONS.SELECT' | oTranslate }}\n      </mat-checkbox>\n    </span>\n  }\n</mat-menu>\n", dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: MatCheckboxModule }, { kind: "component", type: i2.MatCheckbox, selector: "mat-checkbox", inputs: ["aria-label", "aria-labelledby", "aria-describedby", "id", "required", "labelPosition", "name", "value", "disableRipple", "tabIndex", "color", "disabledInteractive", "checked", "disabled", "indeterminate"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }, { kind: "ngmodule", type: MatMenuModule }, { kind: "component", type: i3.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: i3.MatMenuItem, selector: "[mat-menu-item]", inputs: ["role", "disabled", "disableRipple"], exportAs: ["matMenuItem"] }, { kind: "pipe", type: OTranslatePipe, name: "oTranslate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: OTreeMenuComponent, decorators: [{
            type: Component,
            args: [{ standalone: true, imports: [FormsModule, MatCheckboxModule, MatMenuModule, OTranslatePipe], selector: 'o-tree-menu', changeDetection: ChangeDetectionStrategy.OnPush, inputs: [
                        'selectAllCheckbox: select-all-checkbox',
                        'selectAllCheckboxVisible: select-all-checkbox-visible',
                    ], outputs: [
                        'onSelectCheckboxChange'
                    ], template: "<mat-menu #menu=\"matMenu\" x-position=\"before\" class=\"o-tree-menu o-mat-menu\">\n  @if (selectAllCheckbox) {\n    <span mat-menu-item>\n      <mat-checkbox (change)=\"toggleShowCheckbox($event)\"  [(ngModel)]=\"selectAllCheckboxVisible\">\n        {{ 'TREE.BUTTONS.SELECT' | oTranslate }}\n      </mat-checkbox>\n    </span>\n  }\n</mat-menu>\n" }]
        }], propDecorators: { matMenu: [{
                type: ViewChild,
                args: ['menu', { static: true }]
            }] } });
//# sourceMapp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