| <!-- |
| ~ 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. |
| --> |
| |
| <div class="dropdown-list" > |
| <button |
| class="dropdown-toggle" |
| type="button" |
| #list |
| (click)="emitEvent()" |
| (click)="actions.toggle($event, list)" |
| > |
| <span class="title"><span [innerHTML]="label || 'None'"></span></span> |
| <span class="caret-btn"><i class="material-icons">keyboard_arrow_down</i></span> |
| </button> |
| |
| <bubble-up #actions position="bottom" class="mt-5"> |
| <ul class="list-menu" id="scrolling"> |
| <ng-template [ngIf]="listStructure === 'array'"> |
| <li *ngIf="empty" (click)="selectOptions($event, null, 0)"> |
| <a role="menuitem">None</a> |
| </li> |
| <ng-template let-item ngFor [ngForOf]="items" let-index="index"> |
| <li role="presentation" (click)="selectOptions($event, item, index)"> |
| <a role="menuitem"><span [innerHTML]="item[byField]"></span></a> |
| </li> |
| </ng-template> |
| |
| <li *ngIf="items.length == 0"> |
| <a role="menuitem"><i class="material-icons">visibility_off</i>No items</a> |
| </li> |
| </ng-template> |
| <ng-template [ngIf]="listStructure === 'json'"> |
| <li *ngFor="let item of (items | keys); let index = index"> |
| <span class="caption">{{item.key | underscoreless}}</span> |
| <a *ngFor="let list_item of item.value" (click)="selectOptions($event, list_item, index)"> |
| <strong>{{list_item.size}}</strong> {{list_item[byField]}} |
| </a> |
| </li> |
| </ng-template> |
| |
| <ng-template [ngIf]="listStructure === 'list'"> |
| <ng-template let-item ngFor [ngForOf]="items" let-index="index"> |
| <li role="presentation"> |
| <a role="menuitem" (click)="selectOptions($event, item, index)"> |
| {{ map[item] }} |
| </a> |
| </li> |
| </ng-template> |
| |
| <li *ngIf="items.length == 0"> |
| <a role="menuitem"><i class="material-icons">visibility_off</i>No items</a> |
| </li> |
| </ng-template> |
| </ul> |
| </bubble-up> |
| </div> |