/*
 * Copyright (C) 2023 Robert Bosch GmbH Copyright (C) 2023 Robert Bosch Manufacturing Solutions GmbH, Germany. All rights reserved.
 */

import { Directive, HostListener, Output, EventEmitter } from '@angular/core';

/**
 * TouchedFlag directive emits a boolean true when the user clicks inside the targeted area.
 */
@Directive({
  selector: '[bciTouchedFlag]',
  standalone: true
})
export class BciTouchedFlagDirective {
  @Output() isTouched: EventEmitter<boolean> = new EventEmitter<boolean>(false);

  @HostListener('click', ['$event'])
  onClick(): void {
    this.isTouched.emit(true);
  }
}
