import { Component, HostBinding, ChangeDetectionStrategy, ViewEncapsulation, Input } from '@angular/core';
import { coerceBooleanProperty } from '@angular/cdk/coercion';
import { BaseDirective } from '../../base.directive';
import { EuiListService } from './services/eui-list.service';
import * as i0 from "@angular/core";
import * as i1 from "./services/eui-list.service";
const _c0 = ["euiList", ""];
const _c1 = ["*"];
export class EuiListComponent extends BaseDirective {
    constructor(euiListService) {
        super();
        this.euiListService = euiListService;
        this._isCollapsible = false;
        this.role = 'list';
    }
    get isCollapsible() { return this._isCollapsible; }
    set isCollapsible(value) { this._isCollapsible = coerceBooleanProperty(value); }
    get cssClasses() {
        return [
            super.getCssClasses('eui-list'),
        ].join(' ').trim();
    }
    ngOnInit() {
        if (this.isCollapsible) {
            this.euiListService.isCollapsible = this.isCollapsible;
        }
    }
}
/** @nocollapse */ EuiListComponent.ɵfac = function EuiListComponent_Factory(t) { return new (t || EuiListComponent)(i0.ɵɵdirectiveInject(i1.EuiListService)); };
/** @nocollapse */ EuiListComponent.ɵcmp = i0.ɵɵdefineComponent({ type: EuiListComponent, selectors: [["", "euiList", ""], ["eui-list"]], hostVars: 3, hostBindings: function EuiListComponent_HostBindings(rf, ctx) { if (rf & 2) {
        i0.ɵɵattribute("role", ctx.role);
        i0.ɵɵclassMap(ctx.cssClasses);
    } }, inputs: { isCollapsible: "isCollapsible" }, features: [i0.ɵɵInheritDefinitionFeature], attrs: _c0, ngContentSelectors: _c1, decls: 1, vars: 0, template: function EuiListComponent_Template(rf, ctx) { if (rf & 1) {
        i0.ɵɵprojectionDef();
        i0.ɵɵprojection(0);
    } }, styles: [".eui-list{display:block;height:auto;position:relative}.eui-list .eui-list-item{-webkit-tap-highlight-color:transparent;-webkit-user-select:none;background:none;border:none;box-shadow:none;cursor:pointer;display:block;max-width:100%;outline:none;overflow:hidden;padding:var(--eui-spacing-2xs) var(--eui-spacing-xs);position:relative;text-align:left;text-decoration:none;text-overflow:ellipsis;user-select:none;white-space:nowrap;width:100%}.eui-list .eui-list-item:hover{background-color:var(--eui-color-grey-lightest)}.eui-list .eui-list-item .eui-list-item__container{align-items:center;display:flex}.eui-list .eui-list-item .eui-list-item__container .eui-list-item__content{align-items:center;display:flex;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.eui-list .eui-list-item .eui-list-item__container .eui-list-item__content .eui-list-item__content-icon{align-items:center;display:flex}.eui-list .eui-list-item .eui-list-item__container .eui-list-item__content .eui-list-item__content-icon .eui-icon{margin-right:var(--eui-spacing-xs)}.eui-list .eui-list-item .eui-list-item__container .eui-list-item__content .eui-list-item__content-text{display:block;margin-right:var(--eui-spacing-s);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.eui-list .eui-list-item .eui-list-item__container .eui-list-item__content .eui-list-item__content-text .eui-label{line-height:var(--eui-spacing-s)}.eui-list .eui-list-item .eui-list-item__container .eui-list-item__content .eui-list-item__content-text .eui-label+.eui-label{display:block}.eui-list .eui-list-item .eui-list-item__container .eui-list-item__content .eui-list-item__content-toggle{align-items:center;display:inline-flex;font-size:var(--eui-font-size-m);margin-left:auto;transition:all .3s linear}.eui-list .eui-list-item .eui-list-item__container.eui-list-item--has-submenu{display:block;width:100%}.eui-list .eui-list-item .eui-list-item__container.eui-list-item--has-submenu .eui-list-item__content{align-items:center;display:flex;width:100%}.eui-list .eui-list-item .eui-list-item__container.eui-list-item--has-submenu .eui-list-item__sub-list{margin-left:var(--eui-spacing)}.eui-list .eui-list-item .eui-list-item__container.eui-list-item--has-submenu .eui-list-item__sub-list .eui-list-item{padding-right:0}navigation-list nav{height:auto}.eui-list-item--primary{color:var(--eui-color-primary)}.eui-list-item--secondary{color:var(--eui-color-grey-darker)}.eui-list-item--info{color:var(--eui-color-info)}.eui-list-item--success{color:var(--eui-color-success)}.eui-list-item--warning{color:var(--eui-color-warning-darkester-2)}.eui-list-item--danger{color:var(--eui-color-danger)}.eui-list-item__content-toggle--expanded{transform:rotate(-180deg)}.eui-list-item--disabled{background-image:none;box-shadow:none;cursor:not-allowed;opacity:var(--eui-disabled-opacity-base);pointer-events:none}"], encapsulation: 2, changeDetection: 0 });
/*@__PURE__*/ (function () { i0.ɵsetClassMetadata(EuiListComponent, [{
        type: Component,
        args: [{
                templateUrl: './eui-list.component.html',
                selector: '[euiList], eui-list',
                styleUrls: ['./styles/_index.scss'],
                changeDetection: ChangeDetectionStrategy.OnPush,
                encapsulation: ViewEncapsulation.None,
            }]
    }], function () { return [{ type: i1.EuiListService }]; }, { isCollapsible: [{
            type: Input
        }], cssClasses: [{
            type: HostBinding,
            args: ['class']
        }], role: [{
            type: HostBinding,
            args: ['attr.role']
        }] }); })();
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZXVpLWxpc3QuY29tcG9uZW50LmpzIiwic291cmNlUm9vdCI6Ii9idWlsZHMvZXVpL2NjLWNzZHItcm9vdC9wYWNrYWdlcy9ldWkvcGFja2FnZXMvY29tcG9uZW50cy1uZXh0L3NyYy8iLCJzb3VyY2VzIjpbImxpYi9jb21wb25lbnRzL2V1aS1saXN0L2V1aS1saXN0LmNvbXBvbmVudC50cyIsImxpYi9jb21wb25lbnRzL2V1aS1saXN0L2V1aS1saXN0LmNvbXBvbmVudC5odG1sIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxTQUFTLEVBQUUsV0FBVyxFQUFFLHVCQUF1QixFQUFFLGlCQUFpQixFQUFFLEtBQUssRUFBVSxNQUFNLGVBQWUsQ0FBQztBQUNsSCxPQUFPLEVBQUUscUJBQXFCLEVBQUUsTUFBTSx1QkFBdUIsQ0FBQztBQUU5RCxPQUFPLEVBQUUsYUFBYSxFQUFFLE1BQU0sc0JBQXNCLENBQUM7QUFDckQsT0FBTyxFQUFFLGNBQWMsRUFBRSxNQUFNLDZCQUE2QixDQUFDOzs7OztBQVM3RCxNQUFNLE9BQU8sZ0JBQWlCLFNBQVEsYUFBYTtJQWdCL0MsWUFBb0IsY0FBOEI7UUFDOUMsS0FBSyxFQ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