import * as i0 from '@angular/core';
import { input, model, booleanAttribute, computed, ChangeDetectionStrategy, Component } from '@angular/core';
import { STATUS_ICON } from '@siemens/element-ng/common';
import { SiIconComponent } from '@siemens/element-ng/icon';
import { SiTranslatePipe } from '@siemens/element-translate-ng/translate';

/**
 * Copyright (c) Siemens 2016 - 2026
 * SPDX-License-Identifier: MIT
 */
class SiSummaryWidgetComponent {
    /** Status. Alternatively, use {@link icon} and {@link color}. */
    status = input(...(ngDevMode ? [undefined, { debugName: "status" }] : []));
    /** Icon token, see {@link https://element.siemens.io/icons/element}. */
    icon = input(...(ngDevMode ? [undefined, { debugName: "icon" }] : []));
    /** Color class, see {@link https://element.siemens.io/fundamentals/typography/#color-variants-classes}. */
    color = input(...(ngDevMode ? [undefined, { debugName: "color" }] : []));
    /** Icon token, see {@link https://element.siemens.io/fundamentals/icons/}. */
    stackedIcon = input(...(ngDevMode ? [undefined, { debugName: "stackedIcon" }] : []));
    /** Color class, see {@link https://element.siemens.io/fundamentals/icons/}. */
    stackedColor = input(...(ngDevMode ? [undefined, { debugName: "stackedColor" }] : []));
    /** The label. */
    label = input.required(...(ngDevMode ? [{ debugName: "label" }] : []));
    /** Value to display. */
    value = input.required(...(ngDevMode ? [{ debugName: "value" }] : []));
    /**
     * Selected state, will change when clicked.
     * @defaultValue false
     */
    selected = model(false, ...(ngDevMode ? [{ debugName: "selected" }] : []));
    /**
     * Readonly state.
     * @defaultValue false
     */
    readonly = input(false, { ...(ngDevMode ? { debugName: "readonly" } : {}), transform: booleanAttribute });
    /**
     * Disabled state.
     * @defaultValue false
     */
    disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : {}), transform: booleanAttribute });
    interactive = computed(() => !this.disabled() && !this.readonly(), ...(ngDevMode ? [{ debugName: "interactive" }] : []));
    statusIcon = computed(() => {
        const status = this.status();
        return status
            ? STATUS_ICON[status]
            : {
                icon: this.icon(),
                color: this.color(),
                stacked: this.stackedIcon(),
                stackedColor: this.stackedColor()
            };
    }, ...(ngDevMode ? [{ debugName: "statusIcon" }] : []));
    toggleSelected() {
        if (this.interactive()) {
            this.selected.set(!this.selected());
        }
    }
    static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: SiSummaryWidgetComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
    static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.8", type: SiSummaryWidgetComponent, isStandalone: true, selector: "si-summary-widget", inputs: { status: { classPropertyName: "status", publicName: "status", isSignal: true, isRequired: false, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, stackedIcon: { classPropertyName: "stackedIcon", publicName: "stackedIcon", isSignal: true, isRequired: false, transformFunction: null }, stackedColor: { classPropertyName: "stackedColor", publicName: "stackedColor", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: true, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: true, transformFunction: null }, selected: { classPropertyName: "selected", publicName: "selected", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { selected: "selectedChange" }, ngImport: i0, template: "<div\n  class=\"widget ps-2 pe-4 gap-2\"\n  role=\"checkbox\"\n  [attr.tabindex]=\"interactive() ? '0' : ''\"\n  [attr.aria-disabled]=\"!interactive()\"\n  [attr.aria-checked]=\"selected()\"\n  [class.selected]=\"selected()\"\n  [class.disabled]=\"disabled()\"\n  [class.interactive]=\"interactive()\"\n  (click)=\"toggleSelected()\"\n  (keydown.enter)=\"toggleSelected()\"\n>\n  @let actualIcon = statusIcon();\n  @if (actualIcon.icon) {\n    <span class=\"icon icon-stack\">\n      <si-icon [class]=\"actualIcon.color\" [icon]=\"actualIcon.icon\" />\n      @if (actualIcon.stacked) {\n        <si-icon [class]=\"actualIcon.stackedColor\" [icon]=\"actualIcon.stacked\" />\n      }\n    </span>\n  }\n  <div class=\"d-flex flex-column py-2\" [class.ps-2]=\"!actualIcon.icon\">\n    <div class=\"si-h5\">{{ value() | translate }}</div>\n    <div class=\"si-body text-secondary\">{{ label() | translate }}</div>\n  </div>\n</div>\n", styles: [".widget{display:inline-flex;align-items:start;block-size:100%;border-radius:var(--element-radius-1)}.widget.interactive{cursor:pointer}.widget.interactive:not(.selected):hover{background:var(--element-base-1-hover)}.selected{background:var(--element-base-1-selected)}.disabled{opacity:var(--element-action-disabled-opacity)}\n"], dependencies: [{ kind: "component", type: SiIconComponent, selector: "si-icon", inputs: ["icon"] }, { kind: "pipe", type: SiTranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: SiSummaryWidgetComponent, decorators: [{
            type: Component,
            args: [{ selector: 'si-summary-widget', imports: [SiIconComponent, SiTranslatePipe], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div\n  class=\"widget ps-2 pe-4 gap-2\"\n  role=\"checkbox\"\n  [attr.tabindex]=\"interactive() ? '0' : ''\"\n  [attr.aria-disabled]=\"!interactive()\"\n  [attr.aria-checked]=\"selected()\"\n  [class.selected]=\"selected()\"\n  [class.disabled]=\"disabled()\"\n  [class.interactive]=\"interactive()\"\n  (click)=\"toggleSelected()\"\n  (keydown.enter)=\"toggleSelected()\"\n>\n  @let actualIcon = statusIcon();\n  @if (actualIcon.icon) {\n    <span class=\"icon icon-stack\">\n      <si-icon [class]=\"actualIcon.color\" [icon]=\"actualIcon.icon\" />\n      @if (actualIcon.stacked) {\n        <si-icon [class]=\"actualIcon.stackedColor\" [icon]=\"actualIcon.stacked\" />\n      }\n    </span>\n  }\n  <div class=\"d-flex flex-column py-2\" [class.ps-2]=\"!actualIcon.icon\">\n    <div class=\"si-h5\">{{ value() | translate }}</div>\n    <div class=\"si-body text-secondary\">{{ label() | translate }}</div>\n  </div>\n</div>\n", styles: [".widget{display:inline-flex;align-items:start;block-size:100%;border-radius:var(--element-radius-1)}.widget.interactive{cursor:pointer}.widget.interactive:not(.selected):hover{background:var(--element-base-1-hover)}.selected{background:var(--element-base-1-selected)}.disabled{opacity:var(--element-action-disabled-opacity)}\n"] }]
        }], propDecorators: { status: [{ type: i0.Input, args: [{ isSignal: true, alias: "status", required: false }] }], icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: false }] }], color: [{ type: i0.Input, args: [{ isSignal: true, alias: "color", required: false }] }], stackedIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "stackedIcon", required: false }] }], stackedColor: [{ type: i0.Input, args: [{ isSignal: true, alias: "stackedColor", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: true }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: true }] }], selected: [{ type: i0.Input, args: [{ isSignal: true, alias: "selected", required: false }] }, { type: i0.Output, args: ["selectedChange"] }], readonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonly", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }] } });

/**
 * Copyright (c) Siemens 2016 - 2026
 * SPDX-License-Identifier: MIT
 */

/**
 * Generated bundle index. Do not edit.
 */

export { SiSummaryWidgetComponent };
//# sourceMappingURL=siemens-element-ng-summary-widget.mjs.map
