import { ChangeDetectionStrategy, Component, Input } from '@angular/core';
import { CommonModule } from '@angular/common';
import { FirstUppercaseLocalizeSAPipe, TooltipModule } from '@anglr/common';
import { FormPipesModule } from '@anglr/common/forms';
import { PropertiesControlBase } from '../propertiesControlBase';
import { PropertyTypeControlsModule } from '../../../propertyTypeControls';
import * as i0 from "@angular/core";
import * as i1 from "@angular/common";
import * as i2 from "@anglr/common";
import * as i3 from "../../../propertyTypeControls/directives/propertyTypeControlRenderer/propertyTypeControlRenderer.directive";
import * as i4 from "@anglr/common/forms";
/**
 * Component used for displaying default generic properties control, displaying specified properties
 */
export class DefaultGenericPropertiesControlComponent extends PropertiesControlBase {
    constructor() {
        super(...arguments);
        //######################### public properties - inputs #########################
        /**
         * Array of properties that should be displayed by this component
         */
        this.properties = [];
    }
}
DefaultGenericPropertiesControlComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.4", ngImport: i0, type: DefaultGenericPropertiesControlComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
DefaultGenericPropertiesControlComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.0.4", type: DefaultGenericPropertiesControlComponent, selector: "default-generic-properties-control", inputs: { properties: "properties" }, usesInheritance: true, ngImport: i0, template: "<ng-container *ngFor=\"let property of properties\">\n    <!-- TODO pipe for control.control -->\n    <div class=\"properties-form-group\" *ngIf=\"form?.get(property)\">\n        <label class=\"properties-control-label\">{{(propertiesMetadata?.[property]?.name ?? property)|firstUppercaseLocalize}} <span *ngIf=\"propertiesMetadata?.[property]?.description\" class=\"fas fa-info-circle\" [tooltip]=\"propertiesMetadata?.[property]?.description|firstUppercaseLocalize\"></span></label>\n        <ng-container [propertyTypeControl]=\"propertiesMetadata?.[property]?.type\" [control]=\"$any(form?.get(property) | asFormControl)\" [values]=\"propertiesMetadata?.[property]?.values ?? []\"></ng-container>\n    </div>\n</ng-container>", dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.TooltipDirective, selector: "[tooltip]", inputs: ["tooltip", "allowHtml", "template", "tooltipOptions", "tooltipVisible", "containerElement"] }, { kind: "directive", type: i3.PropertyTypeControlRendererDirective, selector: "[propertyTypeControl]", inputs: ["control", "propertyTypeControl", "values"] }, { kind: "pipe", type: i4.AsFormControlPipe, name: "asFormControl" }, { kind: "pipe", type: i2.FirstUppercaseLocalizeSAPipe, name: "firstUppercaseLocalize" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.4", ngImport: i0, type: DefaultGenericPropertiesControlComponent, decorators: [{
            type: Component,
            args: [{ selector: 'default-generic-properties-control', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container *ngFor=\"let property of properties\">\n    <!-- TODO pipe for control.control -->\n    <div class=\"properties-form-group\" *ngIf=\"form?.get(property)\">\n        <label class=\"properties-control-label\">{{(propertiesMetadata?.[property]?.name ?? property)|firstUppercaseLocalize}} <span *ngIf=\"propertiesMetadata?.[property]?.description\" class=\"fas fa-info-circle\" [tooltip]=\"propertiesMetadata?.[property]?.description|firstUppercaseLocalize\"></span></label>\n        <ng-container [propertyTypeControl]=\"propertiesMetadata?.[property]?.type\" [control]=\"$any(form?.get(property) | asFormControl)\" [values]=\"propertiesMetadata?.[property]?.values ?? []\"></ng-container>\n    </div>\n</ng-container>" }]
        }], propDecorators: { properties: [{
                type: Input
            }] } });
/**
 * Gets generic properties control component for specific properties
 * @param properties - Array of properties which will be displayed in generic properties control
 */
export function genericPropertiesControlFor(properties) {
    class GenericPropertiesControl extends DefaultGenericPropertiesControlComponent {
        constructor() {
            super(...arguments);
            /**
             * @inheritdoc
             */
            this.properties = properties;
        }
    }
    GenericPropertiesControl.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.4", ngImport: i0, type: GenericPropertiesControl, deps: null, target: i0.ɵɵFactoryTarget.Component });
    GenericPropertiesControl.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.0.4", type: GenericPropertiesControl, isStandalone: true, selector: "generic-properties-control", inputs: { properties: "properties" }, usesInheritance: true, ngImport: i0, template: "<ng-container *ngFor=\"let property of properties\">\n    <!-- TODO pipe for control.control -->\n    <div class=\"properties-form-group\" *ngIf=\"form?.get(property)\">\n        <label class=\"properties-control-label\">{{(propertiesMetadata?.[property]?.name ?? property)|firstUppercaseLocalize}} <span *ngIf=\"propertiesMetadata?.[property]?.description\" class=\"fas fa-info-circle\" [tooltip]=\"propertiesMetadata?.[property]?.description|firstUppercaseLocalize\"></span></label>\n        <ng-container [propertyTypeControl]=\"propertiesMetadata?.[property]?.type\" [control]=\"$any(form?.get(property) | asFormControl)\" [values]=\"propertiesMetadata?.[property]?.values ?? []\"></ng-container>\n    </div>\n</ng-container>", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: TooltipModule }, { kind: "directive", type: i2.TooltipDirective, selector: "[tooltip]", inputs: ["tooltip", "allowHtml", "template", "tooltipOptions", "tooltipVisible", "containerElement"] }, { kind: "ngmodule", type: PropertyTypeControlsModule }, { kind: "directive", type: i3.PropertyTypeControlRendererDirective, selector: "[propertyTypeControl]", inputs: ["control", "propertyTypeControl", "values"] }, { kind: "ngmodule", type: FormPipesModule }, { kind: "pipe", type: i4.AsFormControlPipe, name: "asFormControl" }, { kind: "pipe", type: FirstUppercaseLocalizeSAPipe, name: "firstUppercaseLocalize" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
    i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.4", ngImport: i0, type: GenericPropertiesControl, decorators: [{
                type: Component,
                args: [{ selector: 'generic-properties-control', standalone: true, imports: [
                            CommonModule,
                            TooltipModule,
                            PropertyTypeControlsModule,
                            FormPipesModule,
                            FirstUppercaseLocalizeSAPipe,
                        ], changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container *ngFor=\"let property of properties\">\n    <!-- TODO pipe for control.control -->\n    <div class=\"properties-form-group\" *ngIf=\"form?.get(property)\">\n        <label class=\"properties-control-label\">{{(propertiesMetadata?.[property]?.name ?? property)|firstUppercaseLocalize}} <span *ngIf=\"propertiesMetadata?.[property]?.description\" class=\"fas fa-info-circle\" [tooltip]=\"propertiesMetadata?.[property]?.description|firstUppercaseLocalize\"></span></label>\n        <ng-container [propertyTypeControl]=\"propertiesMetadata?.[property]?.type\" [control]=\"$any(form?.get(property) | asFormControl)\" [values]=\"propertiesMetadata?.[property]?.values ?? []\"></ng-container>\n    </div>\n</ng-container>" }]
            }], propDecorators: { properties: [{
                    type: Input
                }] } });
    return GenericPropertiesControl;
}
//# sourceMappingURL=genericPropertiesControl.component.js.map