Skip to content
Snippets Groups Projects
Select Git revision
  • OZG-7983-OZG-8244-Statistik-Datenanfrage-veröffentlichen
  • OZG-7983-Statistik-veröffentlichen-E2E
  • OZG-7983-Statistik-Land-kann-Anfrage-an-Mandanten-veröffentlichen
  • main default protected
  • OZG-8222-fix-e2e
  • OZG-6123-Vorgänge-aus-Suche-E2E
  • OZG-8086-Admin-Datenanfrage-erstellen
  • OZG-8086-Datenanfrage-Umbenennung
  • mongodb-7-0-16-e2e
  • release-info
  • release-administration
  • release
  • OZG-6220-Bescheid-speichern-ohne-Postfach
  • OZG-7985-Statistik-Datenfreigabe
  • OZG-7922-KeycloakOperatorExceptions
  • OZG-8142-poc-cards
  • OZG-8086-E2E
  • OZG-8086-E2E2
  • OZG-8142-ProjectionStuff
  • OZG-8086-Statistik-Datenanfrage-erstellen
  • 1.10.0-info
  • 1.10.0-administration
  • 2.25.0-alfa
  • 1.9.0-info
  • 1.9.0-administration
  • 2.24.0-alfa
  • 1.8.0-info
  • 1.8.0-administration
  • 2.23.0-alfa
  • 1.7.0-info
  • 1.7.0-administration
  • 2.22.0-alfa
  • 1.6.0-info
  • 1.6.0-administration
  • 2.21.0-alfa
  • 1.5.0-info
  • 1.5.0-administration
  • 2.20.0-alfa
  • 2.19.2-alfa
  • 2.19.1-alfa
40 results

search-field.component.ts

Blame
  • search-field.component.ts 1.42 KiB
    import { CommonModule } from '@angular/common';
    import { Component, EventEmitter, Input, Output } from '@angular/core';
    import { FormControl } from '@angular/forms';
    import { EMPTY_STRING } from '../../../../../tech-shared/src';
    import { TextInputComponent } from '../../form/text-input/text-input.component';
    import { CloseIconComponent } from '../../icons/close-icon/close-icon.component';
    import { SearchIconComponent } from '../../icons/search-icon/search-icon.component';
    
    @Component({
      selector: 'ods-search-field',
      standalone: true,
      imports: [CommonModule, TextInputComponent, SearchIconComponent, CloseIconComponent],
      template: `<ods-text-input
        [label]="label"
        [fieldControl]="control"
        [placeholder]="placeholder"
        [withPrefix]="true"
        [withSuffix]="true"
        (clickEmitter)="inputClicked.emit()"
        role="combobox"
      >
        <ods-search-icon prefix aria-hidden="true" aria-label="Suchfeld" />
        <button suffix *ngIf="control.value" (click)="clearInput()" aria-label="Eingabe löschen">
          <ods-close-icon class="fill-primary hover:fill-primary-hover" />
        </button>
      </ods-text-input>`,
    })
    export class SearchFieldComponent {
      @Input() label: string = EMPTY_STRING;
      @Input() placeholder: string = EMPTY_STRING;
      @Input() control = new FormControl(EMPTY_STRING);
    
      @Output() inputClicked: EventEmitter<MouseEvent> = new EventEmitter<MouseEvent>();
    
      clearInput() {
        this.control.setValue(EMPTY_STRING);
      }
    }