All files / lib/badge-list badge-list.component.ts

100% Statements 47/47
100% Branches 5/5
100% Functions 4/4
100% Lines 47/47

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 481x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 28x 28x 28x 28x 28x 28x 28x 28x 28x 28x 28x 1x 1x 1x 1x 1x 111x 111x 1x  
/*******************************************************************************
 * Copyright bei
 * Entwicklungs- und Pflegeverbund für das gemeinsame Fachverfahren gefa
 *
 *******************************************************************************/
import { Component, TemplateRef, input } from '@angular/core';
 
import { BadgeItem } from '../utils/util.types';
import { itemTrack } from '../utils/utilities';
 
export interface BadgeItemTemplateContext {
  $implicit: BadgeItem;
}
 
/**
 * A BadgeList element is used to display multiple Badge components.
 */
@Component({
  selector: 'gc-badge-list',
  templateUrl: './badge-list.component.html',
  styleUrls: ['./badge-list.component.css'],
  standalone: false,
})
export class BadgeListComponent {
  /**
   * Badge items to show.
   */
  public readonly badges = input<readonly BadgeItem[]>([]);
 
  /**
   * If provided, this text is inserted for accessibility tools additionally in front of the badges.
   * May be used for example to separate the badges from preceeding (text) content.
   */
  public readonly accessibleTextPrefix = input<string>('');
 
  /**
   * Icon provider for rendering badges with icons.
   */
  public readonly iconProvider = input<TemplateRef<BadgeItemTemplateContext>>();
 
  /**
   * @ignore
   */
  protected _itemTrackBy(item: BadgeItem): string {
    return itemTrack(item);
  }
}