All files / element-ng/select/select-list si-select-list.component.html

63.88% Statements 23/36
50% Branches 4/8
50% Functions 2/4
61.29% Lines 19/31

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 6530x     76x       30x         76x 247x                                         247x 96x 247x         30x 96x   247x         247x       30x 76x 3x 3x 8x 3x     30x      
<div
  cdkListbox
  class="dropdown-menu-scroller focus-none"
  [id]="baseId() + '-listbox'"
  [cdkListboxMultiple]="selectionStrategy.allowMultiple"
  [cdkListboxValue]="selectionStrategy.arrayValue()"
  [attr.aria-labelledby]="baseId() + '-aria-label' + ' ' + labelledby()"
  (cdkListboxValueChange)="listBoxValueChange($event)"
  (click)="closeOverlayIfSingle()"
  (keydown.enter)="closeOverlayIfSingle()"
  (keydown.space)="closeOverlayIfSingle()"
>
  @for (item of rows(); track item; let index = $index) {
    @if (item.type === 'group') {
      <div
        role="group"
        class="ps-0"
        aria-disabled="false"
        [attr.aria-labelledby]="baseId() + '-' + index + '-group-header'"
      >
        <span class="dropdown-header" [id]="baseId() + '-' + index + '-group-header'">
          <ng-container
            [ngTemplateOutlet]="groupTemplate() ?? defaultGroupTemplate"
            [ngTemplateOutletContext]="{ $implicit: item }"
          />
        </span>
        @for (optionRow of item.options; track optionRow) {
          <ng-container
            [ngTemplateOutlet]="optionRowTemplate"
            [ngTemplateOutletContext]="{ $implicit: optionRow }"
          />
        }
      </div>
    }
    @if (item.type === 'option') {
      <ng-container
        [ngTemplateOutlet]="optionRowTemplate"
        [ngTemplateOutletContext]="{ $implicit: item }"
      />
    }
  }
  <ng-template #optionRowTemplate let-option siSelectOptionRowTemplate>
    <si-select-option-row
      #cdkOption="cdkOption"
      [option]="option"
      [optionTemplate]="optionTemplate()"
      [cdkOption]="option.value"
      [cdkOptionDisabled]="!!option.disabled"
      [cdkOptionTypeaheadLabel]="(option.typeaheadLabel | translate)!"
      [class.active]="cdkOption.isActive()"
      [selected]="cdkOption.isSelected()"
    />
  </ng-template>
</div>
@if (actionsTemplate()) {
  <div class="dropdown-divider"></div>
  <div class="d-flex flex-column align-items-start">
    <ng-container [ngTemplateOutlet]="actionsTemplate()!" />
  </div>
}
 
<ng-template #defaultGroupTemplate let-group siSelectGroupTemplate>
  {{ group.label | translate }}
</ng-template>