import { AXComponent } from '@acorex/cdk/common';
import { NgClass, CommonModule } from '@angular/common';
import * as i0 from '@angular/core';
import { input, signal, effect, ChangeDetectionStrategy, ViewEncapsulation, Component, inject, model, HostBinding, NgModule } from '@angular/core';

class AXTimeLineComponent {
    constructor() {
        this.mode = input('bullet', ...(ngDevMode ? [{ debugName: "mode" }] : []));
        this.containerStyle = signal('gap: 1rem;padding-block: 0.5rem;', ...(ngDevMode ? [{ debugName: "containerStyle" }] : []));
        this.#modeChange = effect(() => {
            switch (this.mode()) {
                case 'bullet':
                    this.containerStyle.set('gap: 1rem;padding-block: 0.5rem;');
                    break;
                case 'icon':
                    this.containerStyle.set('gap: 2rem;padding-block: 1rem;');
                    break;
                default:
                    break;
            }
        }, ...(ngDevMode ? [{ debugName: "#modeChange" }] : []));
    }
    #modeChange;
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: AXTimeLineComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.3.3", type: AXTimeLineComponent, isStandalone: true, selector: "ax-time-line", inputs: { mode: { classPropertyName: "mode", publicName: "mode", isSignal: true, isRequired: false, transformFunction: null } }, providers: [{ provide: AXComponent, useExisting: AXTimeLineComponent }], ngImport: i0, template: "<div class=\"ax-time-line-item-container\" [style]=\"containerStyle()\">\n  <ng-content></ng-content>\n</div>\n", styles: ["ax-time-line{width:100%;display:block}ax-time-line .ax-time-line-item-container{position:relative;display:flex;flex-direction:column}ax-time-line .ax-time-line-item-container:before,ax-time-line .ax-time-line-item-container:after{display:block;content:\"\";position:absolute;background-color:rgba(var(--ax-sys-color-border-lightest-surface))}ax-time-line .ax-time-line-item-container:before{width:1px;height:100%;top:0;inset-inline-start:.875rem}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: AXTimeLineComponent, decorators: [{
            type: Component,
            args: [{ selector: 'ax-time-line', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, providers: [{ provide: AXComponent, useExisting: AXTimeLineComponent }], template: "<div class=\"ax-time-line-item-container\" [style]=\"containerStyle()\">\n  <ng-content></ng-content>\n</div>\n", styles: ["ax-time-line{width:100%;display:block}ax-time-line .ax-time-line-item-container{position:relative;display:flex;flex-direction:column}ax-time-line .ax-time-line-item-container:before,ax-time-line .ax-time-line-item-container:after{display:block;content:\"\";position:absolute;background-color:rgba(var(--ax-sys-color-border-lightest-surface))}ax-time-line .ax-time-line-item-container:before{width:1px;height:100%;top:0;inset-inline-start:.875rem}\n"] }]
        }] });

class AXTimeLineItemComponent {
    constructor() {
        this.parent = inject(AXTimeLineComponent);
        this.text = input('', ...(ngDevMode ? [{ debugName: "text" }] : []));
        this.isActive = input(false, ...(ngDevMode ? [{ debugName: "isActive" }] : []));
        this.isCollapsed = model(false, ...(ngDevMode ? [{ debugName: "isCollapsed" }] : []));
        this.mode = signal('bullet', ...(ngDevMode ? [{ debugName: "mode" }] : []));
        effect(() => {
            this.mode.set(this.parent.mode());
        });
    }
    /**
     * Handles the click event on the time line item header to toggle collapsed state.
     */
    handleClick() {
        this.isCollapsed.set(!this.isCollapsed());
    }
    get __hostClass() {
        return [`ax-mode-${this.mode()}`, `${this.isActive() ? 'ax-state-active' : ''}`];
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: AXTimeLineItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.3", type: AXTimeLineItemComponent, isStandalone: true, selector: "ax-time-line-item", inputs: { text: { classPropertyName: "text", publicName: "text", isSignal: true, isRequired: false, transformFunction: null }, isActive: { classPropertyName: "isActive", publicName: "isActive", isSignal: true, isRequired: false, transformFunction: null }, isCollapsed: { classPropertyName: "isCollapsed", publicName: "isCollapsed", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { isCollapsed: "isCollapsedChange" }, host: { properties: { "class": "this.__hostClass" } }, providers: [{ provide: AXComponent, useExisting: AXTimeLineItemComponent }], ngImport: i0, template: "<div class=\"ax-time-line-header\" (click)=\"handleClick()\">\n  @switch (mode()) {\n    @case ('bullet') {\n      <span class=\"ax-time-line-bullet\"></span>\n    }\n    @case ('icon') {\n      <span class=\"ax-time-line-icon\">\n        <ng-content select=\"ax-icon\"></ng-content>\n      </span>\n    }\n  }\n  <span class=\"ax-time-line-text\">{{ text() }}</span>\n  <span\n    class=\"ax-icon ax-icon-chevron-left ax-collapse-arrow\"\n    [ngClass]=\"{ '-rotation-90': isCollapsed(), 'rotation-90': !isCollapsed() }\"\n  ></span>\n</div>\n\n@if (!isCollapsed()) {\n  <div animate.enter=\"ax-fade-slide-in\" animate.leave=\"ax-fade-slide-out\" class=\"ax-time-line-content\">\n    <ng-content></ng-content>\n  </div>\n}\n", styles: ["ax-time-line{--ax-comp-time-line-deactivate-bg-color: var(--ax-sys-color-darkest-surface);--ax-comp-time-line-bullet-active-bg-color: var(--ax-sys-color-primary-surface);--ax-comp-time-line-active-bg-color: var(--ax-sys-color-primary-lightest-surface);--ax-comp-time-line-active-text-color: var(--ax-sys-color-on-primary-lightest-surface);--ax-comp-time-line-icon-bg-color: var(--ax-sys-color-surface);--ax-comp-time-line-icon-text-color: var(--ax-sys-color-on-surface)}.ax-dark ax-time-line{--ax-comp-time-line-deactivate-bg-color: var(--ax-sys-color-lightest-surface)}ax-time-line-item{position:relative;display:flex;flex-direction:column;gap:.75rem}ax-time-line-item.ax-mode-icon{padding-inline-start:3rem}ax-time-line-item.ax-mode-bullet{padding-inline-start:1.75rem}ax-time-line-item.ax-state-active .ax-time-line-bullet{background-color:rgba(var(--ax-comp-time-line-bullet-active-bg-color))!important}ax-time-line-item.ax-state-active .ax-time-line-icon{background-color:rgba(var(--ax-comp-time-line-active-bg-color))!important;color:rgba(var(--ax-comp-time-line-active-text-color))!important}ax-time-line-item .ax-time-line-header{display:flex;justify-content:space-between;align-items:center;cursor:pointer;-webkit-user-select:none;user-select:none}ax-time-line-item .ax-time-line-header .ax-time-line-bullet,ax-time-line-item .ax-time-line-header .ax-time-line-icon{position:absolute;border-radius:999rem}ax-time-line-item .ax-time-line-header .ax-time-line-bullet{width:.75rem;height:.75rem;inset-inline-start:.5rem;background-color:rgba(var(--ax-comp-time-line-deactivate-bg-color))}ax-time-line-item .ax-time-line-header .ax-time-line-icon{width:2.5rem;height:2.5rem;inset-inline-start:-.25rem;display:flex;align-items:center;justify-content:center;background-color:rgba(var(--ax-comp-time-line-icon-bg-color));color:rgba(var(--ax-comp-time-line-icon-text-color))}ax-time-line-item .ax-time-line-header .ax-time-line-text{flex:1}ax-time-line-item .ax-time-line-header .ax-collapse-arrow{transition-property:all;transition-duration:var(--ax-sys-transition-duration);transition-timing-function:var(--ax-sys-transition-timing-function);display:block}ax-time-line-item .ax-time-line-header .ax-collapse-arrow.-rotation-90{transform:rotate(-90deg)}ax-time-line-item .ax-time-line-header .ax-collapse-arrow.rotation-90{transform:rotate(90deg)}@keyframes fadeSlideIn{0%{opacity:0;max-height:0}to{opacity:1;max-height:1500px}}@keyframes fadeSlideOut{0%{opacity:1;max-height:1500px}to{opacity:0;max-height:0}}ax-time-line-item .ax-fade-slide-in{animation:fadeSlideIn var(--ax-sys-transition-duration) var(--ax-sys-transition-timing-function)}ax-time-line-item .ax-fade-slide-out{animation:fadeSlideOut var(--ax-sys-transition-duration) var(--ax-sys-transition-timing-function)}\n"], dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: AXTimeLineItemComponent, decorators: [{
            type: Component,
            args: [{ selector: 'ax-time-line-item', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, imports: [NgClass], providers: [{ provide: AXComponent, useExisting: AXTimeLineItemComponent }], template: "<div class=\"ax-time-line-header\" (click)=\"handleClick()\">\n  @switch (mode()) {\n    @case ('bullet') {\n      <span class=\"ax-time-line-bullet\"></span>\n    }\n    @case ('icon') {\n      <span class=\"ax-time-line-icon\">\n        <ng-content select=\"ax-icon\"></ng-content>\n      </span>\n    }\n  }\n  <span class=\"ax-time-line-text\">{{ text() }}</span>\n  <span\n    class=\"ax-icon ax-icon-chevron-left ax-collapse-arrow\"\n    [ngClass]=\"{ '-rotation-90': isCollapsed(), 'rotation-90': !isCollapsed() }\"\n  ></span>\n</div>\n\n@if (!isCollapsed()) {\n  <div animate.enter=\"ax-fade-slide-in\" animate.leave=\"ax-fade-slide-out\" class=\"ax-time-line-content\">\n    <ng-content></ng-content>\n  </div>\n}\n", styles: ["ax-time-line{--ax-comp-time-line-deactivate-bg-color: var(--ax-sys-color-darkest-surface);--ax-comp-time-line-bullet-active-bg-color: var(--ax-sys-color-primary-surface);--ax-comp-time-line-active-bg-color: var(--ax-sys-color-primary-lightest-surface);--ax-comp-time-line-active-text-color: var(--ax-sys-color-on-primary-lightest-surface);--ax-comp-time-line-icon-bg-color: var(--ax-sys-color-surface);--ax-comp-time-line-icon-text-color: var(--ax-sys-color-on-surface)}.ax-dark ax-time-line{--ax-comp-time-line-deactivate-bg-color: var(--ax-sys-color-lightest-surface)}ax-time-line-item{position:relative;display:flex;flex-direction:column;gap:.75rem}ax-time-line-item.ax-mode-icon{padding-inline-start:3rem}ax-time-line-item.ax-mode-bullet{padding-inline-start:1.75rem}ax-time-line-item.ax-state-active .ax-time-line-bullet{background-color:rgba(var(--ax-comp-time-line-bullet-active-bg-color))!important}ax-time-line-item.ax-state-active .ax-time-line-icon{background-color:rgba(var(--ax-comp-time-line-active-bg-color))!important;color:rgba(var(--ax-comp-time-line-active-text-color))!important}ax-time-line-item .ax-time-line-header{display:flex;justify-content:space-between;align-items:center;cursor:pointer;-webkit-user-select:none;user-select:none}ax-time-line-item .ax-time-line-header .ax-time-line-bullet,ax-time-line-item .ax-time-line-header .ax-time-line-icon{position:absolute;border-radius:999rem}ax-time-line-item .ax-time-line-header .ax-time-line-bullet{width:.75rem;height:.75rem;inset-inline-start:.5rem;background-color:rgba(var(--ax-comp-time-line-deactivate-bg-color))}ax-time-line-item .ax-time-line-header .ax-time-line-icon{width:2.5rem;height:2.5rem;inset-inline-start:-.25rem;display:flex;align-items:center;justify-content:center;background-color:rgba(var(--ax-comp-time-line-icon-bg-color));color:rgba(var(--ax-comp-time-line-icon-text-color))}ax-time-line-item .ax-time-line-header .ax-time-line-text{flex:1}ax-time-line-item .ax-time-line-header .ax-collapse-arrow{transition-property:all;transition-duration:var(--ax-sys-transition-duration);transition-timing-function:var(--ax-sys-transition-timing-function);display:block}ax-time-line-item .ax-time-line-header .ax-collapse-arrow.-rotation-90{transform:rotate(-90deg)}ax-time-line-item .ax-time-line-header .ax-collapse-arrow.rotation-90{transform:rotate(90deg)}@keyframes fadeSlideIn{0%{opacity:0;max-height:0}to{opacity:1;max-height:1500px}}@keyframes fadeSlideOut{0%{opacity:1;max-height:1500px}to{opacity:0;max-height:0}}ax-time-line-item .ax-fade-slide-in{animation:fadeSlideIn var(--ax-sys-transition-duration) var(--ax-sys-transition-timing-function)}ax-time-line-item .ax-fade-slide-out{animation:fadeSlideOut var(--ax-sys-transition-duration) var(--ax-sys-transition-timing-function)}\n"] }]
        }], ctorParameters: () => [], propDecorators: { __hostClass: [{
                type: HostBinding,
                args: ['class']
            }] } });

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

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

export { AXTimeLineComponent, AXTimeLineItemComponent, AXTimeLineModule };
//# sourceMappingURL=acorex-components-time-line.mjs.map
