import { Component, HostBinding, Input } 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", inputs: { routerUrl: "routerUrl", ariaLabel: "ariaLabel" }, host: { properties: { "style.pointer-events": "this.pointerEvents" } }, usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<ng-template #content>\n  <ax-icon *ngIf=\"icon && !_loading\" [name]=\"icon\" class=\"icon\"></ax-icon>\n  <ax-spinner class=\"button-spinner\" *ngIf=\"_loading\"></ax-spinner>\n  <ng-content></ng-content>\n</ng-template>\n\n<a\n  *ngIf=\"routerUrl\"\n  axButton\n  [attr.type]=\"type\"\n  [color]=\"color\"\n  [hover]=\"hover\"\n  [labelHideMobile]=\"_labelHideMobile\"\n  [smallButton]=\"_smallButton\"\n  [fullWidth]=\"_fullWidth\"\n  [filled]=\"_filled\"\n  [outline]=\"_outline\"\n  [icon-button]=\"_iconButton\"\n  [hover]=\"_hover\"\n  [hoverLabel]=\"_hoverLabel\"\n  [lowercase]=\"_lowercase\"\n  [disabled]=\"disabled || _loading\"\n  [attr.aria-label]=\"ariaLabel\"\n>\n  <ng-container [ngTemplateOutlet]=\"content\"></ng-container>\n</a>\n\n<button\n  *ngIf=\"!routerUrl\"\n  axButton\n  [attr.type]=\"type\"\n  [color]=\"color\"\n  [hover]=\"hover\"\n  [labelHideMobile]=\"_labelHideMobile\"\n  [smallButton]=\"_smallButton\"\n  [fullWidth]=\"_fullWidth\"\n  [filled]=\"_filled\"\n  [outline]=\"_outline\"\n  [icon-button]=\"_iconButton\"\n  [hover]=\"_hover\"\n  [hoverLabel]=\"_hoverLabel\"\n  [lowercase]=\"_lowercase\"\n  [disabled]=\"disabled || _loading\"\n  [attr.aria-label]=\"ariaLabel\"\n>\n  <ng-container [ngTemplateOutlet]=\"content\"></ng-container>\n</button>\n", dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { 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: "<ng-template #content>\n  <ax-icon *ngIf=\"icon && !_loading\" [name]=\"icon\" class=\"icon\"></ax-icon>\n  <ax-spinner class=\"button-spinner\" *ngIf=\"_loading\"></ax-spinner>\n  <ng-content></ng-content>\n</ng-template>\n\n<a\n  *ngIf=\"routerUrl\"\n  axButton\n  [attr.type]=\"type\"\n  [color]=\"color\"\n  [hover]=\"hover\"\n  [labelHideMobile]=\"_labelHideMobile\"\n  [smallButton]=\"_smallButton\"\n  [fullWidth]=\"_fullWidth\"\n  [filled]=\"_filled\"\n  [outline]=\"_outline\"\n  [icon-button]=\"_iconButton\"\n  [hover]=\"_hover\"\n  [hoverLabel]=\"_hoverLabel\"\n  [lowercase]=\"_lowercase\"\n  [disabled]=\"disabled || _loading\"\n  [attr.aria-label]=\"ariaLabel\"\n>\n  <ng-container [ngTemplateOutlet]=\"content\"></ng-container>\n</a>\n\n<button\n  *ngIf=\"!routerUrl\"\n  axButton\n  [attr.type]=\"type\"\n  [color]=\"color\"\n  [hover]=\"hover\"\n  [labelHideMobile]=\"_labelHideMobile\"\n  [smallButton]=\"_smallButton\"\n  [fullWidth]=\"_fullWidth\"\n  [filled]=\"_filled\"\n  [outline]=\"_outline\"\n  [icon-button]=\"_iconButton\"\n  [hover]=\"_hover\"\n  [hoverLabel]=\"_hoverLabel\"\n  [lowercase]=\"_lowercase\"\n  [disabled]=\"disabled || _loading\"\n  [attr.aria-label]=\"ariaLabel\"\n>\n  <ng-container [ngTemplateOutlet]=\"content\"></ng-container>\n</button>\n" }]
        }], propDecorators: { routerUrl: [{
                type: Input
            }], ariaLabel: [{
                type: Input
            }], pointerEvents: [{
                type: HostBinding,
                args: ['style.pointer-events']
            }] } });
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYnV0dG9uLmNvbXBvbmVudC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL2xpYnMvY29tcG9uZW50cy9idXR0b24vYnV0dG9uLmNvbXBvbmVudC50cyIsIi4uLy4uLy4uLy4uLy4uL2xpYnMvY29tcG9uZW50cy9idXR0b24vYnV0dG9uLmNvbXBvbmVudC5odG1sIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBQyxTQUFTLEVBQUUsV0FBVyxFQUFFLEtBQUssRUFBMkIsTUFBTSxlQUFlLENBQUM7QUFFdEYsT0FBTyxFQUFDLGNBQWMsRUFBQyxNQUFNLG1CQUFtQixDQUFDOzs7Ozs7QUFNakQsTUFBTSxPQUFPLGVBQWdCLFNBQ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