/**
 * @fileoverview added by tsickle
 * @suppress {checkTypes} checked by tsc
 */
import { Component, Input, Renderer2, ElementRef, HostBinding } from '@angular/core';
import { inputAttrToBoolean } from '../helper';
var ButtonComponent = /** @class */ (function () {
    function ButtonComponent(renderer, elementRef) {
        this.renderer = renderer;
        this.elementRef = elementRef;
        this._loading = false;
    }
    Object.defineProperty(ButtonComponent.prototype, "loading", {
        get: /**
         * @return {?}
         */
        function () {
            return this._loading;
        },
        set: /**
         * @param {?} v
         * @return {?}
         */
        function (v) {
            this._loading = inputAttrToBoolean(v);
            this.updateState();
        },
        enumerable: true,
        configurable: true
    });
    /**
     * @return {?}
     */
    ButtonComponent.prototype.updateState = /**
     * @return {?}
     */
    function () {
        this.renderer.setProperty(this.elementRef.nativeElement, 'disabled', this._loading);
    };
    ButtonComponent.decorators = [
        { type: Component, args: [{
                    /* tslint:disable */
                    selector: '[ui-button]',
                    /* tslint:enable */
                    template: "<span class=\"ui-loading-bar\"></span>\n<ng-content></ng-content>"
                },] },
    ];
    /** @nocollapse */
    ButtonComponent.ctorParameters = function () { return [
        { type: Renderer2, },
        { type: ElementRef, },
    ]; };
    ButtonComponent.propDecorators = {
        "loading": [{ type: Input }, { type: HostBinding, args: ['class.ui-loading',] },],
    };
    return ButtonComponent;
}());
export { ButtonComponent };
function ButtonComponent_tsickle_Closure_declarations() {
    /** @type {!Array<{type: !Function, args: (undefined|!Array<?>)}>} */
    ButtonComponent.decorators;
    /**
     * @nocollapse
     * @type {function(): !Array<(null|{type: ?, decorators: (undefined|!Array<{type: !Function, args: (undefined|!Array<?>)}>)})>}
     */
    ButtonComponent.ctorParameters;
    /** @type {!Object<string,!Array<{type: !Function, args: (undefined|!Array<?>)}>>} */
    ButtonComponent.propDecorators;
    /** @type {?} */
    ButtonComponent.prototype._loading;
    /** @type {?} */
    ButtonComponent.prototype.renderer;
    /** @type {?} */
    ButtonComponent.prototype.elementRef;
}

//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJ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