import * as i6 from '@acorex/core/translation';
import { AXTranslationModule } from '@acorex/core/translation';
import { AXPColumnWidgetComponent } from '@acorex/platform/layout/widget-core';
import { AXPWorkflowService } from '@acorex/platform/workflow';
import * as i1 from '@angular/common';
import { CommonModule } from '@angular/common';
import * as i0 from '@angular/core';
import { computed, inject, ChangeDetectionStrategy, Component } from '@angular/core';

class AXPFeaturesWidgetColumnComponent extends AXPColumnWidgetComponent {
    constructor() {
        super(...arguments);
        this.count = computed(() => Object.keys(this.rawValue || {}).length, ...(ngDevMode ? [{ debugName: "count" }] : []));
        this.workflowService = inject(AXPWorkflowService);
    }
    async openFeaturesEditor() {
        await this.workflowService.execute('assign-features', {
            data: this.rowData
        });
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: AXPFeaturesWidgetColumnComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.19", type: AXPFeaturesWidgetColumnComponent, isStandalone: true, selector: "ng-component", inputs: { rawValue: "rawValue", rowData: "rowData" }, usesInheritance: true, ngImport: i0, template: `
    <span class="ax-cursor-pointer ax-text-primary ax-underline" (click)="openFeaturesEditor()">
      {{ count() }} {{ '@application-management:features-widget.terms.features' | translate | async }}
    </span>
  `, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: AXTranslationModule }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "pipe", type: i6.AXTranslatorPipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: AXPFeaturesWidgetColumnComponent, decorators: [{
            type: Component,
            args: [{
                    template: `
    <span class="ax-cursor-pointer ax-text-primary ax-underline" (click)="openFeaturesEditor()">
      {{ count() }} {{ '@application-management:features-widget.terms.features' | translate | async }}
    </span>
  `,
                    standalone: true,
                    changeDetection: ChangeDetectionStrategy.OnPush,
                    imports: [CommonModule, AXTranslationModule],
                    inputs: ['rawValue', 'rowData']
                }]
        }] });

export { AXPFeaturesWidgetColumnComponent };
//# sourceMappingURL=acorex-modules-application-management-features-widget-column.component-D3Ga1TW3.mjs.map
