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 AXMLearningManagementSkillMatrixComponent } from './acorex-modules-learning-management-skill-matrix.component-BVVtpWD_.mjs';

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

export { AXLSkillMatrixWidgetViewComponent };
//# sourceMappingURL=acorex-modules-learning-management-skill-matrix-widget-view.component-C5O2l2HW.mjs.map
