import { Component, ChangeDetectionStrategy, Inject } from '@angular/core';
import { CommonModule } from '@angular/common';
import { ReactiveFormsModule } from '@angular/forms';
import { MatDialogModule } from '@angular/material/dialog';
import { FirstUppercaseLocalizeSAPipe } from '@anglr/common';
import { TITLED_DIALOG_DATA } from '@anglr/common/material';
import { FormModelBuilder } from '@anglr/common/forms';
import { RelationsNodePropertiesModel } from './relationsNodePropertiesEditor.model';
import * as i0 from "@angular/core";
import * as i1 from "@anglr/common/forms";
import * as i2 from "@angular/common";
import * as i3 from "@angular/material/dialog";
import * as i4 from "@angular/forms";
/**
 * Component used for editing display name of relations node
 */
export class RelationsNodePropertiesEditorSAComponent {
    //######################### constructor #########################
    constructor(data, formModelBuilder) {
        this.data = data;
        /**
         * Array of available scopes
         */
        this.scopes = [];
        this.form = formModelBuilder.build(new RelationsNodePropertiesModel(data.properties));
        this.scopes = data.scopeRegister.scopes;
    }
}
RelationsNodePropertiesEditorSAComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.4", ngImport: i0, type: RelationsNodePropertiesEditorSAComponent, deps: [{ token: TITLED_DIALOG_DATA }, { token: i1.FormModelBuilder }], target: i0.ɵɵFactoryTarget.Component });
RelationsNodePropertiesEditorSAComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.0.4", type: RelationsNodePropertiesEditorSAComponent, isStandalone: true, selector: "relations-node-properties-editor", providers: [
        FormModelBuilder,
    ], ngImport: i0, template: "<div class=\"dynamic-form-group\" [formGroup]=\"form\">\n    <label class=\"dynamic-control-label\">{{'display name'|firstUppercaseLocalize}}</label>\n    <input class=\"dynamic-form-control\" type=\"text\" formControlName=\"displayName\">\n\n    <label class=\"dynamic-control-label\">{{'scope'|firstUppercaseLocalize}}</label>\n    <input class=\"dynamic-form-control\" type=\"text\" formControlName=\"scope\" [readonly]=\"true\" *ngIf=\"!data.scopeConfigurable\">\n\n    <select class=\"dynamic-form-control\" formControlName=\"scope\" *ngIf=\"data.scopeConfigurable\">\n        <option value=\"\">---</option>\n        <option *ngFor=\"let scope of scopes\" [value]=\"scope\">{{scope}}</option>\n    </select>\n</div>\n\n<div class=\"dynamic-flex-row dynamic-flex-end dynamic-action-buttons\">\n    <button type=\"button\" class=\"dynamic-btn dynamic-btn-info dynamic-margin-right-extra-small\" [mat-dialog-close]=\"null\">\n        <span>{{'cancel'|firstUppercaseLocalize}}</span>\n    </button>\n\n    <button type=\"button\" class=\"dynamic-btn dynamic-btn-primary\" [mat-dialog-close]=\"form.value\">\n        <span>{{'ok'|firstUppercaseLocalize}}</span>\n    </button>\n</div>", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: MatDialogModule }, { kind: "directive", type: i3.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["aria-label", "type", "mat-dialog-close", "matDialogClose"], exportAs: ["matDialogClose"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i4.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i4.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i4.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i4.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i4.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i4.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i4.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "pipe", type: FirstUppercaseLocalizeSAPipe, name: "firstUppercaseLocalize" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.4", ngImport: i0, type: RelationsNodePropertiesEditorSAComponent, decorators: [{
            type: Component,
            args: [{ selector: 'relations-node-properties-editor', standalone: true, imports: [
                        CommonModule,
                        MatDialogModule,
                        ReactiveFormsModule,
                        FirstUppercaseLocalizeSAPipe
                    ], providers: [
                        FormModelBuilder,
                    ], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"dynamic-form-group\" [formGroup]=\"form\">\n    <label class=\"dynamic-control-label\">{{'display name'|firstUppercaseLocalize}}</label>\n    <input class=\"dynamic-form-control\" type=\"text\" formControlName=\"displayName\">\n\n    <label class=\"dynamic-control-label\">{{'scope'|firstUppercaseLocalize}}</label>\n    <input class=\"dynamic-form-control\" type=\"text\" formControlName=\"scope\" [readonly]=\"true\" *ngIf=\"!data.scopeConfigurable\">\n\n    <select class=\"dynamic-form-control\" formControlName=\"scope\" *ngIf=\"data.scopeConfigurable\">\n        <option value=\"\">---</option>\n        <option *ngFor=\"let scope of scopes\" [value]=\"scope\">{{scope}}</option>\n    </select>\n</div>\n\n<div class=\"dynamic-flex-row dynamic-flex-end dynamic-action-buttons\">\n    <button type=\"button\" class=\"dynamic-btn dynamic-btn-info dynamic-margin-right-extra-small\" [mat-dialog-close]=\"null\">\n        <span>{{'cancel'|firstUppercaseLocalize}}</span>\n    </button>\n\n    <button type=\"button\" class=\"dynamic-btn dynamic-btn-primary\" [mat-dialog-close]=\"form.value\">\n        <span>{{'ok'|firstUppercaseLocalize}}</span>\n    </button>\n</div>" }]
        }], ctorParameters: () => [{ type: undefined, decorators: [{
                    type: Inject,
                    args: [TITLED_DIALOG_DATA]
                }] }, { type: i1.FormModelBuilder }] });
//# sourceMappingURL=relationsNodePropertiesEditor.component.js.map