Files
zitadel/console/src/app/modules/search-roles-autocomplete/search-roles-autocomplete.component.html
T
b099a26a16 feat(console): MDC components (#6482)
mdc components

---------

Co-authored-by: Elio Bischof <[email protected]>
2023-10-26 08:29:06 +00:00

42 lines
1.4 KiB
HTML

<form>
<cnsl-form-field class="full-width">
<cnsl-label>Role Name</cnsl-label>
<input
cnslInput
*ngIf="singleOutput"
type="text"
placeholder="Search for the role name"
#nameInput
[formControl]="myControl"
[matAutocomplete]="auto"
/>
<mat-chip-grid *ngIf="!singleOutput" #chipList aria-label="name selection">
<mat-chip-row class="chip" *ngFor="let selectedRole of roles" [removable]="removable" (removed)="remove(selectedRole)">
{{ selectedRole.displayName }}
<mat-icon matChipRemove *ngIf="removable">cancel</mat-icon>
</mat-chip-row>
<input
cnslInput
placeholder="Role Name"
#nameInput
[formControl]="myControl"
[matAutocomplete]="auto"
[matChipInputFor]="chipList"
[matChipInputSeparatorKeyCodes]="separatorKeysCodes"
[matChipInputAddOnBlur]="addOnBlur"
(matChipInputTokenEnd)="add($event)"
/>
</mat-chip-grid>
<mat-autocomplete #auto="matAutocomplete" (optionSelected)="selected($event)" [displayWith]="displayFn">
<mat-option *ngIf="isLoading" class="is-loading">
<mat-spinner diameter="30"></mat-spinner>
</mat-option>
<mat-option *ngFor="let role of filteredRoles" [value]="role.key">
{{ role.displayName }}
</mat-option>
</mat-autocomplete>
</cnsl-form-field>
</form>