import { Component, Input, EventEmitter, Output } from '@angular/core';
import * as i0 from "@angular/core";
import * as i1 from "../button/button.component";
export class CollapsibleToggleComponent {
    constructor() {
        /**
         * The expanded state.
         * The toggle icon is changed in the template based on the value of expanded.
         */
        this.expanded = false;
        /**
         * Emits the value of expanded to the parent component for two-way binding
         */
        this.expandedChange = new EventEmitter();
    }
    /**
     * On click, toggle the value of exanded and emit the current value
     */
    onToggle() {
        this.expanded = !this.expanded;
        this.expandedChange.emit(this.expanded);
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: CollapsibleToggleComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: CollapsibleToggleComponent, selector: "ec-collapsible-toggle", inputs: { id: "id", expanded: "expanded", tabindex: "tabindex" }, outputs: { expandedChange: "expandedChange" }, ngImport: i0, template: `<ec-button id="{{id}}_button" type="icon" icon="icon-angle-down {{expanded ? '' : 'rotate-270'}}" tabindex="{{tabindex}}" (clicked)="onToggle()"></ec-button>`, isInline: true, styles: [":host{width:1.5rem;height:1.5rem;display:inline-flex;justify-content:center;align-items:center}ec-button::ng-deep .ec-button-icon{width:1.25rem;height:1.25rem}\n"], dependencies: [{ kind: "component", type: i1.ButtonComponent, selector: "ec-button", inputs: ["id", "disabled", "icon", "label", "badge", "tabindex", "type", "pending", "pendingIcon", "customTemplate", "isSubmit", "autofocus"], outputs: ["clicked"] }] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: CollapsibleToggleComponent, decorators: [{
            type: Component,
            args: [{ selector: 'ec-collapsible-toggle', template: `<ec-button id="{{id}}_button" type="icon" icon="icon-angle-down {{expanded ? '' : 'rotate-270'}}" tabindex="{{tabindex}}" (clicked)="onToggle()"></ec-button>`, styles: [":host{width:1.5rem;height:1.5rem;display:inline-flex;justify-content:center;align-items:center}ec-button::ng-deep .ec-button-icon{width:1.25rem;height:1.25rem}\n"] }]
        }], propDecorators: { id: [{
                type: Input
            }], expanded: [{
                type: Input
            }], tabindex: [{
                type: Input
            }], expandedChange: [{
                type: Output
            }] } });
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29sbGFwc2libGUtdG9nZ2xlLmNvbXBvbmVudC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL2NvbXBvbmVudHMvc3JjL2xpYi9jb250cm9scy9jb2xsYXBzaWJsZS10b2dnbGUvY29sbGFwc2libGUtdG9nZ2xlLmNvbXBvbmVudC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsU0FBUyxFQUFFLEtBQUssRUFBRSxZQUFZLEVBQUUsTUFBTSxFQUFFLE1BQU0sZUFBZSxDQUFDOzs7QUFPdkUsTUFBTSxPQUFPLDBCQUEwQjtJQUx2QztRQVlFOzs7V0FHRztRQUNhLGFBQVEsR0FBWSxLQUFLLENBQUM7UUFLMUM7O1dBRUc7UUFDYyxtQkFBYyxHQUEwQixJQUFJLFlBQVksRUFBVyxDQUFDO0tBU3RGO0lBUEM7O09BRUc7SUFDSSxRQUFRO1FBQ2IsSUFBSSxDQUFDLFFBQVEsR0FBRyxDQUFDLElBQUksQ0FBQyxRQUFRLENBQUM7UUFDL0IsSUFBSSxDQUFDLGNBQWMsQ0FBQyxJQUFJLENBQUMsSUFBSSxDQUFDLFFBQVEsQ0FBQyxDQUFDO0lBQzFDLENBQUM7K0dBM0JVLDBCQUEwQjttR0FBMUIsMEJBQTBCLDhLQUgzQiwrSkFBK0o7OzRGQUc5SiwwQkFBMEI7a0JBTHRDLFNBQVM7K0JBQ0UsdUJBQXVCLFlBQ3ZCLCtKQUErSjs4QkFRekosRUFBRTtzQkFBakIsS0FBSztnQkFNVSxRQU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