All files / element-ng/search-bar si-search-bar.component.html

95.83% Statements 23/24
100% Branches 6/6
75% Functions 3/4
100% Lines 14/14

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 31135x 135x 124x   77x       135x   135x       77x     135x 19x       25x 19x     25x 19x   77x  
<div class="search-bar" [class.variant-background-0]="colorVariant() === 'base-0'">
  @if (showIcon()) {
    <si-icon class="search-bar-icon" [icon]="icons.elementSearch" />
  }
  <input
    #inputRef
    type="text"
    class="search-bar-input form-control"
    [disabled]="disabled()"
    [placeholder]="placeholder()"
    [class.is-invalid]="isInvalid"
    [class.icon-end]="searchValue()"
    [attr.maxlength]="maxlength()"
    [readonly]="readonly()"
    (blur)="onBlur()"
    (input)="input($event)"
  />
  @if (searchValue()) {
    <button
      type="button"
      class="btn btn-icon btn-sm btn-tertiary-ghost search-bar-clear"
      [attr.aria-label]="clearButtonAriaLabel() | translate"
      [disabled]="disabled() || readonly()"
      (click)="resetForm()"
      (focusin)="onCancelFocus($event)"
    >
      <si-icon [icon]="icons.elementCancel" />
    </button>
  }
</div>