import { Component, Input } from '@angular/core';
import { NgIf, NgSwitch, NgSwitchCase } from '@angular/common';
import { FormControl } from '@angular/forms';
import { InputType, FormControlType, } from '@testlocallibrary/shared-kernel/components/ldc-form/enums';
import { LdcValidationMessagesComponent } from '@testlocallibrary/shared-kernel/components/ldc-form/ldc-fields/ldc-validation-messages';
import { LdcInputComponent } from '@testlocallibrary/shared-kernel/components/ldc-form/ldc-fields/ldc-input';
import { LdcTextAreaComponent } from '@testlocallibrary/shared-kernel/components/ldc-form/ldc-fields/ldc-text-area';
import { LdcDropDownComponent } from '@testlocallibrary/shared-kernel/components/ldc-form/ldc-fields/ldc-drop-down';
import { LdcRadioButtonComponent } from '@testlocallibrary/shared-kernel/components/ldc-form/ldc-fields/ldc-radio-button';
import { LdcSocialReferenceComponent } from "@testlocallibrary/shared-kernel/components/ldc-form/ldc-fields/ldc-social-reference";
import { TranslateModule } from "@ngx-translate/core";
import * as i0 from "@angular/core";
import * as i1 from "@ngx-translate/core";
export class LdcFieldBuilderComponent {
    constructor() {
        this.errors = {};
        this.formControlType = FormControlType;
        this.inputType = InputType;
        this.formControl = new FormControl();
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: LdcFieldBuilderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: LdcFieldBuilderComponent, isStandalone: true, selector: "lib-ldc-field-builder", inputs: { input: ["inputSpecification", "input"], errors: "errors" }, ngImport: i0, template: "<ng-container [ngSwitch]=\"input.type\">\r\n  <ng-container *ngSwitchCase=\"formControlType.input\">\r\n    <lib-ldc-input\r\n      class=\"ldc-input form-field\"\r\n      [controller]=\"input.controller.controller ?? undefined\"\r\n      [isAutocomplete]=\"input?.isAutocomplete ?? false\"\r\n      [isAutofocus]=\"input?.isAutofocus ?? false\"\r\n      [label]=\"input?.controller?.label ?? input.placeholder\"\r\n      [inputId]=\"input?.id ?? ''\"\r\n      [placeholder]=\"input?.placeholder ?? ''\"\r\n      [type]=\"input.controllerSpecification.inputType ?? inputType.Text\"\r\n      (onChange)=\"input?.controllerSpecification?.change?.($event)\"\r\n      [isDisabled]=\"input?.controllerSpecification?.isDisabled ?? false\"\r\n      [isDisplayIconSearch]=\"\r\n        input?.controllerSpecification?.isDisplayIconSearch ?? false\r\n      \"\r\n      [isRequired]=\"input?.controllerSpecification?.isRequired ?? false\"\r\n      [options]=\"input?.controllerSpecification?.options ?? []\"\r\n      (onSelectionChange)=\"input?.controllerSpecification?.onSelectionChange?.($event)\"\r\n      [isWhiteMode]=\"input?.controllerSpecification?.isWhiteMode ?? false\"\r\n      [min]=\"input?.controllerSpecification?.min ?? 0\"\r\n      [max]=\"input?.controllerSpecification?.max ?? 100\"\r\n      [inputId]=\"input.controller.name\"\r\n    />\r\n  </ng-container>\r\n  <ng-container *ngSwitchCase=\"formControlType.select\">\r\n    <lib-ldc-drop-down\r\n      (onChange)=\"input?.controllerSpecification?.change?.($event)\"\r\n      (onScroll)=\"input?.controllerSpecification?.scroll?.($event)\"\r\n      (onSearch)=\"input?.controllerSpecification?.search?.($event)\"\r\n      (onRemoveChip)=\"input?.controllerSpecification?.removeChip?.($event)\"\r\n      (onControlValueChange)=\"input?.controllerSpecification?.controlValueChange?.($event)\"\r\n      [controller]=\"input.controller.controller\"\r\n      [isDependent]=\"input?.controllerSpecification?.isDependent\"\r\n      [isMultiple]=\"input?.controllerSpecification?.isMultiple ?? false\"\r\n      [isSearchable]=\"input?.controllerSpecification?.isSearchable ?? false\"\r\n      [isObservable]=\"input?.controllerSpecification?.isObservable ?? false\"\r\n      [isDisplayChips]=\"input?.controllerSpecification?.isDisplayChips ?? false\"\r\n      [key]=\"input?.controllerSpecification?.key ?? 'id'\"\r\n      [label]=\"input?.controller?.label ?? input.placeholder\"\r\n      [optionsObservable]=\"input?.controllerSpecification?.optionsObservable\"\r\n      [controllerValue]=\"input?.controllerSpecification?.controllerValue ?? []\"\r\n      [options]=\"input?.controllerSpecification?.options ?? []\"\r\n      [placeholder]=\"input?.placeholder ?? ''\"\r\n      [value]=\"input.controllerSpecification.value ?? ''\"\r\n      [isShowTooltip]=\"input?.controllerSpecification?.isShowTooltip ?? false\"\r\n      [isWhiteMode]=\"input?.controllerSpecification?.isWhiteMode ?? false\"\r\n      [isDisplayButton]=\"\r\n        input?.controllerSpecification?.isDisplayButton ?? false\r\n      \"\r\n      (onButtonClick)=\"input?.controllerSpecification?.onButtonClick?.($event)\"\r\n      [isLoading]=\"input?.controllerSpecification?.isLoading ?? false\"\r\n      [textButton]=\"input?.controllerSpecification?.textButton ?? ''\"\r\n      [searchValue]=\"input?.controllerSpecification?.searchValue ?? ''\"\r\n      [isDisplayNone]=\"input?.controllerSpecification?.isDisplayNone ?? false\"\r\n      [textNone]=\"input?.controllerSpecification?.textNone ?? ''\"\r\n      [isRequired]=\"input?.controllerSpecification?.isRequired ?? false\"\r\n      [inputId]=\"input.controller.name\"\r\n    />\r\n  </ng-container>\r\n  <ng-container *ngSwitchCase=\"formControlType.radioGroup\">\r\n    <lib-ldc-radio-button\r\n      [controller]=\"input.controller.controller ?? undefined\"\r\n      [label]=\"input?.controller?.label ?? input.placeholder\"\r\n      [optionsList]=\"input?.controllerSpecification?.optionsListRadio ?? []\"\r\n      (inputValueChanged)=\"input?.controllerSpecification?.change?.($event)\"\r\n      [className]=\"input?.controllerSpecification?.className ?? ''\"\r\n      [isDisabled]=\"input?.controllerSpecification?.isDisabled ?? false\"\r\n      [isToggle]=\"input?.controllerSpecification?.isToggle ?? false\"\r\n      [isRequired]=\"input?.controllerSpecification?.isRequired ?? false\"\r\n\r\n    ></lib-ldc-radio-button>\r\n  </ng-container>\r\n\r\n  <ng-container *ngSwitchCase=\"formControlType.textarea\">\r\n    <lib-ldc-text-area\r\n      [controller]=\"input.controller.controller\"\r\n      [label]=\"input?.controller?.label ?? input.placeholder\"\r\n      [placeholder]=\"input?.placeholder ?? ''\"\r\n      [rows]=\"input.controllerSpecification?.rows ?? 3\"\r\n      [columns]=\"input.controllerSpecification?.columns ?? 50\"\r\n      [isWhiteMode]=\"input?.controllerSpecification?.isWhiteMode ?? false\"\r\n      [isRequired]=\"input?.controllerSpecification?.isRequired ?? false\"\r\n      [inputId]=\"input.controller.name\"\r\n\r\n    ></lib-ldc-text-area>\r\n  </ng-container>\r\n  <ng-container *ngSwitchCase=\"formControlType.socialReference\">\r\n    <lib-ldc-social-reference\r\n      [controller]=\"input.controller.controller\"\r\n      [label]=\"input?.controller?.label ?? input.placeholder\"\r\n      [placeholder]=\"input?.placeholder ?? ''\"\r\n      [isRequired]=\"input?.controllerSpecification?.isRequired ?? false\"\r\n      [inputId]=\"input?.id ?? ''\"\r\n    ></lib-ldc-social-reference>\r\n  </ng-container>\r\n\r\n  <lib-ldc-validation-messages\r\n    [controller]=\"input.controller.controller\"\r\n    [errors]=\"errors\"\r\n    [defaultErrorMessage]=\"input?.defaultErrorMessage ?? 'Invalid field'\"\r\n    [label]=\"(input.controller.label ?? '') | translate\"\r\n  ></lib-ldc-validation-messages>\r\n</ng-container>\r\n", styles: [".form-field{margin-top:0}\n"], dependencies: [{ kind: "directive", type: NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "component", type: LdcValidationMessagesComponent, selector: "lib-ldc-validation-messages", inputs: ["controller", "errors", "defaultErrorMessage", "label"] }, { kind: "component", type: LdcInputComponent, selector: "lib-ldc-input", inputs: ["controller", "label", "type", "placeholder", "inputId", "isAutocomplete", "isAutofocus", "isRequired", "isDisabled", "isDisplayIconSearch", "options", "isWhiteMode", "min", "max"], outputs: ["onChange", "onSelectionChange"] }, { kind: "component", type: LdcTextAreaComponent, selector: "lib-ldc-text-area", inputs: ["label", "controller", "placeholder", "isReadOnly", "isRequired", "isDisabled", "isWhiteMode", "rows", "columns", "inputId"], outputs: ["inputValueChanged"] }, { kind: "component", type: LdcDropDownComponent, selector: "lib-ldc-drop-down", inputs: ["controller", "label", "value", "key", "options", "optionsObservable", "isObservable", "isRequired", "isDependent", "isMultiple", "isSearchable", "isDisplayClearBtn", "isDisabled", "placeholder", "searchOptions", "controllerValue", "isDisplayChips", "isShowTooltip", "isWhiteMode", "isDisplayButton", "isDisplayNone", "isLoading", "searchValue", "textButton", "textNone", "inputId"], outputs: ["onChange", "onScroll", "onSearch", "onClear", "onRemoveChip", "onControlValueChange", "onButtonClick"] }, { kind: "component", type: LdcRadioButtonComponent, selector: "lib-ldc-radio-button", inputs: ["controller", "label", "className", "optionsList", "isDisabled", "isRequired", "isToggle"], outputs: ["inputValueChanged"] }, { kind: "component", type: LdcSocialReferenceComponent, selector: "lib-ldc-social-reference", inputs: ["label", "controller", "placeholder", "inputId", "isRequired"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i1.TranslatePipe, name: "translate" }] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: LdcFieldBuilderComponent, decorators: [{
            type: Component,
            args: [{ selector: 'lib-ldc-field-builder', imports: [
                        NgSwitch,
                        NgSwitchCase,
                        NgIf,
                        LdcValidationMessagesComponent,
                        LdcInputComponent,
                        LdcTextAreaComponent,
                        LdcDropDownComponent,
                        LdcDropDownComponent,
                        LdcRadioButtonComponent,
                        LdcSocialReferenceComponent,
                        TranslateModule
                    ], standalone: true, template: "<ng-container [ngSwitch]=\"input.type\">\r\n  <ng-container *ngSwitchCase=\"formControlType.input\">\r\n    <lib-ldc-input\r\n      class=\"ldc-input form-field\"\r\n      [controller]=\"input.controller.controller ?? undefined\"\r\n      [isAutocomplete]=\"input?.isAutocomplete ?? false\"\r\n      [isAutofocus]=\"input?.isAutofocus ?? false\"\r\n      [label]=\"input?.controller?.label ?? input.placeholder\"\r\n      [inputId]=\"input?.id ?? ''\"\r\n      [placeholder]=\"input?.placeholder ?? ''\"\r\n      [type]=\"input.controllerSpecification.inputType ?? inputType.Text\"\r\n      (onChange)=\"input?.controllerSpecification?.change?.($event)\"\r\n      [isDisabled]=\"input?.controllerSpecification?.isDisabled ?? false\"\r\n      [isDisplayIconSearch]=\"\r\n        input?.controllerSpecification?.isDisplayIconSearch ?? false\r\n      \"\r\n      [isRequired]=\"input?.controllerSpecification?.isRequired ?? false\"\r\n      [options]=\"input?.controllerSpecification?.options ?? []\"\r\n      (onSelectionChange)=\"input?.controllerSpecification?.onSelectionChange?.($event)\"\r\n      [isWhiteMode]=\"input?.controllerSpecification?.isWhiteMode ?? false\"\r\n      [min]=\"input?.controllerSpecification?.min ?? 0\"\r\n      [max]=\"input?.controllerSpecification?.max ?? 100\"\r\n      [inputId]=\"input.controller.name\"\r\n    />\r\n  </ng-container>\r\n  <ng-container *ngSwitchCase=\"formControlType.select\">\r\n    <lib-ldc-drop-down\r\n      (onChange)=\"input?.controllerSpecification?.change?.($event)\"\r\n      (onScroll)=\"input?.controllerSpecification?.scroll?.($event)\"\r\n      (onSearch)=\"input?.controllerSpecification?.search?.($event)\"\r\n      (onRemoveChip)=\"input?.controllerSpecification?.removeChip?.($event)\"\r\n      (onControlValueChange)=\"input?.controllerSpecification?.controlValueChange?.($event)\"\r\n      [controller]=\"input.controller.controller\"\r\n      [isDependent]=\"input?.controllerSpecification?.isDependent\"\r\n      [isMultiple]=\"input?.controllerSpecification?.isMultiple ?? false\"\r\n      [isSearchable]=\"input?.controllerSpecification?.isSearchable ?? false\"\r\n      [isObservable]=\"input?.controllerSpecification?.isObservable ?? false\"\r\n      [isDisplayChips]=\"input?.controllerSpecification?.isDisplayChips ?? false\"\r\n      [key]=\"input?.controllerSpecification?.key ?? 'id'\"\r\n      [label]=\"input?.controller?.label ?? input.placeholder\"\r\n      [optionsObservable]=\"input?.controllerSpecification?.optionsObservable\"\r\n      [controllerValue]=\"input?.controllerSpecification?.controllerValue ?? []\"\r\n      [options]=\"input?.controllerSpecification?.options ?? []\"\r\n      [placeholder]=\"input?.placeholder ?? ''\"\r\n      [value]=\"input.controllerSpecification.value ?? ''\"\r\n      [isShowTooltip]=\"input?.controllerSpecification?.isShowTooltip ?? false\"\r\n      [isWhiteMode]=\"input?.controllerSpecification?.isWhiteMode ?? false\"\r\n      [isDisplayButton]=\"\r\n        input?.controllerSpecification?.isDisplayButton ?? false\r\n      \"\r\n      (onButtonClick)=\"input?.controllerSpecification?.onButtonClick?.($event)\"\r\n      [isLoading]=\"input?.controllerSpecification?.isLoading ?? false\"\r\n      [textButton]=\"input?.controllerSpecification?.textButton ?? ''\"\r\n      [searchValue]=\"input?.controllerSpecification?.searchValue ?? ''\"\r\n      [isDisplayNone]=\"input?.controllerSpecification?.isDisplayNone ?? false\"\r\n      [textNone]=\"input?.controllerSpecification?.textNone ?? ''\"\r\n      [isRequired]=\"input?.controllerSpecification?.isRequired ?? false\"\r\n      [inputId]=\"input.controller.name\"\r\n    />\r\n  </ng-container>\r\n  <ng-container *ngSwitchCase=\"formControlType.radioGroup\">\r\n    <lib-ldc-radio-button\r\n      [controller]=\"input.controller.controller ?? undefined\"\r\n      [label]=\"input?.controller?.label ?? input.placeholder\"\r\n      [optionsList]=\"input?.controllerSpecification?.optionsListRadio ?? []\"\r\n      (inputValueChanged)=\"input?.controllerSpecification?.change?.($event)\"\r\n      [className]=\"input?.controllerSpecification?.className ?? ''\"\r\n      [isDisabled]=\"input?.controllerSpecification?.isDisabled ?? false\"\r\n      [isToggle]=\"input?.controllerSpecification?.isToggle ?? false\"\r\n      [isRequired]=\"input?.controllerSpecification?.isRequired ?? false\"\r\n\r\n    ></lib-ldc-radio-button>\r\n  </ng-container>\r\n\r\n  <ng-container *ngSwitchCase=\"formControlType.textarea\">\r\n    <lib-ldc-text-area\r\n      [controller]=\"input.controller.controller\"\r\n      [label]=\"input?.controller?.label ?? input.placeholder\"\r\n      [placeholder]=\"input?.placeholder ?? ''\"\r\n      [rows]=\"input.controllerSpecification?.rows ?? 3\"\r\n      [columns]=\"input.controllerSpecification?.columns ?? 50\"\r\n      [isWhiteMode]=\"input?.controllerSpecification?.isWhiteMode ?? false\"\r\n      [isRequired]=\"input?.controllerSpecification?.isRequired ?? false\"\r\n      [inputId]=\"input.controller.name\"\r\n\r\n    ></lib-ldc-text-area>\r\n  </ng-container>\r\n  <ng-container *ngSwitchCase=\"formControlType.socialReference\">\r\n    <lib-ldc-social-reference\r\n      [controller]=\"input.controller.controller\"\r\n      [label]=\"input?.controller?.label ?? input.placeholder\"\r\n      [placeholder]=\"input?.placeholder ?? ''\"\r\n      [isRequired]=\"input?.controllerSpecification?.isRequired ?? false\"\r\n      [inputId]=\"input?.id ?? ''\"\r\n    ></lib-ldc-social-reference>\r\n  </ng-container>\r\n\r\n  <lib-ldc-validation-messages\r\n    [controller]=\"input.controller.controller\"\r\n    [errors]=\"errors\"\r\n    [defaultErrorMessage]=\"input?.defaultErrorMessage ?? 'Invalid field'\"\r\n    [label]=\"(input.controller.label ?? '') | translate\"\r\n  ></lib-ldc-validation-messages>\r\n</ng-container>\r\n", styles: [".form-field{margin-top:0}\n"] }]
        }], propDecorators: { input: [{
                type: Input,
                args: [{ alias: 'inputSpecification', required: true }]
            }], errors: [{
                type: Input
            }] } });
//# sourceMappingURL=data:application/json;base64, 