import { CommonModule } from '@angular/common';
import { NgModule, Component, ChangeDetectionStrategy, HostBinding, ViewEncapsulation, Input, Output, EventEmitter, } from '@angular/core';
import * as i0 from "@angular/core";
import * as i1 from "@angular/common";
function EuiExpandContentComponent_div_0_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "div", 4);
    i0.ɵɵprojection(1);
    i0.ɵɵelementEnd();
} }
function EuiExpandContentComponent_button_2_span_1_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "span", 8);
    i0.ɵɵtext(1);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r3 = i0.ɵɵnextContext(2);
    i0.ɵɵadvance(1);
    i0.ɵɵtextInterpolate(ctx_r3.expandLabel);
} }
function EuiExpandContentComponent_button_2_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "button", 5);
    i0.ɵɵtemplate(1, EuiExpandContentComponent_button_2_span_1_Template, 2, 1, "span", 6);
    i0.ɵɵelement(2, "span", 7);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r1 = i0.ɵɵnextContext();
    i0.ɵɵadvance(1);
    i0.ɵɵproperty("ngIf", ctx_r1.expandLabel);
} }
function EuiExpandContentComponent_button_3_span_1_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "span", 8);
    i0.ɵɵtext(1);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r4 = i0.ɵɵnextContext(2);
    i0.ɵɵadvance(1);
    i0.ɵɵtextInterpolate(ctx_r4.collapseLabel);
} }
function EuiExpandContentComponent_button_3_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "button", 9);
    i0.ɵɵtemplate(1, EuiExpandContentComponent_button_3_span_1_Template, 2, 1, "span", 6);
    i0.ɵɵelement(2, "span", 10);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r2 = i0.ɵɵnextContext();
    i0.ɵɵadvance(1);
    i0.ɵɵproperty("ngIf", ctx_r2.collapseLabel);
} }
const _c0 = ["*"];
export class EuiExpandContentComponent {
    constructor() {
        this.isCollapsed = false;
        this.expandLabel = '';
        this.collapseLabel = '';
        this.collapsed = new EventEmitter();
    }
    get cssClasses() {
        return [
            `eui-expand-content`,
            this.isCollapsed ? 'eui-expand-content--collapsed' : '',
        ].join(' ').trim();
    }
    onToggle() {
        this.isCollapsed = !this.isCollapsed;
        this.collapsed.emit(this.isCollapsed);
    }
}
/** @nocollapse */ EuiExpandContentComponent.ɵfac = function EuiExpandContentComponent_Factory(t) { return new (t || EuiExpandContentComponent)(); };
/** @nocollapse */ EuiExpandContentComponent.ɵcmp = i0.ɵɵdefineComponent({ type: EuiExpandContentComponent, selectors: [["eui-expand-content"]], hostVars: 2, hostBindings: function EuiExpandContentComponent_HostBindings(rf, ctx) { if (rf & 2) {
        i0.ɵɵclassMap(ctx.cssClasses);
    } }, inputs: { isCollapsed: "isCollapsed", expandLabel: "expandLabel", collapseLabel: "collapseLabel" }, outputs: { collapsed: "collapsed" }, ngContentSelectors: _c0, decls: 4, vars: 5, consts: [["class", "eui-expand-content__body", 4, "ngIf"], ["aria-label", "Expand / Collapse trigger", 1, "eui-button__expand-trigger", 3, "click"], ["class", "eui-button eui-button--expand-toggle", "aria-label", "Expand", 4, "ngIf"], ["class", "eui-button eui-button--expand-toggle", "aria-label", "Collapse", 4, "ngIf"], [1, "eui-expand-content__body"], ["aria-label", "Expand", 1, "eui-button", "eui-button--expand-toggle"], ["class", "eui-label eui-u-color-grey-dark", 4, "ngIf"], [1, "eui-icon", "eui-icon-angle-down"], [1, "eui-label", "eui-u-color-grey-dark"], ["aria-label", "Collapse", 1, "eui-button", "eui-button--expand-toggle"], [1, "eui-icon", "eui-icon-angle-up"]], template: function EuiExpandContentComponent_Template(rf, ctx) { if (rf & 1) {
        i0.ɵɵprojectionDef();
        i0.ɵɵtemplate(0, EuiExpandContentComponent_div_0_Template, 2, 0, "div", 0);
        i0.ɵɵelementStart(1, "div", 1);
        i0.ɵɵlistener("click", function EuiExpandContentComponent_Template_div_click_1_listener() { return ctx.onToggle(); });
        i0.ɵɵtemplate(2, EuiExpandContentComponent_button_2_Template, 3, 1, "button", 2);
        i0.ɵɵtemplate(3, EuiExpandContentComponent_button_3_Template, 3, 1, "button", 3);
        i0.ɵɵelementEnd();
    } if (rf & 2) {
        i0.ɵɵproperty("ngIf", !ctx.isCollapsed);
        i0.ɵɵadvance(1);
        i0.ɵɵclassProp("eui-button__expand-trigger--collapsed", ctx.isCollapsed);
        i0.ɵɵadvance(1);
        i0.ɵɵproperty("ngIf", ctx.isCollapsed);
        i0.ɵɵadvance(1);
        i0.ɵɵproperty("ngIf", !ctx.isCollapsed);
    } }, directives: [i1.NgIf], styles: [".eui-expand-content{display:flex;flex-direction:column;position:relative;width:100%}.eui-expand-content__body{display:flex;padding-top:var(--eui-spacing);width:100%}"], encapsulation: 2, changeDetection: 0 });
/*@__PURE__*/ (function () { i0.ɵsetClassMetadata(EuiExpandContentComponent, [{
        type: Component,
        args: [{
                selector: 'eui-expand-content',
                templateUrl: './eui-expand-content.component.html',
                styleUrls: ['./styles/_index.scss'],
                changeDetection: ChangeDetectionStrategy.OnPush,
                encapsulation: ViewEncapsulation.None,
            }]
    }], function () { return []; }, { cssClasses: [{
            type: HostBinding,
            args: ['class']
        }], isCollapsed: [{
            type: Input
        }], expandLabel: [{
            type: Input
        }], collapseLabel: [{
            type: Input
        }], collapsed: [{
            type: Output
        }] }); })();
/* ***************************************** */
/* MODULE EXPORT */
/* ***************************************** */
export class EuiExpandContentModule {
}
/** @nocollapse */ EuiExpandContentModule.ɵmod = i0.ɵɵdefineNgModule({ type: EuiExpandContentModule });
/** @nocollapse */ EuiExpandContentModule.ɵinj = i0.ɵɵdefineInjector({ factory: function EuiExpandContentModule_Factory(t) { return new (t || EuiExpandContentModule)(); }, imports: [[
            CommonModule,
        ]] });
(function () { (typeof ngJitMode === "undefined" || ngJitMode) && i0.ɵɵsetNgModuleScope(EuiExpandContentModule, { declarations: [EuiExpandContentComponent], imports: [CommonModule], exports: [EuiExpandContentComponent] }); })();
/*@__PURE__*/ (function () { i0.ɵsetClassMetadata(EuiExpandContentModule, [{
        type: NgModule,
        args: [{
                imports: [
                    CommonModule,
                ],
                declarations: [
                    EuiExpandContentComponent,
                ],
                exports: [
                    EuiExpandContentComponent,
                ],
            }]
    }], null, null); })();
//# sourceMappingURL=data:application/json;base64, 