argos/dmp-frontend/src/app/shared/components/autocompletes/single/single-auto-complete.compon...

16 lines
1.1 KiB
HTML

<mat-form-field class="auto-complete">
<input matInput [placeholder]="placeholder" [matAutocomplete]="auto" [required]='required' [formControl]="reactiveFormControl" (focus)="_onInputFocus()">
<mat-error *ngIf="validationErrorString">{{validationErrorString}}</mat-error>
<mat-error *ngIf="reactiveFormControl.hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
<mat-error *ngIf="reactiveFormControl.hasError('invalidJson')">{{'GENERAL.VALIDATION.INVALID-JSON' | translate}}</mat-error>
<mat-progress-spinner matSuffix mode="indeterminate" [class.not-loading]="!loading" [diameter]="22"></mat-progress-spinner>
<mat-autocomplete #auto="matAutocomplete" [displayWith]="this._displayFn.bind(this)" (optionSelected)="_optionSelected($event)">
<mat-option *ngFor="let item of _items | async" [value]="item" [class.two-line-mat-option]="_subtitleFn(item)">
<!-- <img style="vertical-align:middle;" aria-hidden src="{{state.flag}}" height="25" /> -->
<span>{{_titleFn(item)}}</span>
<br *ngIf="_subtitleFn(item)">
<small *ngIf="_subtitleFn(item)">{{_subtitleFn(item)}}</small>
</mat-option>
</mat-autocomplete>
</mat-form-field>