import { Component, HostBinding } from '@angular/core';
import { AbstractButton } from './abstract-button';
import * as i0 from "@angular/core";
import * as i1 from "@angular/common";
import * as i2 from "@aztrix/icons";
import * as i3 from "@aztrix/components/spinner";
import * as i4 from "./button.directive";
export class ButtonComponent extends AbstractButton {
    constructor() {
        super(...arguments);
        this.pointerEvents = 'auto';
    }
    ngOnChanges(changes) {
        if (changes.disabled !== undefined || changes.loading !== undefined) {
            this.pointerEvents = this.disabled || this._loading ? 'none' : 'auto';
        }
    }
}
ButtonComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: ButtonComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
ButtonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1.5", type: ButtonComponent, selector: "ax-button", host: { properties: { "style.pointer-events": "this.pointerEvents" } }, usesInheritance: true, usesOnChanges: true, ngImport: i0, template: `<button
    axButton
    [attr.type]="type"
    [color]="color"
    [hover]="hover"
    [labelHideMobile]="_labelHideMobile"
    [smallButton]="_smallButton"
    [fullWidth]="_fullWidth"
    [filled]="_filled"
    [outline]="_outline"
    [icon-button]="_iconButton"
    [hoverLabel]="_hoverLabel"
    [lowercase]="_lowercase"
    [disabled]="disabled || _loading"
  >
    <ax-icon *ngIf="icon && !_loading" [name]="icon" class="icon"></ax-icon>
    <ax-spinner class="button-spinner" *ngIf="_loading"></ax-spinner>
    <ng-content></ng-content>
  </button>`, isInline: true, dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i2.IconComponent, selector: "ax-icon", inputs: ["name", "inline"] }, { kind: "component", type: i3.SpinnerComponent, selector: "ax-spinner" }, { kind: "directive", type: i4.ButtonDirective, selector: "[axButton]", inputs: ["color", "labelHideMobile", "smallButton", "bigButton", "fullWidth", "filled", "outline", "icon-button", "hoverLabel", "hover", "lowercase", "disabled"] }] });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: ButtonComponent, decorators: [{
            type: Component,
            args: [{
                    selector: 'ax-button',
                    template: `<button
    axButton
    [attr.type]="type"
    [color]="color"
    [hover]="hover"
    [labelHideMobile]="_labelHideMobile"
    [smallButton]="_smallButton"
    [fullWidth]="_fullWidth"
    [filled]="_filled"
    [outline]="_outline"
    [icon-button]="_iconButton"
    [hoverLabel]="_hoverLabel"
    [lowercase]="_lowercase"
    [disabled]="disabled || _loading"
  >
    <ax-icon *ngIf="icon && !_loading" [name]="icon" class="icon"></ax-icon>
    <ax-spinner class="button-spinner" *ngIf="_loading"></ax-spinner>
    <ng-content></ng-content>
  </button>`,
                }]
        }], propDecorators: { pointerEvents: [{
                type: HostBinding,
                args: ['style.pointer-events']
            }] } });
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYnV0dG9uLmNvbXBvbmVudC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL2xpYnMvY29tcG9uZW50cy9idXR0b24vYnV0dG9uLmNvbXBvbmVudC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUMsU0FBUyxFQUFFLFdBQVcsRUFBMkIsTUFBTSxlQUFlLENBQUM7QUFFL0UsT0FBTyxFQUFDLGNBQWMsRUFBQyxNQUFNLG1CQUFtQixDQUFDOzs7Ozs7QUF3QmpELE1BQU0sT0FBTyxlQUFnQixTQUFRLGNBQWM7SUF0Qm5EOztRQXVCdUMsa0JBQWEsR0FBRyxNQUFNLENBQUM7S0FPN0Q7SUFMQyxXQUFXLENBQUMsT0FBc0I7UUFDaEMsSUFBSSxPQUFPLENBQUMsUUFBUSxLQUFLLFNBQVMsSUFBSSxPQUFPLENBQUMsT0FBTyxLQUFLLFNBQVMsRUFBRTtZQUNuRSxJQUFJLENBQUMsYUFBYSxHQUFHL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