import { AXBadgeModule } from '@acorex/components/badge';
import * as i1 from '@acorex/components/button';
import { AXButtonModule } from '@acorex/components/button';
import * as i2$1 from '@acorex/components/decorators';
import { AXDecoratorModule } from '@acorex/components/decorators';
import * as i2 from '@acorex/components/loading';
import { AXLoadingModule } from '@acorex/components/loading';
import { AXPLayoutBaseWidgetComponent } from '@acorex/platform/layout/widget-core';
import * as i0 from '@angular/core';
import { computed, EventEmitter, HostBinding, ChangeDetectionStrategy, Component } from '@angular/core';

class AXPButtonWidgetDesignerComponent extends AXPLayoutBaseWidgetComponent {
    constructor() {
        super(...arguments);
        this.disabled = computed(() => this.options()['disabled'], ...(ngDevMode ? [{ debugName: "disabled" }] : []));
        this.color = computed(() => this.options()['color']?.id ?? 'primary', ...(ngDevMode ? [{ debugName: "color" }] : []));
        this.look = computed(() => this.options()['look']?.id ?? 'solid', ...(ngDevMode ? [{ debugName: "look" }] : []));
        this.text = computed(() => this.options()['text'], ...(ngDevMode ? [{ debugName: "text" }] : []));
        this.loading = computed(() => this.options()['loading'], ...(ngDevMode ? [{ debugName: "loading" }] : []));
        this.icon = computed(() => this.options()['icon'], ...(ngDevMode ? [{ debugName: "icon" }] : []));
        this.onClick = new EventEmitter();
    }
    get __class() {
        const cls = {};
        //
        cls['ax-inline-block'] = true;
        return cls;
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: AXPButtonWidgetDesignerComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.16", type: AXPButtonWidgetDesignerComponent, isStandalone: true, selector: "axp-button-widget-designer", host: { properties: { "class": "this.__class" } }, usesInheritance: true, ngImport: i0, template: `
    <ax-button [disabled]="disabled()" [color]="color()" [look]="look()" [text]="text()">
      @if (icon() && text()) {
        <ax-prefix
          ><ax-icon> <i class="fa-solid" [class]="icon()"></i> </ax-icon
        ></ax-prefix>
      } @else if (icon() && !text()) {
        <ax-icon> <i class="fa-solid" [class]="icon()"></i> </ax-icon>
      }
      @if (loading()) {
        <ax-loading> </ax-loading>
      }
    </ax-button>
  `, isInline: true, dependencies: [{ kind: "ngmodule", type: AXButtonModule }, { kind: "component", type: i1.AXButtonComponent, selector: "ax-button", inputs: ["disabled", "size", "tabIndex", "color", "look", "text", "toggleable", "selected", "iconOnly", "type", "loadingText"], outputs: ["onBlur", "onFocus", "onClick", "selectedChange", "toggleableChange", "lookChange", "colorChange", "disabledChange", "loadingTextChange"] }, { kind: "ngmodule", type: AXLoadingModule }, { kind: "component", type: i2.AXLoadingComponent, selector: "ax-loading", inputs: ["visible", "type", "context"], outputs: ["visibleChange"] }, { kind: "ngmodule", type: AXDecoratorModule }, { kind: "component", type: i2$1.AXDecoratorIconComponent, selector: "ax-icon", inputs: ["icon"] }, { kind: "component", type: i2$1.AXDecoratorGenericComponent, selector: "ax-footer, ax-header, ax-content, ax-divider, ax-form-hint, ax-prefix, ax-suffix, ax-text, ax-title, ax-subtitle, ax-placeholder, ax-overlay" }, { kind: "ngmodule", type: AXBadgeModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: AXPButtonWidgetDesignerComponent, decorators: [{
            type: Component,
            args: [{
                    selector: 'axp-button-widget-designer',
                    template: `
    <ax-button [disabled]="disabled()" [color]="color()" [look]="look()" [text]="text()">
      @if (icon() && text()) {
        <ax-prefix
          ><ax-icon> <i class="fa-solid" [class]="icon()"></i> </ax-icon
        ></ax-prefix>
      } @else if (icon() && !text()) {
        <ax-icon> <i class="fa-solid" [class]="icon()"></i> </ax-icon>
      }
      @if (loading()) {
        <ax-loading> </ax-loading>
      }
    </ax-button>
  `,
                    changeDetection: ChangeDetectionStrategy.OnPush,
                    imports: [AXButtonModule, AXLoadingModule, AXDecoratorModule, AXBadgeModule],
                }]
        }], propDecorators: { __class: [{
                type: HostBinding,
                args: ['class']
            }] } });

export { AXPButtonWidgetDesignerComponent };
//# sourceMappingURL=acorex-platform-layout-widgets-button-widget-designer.component-Dnbx_uY7.mjs.map
