argos/dmp-frontend/src/app/shared/components/autocomplete/autocomplete.component.html

25 lines
1.2 KiB
HTML

<div [formGroup]="form" class="autocomplete">
<table class="full-width">
<tr>
<td>
<mat-form-field class="autocomplete-input">
<input matInput type="text" placeholder="{{placeholder}}" [matAutocomplete]="auto" formControlName="text" [required]="required"
[errorStateMatcher]="errorStateMatcher">
<mat-error *ngIf="form.get('value').errors?.required">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
<mat-error *ngIf="validationErrorString">{{errorString}}</mat-error>
<mat-progress-spinner matSuffix mode="indeterminate" *ngIf="loading" [diameter]="22"></mat-progress-spinner>
<input matInput type="text" [matAutocomplete]="auto" hidden="hidden">
</mat-form-field>
</td>
<td *ngIf="createNew">
<button mat-raised-button type="button" color="primary" (click)="this.ClickFunctionCall()" tabindex="2">{{'GENERAL.AUTOCOMPLETE.CREATE-NEW' | translate}}</button>
</td>
</tr>
</table>
<mat-autocomplete #auto="matAutocomplete" (optionSelected)="this.optionSelected($event)">
<mat-option *ngFor="let option of options" [value]="option">
{{ option.text }} {{option.description?'['+option.description+']':''}}
</mat-option>
</mat-autocomplete>
</div>