import { __decorate } from "tslib";
import { Component, ChangeDetectionStrategy, Input } from '@angular/core';
import { CommonModule } from '@angular/common';
import { ReactiveFormsModule } from '@angular/forms';
import { LayoutEditorMetadata } from '@anglr/dynamic/layout-editor';
import { CastPipesModule, HostDisplayBlockStyle } from '@anglr/common';
import { FormPipesModule } from '@anglr/common/forms';
import { FormComponentBase, FormComponentControlSAPipe } from '@anglr/dynamic/form';
import { RelationsEditorMetadata } from '@anglr/dynamic/relations-editor';
import { SelectLayoutMetadataLoader, SelectRelationsMetadataLoader } from './select.metadata';
import * as i0 from "@angular/core";
import * as i1 from "@anglr/common/forms";
import * as i2 from "@anglr/common";
import * as i3 from "@angular/forms";
import * as i4 from "@angular/common";
/**
 * Component used for displaying text field
 */
let SelectSAComponent = class SelectSAComponent extends FormComponentBase {
    constructor() {
        super(...arguments);
        //######################### public properties #########################
        this._values = [
            {
                code: 'foo',
                value: 'foo value',
            },
            {
                code: 'bar',
                value: 'bar value',
            }
        ];
    }
    //######################### poublic properties - inputs and outputs #########################
    /**
     * Indication whether form component is disabled
     */
    set values(value) {
        this._values = value;
    }
    get values() {
        return this._values;
    }
};
SelectSAComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.4", ngImport: i0, type: SelectSAComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
SelectSAComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.0.4", type: SelectSAComponent, isStandalone: true, selector: "form-select", inputs: { values: "values" }, usesInheritance: true, ngImport: i0, template: "<label>{{options?.label}}</label>\n<select *ngIf=\"!options?.multiple; else multipleSelect\" [formControl]=\"control|asFormControl|asRequired\">\n    <option *ngFor=\"let value of values\" [value]=\"value?.code\">{{value?.value}}</option>\n</select>\n<ng-template #multipleSelect>\n    <select multiple [formControl]=\"control|asFormControl|asRequired\">\n        <option *ngFor=\"let value of values\" [value]=\"value?.code\">{{value?.value}}</option>\n    </select>\n</ng-template>", styles: [":host{display: block;}"], dependencies: [{ kind: "ngmodule", type: FormPipesModule }, { kind: "pipe", type: i1.AsFormControlPipe, name: "asFormControl" }, { kind: "ngmodule", type: CastPipesModule }, { kind: "pipe", type: i2.AsRequiredTypePipe, name: "asRequired" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i3.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i3.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i3.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i3.SelectMultipleControlValueAccessor, selector: "select[multiple][formControlName],select[multiple][formControl],select[multiple][ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
SelectSAComponent = __decorate([
    RelationsEditorMetadata(SelectRelationsMetadataLoader),
    LayoutEditorMetadata(SelectLayoutMetadataLoader)
], SelectSAComponent);
export { SelectSAComponent };
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.4", ngImport: i0, type: SelectSAComponent, decorators: [{
            type: Component,
            args: [{ selector: 'form-select', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [
                        FormPipesModule,
                        CastPipesModule,
                        FormComponentControlSAPipe,
                        ReactiveFormsModule,
                        CommonModule,
                    ], template: "<label>{{options?.label}}</label>\n<select *ngIf=\"!options?.multiple; else multipleSelect\" [formControl]=\"control|asFormControl|asRequired\">\n    <option *ngFor=\"let value of values\" [value]=\"value?.code\">{{value?.value}}</option>\n</select>\n<ng-template #multipleSelect>\n    <select multiple [formControl]=\"control|asFormControl|asRequired\">\n        <option *ngFor=\"let value of values\" [value]=\"value?.code\">{{value?.value}}</option>\n    </select>\n</ng-template>", styles: [":host{display: block;}"] }]
        }], propDecorators: { values: [{
                type: Input
            }] } });
//# sourceMappingURL=select.component.js.map