import { CommonModule } from '@angular/common';
import * as i0 from '@angular/core';
import { computed, ChangeDetectionStrategy, ViewEncapsulation, Component } from '@angular/core';
import { AXPValueWidgetComponent } from '@acorex/platform/layout/widget-core';
import { A as AXMOrganizationManagementResponsibilitiesMatrixComponent } from './acorex-modules-organization-management-responsibilities-matrix.component-BM-jMzZf.mjs';

//#region ----   Imports   ----
//#endregion
//#region ----   Component Definition   ----
class AXMResponsibilitiesMatrixWidgetViewComponent extends AXPValueWidgetComponent {
    constructor() {
        super(...arguments);
        //#endregion
        //#region ----   Computed Properties   ----
        /**
         * Current matrix value
         */
        this.matrixValue = computed(() => {
            return this.getValue() || {};
        }, ...(ngDevMode ? [{ debugName: "matrixValue" }] : []));
    }
    //#endregion
    //#region ----   Event Handlers   ----
    /**
     * Handle value change from responsibilities-matrix component
     */
    handleValueChange(data) {
        if (data) {
            this.setValue(data);
        }
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: AXMResponsibilitiesMatrixWidgetViewComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.19", type: AXMResponsibilitiesMatrixWidgetViewComponent, isStandalone: true, selector: "axm-responsibilities-matrix-widget-view", host: { classAttribute: "ax-block ax-w-full" }, usesInheritance: true, ngImport: i0, template: `
        <axm-responsibilities-matrix
            [value]="matrixValue()"
            [readonly]="true"
            (valueChange)="handleValueChange($any($event))"
        ></axm-responsibilities-matrix>
    `, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "component", type: AXMOrganizationManagementResponsibilitiesMatrixComponent, selector: "axm-responsibilities-matrix", inputs: ["titles", "value", "readonly", "responsibilityIds"], outputs: ["valueChange", "cellChange", "responsibilityIdsChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: AXMResponsibilitiesMatrixWidgetViewComponent, decorators: [{
            type: Component,
            args: [{
                    selector: 'axm-responsibilities-matrix-widget-view',
                    standalone: true,
                    imports: [
                        CommonModule,
                        AXMOrganizationManagementResponsibilitiesMatrixComponent,
                    ],
                    template: `
        <axm-responsibilities-matrix
            [value]="matrixValue()"
            [readonly]="true"
            (valueChange)="handleValueChange($any($event))"
        ></axm-responsibilities-matrix>
    `,
                    host: {
                        class: 'ax-block ax-w-full',
                    },
                    encapsulation: ViewEncapsulation.None,
                    changeDetection: ChangeDetectionStrategy.OnPush,
                }]
        }] });

export { AXMResponsibilitiesMatrixWidgetViewComponent };
//# sourceMappingURL=acorex-modules-organization-management-responsibilities-matrix-widget-view.component-DZwqUHuP.mjs.map
