2020-12-17 23:09:27 -08:00
|
|
|
<div class="form-group paperless-input-select">
|
2020-10-28 18:02:30 +01:00
|
|
|
<label [for]="inputId">{{title}}</label>
|
2021-04-03 09:30:29 -07:00
|
|
|
<div>
|
|
|
|
|
<ng-select *ngIf="allowCreateNew; else noAddTag" name="inputId" [(ngModel)]="value"
|
2020-12-17 23:09:27 -08:00
|
|
|
[disabled]="disabled"
|
|
|
|
|
[style.color]="textColor"
|
|
|
|
|
[style.background]="backgroundColor"
|
2020-12-22 13:39:46 +01:00
|
|
|
[clearable]="allowNull"
|
2021-01-10 01:59:47 +01:00
|
|
|
[items]="items"
|
2021-04-03 09:30:29 -07:00
|
|
|
[addTag]="addItemRef"
|
2021-01-10 01:59:47 +01:00
|
|
|
bindLabel="name"
|
|
|
|
|
bindValue="id"
|
2021-04-03 09:30:29 -07:00
|
|
|
(blur)="onTouched()">
|
2020-12-17 23:09:27 -08:00
|
|
|
</ng-select>
|
2021-04-03 09:30:29 -07:00
|
|
|
<ng-template #noAddTag>
|
|
|
|
|
<ng-select name="inputId" [(ngModel)]="value"
|
|
|
|
|
[disabled]="disabled"
|
|
|
|
|
[style.color]="textColor"
|
|
|
|
|
[style.background]="backgroundColor"
|
|
|
|
|
[clearable]="allowNull"
|
|
|
|
|
[items]="items"
|
|
|
|
|
bindLabel="name"
|
|
|
|
|
bindValue="id"
|
|
|
|
|
(blur)="onTouched()">
|
|
|
|
|
</ng-select>
|
|
|
|
|
</ng-template>
|
2020-10-28 20:21:00 +01:00
|
|
|
</div>
|
2020-10-28 18:02:30 +01:00
|
|
|
<small *ngIf="hint" class="form-text text-muted">{{hint}}</small>
|
2021-01-29 16:48:51 +01:00
|
|
|
<small *ngIf="getSuggestions().length > 0">
|
2021-01-29 16:57:00 +01:00
|
|
|
<span i18n>Suggestions:</span>
|
2021-01-29 16:48:51 +01:00
|
|
|
<ng-container *ngFor="let s of getSuggestions()">
|
|
|
|
|
<a (click)="value = s.id; onChange(value)" [routerLink]="">{{s.name}}</a>
|
|
|
|
|
</ng-container>
|
2021-03-24 12:21:13 -07:00
|
|
|
|
|
|
|
|
|
2021-01-29 16:48:51 +01:00
|
|
|
</small>
|
2020-12-17 23:09:27 -08:00
|
|
|
</div>
|