/**
 * @fileoverview added by tsickle
 * Generated from: components/button/button.ts
 * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
 */
/*
 MIT License

 Copyright (c) 2019 Temainfo Software

 Permission is hereby granted, free of charge, to any person obtaining a copy
 of this software and associated documentation files (the "Software"), to deal
 in the Software without restriction, including without limitation the rights
 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 copies of the Software, and to permit persons to whom the Software is
 furnished to do so, subject to the following conditions:
 The above copyright notice and this permission notice shall be included in all
 copies or substantial portions of the Software.
 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 SOFTWARE.
 */
import { Component, ElementRef, EventEmitter, HostBinding, Input, Output, TemplateRef, ViewChild } from '@angular/core';
import { I18nService } from '../i18n/i18n.service';
export class TlButton {
    /**
     * @param {?} button
     * @param {?} i18nService
     */
    constructor(button, i18nService) {
        this.button = button;
        this.i18nService = i18nService;
        this.text = '';
        this.iconAddonBefore = '';
        this.iconAddonAfter = '';
        this.iconBeforeText = '';
        this.iconAfterText = '';
        this.height = '30px';
        this.width = 'auto';
        this.disabled = false;
        this.flatBorder = false;
        this.colorIconBefore = '';
        this.colorIconAfter = '';
        this.outline = false;
        this.color = 'basic';
        this.loaderColor = '#ccc';
        this.isLoading = false;
        this.indexShortcut = 0;
        this.selected = new EventEmitter();
    }
    /**
     * @param {?} text
     * @return {?}
     */
    set textLoading(text) {
        this._textLoading = text;
    }
    /**
     * @return {?}
     */
    get disabledButton() {
        return this.disabled;
    }
    /**
     * @return {?}
     */
    get textLoading() {
        return this._textLoading || this.i18nService.getLocale().Button.loadingText;
    }
    /**
     * @param {?} modal
     * @return {?}
     */
    set modalContext(modal) {
        this._modalContext = modal;
    }
    /**
     * @return {?}
     */
    get modalContext() {
        return this._modalContext;
    }
    /**
     * @return {?}
     */
    ngOnInit() { }
    /**
     * @return {?}
     */
    setFocus() {
        this.buttonElement.nativeElement.focus();
    }
}
TlButton.decorators = [
    { type: Component, args: [{
                selector: 'tl-button',
                template: "<button #tlbutton\n        attr.tabindex=\"-1\"\n        cdkTrapFocus\n        [ngStyle]=\"{'min-width': width, 'height': height, 'border-radius': flatBorder ? '0' : '3px', 'line-height': height }\"\n        [ngClass]=\"{'disabled ': disabled, 'outline': outline}\"\n        [class]=\"'tl-button ripple '+ color\"\n        [disabled]=\"( disabled || isLoading ) ? true : null\">\n  <ng-container *ngTemplateOutlet=\"template ? template : templateContent\"></ng-container>\n</button>\n<ng-template #templateContent>\n  <tl-icon *ngIf=\"iconAddonBefore\"\n           [class]=\"color + ' iconAddonBefore'\"\n           [ngStyle]=\"{'line-height' : 'calc(' + height + ' - 1px)'}\"\n           [style.color]=\"colorIconBefore\">{{ iconAddonBefore }}\n  </tl-icon>\n  <div class=\"button-content\" [style.lineHeight]=\"height\">\n    <tl-icon *ngIf=\"iconBeforeText\">{{ iconBeforeText }}</tl-icon>\n    <span class=\"label\" *ngIf=\"!isLoading\">{{ text }}</span>\n    <span class=\"label\" *ngIf=\"isLoading\">{{ textLoading }}</span>\n    <tl-icon [lib]=\"'fa'\" [animation]=\"'spin'\" [color]=\"loaderColor\" *ngIf=\"isLoading\">spinner</tl-icon>\n    <tl-icon *ngIf=\"iconAfterText\">{{ iconAfterText }}</tl-icon>\n  </div>\n  <tl-icon *ngIf=\"iconAddonAfter\"\n           [class]=\"color + ' iconAddonAfter'\"\n           [ngStyle]=\"{'line-height': 'calc(' + height + ' - 1px)'}\"\n           [style.color]=\"colorIconAfter\">{{ iconAddonAfter }}\n  </tl-icon>\n</ng-template>\n\n",
                styles: [":host([disabled=true]){pointer-events:none}.tl-button{box-sizing:border-box;cursor:pointer;display:flex;font-family:Segoe UI,Lato,\"sans-serif\",Arial;font-size:1em;margin:0;outline:none;padding:0}.tl-button>.iconAddonAfter,.tl-button>.iconAddonBefore{box-sizing:border-box;padding:0 15px;pointer-events:none}.tl-button>.button-content{-moz-user-select:none;-ms-user-select:none;-webkit-user-select:none;align-items:center;display:flex;justify-content:center;margin:0 8px;user-select:none;width:100%}.tl-button>.button-content .label{padding:0 10px}.tl-button>.button-content tl-loader{box-sizing:border-box;margin:0 5px;position:relative;width:15px}.tl-button.disabled{pointer-events:none}.iconAfterText{padding:0 0 0 5px!important}"]
            }] }
];
/** @nocollapse */
TlButton.ctorParameters = () => [
    { type: ElementRef },
    { type: I18nService }
];
TlButton.propDecorators = {
    text: [{ type: Input }],
    iconAddonBefore: [{ type: Input }],
    iconAddonAfter: [{ type: Input }],
    iconBeforeText: [{ type: Input }],
    iconAfterText: [{ type: Input }],
    height: [{ type: Input }],
    width: [{ type: Input }],
    disabled: [{ type: Input }],
    flatBorder: [{ type: Input }],
    colorIconBefore: [{ type: Input }],
    colorIconAfter: [{ type: Input }],
    template: [{ type: Input }],
    outline: [{ type: Input }],
    color: [{ type: Input }],
    loaderColor: [{ type: Input }],
    isLoading: [{ type: Input }],
    indexShortcut: [{ type: Input }],
    textLoading: [{ type: Input }],
    disabledButton: [{ type: HostBinding, args: ['attr.disabled',] }],
    selected: [{ type: Output }],
    buttonElement: [{ type: ViewChild, args: ['tlbutton', { static: true },] }]
};
if (false) {
    /** @type {?} */
    TlButton.prototype.text;
    /** @type {?} */
    TlButton.prototype.iconAddonBefore;
    /** @type {?} */
    TlButton.prototype.iconAddonAfter;
    /** @type {?} */
    TlButton.prototype.iconBeforeText;
    /** @type {?} */
    TlButton.prototype.iconAfterText;
    /** @type {?} */
    TlButton.prototype.height;
    /** @type {?} */
    TlButton.prototype.width;
    /** @type {?} */
    TlButton.prototype.disabled;
    /** @type {?} */
    TlButton.prototype.flatBorder;
    /** @type {?} */
    TlButton.prototype.colorIconBefore;
    /** @type {?} */
    TlButton.prototype.colorIconAfter;
    /** @type {?} */
    TlButton.prototype.template;
    /** @type {?} */
    TlButton.prototype.outline;
    /** @type {?} */
    TlButton.prototype.color;
    /** @type {?} */
    TlButton.prototype.loaderColor;
    /** @type {?} */
    TlButton.prototype.isLoading;
    /** @type {?} */
    TlButton.prototype.indexShortcut;
    /** @type {?} */
    TlButton.prototype.selected;
    /** @type {?} */
    TlButton.prototype.buttonElement;
    /**
     * @type {?}
     * @private
     */
    TlButton.prototype._textLoading;
    /**
     * @type {?}
     * @private
     */
    TlButton.prototype._modalContext;
    /** @type {?} */
    TlButton.prototype.button;
    /**
     * @type {?}
     * @private
     */
    TlButton.prototype.i18nService;
}
//# sourceMappingURL=data:application/json;base64, 