/**
 * @fileoverview added by tsickle
 * Generated from: components/accordion/parts/accordion-item/accordion-item.ts
 * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
 */
import { Component, ElementRef, Input, ViewChild } from '@angular/core';
import { AccordionService } from '../../services/accordion.service';
export class TlAccordionItem {
    /**
     * @param {?} accordionService
     */
    constructor(accordionService) {
        this.accordionService = accordionService;
        this.title = 'Title 1';
        this.heightHeader = '45px';
        this.disabled = false;
        this.opened = false;
    }
    /**
     * @return {?}
     */
    toggle() {
        if (this.disabled) {
            return;
        }
        this.accordionService.closeAll(this);
        this.opened = !this.opened;
    }
    /**
     * @return {?}
     */
    getColor() {
        return this.accordionService.getColor();
    }
    /**
     * @return {?}
     */
    close() {
        this.opened = false;
    }
}
TlAccordionItem.decorators = [
    { type: Component, args: [{
                selector: 'tl-accordion-item',
                template: "<div [class]=\"'ui-wrapper-accordion-item ' + getColor()\">\n  <div class=\"ui-accordion-item-header\"\n       [ngClass]=\"{'opened': opened, 'disabled': disabled}\"\n       [style.height]=\"heightHeader\"\n       [style.line-height]=\"heightHeader\"\n       [style.border-bottom]=\"opened ? '1px solid #DCDCDC' : 0\"\n       (click)=\"toggle()\">\n    <div class=\"ui-accordion-arrow\">\n      <tl-icon [lib]=\"'ion'\" [style]=\"'ios'\" [icon]=\"(!opened) ? 'arrow-forward' : 'arrow-down'\"></tl-icon>\n    </div>\n    <span>{{title}}</span>\n  </div>\n\n  <div #panel\n       [style.max-height.px]=\"opened ? panel.scrollHeight : 0\"\n       [style.display]=\"'block' ? opened : 'none'\"\n       class=\"ui-accordion-item-content\">\n      <ng-content></ng-content>\n  </div>\n\n</div>\n",
                styles: ["*{-moz-user-select:none;-ms-user-select:none;-webkit-user-select:none;user-select:none}.ui-accordion-item-header{-ms-grid-columns:40px 1fr;box-sizing:border-box;display:-ms-grid;display:grid;font-family:Segoe UI,Lato,\"sans-serif\",Arial;font-size:1.2em;grid-template-columns:40px 1fr}.ui-accordion-item-header>.ui-accordion-arrow{font-size:.9em;text-align:center}.ui-accordion-item-header:hover{cursor:pointer}.ui-accordion-item-content{max-height:0;overflow:hidden;padding:0 5px;transition:all .3s linear}"]
            }] }
];
/** @nocollapse */
TlAccordionItem.ctorParameters = () => [
    { type: AccordionService }
];
TlAccordionItem.propDecorators = {
    title: [{ type: Input }],
    heightHeader: [{ type: Input }],
    disabled: [{ type: Input }],
    opened: [{ type: Input }],
    panel: [{ type: ViewChild, args: ['panel', { static: true },] }]
};
if (false) {
    /** @type {?} */
    TlAccordionItem.prototype.title;
    /** @type {?} */
    TlAccordionItem.prototype.heightHeader;
    /** @type {?} */
    TlAccordionItem.prototype.disabled;
    /** @type {?} */
    TlAccordionItem.prototype.opened;
    /** @type {?} */
    TlAccordionItem.prototype.panel;
    /** @type {?} */
    TlAccordionItem.prototype.maxHeight;
    /**
     * @type {?}
     * @private
     */
    TlAccordionItem.prototype.accordionService;
}
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYWNjb3JkaW9uLWl0ZW0uanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy90cnVseS11aS9zcmMvY29tcG9uZW50cy9hY2NvcmRpb24vcGFydHMvYWNjb3JkaW9uLWl0ZW0vYWNjb3JkaW9uLWl0ZW0udHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7QUFBQSxPQUFPLEVBQUUsU0FBUyxFQUFFLFVBQVUsRUFBRSxLQUFLLEVBQ25DLFNBQVMsRUFDVixNQUFNLGVBQWUsQ0FBQztBQUN2QixPQUFPLEVBQUUsZ0JBQWdCLEVBQUUsTUFBTSxrQ0FBa0MsQ0FBQztBQU9wRSxNQUFNLE9BQU8sZUFBZTs7OztJQWMxQixZQUFxQixnQkFBa0M7UUFBbEMscUJBQWdCLEdBQWhCLGdCQUFnQixDQUFrQjtRQVo5QyxVQ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