paperless-ngx/src-ui/src/app/components/common/input/select/select.component.html

38 lines
1.1 KiB
HTML
Raw Normal View History

<div class="form-group paperless-input-select">
2020-10-28 18:02:30 +01:00
<label [for]="inputId">{{title}}</label>
<div>
<ng-select *ngIf="allowCreateNew; else noAddTag" name="inputId" [(ngModel)]="value"
[disabled]="disabled"
[style.color]="textColor"
[style.background]="backgroundColor"
[clearable]="allowNull"
2021-01-10 01:59:47 +01:00
[items]="items"
[addTag]="addItemRef"
2021-01-10 01:59:47 +01:00
bindLabel="name"
bindValue="id"
(blur)="onTouched()">
</ng-select>
<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>&nbsp;
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>&nbsp;
</ng-container>
2021-01-29 16:48:51 +01:00
</small>
</div>