import { ChangeDetectionStrategy, Component, HostBinding, Input } from '@angular/core';
import * as i0 from "@angular/core";
import * as i1 from "@angular/common";
// TODO: replace color to string literal type based on a `EvoColor` type
export var EvoIconButtonColor;
(function (EvoIconButtonColor) {
    EvoIconButtonColor["link"] = "link";
    EvoIconButtonColor["danger"] = "danger";
    EvoIconButtonColor["success"] = "success";
})(EvoIconButtonColor || (EvoIconButtonColor = {}));
const wrapperSelector = 'evo-icon-button';
export class EvoIconButtonComponent {
    constructor() {
        this.color = EvoIconButtonColor.link;
        /**
         * @deprecated instead of rectangle theme use `EvoNavigationButtonComponent`
         */
        this.theme = 'default';
        this.classes = [];
    }
    get isDisabled() {
        return this.disabled || this.loading;
    }
    ngOnInit() {
        this.updateClassesList();
    }
    ngOnChanges(changes) {
        if (changes.color !== undefined || changes.theme !== undefined) {
            this.updateClassesList();
        }
    }
    updateClassesList() {
        this.classes = [];
        if (this.size) {
            this.classes.push(`${wrapperSelector}_size-${this.size}`);
        }
        if (this.color && EvoIconButtonColor[this.color]) {
            this.classes.push(`${wrapperSelector}_color-${EvoIconButtonColor[this.color]}`);
        }
        if (this.theme) {
            this.classes.push(`${wrapperSelector}_theme-${this.theme}`);
        }
    }
}
EvoIconButtonComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: EvoIconButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
EvoIconButtonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.4.0", type: EvoIconButtonComponent, selector: "button[evo-icon-button], a[evo-icon-button]", inputs: { disabled: "disabled", loading: "loading", color: "color", theme: "theme", size: "size" }, host: { properties: { "disabled": "this.isDisabled" } }, usesOnChanges: true, ngImport: i0, template: "<div class=\"evo-icon-button\" [ngClass]=\"classes\">\n    <div *ngIf=\"!loading else spinner\" class=\"evo-icon-button__icon-wrapper\">\n        <ng-content select=\"evo-icon\"></ng-content>\n    </div>\n    <span class=\"evo-icon-button__label\"><ng-content></ng-content></span>\n</div>\n\n<ng-template #spinner>\n    <span class=\"evo-icon-button__loading-spinner\"></span>\n</ng-template>\n", styles: ["@keyframes evo-fx-blink{50%{transform:scale(1);opacity:1}to{opacity:0}}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}@keyframes gradient{0%{background-position:0 50%}50%{background-position:50vw 50%}to{background-position:100vw 50%}}:host{display:inline-block;padding:0;background:none;border:none;cursor:pointer;--evo-icon-button-background: #F4F6F8}.evo-icon-button{display:flex;flex-flow:row nowrap;align-items:center;margin:0;padding:0;background:none;border:none;outline:none;transition:color .3s}.evo-icon-button_theme-rectangle{padding:16px 16px 16px 8px;background:var(--evo-icon-button-background);border-radius:8px;cursor:pointer}.evo-icon-button_color-link{color:#0986e2}.evo-icon-button_color-link:hover{color:#3a9ee8}.evo-icon-button_color-link:active{color:#0879cb}.evo-icon-button_color-danger{color:#ff1817}.evo-icon-button_color-danger:hover{color:#ff4645}.evo-icon-button_color-danger:active{color:#e51715}.evo-icon-button_color-success{color:#21c68b}.evo-icon-button_color-success:hover{color:#4dd1a2}.evo-icon-button_color-success:active{color:#1eb27d}.evo-icon-button_size-small .evo-icon-button__icon-wrapper,.evo-icon-button_size-small .evo-icon-button__loading-spinner{flex:0 0 16px;width:16px;height:16px}.evo-icon-button_size-small .evo-icon-button__label{font-family:var(--evo-font);font-style:normal;font-size:14px;line-height:22px;font-weight:600}.evo-icon-button__icon-wrapper,.evo-icon-button__loading-spinner{flex:0 0 24px;width:24px;height:24px}.evo-icon-button ::ng-deep evo-icon{fill:currentColor}.evo-icon-button__label{margin-left:8px;white-space:nowrap;font-family:var(--evo-font);font-style:normal;font-size:16px;line-height:24px;font-weight:600}.evo-icon-button__label:empty{display:none}.evo-icon-button__loading-spinner{display:flex;justify-content:center;align-items:center}.evo-icon-button__loading-spinner:after{display:block;content:\"\";box-sizing:border-box;flex:0 0 20px;width:20px;height:20px;border:2px solid #C6C6C6;border-top-color:#21c68b;border-radius:50%;animation:spin .8s linear infinite}:host:disabled .evo-icon-button{color:#c6c6c6!important}\n"], directives: [{ type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: EvoIconButtonComponent, decorators: [{
            type: Component,
            args: [{ selector: 'button[evo-icon-button], a[evo-icon-button]', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"evo-icon-button\" [ngClass]=\"classes\">\n    <div *ngIf=\"!loading else spinner\" class=\"evo-icon-button__icon-wrapper\">\n        <ng-content select=\"evo-icon\"></ng-content>\n    </div>\n    <span class=\"evo-icon-button__label\"><ng-content></ng-content></span>\n</div>\n\n<ng-template #spinner>\n    <span class=\"evo-icon-button__loading-spinner\"></span>\n</ng-template>\n", styles: ["@keyframes evo-fx-blink{50%{transform:scale(1);opacity:1}to{opacity:0}}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}@keyframes gradient{0%{background-position:0 50%}50%{background-position:50vw 50%}to{background-position:100vw 50%}}:host{display:inline-block;padding:0;background:none;border:none;cursor:pointer;--evo-icon-button-background: #F4F6F8}.evo-icon-button{display:flex;flex-flow:row nowrap;align-items:center;margin:0;padding:0;background:none;border:none;outline:none;transition:color .3s}.evo-icon-button_theme-rectangle{padding:16px 16px 16px 8px;background:var(--evo-icon-button-background);border-radius:8px;cursor:pointer}.evo-icon-button_color-link{color:#0986e2}.evo-icon-button_color-link:hover{color:#3a9ee8}.evo-icon-button_color-link:active{color:#0879cb}.evo-icon-button_color-danger{color:#ff1817}.evo-icon-button_color-danger:hover{color:#ff4645}.evo-icon-button_color-danger:active{color:#e51715}.evo-icon-button_color-success{color:#21c68b}.evo-icon-button_color-success:hover{color:#4dd1a2}.evo-icon-button_color-success:active{color:#1eb27d}.evo-icon-button_size-small .evo-icon-button__icon-wrapper,.evo-icon-button_size-small .evo-icon-button__loading-spinner{flex:0 0 16px;width:16px;height:16px}.evo-icon-button_size-small .evo-icon-button__label{font-family:var(--evo-font);font-style:normal;font-size:14px;line-height:22px;font-weight:600}.evo-icon-button__icon-wrapper,.evo-icon-button__loading-spinner{flex:0 0 24px;width:24px;height:24px}.evo-icon-button ::ng-deep evo-icon{fill:currentColor}.evo-icon-button__label{margin-left:8px;white-space:nowrap;font-family:var(--evo-font);font-style:normal;font-size:16px;line-height:24px;font-weight:600}.evo-icon-button__label:empty{display:none}.evo-icon-button__loading-spinner{display:flex;justify-content:center;align-items:center}.evo-icon-button__loading-spinner:after{display:block;content:\"\";box-sizing:border-box;flex:0 0 20px;width:20px;height:20px;border:2px solid #C6C6C6;border-top-color:#21c68b;border-radius:50%;animation:spin .8s linear infinite}:host:disabled .evo-icon-button{color:#c6c6c6!important}\n"] }]
        }], propDecorators: { disabled: [{
                type: Input
            }], loading: [{
                type: Input
            }], color: [{
                type: Input
            }], theme: [{
                type: Input
            }], size: [{
                type: Input
            }], isDisabled: [{
                type: HostBinding,
                args: ['disabled']
            }] } });
//# sourceMappingURL=data:application/json;base64, 