71 lines
2.3 KiB
HTML
71 lines
2.3 KiB
HTML
<mat-form-field style="width: 100%" subscriptSizing="dynamic">
|
|
@if (icon()) {
|
|
<mat-icon matPrefix [fontIcon]="icon()"></mat-icon>
|
|
}
|
|
<mat-select
|
|
canSelectNullableOptions
|
|
(selectionChange)="handleSelectChange.emit($event.value)"
|
|
[placeholder]="label()">
|
|
<mat-select-trigger>{{ label() }}</mat-select-trigger>
|
|
<div
|
|
class="search-panel-header"
|
|
(click)="$event.stopPropagation()"
|
|
(keydown)="$event.stopPropagation()">
|
|
<mat-icon matPrefix>search</mat-icon>
|
|
<input
|
|
matInput
|
|
[placeholder]="inputPlaceholder()"
|
|
[(ngModel)]="searchValue"
|
|
(ngModelChange)="_handleValueChange($event)"
|
|
(click)="$event.stopPropagation()"
|
|
(keydown)="$event.stopPropagation()" />
|
|
|
|
<button
|
|
mat-icon-button
|
|
aria-label="Clear"
|
|
(click)="_clearSearchValue(); $event.stopPropagation()">
|
|
<mat-icon>close</mat-icon>
|
|
</button>
|
|
</div>
|
|
|
|
@if (isLoading()) {
|
|
<mat-option disabled>Laden…</mat-option>
|
|
} @else {
|
|
@if (selectedElements().length > 0) {
|
|
<mat-optgroup [label]="selectedLabel()">
|
|
@for (
|
|
element of selectedElements();
|
|
track getSelectValue()(element)
|
|
) {
|
|
<mat-option [value]="element" selected>
|
|
<mat-icon>check</mat-icon>
|
|
{{ getSelectLabel()(element) }}
|
|
@if (getSelectDescription()) {
|
|
<span class="option-description">{{
|
|
getSelectDescription()!(element)
|
|
}}</span>
|
|
}
|
|
</mat-option>
|
|
} @empty {
|
|
<mat-option disabled>Keine Ergebnisse</mat-option>
|
|
}
|
|
</mat-optgroup>
|
|
}
|
|
<mat-optgroup [label]="fetchedLabel()">
|
|
@for (element of fetchedElements().elements; track getSelectValue()(element)) {
|
|
<mat-option [value]="element">
|
|
{{ getSelectLabel()(element) }}
|
|
@if (getSelectDescription()) {
|
|
<span class="option-description">{{
|
|
getSelectDescription()!(element)
|
|
}}</span>
|
|
}
|
|
</mat-option>
|
|
} @empty {
|
|
<mat-option disabled>Keine Ergebnisse</mat-option>
|
|
}
|
|
</mat-optgroup>
|
|
}
|
|
</mat-select>
|
|
</mat-form-field>
|