import { Component, Input, ElementRef, Host, HostBinding } from '@angular/core';
import { trigger, state, style, animate, transition } from '@angular/animations';
import { NzCollapsesetComponent } from './nz-collapseset.component';
var NzCollapseComponent = (function () {
    function NzCollapseComponent(_collapseSet, _elementRef) {
        this._collapseSet = _collapseSet;
        this._elementRef = _elementRef;
        this._nzCollapseItem = true;
        this.nzDisabled = false;
        this._el = this._elementRef.nativeElement;
        this._collapseSet.addTab(this);
    }
    Object.defineProperty(NzCollapseComponent.prototype, "nzActive", {
        get: function () {
            return this._active;
        },
        set: function (active) {
            if (this._active === active) {
                return;
            }
            if (!this.nzDisabled) {
                this._active = active;
            }
        },
        enumerable: true,
        configurable: true
    });
    NzCollapseComponent.prototype.clickHeader = function ($event) {
        this.nzActive = !this.nzActive;
        /** trigger host collapseSet click event */
        this._collapseSet.nzClick(this);
    };
    return NzCollapseComponent;
}());
export { NzCollapseComponent };
NzCollapseComponent.decorators = [
    { type: Component, args: [{
                selector: 'nz-collapse',
                template: "\n    <div class=\"ant-collapse-header\" [attr.aria-expanded]=\"_active\" (click)=\"clickHeader($event)\" role=\"tab\">\n      <i class=\"arrow\"></i>\n      {{ nzTitle }}\n    </div>\n    <div class=\"ant-collapse-content\" [@collapseState]=\"_active?'active':'inactive'\">\n      <div class=\"ant-collapse-content-box\">\n        <ng-content></ng-content>\n      </div>\n    </div>\n  ",
                animations: [
                    trigger('collapseState', [
                        state('inactive', style({
                            opacity: '0',
                            height: 0
                        })),
                        state('active', style({
                            opacity: '1',
                            height: '*'
                        })),
                        transition('inactive => active', animate('150ms ease-in')),
                        transition('active => inactive', animate('150ms ease-out'))
                    ])
                ]
            },] },
];
/** @nocollapse */
NzCollapseComponent.ctorParameters = function () { return [
    { type: NzCollapsesetComponent, decorators: [{ type: Host },] },
    { type: ElementRef, },
]; };
NzCollapseComponent.propDecorators = {
    '_nzCollapseItem': [{ type: HostBinding, args: ['class.ant-collapse-item',] },],
    'nzTitle': [{ type: Input },],
    'nzDisabled': [{ type: Input }, { type: HostBinding, args: ['class.ant-collapse-item-disabled',] },],
    'nzActive': [{ type: Input },],
};
