import * as i1 from '@acorex/cdk/common';
import { MXInteractiveComponent, MXLookComponent, AXComponent, AXRippleDirective } from '@acorex/cdk/common';
import * as i0 from '@angular/core';
import { EventEmitter, HostListener, HostBinding, Output, Input, ViewEncapsulation, ChangeDetectionStrategy, Component, input, output, ContentChildren, NgModule } from '@angular/core';
import { classes } from 'polytype';

class AXBottomNavigationItemComponent extends classes(MXInteractiveComponent, MXLookComponent) {
    constructor() {
        super(...arguments);
        /**
         * Indicates if the item is currently active.
         */
        this.active = false;
        /**
         * Emitted when the item is clicked. Payload is the click event.
         */
        this.onClick = new EventEmitter();
    }
    get __hostClass() {
        return `${this.active ? 'ax-state-active' : ''} ${this.disabled ? 'ax-state-disabled' : ''} `;
    }
    handleClick(e) {
        if (this.disabled)
            return;
        const dataset = e.target.dataset;
        this.onClick.emit({
            component: this,
            htmlElement: this.getHostElement(),
            nativeEvent: e,
            data: { active: this.active, name: this.name, ...dataset },
            isUserInteraction: e.isTrusted,
        });
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AXBottomNavigationItemComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.15", type: AXBottomNavigationItemComponent, isStandalone: true, selector: "ax-bottom-navigation-item", inputs: { disabled: "disabled", tabIndex: "tabIndex", name: "name", active: "active" }, outputs: { disabledChange: "disabledChange", onFocus: "onFocus", onBlur: "onBlur", onClick: "onClick" }, host: { listeners: { "click": "handleClick($event)" }, properties: { "class": "this.__hostClass" } }, providers: [{ provide: AXComponent, useExisting: AXBottomNavigationItemComponent }], usesInheritance: true, hostDirectives: [{ directive: i1.AXRippleDirective }], ngImport: i0, template: "<ng-content select=\"ax-prefix, ax-icon\"></ng-content>\n<ng-content select=\"ax-text, ng-content, ng-container\"></ng-content>\n<ng-content select=\"ax-suffix\"></ng-content>\n", changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AXBottomNavigationItemComponent, decorators: [{
            type: Component,
            args: [{ selector: 'ax-bottom-navigation-item', inputs: ['disabled', 'tabIndex'], outputs: ['disabledChange', 'onFocus', 'onBlur'], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, hostDirectives: [AXRippleDirective], providers: [{ provide: AXComponent, useExisting: AXBottomNavigationItemComponent }], template: "<ng-content select=\"ax-prefix, ax-icon\"></ng-content>\n<ng-content select=\"ax-text, ng-content, ng-container\"></ng-content>\n<ng-content select=\"ax-suffix\"></ng-content>\n" }]
        }], propDecorators: { name: [{
                type: Input
            }], active: [{
                type: Input
            }], onClick: [{
                type: Output
            }], __hostClass: [{
                type: HostBinding,
                args: ['class']
            }], handleClick: [{
                type: HostListener,
                args: ['click', ['$event']]
            }] } });

/**
 * The BottomNavigation component provides a navigational bar at the bottom of the screen with customizable appearance and behavior.
 *
 * @category Components
 */
class AXBottomNavigationComponent {
    constructor() {
        this.look = input('solid', ...(ngDevMode ? [{ debugName: "look" }] : []));
        /**
         * This will be displayed as an interface
         */
        this.hasBorder = input(false, ...(ngDevMode ? [{ debugName: "hasBorder" }] : []));
        /**
         * Determines the position of the indicator relative to the button.
         *
         * @defaultValue 'top'
         */
        this.indicatorPosition = input('top', ...(ngDevMode ? [{ debugName: "indicatorPosition" }] : []));
        /**
         * Emit item click.
         * @returns The AXClickEvent
         */
        this.onItemClick = output();
    }
    //@Output() onItemClick = new EventEmitter<AXClickEvent>();
    /**
     *  @ignore
     */
    ngAfterContentInit() {
        this._bindEvents();
    }
    /** @ignore */
    _bindEvents() {
        this._contentButtons?.forEach((i) => {
            if (!i.onClick.length)
                i.onClick.subscribe((event) => {
                    this._handleClickEvent(event);
                });
        });
    }
    /** @ignore */
    _handleClickEvent(item) {
        this.onItemClick.emit(item);
    }
    /** @ignore */
    get __hostClass() {
        return ` ax-look-${this.look()} ax-indicator-${this.indicatorPosition()} ${this.hasBorder() ? 'ax-has-border' : ''}`;
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AXBottomNavigationComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.3.15", type: AXBottomNavigationComponent, isStandalone: true, selector: "ax-bottom-navigation", inputs: { look: { classPropertyName: "look", publicName: "look", isSignal: true, isRequired: false, transformFunction: null }, hasBorder: { classPropertyName: "hasBorder", publicName: "hasBorder", isSignal: true, isRequired: false, transformFunction: null }, indicatorPosition: { classPropertyName: "indicatorPosition", publicName: "indicatorPosition", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { onItemClick: "onItemClick" }, host: { properties: { "class": "this.__hostClass" } }, providers: [{ provide: AXComponent, useExisting: AXBottomNavigationComponent }], queries: [{ propertyName: "_contentButtons", predicate: AXBottomNavigationItemComponent }], ngImport: i0, template: "<ng-content select=\"ng-container, ax-bottom-navigation-item\"></ng-content>\n", styles: ["ax-bottom-navigation{--ax-comp-bottom-navigation-border-size: 1px;--ax-comp-bottom-navigation-indicator-width: 60%;--ax-comp-bottom-navigation-indicator-height: .2rem;--ax-comp-bottom-navigation-indicator-border-radius: .125rem}ax-bottom-navigation.ax-look-pills,ax-bottom-navigation.ax-look-pills-color{--ax-comp-bottom-navigation-active-text-color: var(--ax-sys-color-on-lightest-surface);--ax-comp-bottom-navigation-active-icon-bg-color: rgba(var(--ax-sys-color-on-lightest-surface), .2)}ax-bottom-navigation.ax-look-pills ax-bottom-navigation-item,ax-bottom-navigation.ax-look-pills-color ax-bottom-navigation-item{opacity:50%}ax-bottom-navigation.ax-look-pills ax-bottom-navigation-item ax-icon,ax-bottom-navigation.ax-look-pills-color ax-bottom-navigation-item ax-icon{width:unset;height:unset;display:block;font-size:1.25rem;border-radius:1rem;padding:.25rem 1.25rem;justify-content:center}ax-bottom-navigation.ax-look-pills ax-bottom-navigation-item:hover,ax-bottom-navigation.ax-look-pills-color ax-bottom-navigation-item:hover{opacity:75%}ax-bottom-navigation.ax-look-pills ax-bottom-navigation-item.ax-state-active,ax-bottom-navigation.ax-look-pills-color ax-bottom-navigation-item.ax-state-active{opacity:100%;color:rgba(var(--ax-comp-bottom-navigation-active-text-color))!important}ax-bottom-navigation.ax-look-pills ax-bottom-navigation-item.ax-state-disabled,ax-bottom-navigation.ax-look-pills-color ax-bottom-navigation-item.ax-state-disabled{opacity:30%}ax-bottom-navigation.ax-look-pills ax-bottom-navigation-item .ax-ripple,ax-bottom-navigation.ax-look-pills-color ax-bottom-navigation-item .ax-ripple{display:none}ax-bottom-navigation.ax-look-with-line{--ax-comp-bottom-navigation-active-bg-color: var(--ax-sys-color-primary-surface)}ax-bottom-navigation.ax-look-with-line.ax-indicator-top ax-bottom-navigation-item:before{top:0}ax-bottom-navigation.ax-look-with-line.ax-indicator-top ax-bottom-navigation-item.ax-state-active:before{border-bottom-left-radius:var(--ax-comp-bottom-navigation-indicator-border-radius);border-bottom-right-radius:var(--ax-comp-bottom-navigation-indicator-border-radius)}ax-bottom-navigation.ax-look-with-line.ax-indicator-bottom ax-bottom-navigation-item:before{bottom:0}ax-bottom-navigation.ax-look-with-line.ax-indicator-bottom ax-bottom-navigation-item.ax-state-active:before{border-top-left-radius:var(--ax-comp-bottom-navigation-indicator-border-radius);border-top-right-radius:var(--ax-comp-bottom-navigation-indicator-border-radius)}ax-bottom-navigation.ax-look-with-line ax-bottom-navigation-item:before{content:\"\";position:absolute;background-color:transparent;transition-property:background-color;transition-duration:var(--ax-sys-transition-duration);width:var(--ax-comp-bottom-navigation-indicator-width);height:var(--ax-comp-bottom-navigation-indicator-height);transition-timing-function:var(--ax-sys-transition-timing-function)}ax-bottom-navigation.ax-look-with-line ax-bottom-navigation-item.ax-state-active:before{background-color:rgba(var(--ax-comp-bottom-navigation-active-bg-color))}ax-bottom-navigation.ax-look-pills-color{--ax-comp-bottom-navigation-active-icon-bg-color: rgba(var(--ax-sys-color-primary-surface), .2)}ax-bottom-navigation{--ax-comp-bottom-navigation-text-color: var(--ax-sys-color-on-surface);--ax-comp-bottom-navigation-ripple-color: var(--ax-sys-color-primary-surface), .3;--ax-comp-bottom-navigation-active-text-color: var(--ax-sys-color-primary-surface)}ax-bottom-navigation{gap:.25rem;display:flex;justify-content:space-between;background-color:rgba(var(--ax-comp-bottom-navigation-bg-color))}ax-bottom-navigation ax-bottom-navigation-item{flex:1;display:flex;cursor:pointer;font-weight:400;-webkit-user-select:none;user-select:none;padding:.75rem 0;position:relative;align-items:center;flex-direction:column;line-height:1.375rem!important;transition-property:opacity,color;color:var(--ax-comp-bottom-navigation-text-color);transition-duration:var(--ax-sys-transition-duration);transition-timing-function:var(--ax-sys-transition-timing-function)}ax-bottom-navigation ax-bottom-navigation-item *{pointer-events:none}ax-bottom-navigation ax-bottom-navigation-item ax-icon{width:1.5rem;height:1.5rem;display:block;font-size:1.25rem;text-align:center;transition-property:background-color,color;transition-duration:var(--ax-sys-transition-duration);transition-timing-function:var(--ax-sys-transition-timing-function)}ax-bottom-navigation ax-bottom-navigation-item ax-text{font-size:.75rem;padding-top:.25rem}ax-bottom-navigation ax-bottom-navigation-item.ax-state-active{font-weight:500;color:rgba(var(--ax-comp-bottom-navigation-active-text-color))}ax-bottom-navigation ax-bottom-navigation-item.ax-state-active ax-icon{font-weight:700!important;background-color:var(--ax-comp-bottom-navigation-active-icon-bg-color, unset)}ax-bottom-navigation ax-bottom-navigation-item .ax-ripple{background-color:rgba(var(--ax-comp-bottom-navigation-ripple-color))!important}ax-bottom-navigation ax-bottom-navigation-item.ax-state-disabled{opacity:.5;cursor:not-allowed}ax-bottom-navigation ax-bottom-navigation-item.ax-state-disabled .ax-ripple{display:none}ax-bottom-navigation.ax-has-border{border-top-style:solid;border-color:rgba(var(--ax-sys-color-border-lightest-surface));border-top-width:var(--ax-comp-bottom-navigation-border-size)}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AXBottomNavigationComponent, decorators: [{
            type: Component,
            args: [{ selector: 'ax-bottom-navigation', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, providers: [{ provide: AXComponent, useExisting: AXBottomNavigationComponent }], template: "<ng-content select=\"ng-container, ax-bottom-navigation-item\"></ng-content>\n", styles: ["ax-bottom-navigation{--ax-comp-bottom-navigation-border-size: 1px;--ax-comp-bottom-navigation-indicator-width: 60%;--ax-comp-bottom-navigation-indicator-height: .2rem;--ax-comp-bottom-navigation-indicator-border-radius: .125rem}ax-bottom-navigation.ax-look-pills,ax-bottom-navigation.ax-look-pills-color{--ax-comp-bottom-navigation-active-text-color: var(--ax-sys-color-on-lightest-surface);--ax-comp-bottom-navigation-active-icon-bg-color: rgba(var(--ax-sys-color-on-lightest-surface), .2)}ax-bottom-navigation.ax-look-pills ax-bottom-navigation-item,ax-bottom-navigation.ax-look-pills-color ax-bottom-navigation-item{opacity:50%}ax-bottom-navigation.ax-look-pills ax-bottom-navigation-item ax-icon,ax-bottom-navigation.ax-look-pills-color ax-bottom-navigation-item ax-icon{width:unset;height:unset;display:block;font-size:1.25rem;border-radius:1rem;padding:.25rem 1.25rem;justify-content:center}ax-bottom-navigation.ax-look-pills ax-bottom-navigation-item:hover,ax-bottom-navigation.ax-look-pills-color ax-bottom-navigation-item:hover{opacity:75%}ax-bottom-navigation.ax-look-pills ax-bottom-navigation-item.ax-state-active,ax-bottom-navigation.ax-look-pills-color ax-bottom-navigation-item.ax-state-active{opacity:100%;color:rgba(var(--ax-comp-bottom-navigation-active-text-color))!important}ax-bottom-navigation.ax-look-pills ax-bottom-navigation-item.ax-state-disabled,ax-bottom-navigation.ax-look-pills-color ax-bottom-navigation-item.ax-state-disabled{opacity:30%}ax-bottom-navigation.ax-look-pills ax-bottom-navigation-item .ax-ripple,ax-bottom-navigation.ax-look-pills-color ax-bottom-navigation-item .ax-ripple{display:none}ax-bottom-navigation.ax-look-with-line{--ax-comp-bottom-navigation-active-bg-color: var(--ax-sys-color-primary-surface)}ax-bottom-navigation.ax-look-with-line.ax-indicator-top ax-bottom-navigation-item:before{top:0}ax-bottom-navigation.ax-look-with-line.ax-indicator-top ax-bottom-navigation-item.ax-state-active:before{border-bottom-left-radius:var(--ax-comp-bottom-navigation-indicator-border-radius);border-bottom-right-radius:var(--ax-comp-bottom-navigation-indicator-border-radius)}ax-bottom-navigation.ax-look-with-line.ax-indicator-bottom ax-bottom-navigation-item:before{bottom:0}ax-bottom-navigation.ax-look-with-line.ax-indicator-bottom ax-bottom-navigation-item.ax-state-active:before{border-top-left-radius:var(--ax-comp-bottom-navigation-indicator-border-radius);border-top-right-radius:var(--ax-comp-bottom-navigation-indicator-border-radius)}ax-bottom-navigation.ax-look-with-line ax-bottom-navigation-item:before{content:\"\";position:absolute;background-color:transparent;transition-property:background-color;transition-duration:var(--ax-sys-transition-duration);width:var(--ax-comp-bottom-navigation-indicator-width);height:var(--ax-comp-bottom-navigation-indicator-height);transition-timing-function:var(--ax-sys-transition-timing-function)}ax-bottom-navigation.ax-look-with-line ax-bottom-navigation-item.ax-state-active:before{background-color:rgba(var(--ax-comp-bottom-navigation-active-bg-color))}ax-bottom-navigation.ax-look-pills-color{--ax-comp-bottom-navigation-active-icon-bg-color: rgba(var(--ax-sys-color-primary-surface), .2)}ax-bottom-navigation{--ax-comp-bottom-navigation-text-color: var(--ax-sys-color-on-surface);--ax-comp-bottom-navigation-ripple-color: var(--ax-sys-color-primary-surface), .3;--ax-comp-bottom-navigation-active-text-color: var(--ax-sys-color-primary-surface)}ax-bottom-navigation{gap:.25rem;display:flex;justify-content:space-between;background-color:rgba(var(--ax-comp-bottom-navigation-bg-color))}ax-bottom-navigation ax-bottom-navigation-item{flex:1;display:flex;cursor:pointer;font-weight:400;-webkit-user-select:none;user-select:none;padding:.75rem 0;position:relative;align-items:center;flex-direction:column;line-height:1.375rem!important;transition-property:opacity,color;color:var(--ax-comp-bottom-navigation-text-color);transition-duration:var(--ax-sys-transition-duration);transition-timing-function:var(--ax-sys-transition-timing-function)}ax-bottom-navigation ax-bottom-navigation-item *{pointer-events:none}ax-bottom-navigation ax-bottom-navigation-item ax-icon{width:1.5rem;height:1.5rem;display:block;font-size:1.25rem;text-align:center;transition-property:background-color,color;transition-duration:var(--ax-sys-transition-duration);transition-timing-function:var(--ax-sys-transition-timing-function)}ax-bottom-navigation ax-bottom-navigation-item ax-text{font-size:.75rem;padding-top:.25rem}ax-bottom-navigation ax-bottom-navigation-item.ax-state-active{font-weight:500;color:rgba(var(--ax-comp-bottom-navigation-active-text-color))}ax-bottom-navigation ax-bottom-navigation-item.ax-state-active ax-icon{font-weight:700!important;background-color:var(--ax-comp-bottom-navigation-active-icon-bg-color, unset)}ax-bottom-navigation ax-bottom-navigation-item .ax-ripple{background-color:rgba(var(--ax-comp-bottom-navigation-ripple-color))!important}ax-bottom-navigation ax-bottom-navigation-item.ax-state-disabled{opacity:.5;cursor:not-allowed}ax-bottom-navigation ax-bottom-navigation-item.ax-state-disabled .ax-ripple{display:none}ax-bottom-navigation.ax-has-border{border-top-style:solid;border-color:rgba(var(--ax-sys-color-border-lightest-surface));border-top-width:var(--ax-comp-bottom-navigation-border-size)}\n"] }]
        }], propDecorators: { _contentButtons: [{
                type: ContentChildren,
                args: [AXBottomNavigationItemComponent]
            }], look: [{ type: i0.Input, args: [{ isSignal: true, alias: "look", required: false }] }], hasBorder: [{ type: i0.Input, args: [{ isSignal: true, alias: "hasBorder", required: false }] }], indicatorPosition: [{ type: i0.Input, args: [{ isSignal: true, alias: "indicatorPosition", required: false }] }], onItemClick: [{ type: i0.Output, args: ["onItemClick"] }], __hostClass: [{
                type: HostBinding,
                args: ['class']
            }] } });

class AXBottomNavigationModule {
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AXBottomNavigationModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
    static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.15", ngImport: i0, type: AXBottomNavigationModule, imports: [AXBottomNavigationComponent, AXBottomNavigationItemComponent], exports: [AXBottomNavigationComponent, AXBottomNavigationItemComponent] }); }
    static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AXBottomNavigationModule }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AXBottomNavigationModule, decorators: [{
            type: NgModule,
            args: [{
                    imports: [AXBottomNavigationComponent, AXBottomNavigationItemComponent],
                    exports: [AXBottomNavigationComponent, AXBottomNavigationItemComponent],
                }]
        }] });

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

export { AXBottomNavigationComponent, AXBottomNavigationItemComponent, AXBottomNavigationModule };
//# sourceMappingURL=acorex-components-bottom-navigation.mjs.map
