Skip to content
Snippets Groups Projects
Select Git revision
  • b4c1c1c93db59c4bad58df323196fff7506fa960
  • master default protected
  • dev
  • ckan-2.9
  • refactor-css
  • improve-accessibility
  • fix-get_action-calls
  • summary-collection
  • debug-collections
  • debug-eakte
  • experimental-linked-resources-as-uploads
  • button-text-detail
  • Detailinfo
  • hash
  • URL_Upload
  • URL_Upload_working_BB
  • url_exp
  • ODPSH-550
  • href-for-preview
  • ODPSH-HASH-ALGO
  • Algo
  • v1.61
  • v1.6
  • v1.51
  • v1.5
  • v1.4
  • v1.3
  • v1.2
  • v1.1
  • v1.0
  • v0.1
  • sprint-18
  • sprint11_2
  • sprint10
  • sprint8
  • sprint7
  • sprint6
37 results

helpers.py

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);
      }
    }