import { Component, EventEmitter, Input, Output, ViewEncapsulation } from '@angular/core';
import { NgClass, NgIf, NgSwitch, NgSwitchCase, NgSwitchDefault } from '@angular/common';
import { ReactiveFormsModule } from '@angular/forms';
import { MatButtonModule } from '@angular/material/button';
import { MatInputModule } from '@angular/material/input';
import { MatIconModule } from '@angular/material/icon';
import { InputType } from '@testlocallibrary/shared-kernel/components/ldc-form/enums';
import { TranslateModule } from "@ngx-translate/core";
import { NgxMatIntlTelInputComponent } from "ngx-mat-intl-tel-input";
import { IdFormatPipe } from '@testlocallibrary/shared-kernel/pipes';
import * as i0 from "@angular/core";
import * as i1 from "@angular/forms";
import * as i2 from "@angular/material/button";
import * as i3 from "@ngx-translate/core";
import * as i4 from "@angular/material/icon";
import * as i5 from "@angular/material/input";
import * as i6 from "@angular/material/form-field";
export class LdcInputComponent {
    constructor() {
        this.placeholder = '';
        this.inputId = '';
        this.isAutocomplete = false;
        this.isAutofocus = false;
        this.isRequired = false;
        this.isDisabled = false;
        this.isDisplayIconSearch = false;
        this.options = [];
        this.isWhiteMode = false;
        this.min = 0;
        this.max = 100;
        this.hide = true;
        this.inputType = InputType;
        this.onChange = new EventEmitter();
        this.onSelectionChange = new EventEmitter();
        this.typeOfArray = 'string';
    }
    ngOnInit() { }
    countryChange($event) {
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: LdcInputComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: LdcInputComponent, isStandalone: true, selector: "lib-ldc-input", inputs: { controller: "controller", label: "label", type: "type", placeholder: "placeholder", inputId: "inputId", isAutocomplete: "isAutocomplete", isAutofocus: "isAutofocus", isRequired: "isRequired", isDisabled: "isDisabled", isDisplayIconSearch: "isDisplayIconSearch", options: "options", isWhiteMode: "isWhiteMode", min: "min", max: "max" }, outputs: { onChange: "onChange", onSelectionChange: "onSelectionChange" }, ngImport: i0, template: "<div class=\"ldc-input\">\r\n  <mat-label class=\"stc-label\"\r\n    >{{ label | translate }}\r\n    <small *ngIf=\"isRequired\" class=\"font-14 text-danger\">*</small>\r\n  </mat-label>\r\n  <ng-container [ngSwitch]=\"type\">\r\n    <mat-form-field\r\n      appearance=\"outline\"\r\n      *ngSwitchCase=\"inputType.Password\"\r\n      class=\"ldc-input w-100\"\r\n    >\r\n      <input\r\n        [autocomplete]=\"isAutocomplete\"\r\n        [autofocus]=\"isAutofocus\"\r\n        [formControl]=\"controller\"\r\n        [placeholder]=\"placeholder | translate\"\r\n        [type]=\"hide ? 'password' : 'text'\"\r\n        (change)=\"onChange.emit($event)\"\r\n        [id]=\"inputId | IdFormat\"\r\n        matInput\r\n      />\r\n      <!-- <button\r\n        (click)=\"hide = !hide\"\r\n        *ngIf=\"type === 'password'\"\r\n        [attr.aria-label]=\"'hidePassword'\"\r\n        [attr.aria-pressed]=\"hide\"\r\n        mat-icon-button\r\n        matSuffix\r\n        type=\"button\"\r\n      >\r\n        <mat-icon>{{ hide ? \"visibility_off\" : \"visibility\" }}</mat-icon>\r\n      </button> -->\r\n    </mat-form-field>\r\n    <mat-form-field\r\n      appearance=\"outline\"\r\n      *ngSwitchCase=\"inputType.PhoneNumber\"\r\n      class=\"ldc-input w-100\"\r\n    >\r\n      <ngx-mat-intl-tel-input\r\n        #phone\r\n        (countryChanged)=\"countryChange($event)\"\r\n        [preferredCountries]=\"['eg']\"\r\n        [enablePlaceholder]=\"true\"\r\n        [enableSearch]=\"true\"\r\n        [formControl]=\"controller\"\r\n        name=\"phone\"\r\n      >\r\n      </ngx-mat-intl-tel-input>\r\n      <mat-hint> eg : {{ phone?.selectedCountry?.placeHolder }}</mat-hint>\r\n    </mat-form-field>\r\n    <mat-form-field\r\n      *ngSwitchDefault\r\n      appearance=\"outline\"\r\n      class=\"ldc-input w-100\"\r\n      [ngClass]=\"isWhiteMode ? 'ldc-bg-white' : 'ldc-bg-gray'\"\r\n    >\r\n      <input\r\n        [autofocus]=\"isAutofocus\"\r\n        [formControl]=\"controller\"\r\n        [placeholder]=\"placeholder | translate\"\r\n        [type]=\"type\"\r\n        (change)=\"onChange.emit($event)\"\r\n        [required]=\"isRequired\"\r\n        [attr.disabled]=\"isDisabled\"\r\n        [id]=\"inputId | IdFormat\"\r\n        matInput\r\n        [min]=\"min\"\r\n        [max]=\"max\"\r\n      />\r\n      <button\r\n        type=\"button\"\r\n        mat-icon-button\r\n        matSuffix\r\n        *ngIf=\"isDisplayIconSearch\"\r\n      >\r\n        <mat-icon>search</mat-icon>\r\n      </button>\r\n    </mat-form-field>\r\n  </ng-container>\r\n\r\n  <ng-template #password></ng-template>\r\n</div>\r\n", styles: [".country-selector{opacity:1!important;width:100px!important;left:-14px!important;background-position:right -5px top 10px!important;background-image:url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24\" viewBox=\"0 0 24 24\" width=\"24\"><path d=\"M0 0h24v24H0V0z\" fill=\"none\"/><path d=\"M7.41 8.59L12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41\" fill=\"darkgrey\"/></svg>')!important}.mat-mdc-select-arrow-wrapper{border:solid #94a3b8;border-width:0 3px 3px 0;height:unset!important;display:inline-block;padding:3px;transform:rotate(45deg)}.mdc-text-field--outlined .mdc-notched-outline{direction:ltr}.mdc-text-field--no-label:not(.mdc-text-field--textarea) .mat-mdc-form-field-input-control.mdc-text-field__input,.mat-mdc-text-field-wrapper .mat-mdc-form-field-input-control{font-family:Noto Kufi Arabic,sans-serif}.stc-label{font-size:.874rem;font-weight:600}\n"], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.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: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i2.MatIconButton, selector: "button[mat-icon-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i3.TranslatePipe, name: "translate" }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i4.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "directive", type: NgSwitchDefault, selector: "[ngSwitchDefault]" }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i5.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl],      input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "component", type: i6.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i6.MatLabel, selector: "mat-label" }, { kind: "directive", type: i6.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i6.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "component", type: NgxMatIntlTelInputComponent, selector: "ngx-mat-intl-tel-input", inputs: ["preferredCountries", "enablePlaceholder", "inputPlaceholder", "cssClass", "name", "onlyCountries", "errorStateMatcher", "enableSearch", "searchPlaceholder", "describedBy", "format", "placeholder", "required", "disabled"], outputs: ["countryChanged"] }, { kind: "pipe", type: IdFormatPipe, name: "IdFormat" }], encapsulation: i0.ViewEncapsulation.None }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: LdcInputComponent, decorators: [{
            type: Component,
            args: [{ selector: 'lib-ldc-input', standalone: true, imports: [
                        ReactiveFormsModule,
                        MatButtonModule,
                        TranslateModule,
                        MatIconModule,
                        NgIf,
                        NgClass,
                        NgSwitch,
                        NgSwitchCase,
                        NgSwitchDefault,
                        MatInputModule,
                        NgxMatIntlTelInputComponent,
                        IdFormatPipe,
                    ], encapsulation: ViewEncapsulation.None, template: "<div class=\"ldc-input\">\r\n  <mat-label class=\"stc-label\"\r\n    >{{ label | translate }}\r\n    <small *ngIf=\"isRequired\" class=\"font-14 text-danger\">*</small>\r\n  </mat-label>\r\n  <ng-container [ngSwitch]=\"type\">\r\n    <mat-form-field\r\n      appearance=\"outline\"\r\n      *ngSwitchCase=\"inputType.Password\"\r\n      class=\"ldc-input w-100\"\r\n    >\r\n      <input\r\n        [autocomplete]=\"isAutocomplete\"\r\n        [autofocus]=\"isAutofocus\"\r\n        [formControl]=\"controller\"\r\n        [placeholder]=\"placeholder | translate\"\r\n        [type]=\"hide ? 'password' : 'text'\"\r\n        (change)=\"onChange.emit($event)\"\r\n        [id]=\"inputId | IdFormat\"\r\n        matInput\r\n      />\r\n      <!-- <button\r\n        (click)=\"hide = !hide\"\r\n        *ngIf=\"type === 'password'\"\r\n        [attr.aria-label]=\"'hidePassword'\"\r\n        [attr.aria-pressed]=\"hide\"\r\n        mat-icon-button\r\n        matSuffix\r\n        type=\"button\"\r\n      >\r\n        <mat-icon>{{ hide ? \"visibility_off\" : \"visibility\" }}</mat-icon>\r\n      </button> -->\r\n    </mat-form-field>\r\n    <mat-form-field\r\n      appearance=\"outline\"\r\n      *ngSwitchCase=\"inputType.PhoneNumber\"\r\n      class=\"ldc-input w-100\"\r\n    >\r\n      <ngx-mat-intl-tel-input\r\n        #phone\r\n        (countryChanged)=\"countryChange($event)\"\r\n        [preferredCountries]=\"['eg']\"\r\n        [enablePlaceholder]=\"true\"\r\n        [enableSearch]=\"true\"\r\n        [formControl]=\"controller\"\r\n        name=\"phone\"\r\n      >\r\n      </ngx-mat-intl-tel-input>\r\n      <mat-hint> eg : {{ phone?.selectedCountry?.placeHolder }}</mat-hint>\r\n    </mat-form-field>\r\n    <mat-form-field\r\n      *ngSwitchDefault\r\n      appearance=\"outline\"\r\n      class=\"ldc-input w-100\"\r\n      [ngClass]=\"isWhiteMode ? 'ldc-bg-white' : 'ldc-bg-gray'\"\r\n    >\r\n      <input\r\n        [autofocus]=\"isAutofocus\"\r\n        [formControl]=\"controller\"\r\n        [placeholder]=\"placeholder | translate\"\r\n        [type]=\"type\"\r\n        (change)=\"onChange.emit($event)\"\r\n        [required]=\"isRequired\"\r\n        [attr.disabled]=\"isDisabled\"\r\n        [id]=\"inputId | IdFormat\"\r\n        matInput\r\n        [min]=\"min\"\r\n        [max]=\"max\"\r\n      />\r\n      <button\r\n        type=\"button\"\r\n        mat-icon-button\r\n        matSuffix\r\n        *ngIf=\"isDisplayIconSearch\"\r\n      >\r\n        <mat-icon>search</mat-icon>\r\n      </button>\r\n    </mat-form-field>\r\n  </ng-container>\r\n\r\n  <ng-template #password></ng-template>\r\n</div>\r\n", styles: [".country-selector{opacity:1!important;width:100px!important;left:-14px!important;background-position:right -5px top 10px!important;background-image:url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24\" viewBox=\"0 0 24 24\" width=\"24\"><path d=\"M0 0h24v24H0V0z\" fill=\"none\"/><path d=\"M7.41 8.59L12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41\" fill=\"darkgrey\"/></svg>')!important}.mat-mdc-select-arrow-wrapper{border:solid #94a3b8;border-width:0 3px 3px 0;height:unset!important;display:inline-block;padding:3px;transform:rotate(45deg)}.mdc-text-field--outlined .mdc-notched-outline{direction:ltr}.mdc-text-field--no-label:not(.mdc-text-field--textarea) .mat-mdc-form-field-input-control.mdc-text-field__input,.mat-mdc-text-field-wrapper .mat-mdc-form-field-input-control{font-family:Noto Kufi Arabic,sans-serif}.stc-label{font-size:.874rem;font-weight:600}\n"] }]
        }], propDecorators: { controller: [{
                type: Input
            }], label: [{
                type: Input
            }], type: [{
                type: Input,
                args: [{ required: true }]
            }], placeholder: [{
                type: Input
            }], inputId: [{
                type: Input
            }], isAutocomplete: [{
                type: Input
            }], isAutofocus: [{
                type: Input
            }], isRequired: [{
                type: Input
            }], isDisabled: [{
                type: Input
            }], isDisplayIconSearch: [{
                type: Input
            }], options: [{
                type: Input
            }], isWhiteMode: [{
                type: Input
            }], min: [{
                type: Input
            }], max: [{
                type: Input
            }], onChange: [{
                type: Output
            }], onSelectionChange: [{
                type: Output
            }] } });
//# sourceMappingURL=data:application/json;base64, 