All files / src/app/shared/components/search/suggest-products suggest-products.component.ts

76.92% Statements 10/13
100% Branches 0/0
0% Functions 0/2
76.92% Lines 10/13

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 304x 4x 4x 4x 4x   4x 4x 4x 4x                 4x                      
import { CommonModule } from '@angular/common';
import { ChangeDetectionStrategy, Component, EventEmitter, Input, Output } from '@angular/core';
import { RouterModule } from '@angular/router';
import { TranslateModule } from '@ngx-translate/core';
import { ReplaySubject } from 'rxjs';
 
import { DirectivesModule } from 'ish-core/directives.module';
import { DeviceType } from 'ish-core/models/viewtype/viewtype.types';
import { PipesModule } from 'ish-core/pipes.module';
import { SuggestProductsTileComponent } from 'ish-shared/components/search/suggest-products-tile/suggest-products-tile.component';
 
@Component({
  selector: 'ish-suggest-products',
  templateUrl: './suggest-products.component.html',
  standalone: true,
  imports: [CommonModule, PipesModule, DirectivesModule, TranslateModule, RouterModule, SuggestProductsTileComponent],
  changeDetection: ChangeDetectionStrategy.OnPush,
})
export class SuggestProductsComponent {
  @Input({ required: true }) products: string[];
  @Input() maxAutoSuggests: number;
  @Input() inputTerms$ = new ReplaySubject<string>(1);
  @Input() deviceType: DeviceType;
  @Output() routeChange = new EventEmitter<void>();
 
  handleInputFocus(): void {
    this.routeChange.emit();
  }
}