import { Component, Input } from '@angular/core';
import { CommonModule } from '@angular/common';
import { C8yTranslatePipe, DateTimePickerModule, FormGroupComponent } from '@c8y/ngx-components';
import { FormsModule } from '@c8y/ngx-components';
import { FormGroup, ReactiveFormsModule } from '@angular/forms';
import * as i0 from "@angular/core";
import * as i1 from "@angular/common";
import * as i2 from "@angular/forms";
import * as i3 from "@c8y/ngx-components";
export class CustomPropertyFieldComponent {
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.9", ngImport: i0, type: CustomPropertyFieldComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.9", type: CustomPropertyFieldComponent, isStandalone: true, selector: "c8y-custom-property-field", inputs: { fieldDefinition: "fieldDefinition", form: "form" }, ngImport: i0, template: "<ng-container *ngIf=\"form && fieldDefinition\">\n  <ng-container [ngSwitch]=\"fieldDefinition.type\">\n    <ng-container *ngSwitchCase=\"'boolean'\">\n      <c8y-form-group [formGroup]=\"form\">\n        <label\n          class=\"c8y-checkbox\"\n          [title]=\"fieldDefinition.label | translate\"\n          [for]=\"fieldDefinition.id\"\n        >\n          <input\n            type=\"checkbox\"\n            [id]=\"fieldDefinition.id\"\n            [formControlName]=\"fieldDefinition.id\"\n          />\n          <span></span>\n          <span>{{ fieldDefinition.label | translate }}</span>\n        </label>\n      </c8y-form-group>\n    </ng-container>\n\n    <ng-container *ngSwitchCase=\"'number'\">\n      <c8y-form-group [formGroup]=\"form\">\n        <label [for]=\"fieldDefinition.id\">\n          {{ fieldDefinition.label | translate }}\n        </label>\n        <input\n          class=\"form-control\"\n          type=\"number\"\n          [id]=\"fieldDefinition.id\"\n          [formControlName]=\"fieldDefinition.id\"\n        />\n      </c8y-form-group>\n    </ng-container>\n\n    <ng-container *ngSwitchCase=\"'integer'\">\n      <c8y-form-group [formGroup]=\"form\">\n        <label [for]=\"fieldDefinition.id\">\n          {{ fieldDefinition.label | translate }}\n        </label>\n        <input\n          class=\"form-control\"\n          type=\"number\"\n          [id]=\"fieldDefinition.id\"\n          [formControlName]=\"fieldDefinition.id\"\n        />\n      </c8y-form-group>\n    </ng-container>\n\n    <ng-container *ngSwitchCase=\"'string'\">\n      <c8y-form-group\n        *ngIf=\"!fieldDefinition.format\"\n        [formGroup]=\"form\"\n      >\n        <label [for]=\"fieldDefinition.id\">\n          {{ fieldDefinition.label | translate }}\n        </label>\n        <input\n          class=\"form-control\"\n          type=\"text\"\n          [id]=\"fieldDefinition.id\"\n          [formControlName]=\"fieldDefinition.id\"\n        />\n      </c8y-form-group>\n\n      <c8y-form-group\n        *ngIf=\"fieldDefinition.format === 'datetime'\"\n        [formGroup]=\"form\"\n      >\n        <label [for]=\"fieldDefinition.id\">\n          {{ fieldDefinition.label | translate }}\n        </label>\n        <c8y-date-time-picker\n          [id]=\"fieldDefinition.id\"\n          [formControlName]=\"fieldDefinition.id\"\n          data-cy=\"c8y-custom-property-field--date-time-picker\"\n        ></c8y-date-time-picker>\n      </c8y-form-group>\n    </ng-container>\n  </ng-container>\n</ng-container>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i1.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "pipe", type: C8yTranslatePipe, name: "translate" }, { kind: "component", type: FormGroupComponent, selector: "c8y-form-group", inputs: ["hasError", "hasWarning", "hasSuccess", "novalidation", "status"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2.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: i2.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }, { kind: "directive", type: i2.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i3.RequiredInputPlaceholderDirective, selector: "input[required], input[formControlName]" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "ngmodule", type: DateTimePickerModule }, { kind: "component", type: i3.DateTimePickerComponent, selector: "c8y-date-time-picker", inputs: ["minDate", "maxDate", "placeholder", "dateInputFormat", "adaptivePosition", "size", "dateType", "config"], outputs: ["onDateSelected"] }] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.9", ngImport: i0, type: CustomPropertyFieldComponent, decorators: [{
            type: Component,
            args: [{ selector: 'c8y-custom-property-field', standalone: true, imports: [
                        CommonModule,
                        C8yTranslatePipe,
                        FormGroupComponent,
                        FormsModule,
                        ReactiveFormsModule,
                        DateTimePickerModule
                    ], template: "<ng-container *ngIf=\"form && fieldDefinition\">\n  <ng-container [ngSwitch]=\"fieldDefinition.type\">\n    <ng-container *ngSwitchCase=\"'boolean'\">\n      <c8y-form-group [formGroup]=\"form\">\n        <label\n          class=\"c8y-checkbox\"\n          [title]=\"fieldDefinition.label | translate\"\n          [for]=\"fieldDefinition.id\"\n        >\n          <input\n            type=\"checkbox\"\n            [id]=\"fieldDefinition.id\"\n            [formControlName]=\"fieldDefinition.id\"\n          />\n          <span></span>\n          <span>{{ fieldDefinition.label | translate }}</span>\n        </label>\n      </c8y-form-group>\n    </ng-container>\n\n    <ng-container *ngSwitchCase=\"'number'\">\n      <c8y-form-group [formGroup]=\"form\">\n        <label [for]=\"fieldDefinition.id\">\n          {{ fieldDefinition.label | translate }}\n        </label>\n        <input\n          class=\"form-control\"\n          type=\"number\"\n          [id]=\"fieldDefinition.id\"\n          [formControlName]=\"fieldDefinition.id\"\n        />\n      </c8y-form-group>\n    </ng-container>\n\n    <ng-container *ngSwitchCase=\"'integer'\">\n      <c8y-form-group [formGroup]=\"form\">\n        <label [for]=\"fieldDefinition.id\">\n          {{ fieldDefinition.label | translate }}\n        </label>\n        <input\n          class=\"form-control\"\n          type=\"number\"\n          [id]=\"fieldDefinition.id\"\n          [formControlName]=\"fieldDefinition.id\"\n        />\n      </c8y-form-group>\n    </ng-container>\n\n    <ng-container *ngSwitchCase=\"'string'\">\n      <c8y-form-group\n        *ngIf=\"!fieldDefinition.format\"\n        [formGroup]=\"form\"\n      >\n        <label [for]=\"fieldDefinition.id\">\n          {{ fieldDefinition.label | translate }}\n        </label>\n        <input\n          class=\"form-control\"\n          type=\"text\"\n          [id]=\"fieldDefinition.id\"\n          [formControlName]=\"fieldDefinition.id\"\n        />\n      </c8y-form-group>\n\n      <c8y-form-group\n        *ngIf=\"fieldDefinition.format === 'datetime'\"\n        [formGroup]=\"form\"\n      >\n        <label [for]=\"fieldDefinition.id\">\n          {{ fieldDefinition.label | translate }}\n        </label>\n        <c8y-date-time-picker\n          [id]=\"fieldDefinition.id\"\n          [formControlName]=\"fieldDefinition.id\"\n          data-cy=\"c8y-custom-property-field--date-time-picker\"\n        ></c8y-date-time-picker>\n      </c8y-form-group>\n    </ng-container>\n  </ng-container>\n</ng-container>\n" }]
        }], propDecorators: { fieldDefinition: [{
                type: Input
            }], form: [{
                type: Input
            }] } });
//# sourceMappingURL=data:application/json;base64, 