/**
 * @fileoverview added by tsickle
 * @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
 */
import { Directive, ElementRef, EventEmitter, HostBinding, Input, Output, NgModule, Renderer2, HostListener } from '@angular/core';
var IgxButtonDirective = /** @class */ (function () {
    function IgxButtonDirective(element, _renderer) {
        this.element = element;
        this._renderer = _renderer;
        /**
         * @hidden
         */
        this._type = 'flat';
        /**
         * @hidden
         */
        this._cssClass = 'igx-button';
        /**
         * Called when the button is clicked
         */
        this.buttonClick = new EventEmitter();
        /**
         * Sets/gets the `role` attribute.
         * ```typescript
         * this.button.role = 'navbutton';
         * ```
         * ```typescript
         * let buttonRole =  this.button.role;
         * ```
         * \@memberof IgxButtonDirective
         */
        this.role = 'button';
        /**
         * Gets or sets whether the button is selected.
         * Mainly used in the IgxButtonGroup component and it will have no effect if set separately.
         * ```html
         * <button igxButton="flat" [selected]="button.selected"></button>
         * ```
         * \@memberof IgxButtonDirective
         */
        this.selected = false;
    }
    Object.defineProperty(IgxButtonDirective.prototype, "nativeElement", {
        /**
         * Returns the underlying DOM element
         */
        get: /**
         * Returns the underlying DOM element
         * @return {?}
         */
        function () {
            return this.element.nativeElement;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgxButtonDirective.prototype, "type", {
        /**
         * Sets the type of the button.
         * ```html
         * <button  igxButton= "icon"></button>
         * ```
         * @memberof IgxButtonDirective
         */
        set: /**
         * Sets the type of the button.
         * ```html
         * <button  igxButton= "icon"></button>
         * ```
         * \@memberof IgxButtonDirective
         * @param {?} value
         * @return {?}
         */
        function (value) {
            this._type = value || this._type;
            this._renderer.addClass(this.nativeElement, this._cssClass + "--" + this._type);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgxButtonDirective.prototype, "color", {
        /**
         * Sets the button text color.
         * ```html
         * <button igxButton="gradient" igxButtonColor="blue"></button>
         * ```
         * @memberof IgxButtonDirective
         */
        set: /**
         * Sets the button text color.
         * ```html
         * <button igxButton="gradient" igxButtonColor="blue"></button>
         * ```
         * \@memberof IgxButtonDirective
         * @param {?} value
         * @return {?}
         */
        function (value) {
            this._color = value || this.nativeElement.style.color;
            this._renderer.setStyle(this.nativeElement, 'color', this._color);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgxButtonDirective.prototype, "background", {
        /**
         * Sets the background color of the button.
         * ```html
         * <button igxButton="raised" igxButtonBackground="red"></button>
         * ```
         * @memberof IgxButtonDirective
         */
        set: /**
         * Sets the background color of the button.
         * ```html
         * <button igxButton="raised" igxButtonBackground="red"></button>
         * ```
         * \@memberof IgxButtonDirective
         * @param {?} value
         * @return {?}
         */
        function (value) {
            this._backgroundColor = value || this._backgroundColor;
            this._renderer.setStyle(this.nativeElement, 'background', this._backgroundColor);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgxButtonDirective.prototype, "label", {
        /**
         * Sets the `aria-label` attribute.
         * ```html
         * <button igxButton= "flat" igxLabel="Label"></button>
         * ```
         * @memberof IgxButtonDirective
         */
        set: /**
         * Sets the `aria-label` attribute.
         * ```html
         * <button igxButton= "flat" igxLabel="Label"></button>
         * ```
         * \@memberof IgxButtonDirective
         * @param {?} value
         * @return {?}
         */
        function (value) {
            this._label = value || this._label;
            this._renderer.setAttribute(this.nativeElement, "aria-label", this._label);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgxButtonDirective.prototype, "disabled", {
        /**
         * Enables/disables the button.
         *  ```html
         * <button igxButton= "fab" [disabled]="true"></button>
         * ```
         * @memberof IgxButtonDirective
         */
        set: /**
         * Enables/disables the button.
         *  ```html
         * <button igxButton= "fab" [disabled]="true"></button>
         * ```
         * \@memberof IgxButtonDirective
         * @param {?} val
         * @return {?}
         */
        function (val) {
            val = !!val;
            if (val) {
                this._renderer.addClass(this.nativeElement, this._cssClass + "--disabled");
            }
            else {
                this._renderer.removeClass(this.nativeElement, this._cssClass + "--disabled");
            }
        },
        enumerable: true,
        configurable: true
    });
    /**
     *@hidden
     */
    /**
     * @hidden
     * @param {?} ev
     * @return {?}
     */
    IgxButtonDirective.prototype.onClick = /**
     * @hidden
     * @param {?} ev
     * @return {?}
     */
    function (ev) {
        this.buttonClick.emit(ev);
    };
    IgxButtonDirective.decorators = [
        { type: Directive, args: [{
                    selector: '[igxButton]'
                },] }
    ];
    /** @nocollapse */
    IgxButtonDirective.ctorParameters = function () { return [
        { type: ElementRef },
        { type: Renderer2 }
    ]; };
    IgxButtonDirective.propDecorators = {
        buttonClick: [{ type: Output }],
        role: [{ type: HostBinding, args: ['attr.role',] }],
        type: [{ type: Input, args: ['igxButton',] }],
        color: [{ type: Input, args: ['igxButtonColor',] }],
        background: [{ type: Input, args: ['igxButtonBackground',] }],
        label: [{ type: Input, args: ['igxLabel',] }],
        disabled: [{ type: Input }],
        selected: [{ type: Input }],
        onClick: [{ type: HostListener, args: ['click', ['$event'],] }]
    };
    return IgxButtonDirective;
}());
export { IgxButtonDirective };
if (false) {
    /**
     * @hidden
     * @type {?}
     * @private
     */
    IgxButtonDirective.prototype._type;
    /**
     * @hidden
     * @type {?}
     * @private
     */
    IgxButtonDirective.prototype._cssClass;
    /**
     * @hidden
     * @type {?}
     * @private
     */
    IgxButtonDirective.prototype._color;
    /**
     * @hidden
     * @type {?}
     * @private
     */
    IgxButtonDirective.prototype._label;
    /**
     * @hidden
     * @type {?}
     * @private
     */
    IgxButtonDirective.prototype._backgroundColor;
    /**
     * Called when the button is clicked
     * @type {?}
     */
    IgxButtonDirective.prototype.buttonClick;
    /**
     * Sets/gets the `role` attribute.
     * ```typescript
     * this.button.role = 'navbutton';
     * ```
     * ```typescript
     * let buttonRole =  this.button.role;
     * ```
     * \@memberof IgxButtonDirective
     * @type {?}
     */
    IgxButtonDirective.prototype.role;
    /**
     * Gets or sets whether the button is selected.
     * Mainly used in the IgxButtonGroup component and it will have no effect if set separately.
     * ```html
     * <button igxButton="flat" [selected]="button.selected"></button>
     * ```
     * \@memberof IgxButtonDirective
     * @type {?}
     */
    IgxButtonDirective.prototype.selected;
    /** @type {?} */
    IgxButtonDirective.prototype.element;
    /**
     * @type {?}
     * @private
     */
    IgxButtonDirective.prototype._renderer;
}
/**
 * The IgxButtonModule provides the {\@link IgxButtonDirective} inside your application.
 */
var IgxButtonModule = /** @class */ (function () {
    function IgxButtonModule() {
    }
    IgxButtonModule.decorators = [
        { type: NgModule, args: [{
                    declarations: [IgxButtonDirective],
                    exports: [IgxButtonDirective]
                },] }
    ];
    return IgxButtonModule;
}());
export { IgxButtonModule };
//# sourceMappingURL=data:application/json;base64, 