2017-12-20 14:34:32 +01:00
|
|
|
<!-- <div [formGroup]="form" class="autocomplete">
|
2017-12-18 11:01:22 +01:00
|
|
|
<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>
|
2017-12-20 14:34:32 +01:00
|
|
|
</div> -->
|
|
|
|
|
|
|
|
<mat-form-field>
|
2018-07-11 15:47:36 +02:00
|
|
|
<input matInput [matAutocomplete]="auto" [formControl]="control" placeholder="{{placeholder}}" [required]="required">
|
|
|
|
<mat-error *ngIf="control['errors'] && control['errors']['required']">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
|
|
|
|
<mat-progress-spinner matSuffix mode="indeterminate" *ngIf="loading" [diameter]="22"></mat-progress-spinner>
|
|
|
|
<mat-autocomplete #auto="matAutocomplete" [displayWith]="displayWith.bind(this)" (optionSelected)="this.optionSelected($event)">
|
|
|
|
<mat-option *ngFor="let item of filteredItems " [value]="item">
|
|
|
|
<span *ngIf="titleKey">{{item[titleKey]}}</span>
|
|
|
|
<span *ngIf="subtitleKey">{{item[subtitleKey]}}</span>
|
|
|
|
</mat-option>
|
|
|
|
<!-- <mat-option *ngIf="filteredItems.length == 0" value="das">
|
2017-12-20 16:15:27 +01:00
|
|
|
<span>{{'GENERAL.AUTOCOMPLETE.NO-ITEMS' | translate}}</span>
|
|
|
|
</mat-option> -->
|
2018-07-11 15:47:36 +02:00
|
|
|
</mat-autocomplete>
|
|
|
|
</mat-form-field>
|