/**
 * @fileoverview added by tsickle
 * @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
 */
import { Component, ChangeDetectorRef, ElementRef, HostBinding, HostListener, Input, Host, EventEmitter, Output, ContentChild, Inject } from '@angular/core';
import { IgxExpansionPanelIconDirective } from './expansion-panel.directives';
import { IGX_EXPANSION_PANEL_COMPONENT } from './expansion-panel.common';
/** @enum {string} */
var ICON_POSITION = {
    LEFT: 'left',
    NONE: 'none',
    RIGHT: 'right',
};
export { ICON_POSITION };
var IgxExpansionPanelHeaderComponent = /** @class */ (function () {
    function IgxExpansionPanelHeaderComponent(panel, cdr, elementRef) {
        this.panel = panel;
        this.cdr = cdr;
        this.elementRef = elementRef;
        // properties section
        this._iconTemplate = false;
        /**
         * Sets/gets the `id` of the expansion panel header.
         * ```typescript
         * let panelHeaderId =  this.panel.header.id;
         * ```
         * \@memberof IgxExpansionPanelComponent
         */
        this.id = '';
        /**
         * Gets/sets the `aria-level` attribute of the header
         * Get
         * ```typescript
         *  const currentAriaLevel = this.panel.header.lv;
         * ```
         * Set
         * ```typescript
         *  this.panel.header.lv = '5';
         * ```
         * ```html
         *  <igx-expansion-panel-header [lv]="myCustomLevel"></igx-expansion-panel-header>
         * ```
         */
        this.lv = '3';
        /**
         * Gets/sets the `role` attribute of the header
         * Get
         * ```typescript
         *  const currentRole = this.panel.header.role;
         * ```
         * Set
         * ```typescript
         *  this.panel.header.role = '5';
         * ```
         * ```html
         *  <igx-expansion-panel-header [role]="'custom'"></igx-expansion-panel-header>
         * ```
         */
        this.role = 'heading';
        /**
         * Gets/sets the position of the expansion-panel-header expand/collapse icon
         * Accepts `left`, `right` or `none`
         * ```typescript
         *  const currentIconPosition = this.panel.header.iconPosition;
         * ```
         * Set
         * ```typescript
         *  this.panel.header.iconPosition = 'left';
         * ```
         * ```html
         *  <igx-expansion-panel-header [iconPosition]="'right'"></igx-expansion-panel-header>
         * ```
         */
        this.iconPosition = ICON_POSITION.LEFT;
        /**
         * Emitted whenever a user interacts with the header host
         * ```typescript
         *  handleInteraction(event: IExpansionPanelEventArgs) {
         *  ...
         * }
         * ```
         * ```html
         *  <igx-expansion-panel-header (onInteraction)="handleInteraction($event)">
         *      ...
         *  </igx-expansion-panel-header>
         * ```
         */
        this.onInteraction = new EventEmitter();
        /**
         * @hidden
         */
        this.cssClass = 'igx-expansion-panel__header';
        /**
         * Gets/sets the whether the header is disabled
         * When disabled, the header will not handle user events and will stop their propagation
         *
         * ```typescript
         *  const isDisabled = this.panel.header.disabled;
         * ```
         * Set
         * ```typescript
         *  this.panel.header.disabled = true;
         * ```
         * ```html
         *  <igx-expansion-panel-header [disabled]="true">
         *     ...
         *  </igx-expansion-panel-header>
         * ```
         */
        this.disabled = false;
        this.id = this.panel.id + "-header";
    }
    Object.defineProperty(IgxExpansionPanelHeaderComponent.prototype, "iconTemplate", {
        /**
         * @hidden
         */
        get: /**
         * @hidden
         * @return {?}
         */
        function () {
            return this._iconTemplate;
        },
        /**
         * @hidden
         */
        set: /**
         * @hidden
         * @param {?} val
         * @return {?}
         */
        function (val) {
            this._iconTemplate = (/** @type {?} */ (val));
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgxExpansionPanelHeaderComponent.prototype, "controls", {
        /**
         * @hidden
         */
        get: /**
         * @hidden
         * @return {?}
         */
        function () {
            return this.panel.id;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgxExpansionPanelHeaderComponent.prototype, "isExpanded", {
        /**
        * @hidden
        */
        get: /**
         * @hidden
         * @return {?}
         */
        function () {
            return !this.panel.collapsed;
        },
        enumerable: true,
        configurable: true
    });
    /**
    * @hidden
    */
    /**
     * @hidden
     * @param {?=} evt
     * @return {?}
     */
    IgxExpansionPanelHeaderComponent.prototype.onAction = /**
     * @hidden
     * @param {?=} evt
     * @return {?}
     */
    function (evt) {
        if (this.disabled) {
            evt.stopPropagation();
            return;
        }
        this.onInteraction.emit({ event: evt, panel: this.panel });
        this.panel.toggle(evt);
        evt.preventDefault();
    };
    /** @hidden @internal */
    /**
     * @hidden \@internal
     * @param {?} event
     * @return {?}
     */
    IgxExpansionPanelHeaderComponent.prototype.openPanel = /**
     * @hidden \@internal
     * @param {?} event
     * @return {?}
     */
    function (event) {
        if (event.altKey) {
            this.panel.expand(event);
            this.onInteraction.emit({ event: event, panel: this.panel });
        }
    };
    /** @hidden @internal */
    /**
     * @hidden \@internal
     * @param {?} event
     * @return {?}
     */
    IgxExpansionPanelHeaderComponent.prototype.closePanel = /**
     * @hidden \@internal
     * @param {?} event
     * @return {?}
     */
    function (event) {
        if (event.altKey) {
            this.panel.collapse(event);
            this.onInteraction.emit({ event: event, panel: this.panel });
        }
    };
    Object.defineProperty(IgxExpansionPanelHeaderComponent.prototype, "iconPositionClass", {
        /**
        * @hidden
        */
        get: /**
         * @hidden
         * @return {?}
         */
        function () {
            switch (this.iconPosition) {
                case (ICON_POSITION.LEFT):
                    return "igx-expansion-panel__header-icon--start";
                case (ICON_POSITION.RIGHT):
                    return "igx-expansion-panel__header-icon--end";
                case (ICON_POSITION.NONE):
                    return "igx-expansion-panel__header-icon--none";
                default:
                    return '';
            }
        },
        enumerable: true,
        configurable: true
    });
    IgxExpansionPanelHeaderComponent.decorators = [
        { type: Component, args: [{
                    selector: 'igx-expansion-panel-header',
                    template: "<div class=\"igx-expansion-panel__header-inner\" tabindex=\"0\" role=\"button\" [attr.id]=\"id\"\n[attr.aria-disabled]=\"disabled\" [attr.aria-expanded]=\"isExpanded\" [attr.aria-controls]=\"controls\">\n    <div class=\"igx-expansion-panel__title-wrapper\">\n        <ng-content select=\"igx-expansion-panel-title\"></ng-content>\n        <ng-content select=\"igx-expansion-panel-description\"></ng-content>\n    </div>\n    <ng-content></ng-content>\n    <div [class]=\"iconPositionClass\">\n        <ng-content *ngIf=\"iconTemplate\" select=\"igx-expansion-panel-icon\"></ng-content>\n        <igx-icon *ngIf=\"!iconTemplate\" fontSet=\"material\">\n            {{panel.collapsed? 'expand_more':'expand_less'}}\n        </igx-icon>\n    </div>\n</div>\n"
                }] }
    ];
    /** @nocollapse */
    IgxExpansionPanelHeaderComponent.ctorParameters = function () { return [
        { type: undefined, decorators: [{ type: Host }, { type: Inject, args: [IGX_EXPANSION_PANEL_COMPONENT,] }] },
        { type: ChangeDetectorRef },
        { type: ElementRef }
    ]; };
    IgxExpansionPanelHeaderComponent.propDecorators = {
        iconTemplate: [{ type: ContentChild, args: [IgxExpansionPanelIconDirective, { static: false },] }],
        lv: [{ type: HostBinding, args: ['attr.aria-level',] }, { type: Input }],
        role: [{ type: HostBinding, args: ['attr.role',] }, { type: Input }],
        iconPosition: [{ type: Input }],
        onInteraction: [{ type: Output }],
        cssClass: [{ type: HostBinding, args: ['class.igx-expansion-panel__header',] }],
        isExpanded: [{ type: HostBinding, args: ['class.igx-expansion-panel__header--expanded',] }],
        disabled: [{ type: Input }, { type: HostBinding, args: ['class.igx-expansion-panel--disabled',] }],
        onAction: [{ type: HostListener, args: ['keydown.Enter', ['$event'],] }, { type: HostListener, args: ['keydown.Space', ['$event'],] }, { type: HostListener, args: ['keydown.Spacebar', ['$event'],] }, { type: HostListener, args: ['click', ['$event'],] }],
        openPanel: [{ type: HostListener, args: ['keydown.Alt.ArrowDown', ['$event'],] }],
        closePanel: [{ type: HostListener, args: ['keydown.Alt.ArrowUp', ['$event'],] }]
    };
    return IgxExpansionPanelHeaderComponent;
}());
export { IgxExpansionPanelHeaderComponent };
if (false) {
    /**
     * @type {?}
     * @private
     */
    IgxExpansionPanelHeaderComponent.prototype._iconTemplate;
    /**
     * Sets/gets the `id` of the expansion panel header.
     * ```typescript
     * let panelHeaderId =  this.panel.header.id;
     * ```
     * \@memberof IgxExpansionPanelComponent
     * @type {?}
     */
    IgxExpansionPanelHeaderComponent.prototype.id;
    /**
     * Gets/sets the `aria-level` attribute of the header
     * Get
     * ```typescript
     *  const currentAriaLevel = this.panel.header.lv;
     * ```
     * Set
     * ```typescript
     *  this.panel.header.lv = '5';
     * ```
     * ```html
     *  <igx-expansion-panel-header [lv]="myCustomLevel"></igx-expansion-panel-header>
     * ```
     * @type {?}
     */
    IgxExpansionPanelHeaderComponent.prototype.lv;
    /**
     * Gets/sets the `role` attribute of the header
     * Get
     * ```typescript
     *  const currentRole = this.panel.header.role;
     * ```
     * Set
     * ```typescript
     *  this.panel.header.role = '5';
     * ```
     * ```html
     *  <igx-expansion-panel-header [role]="'custom'"></igx-expansion-panel-header>
     * ```
     * @type {?}
     */
    IgxExpansionPanelHeaderComponent.prototype.role;
    /**
     * Gets/sets the position of the expansion-panel-header expand/collapse icon
     * Accepts `left`, `right` or `none`
     * ```typescript
     *  const currentIconPosition = this.panel.header.iconPosition;
     * ```
     * Set
     * ```typescript
     *  this.panel.header.iconPosition = 'left';
     * ```
     * ```html
     *  <igx-expansion-panel-header [iconPosition]="'right'"></igx-expansion-panel-header>
     * ```
     * @type {?}
     */
    IgxExpansionPanelHeaderComponent.prototype.iconPosition;
    /**
     * Emitted whenever a user interacts with the header host
     * ```typescript
     *  handleInteraction(event: IExpansionPanelEventArgs) {
     *  ...
     * }
     * ```
     * ```html
     *  <igx-expansion-panel-header (onInteraction)="handleInteraction($event)">
     *      ...
     *  </igx-expansion-panel-header>
     * ```
     * @type {?}
     */
    IgxExpansionPanelHeaderComponent.prototype.onInteraction;
    /**
     * @hidden
     * @type {?}
     */
    IgxExpansionPanelHeaderComponent.prototype.cssClass;
    /**
     * Gets/sets the whether the header is disabled
     * When disabled, the header will not handle user events and will stop their propagation
     *
     * ```typescript
     *  const isDisabled = this.panel.header.disabled;
     * ```
     * Set
     * ```typescript
     *  this.panel.header.disabled = true;
     * ```
     * ```html
     *  <igx-expansion-panel-header [disabled]="true">
     *     ...
     *  </igx-expansion-panel-header>
     * ```
     * @type {?}
     */
    IgxExpansionPanelHeaderComponent.prototype.disabled;
    /** @type {?} */
    IgxExpansionPanelHeaderComponent.prototype.panel;
    /** @type {?} */
    IgxExpansionPanelHeaderComponent.prototype.cdr;
    /** @type {?} */
    IgxExpansionPanelHeaderComponent.prototype.elementRef;
}
//# sourceMappingURL=data:application/json;base64, 