import { Component, HostBinding, Inject, Injector, Optional } from '@angular/core';
import { DISPLAY_TYPE, provideAsWidgetRef, StylableComponent, styler } from '@wm/components/base';
import { registerProps } from './button.props';
import * as i0 from "@angular/core";
import * as i1 from "@angular/common";
import * as i2 from "@wm/components/base";
const _c0 = ["wmButton", ""];
const _c1 = [[["", 8, "caret"]]];
const _c2 = [".caret"];
const _c3 = (a0, a1, a2) => ({ width: a0, height: a1, margin: a2 });
const _c4 = (a0, a1, a2, a3) => ({ width: a0, height: a1, margin: a2, fontSize: a3 });
function ButtonComponent_img_0_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelement(0, "img", 5);
    i0.ɵɵpipe(1, "image");
} if (rf & 2) {
    const ctx_r0 = i0.ɵɵnextContext();
    i0.ɵɵproperty("src", i0.ɵɵpipeBind1(1, 2, ctx_r0.iconurl), i0.ɵɵsanitizeUrl)("ngStyle", i0.ɵɵpureFunction3(4, _c3, ctx_r0.iconwidth, ctx_r0.iconheight, ctx_r0.iconmargin));
} }
function ButtonComponent_i_1_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelement(0, "i", 6);
} if (rf & 2) {
    const ctx_r0 = i0.ɵɵnextContext();
    i0.ɵɵclassMapInterpolate1("app-icon ", ctx_r0.iconclass, "");
    i0.ɵɵproperty("ngStyle", i0.ɵɵpureFunction4(4, _c4, ctx_r0.iconwidth, ctx_r0.iconheight, ctx_r0.iconmargin, ctx_r0.iconwidth));
} }
function ButtonComponent_span_2_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "span", 7);
    i0.ɵɵtext(1);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r0 = i0.ɵɵnextContext();
    i0.ɵɵadvance();
    i0.ɵɵtextInterpolate2("", ctx_r0.caption, " ", ctx_r0.appLocale.LABEL_ICON, "");
} }
function ButtonComponent_span_5_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelement(0, "span", 8);
} if (rf & 2) {
    const ctx_r0 = i0.ɵɵnextContext();
    i0.ɵɵproperty("textContent", ctx_r0.badgevalue);
} }
const DEFAULT_CLS = 'btn app-button';
const WIDGET_CONFIG = {
    widgetType: 'wm-button',
    hostClass: DEFAULT_CLS,
    displayType: DISPLAY_TYPE.INLINE_BLOCK
};
export class ButtonComponent extends StylableComponent {
    static { this.initializeProps = registerProps(); }
    constructor(inj, explicitContext) {
        super(inj, WIDGET_CONFIG, explicitContext);
        styler(this.nativeElement, this);
    }
    static { this.ɵfac = function ButtonComponent_Factory(t) { return new (t || ButtonComponent)(i0.ɵɵdirectiveInject(i0.Injector), i0.ɵɵdirectiveInject('EXPLICIT_CONTEXT', 8)); }; }
    static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: ButtonComponent, selectors: [["button", "wmButton", ""]], hostVars: 5, hostBindings: function ButtonComponent_HostBindings(rf, ctx) { if (rf & 2) {
            i0.ɵɵhostProperty("type", ctx.type)("tabIndex", ctx.tabindex)("disabled", ctx.disabled);
            i0.ɵɵattribute("accesskey", ctx.shortcutkey)("icon-position", ctx.iconposition);
        } }, exportAs: ["wmButton"], features: [i0.ɵɵProvidersFeature([
                provideAsWidgetRef(ButtonComponent)
            ]), i0.ɵɵInheritDefinitionFeature], attrs: _c0, ngContentSelectors: _c2, decls: 6, vars: 5, consts: [["data-identifier", "img", "alt", "button image", "class", "button-image-icon", 3, "src", "ngStyle", 4, "ngIf"], ["aria-hidden", "true", 3, "class", "ngStyle", 4, "ngIf"], ["class", "sr-only", 4, "ngIf"], [1, "btn-caption", 3, "innerHTML"], ["class", "badge pull-right", 3, "textContent", 4, "ngIf"], ["data-identifier", "img", "alt", "button image", 1, "button-image-icon", 3, "src", "ngStyle"], ["aria-hidden", "true", 3, "ngStyle"], [1, "sr-only"], [1, "badge", "pull-right", 3, "textContent"]], template: function ButtonComponent_Template(rf, ctx) { if (rf & 1) {
            i0.ɵɵprojectionDef(_c1);
            i0.ɵɵtemplate(0, ButtonComponent_img_0_Template, 2, 8, "img", 0)(1, ButtonComponent_i_1_Template, 1, 9, "i", 1)(2, ButtonComponent_span_2_Template, 2, 2, "span", 2);
            i0.ɵɵelement(3, "span", 3);
            i0.ɵɵprojection(4);
            i0.ɵɵtemplate(5, ButtonComponent_span_5_Template, 1, 1, "span", 4);
        } if (rf & 2) {
            i0.ɵɵproperty("ngIf", ctx.iconurl);
            i0.ɵɵadvance();
            i0.ɵɵproperty("ngIf", ctx.iconclass);
            i0.ɵɵadvance();
            i0.ɵɵproperty("ngIf", ctx.iconclass);
            i0.ɵɵadvance();
            i0.ɵɵproperty("innerHTML", ctx.caption, i0.ɵɵsanitizeHtml);
            i0.ɵɵadvance(2);
            i0.ɵɵproperty("ngIf", ctx.badgevalue);
        } }, dependencies: [i1.NgIf, i1.NgStyle, i2.TextContentDirective, i2.ImagePipe], encapsulation: 2 }); }
}
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ButtonComponent, [{
        type: Component,
        args: [{ selector: 'button[wmButton]', providers: [
                    provideAsWidgetRef(ButtonComponent)
                ], exportAs: 'wmButton', template: "<img data-identifier=\"img\" alt=\"button image\" class=\"button-image-icon\" [src]=\"iconurl | image\" *ngIf=\"iconurl\" [ngStyle]=\"{width:iconwidth, height:iconheight, margin:iconmargin}\"/>\n<i class=\"app-icon {{iconclass}}\" aria-hidden=\"true\" [ngStyle]=\"{width:iconwidth, height:iconheight, margin:iconmargin, fontSize:iconwidth}\" *ngIf=\"iconclass\"></i>\n<span class=\"sr-only\" *ngIf=\"iconclass\">{{caption}} {{appLocale.LABEL_ICON}}</span>\n<span class=\"btn-caption\" [innerHTML]=\"caption\"></span>\n<ng-content select=\".caret\"></ng-content>\n<span *ngIf=\"badgevalue\" class=\"badge pull-right\" [textContent]=\"badgevalue\"></span>\n" }]
    }], () => [{ type: i0.Injector }, { type: undefined, decorators: [{
                type: Inject,
                args: ['EXPLICIT_CONTEXT']
            }, {
                type: Optional
            }] }], { type: [{
            type: HostBinding,
            args: ['type']
        }], tabindex: [{
            type: HostBinding,
            args: ['tabIndex']
        }], disabled: [{
            type: HostBinding,
            args: ['disabled']
        }], shortcutkey: [{
            type: HostBinding,
            args: ['attr.accesskey']
        }], iconposition: [{
            type: HostBinding,
            args: ['attr.icon-position']
        }] }); })();
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(ButtonComponent, { className: "ButtonComponent", filePath: "button/button.component.ts", lineNumber: 22 }); })();
//# sourceMappingURL=data:application/json;base64, 