| <!-- |
| Licensed to the Apache Software Foundation (ASF) under one or more |
| contributor license agreements. See the NOTICE file distributed with |
| this work for additional information regarding copyright ownership. |
| The ASF licenses this file to You under the Apache License, Version 2.0 |
| (the "License"); you may not use this file except in compliance with |
| the License. You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, software |
| distributed under the License is distributed on an "AS IS" BASIS, |
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| See the License for the specific language governing permissions and |
| limitations under the License. |
| --> |
| |
| <h4>{{title}}</h4> |
| <mat-form-field layout-gt-xs="row" layout-margin> |
| <input matInput flex placeholder="{{'Search...' | translate}}" tdAutoTrim [formControl]="term"/> |
| </mat-form-field> |
| <mat-card flex> |
| <mat-list flex> |
| <h3 mat-subheader translate>Results</h3> |
| <mat-list-item *ngFor="let row of data | async"> |
| <div layout="row" layout-align="start center" style="width: 100%;"> |
| <mat-icon matListAvatar>{{listIcon}}</mat-icon> |
| <div flex> |
| {{ row[id] }} |
| </div> |
| <div> |
| <button mat-raised-button color="accent" title="{{'Assign' | translate}}" (click)="doSelect(row[id])">{{'Select' | translate}}</button> |
| </div> |
| </div> |
| </mat-list-item> |
| <mat-list-item *ngIf="(data | async)?.length == 0"> |
| {{noResultsMessage}} |
| </mat-list-item> |
| <h3 mat-subheader translate>Current selection</h3> |
| <mat-list-item *ngFor="let selection of selections" class="active"> |
| <div layout="row" layout-align="start center" style="width: 100%;"> |
| <mat-icon matListAvatar>{{listIcon}}</mat-icon> |
| <div flex> |
| {{selection}} |
| </div> |
| <div> |
| <button mat-raised-button color="warn" title="{{'Unassign' | translate}}" (click)="doDeselect(selection)">{{'Deselect' | translate}}</button> |
| </div> |
| </div> |
| </mat-list-item> |
| <mat-list-item *ngIf="!selections || selections.length === 0"> |
| <div layout="row" layout-align="start center" style="width: 100%;"> |
| <div flex> |
| {{noSelectionMessage}} |
| </div> |
| </div> |
| </mat-list-item> |
| </mat-list> |
| </mat-card> |