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"
    [hover]="_hover"
    [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"
    [hover]="_hover"
    [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,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYnV0dG9uLmNvbXBvbmVudC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL2xpYnMvY29tcG9uZW50cy9idXR0b24vYnV0dG9uLmNvbXBvbmVudC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUMsU0FBUyxFQUFFLFdBQVcsRUFBMkIsTUFBTSxlQUFlLENBQUM7QUFFL0UsT0FBTyxFQUFDLGNBQWMsRUFBQyxNQUFNLG1CQUFtQixDQUFDOzs7Ozs7QUF5QmpELE1BQU0sT0FBTyxlQUFnQixTQUFRLGNBQWM7SUF2Qm5EOztRQXdCdUMsa0JBQWEsR0FBRyxNQUFNLENBQUM7S0FPN0Q7SUFMQyxXQUFXLENBQUMsT0FBc0I7UUFDaEMsSUFBSSxPQUFPLENBQUMsUUFBUSxLQUFLLFNBQVMsSUFBSSxPQUFPLENBQUMsT0FBTyxLQUFLLFNBQVMsRUFBRTtZQUNuRSxJQU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