import { AXComponent } from '@acorex/cdk/common';
import { AXButtonComponent } from '@acorex/components/button';
import { AXDecoratorGenericComponent, AXDecoratorModule } from '@acorex/components/decorators';
import * as i0 from '@angular/core';
import { contentChildren, signal, afterNextRender, HostBinding, ViewEncapsulation, ChangeDetectionStrategy, Component, NgModule } from '@angular/core';

class AXToolBarComponent {
    constructor() {
        this.buttons = contentChildren(AXButtonComponent, ...(ngDevMode ? [{ debugName: "buttons", descendants: true }] : [{ descendants: true }]));
        this.decorators = contentChildren(AXDecoratorGenericComponent, ...(ngDevMode ? [{ debugName: "decorators" }] : []));
        this.prefixState = signal(false, ...(ngDevMode ? [{ debugName: "prefixState" }] : []));
        this.suffixState = signal(false, ...(ngDevMode ? [{ debugName: "suffixState" }] : []));
        this.contentState = signal(false, ...(ngDevMode ? [{ debugName: "contentState" }] : []));
        this.#init = afterNextRender(() => {
            this.decorators().forEach((item) => {
                switch (item.getHostElement().tagName) {
                    case 'AX-PREFIX':
                        this.prefixState.set(true);
                        break;
                    case 'AX-SUFFIX':
                        this.suffixState.set(true);
                        break;
                    case 'AX-CONTENT':
                        this.contentState.set(true);
                }
            });
            if (this.buttons().length > 0) {
                this.buttons().forEach((item) => {
                    item.look = 'blank';
                });
            }
        });
    }
    #init;
    get __hostClass() {
        return `ax-sm`;
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: AXToolBarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.3", type: AXToolBarComponent, isStandalone: true, selector: "ax-toolbar", host: { properties: { "class": "this.__hostClass" } }, providers: [{ provide: AXComponent, useExisting: AXToolBarComponent }], queries: [{ propertyName: "buttons", predicate: AXButtonComponent, descendants: true, isSignal: true }, { propertyName: "decorators", predicate: AXDecoratorGenericComponent, isSignal: true }], ngImport: i0, template: "<ng-content select=\"ax-prefix\"> </ng-content>\n@if (prefixState() && (contentState() || suffixState())) {\n  <ax-divider class=\"ax-start-toolbar-divider\"></ax-divider>\n}\n\n<ng-content select=\"ax-content\"></ng-content>\n\n@if (contentState() && suffixState()) {\n  <ax-divider class=\"ax-end-toolbar-divider\"></ax-divider>\n}\n\n<ng-content select=\"ax-suffix\"></ng-content>\n", styles: ["ax-toolbar{display:flex;align-items:center;flex-wrap:wrap;padding-block:.25rem;padding-inline:.5rem;width:100%}ax-toolbar>ax-divider{display:block;margin-inline:.5rem;width:1px;min-height:25px;background-color:rgba(var(--ax-sys-color-border-lightest-surface))}ax-toolbar>ax-suffix,ax-toolbar>ax-prefix,ax-toolbar>ax-content{display:flex;justify-content:space-between;align-items:center;min-height:100%;flex-wrap:wrap}ax-toolbar>ax-button,ax-toolbar>ax-select-box,ax-toolbar>ax-text-box,ax-toolbar>ax-number-box{margin-inline:.15rem}\n"], dependencies: [{ kind: "component", type: AXDecoratorGenericComponent, selector: "ax-footer, ax-header, ax-content, ax-divider, ax-form-hint, ax-prefix, ax-suffix, ax-text, ax-title, ax-subtitle, ax-placeholder, ax-overlay" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: AXToolBarComponent, decorators: [{
            type: Component,
            args: [{ selector: 'ax-toolbar', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, imports: [AXDecoratorGenericComponent], providers: [{ provide: AXComponent, useExisting: AXToolBarComponent }], template: "<ng-content select=\"ax-prefix\"> </ng-content>\n@if (prefixState() && (contentState() || suffixState())) {\n  <ax-divider class=\"ax-start-toolbar-divider\"></ax-divider>\n}\n\n<ng-content select=\"ax-content\"></ng-content>\n\n@if (contentState() && suffixState()) {\n  <ax-divider class=\"ax-end-toolbar-divider\"></ax-divider>\n}\n\n<ng-content select=\"ax-suffix\"></ng-content>\n", styles: ["ax-toolbar{display:flex;align-items:center;flex-wrap:wrap;padding-block:.25rem;padding-inline:.5rem;width:100%}ax-toolbar>ax-divider{display:block;margin-inline:.5rem;width:1px;min-height:25px;background-color:rgba(var(--ax-sys-color-border-lightest-surface))}ax-toolbar>ax-suffix,ax-toolbar>ax-prefix,ax-toolbar>ax-content{display:flex;justify-content:space-between;align-items:center;min-height:100%;flex-wrap:wrap}ax-toolbar>ax-button,ax-toolbar>ax-select-box,ax-toolbar>ax-text-box,ax-toolbar>ax-number-box{margin-inline:.15rem}\n"] }]
        }], propDecorators: { __hostClass: [{
                type: HostBinding,
                args: ['class']
            }] } });

const COMPONENT = [AXToolBarComponent];
const MODULES = [AXDecoratorModule];
class AXToolBarModule {
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: AXToolBarModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
    static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.3", ngImport: i0, type: AXToolBarModule, imports: [AXDecoratorModule, AXToolBarComponent], exports: [AXToolBarComponent] }); }
    static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: AXToolBarModule, imports: [MODULES, COMPONENT] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: AXToolBarModule, decorators: [{
            type: NgModule,
            args: [{
                    imports: [...MODULES, ...COMPONENT],
                    exports: [...COMPONENT],
                    providers: [],
                }]
        }] });

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

export { AXToolBarComponent, AXToolBarModule };
//# sourceMappingURL=acorex-components-toolbar.mjs.map
