Skip to content
Snippets Groups Projects
Commit c2dd9e10 authored by OZGCloud's avatar OZGCloud
Browse files

OZG-635 styling search-field part 1

parent ad0cc2bd
Branches
Tags
No related merge requests found
goofy-client-header { goofy-client-header header {
background-color: #fff; background-color: #fff;
} }
......
...@@ -23,6 +23,10 @@ header { ...@@ -23,6 +23,10 @@ header {
pointer-events: none; pointer-events: none;
} }
.middle {
flex-grow: 1;
}
img { img {
margin: 0 14px; margin: 0 14px;
height: 40px; height: 40px;
...@@ -32,6 +36,7 @@ img { ...@@ -32,6 +36,7 @@ img {
.left { .left {
display: flex; display: flex;
align-items: inherit; align-items: inherit;
min-width: 240px;
a { a {
outline: 0; outline: 0;
......
<form (ngSubmit)="search()" [formGroup]="formService.form"> <form (ngSubmit)="search()" [formGroup]="formService.form" class="search-field">
<div class="c-searchfield">
<button class="material-icons" type="submit" data-test-id="search-button" matTooltip="Suche ausführen">search</button> <button type="submit" data-test-id="search-button" mat-icon-button aria-label="icon button with search icon">
<input type="text" [formControlName]="formService.SEARCH_FIELD" name="searchString" data-test-id="search-input" placeholder="Eingangskennzeichen" /> <mat-icon>search</mat-icon>
</div> </button>
<input type="text" maxlength="32" [formControlName]="formService.SEARCH_FIELD" name="searchString" data-test-id="search-input" placeholder="Eingangskennzeichen" />
<button
*ngIf="isSearchFieldFilled()"
(click)="formService.reset()"
mat-icon-button aria-label="icon button to clear the search field"
data-test-id="clear-button">
<mat-icon>close</mat-icon>
</button>
</form> </form>
@import "variables"; @import "variables";
.c-searchfield { input {
border: 0;
background-color: transparent;
outline: 0;
flex-grow: 1;
font-size: 18px;
&::placeholder {
color: rgba(#000, 0.2);
}
}
.search-field {
border-radius: 20px;
background-color: #fafafa;
max-width: 320px;
display: flex;
box-shadow: 0 0 0 1px rgba(#000, 0.08);
margin-left: 16px;
}
.xc-searchfield {
border: 1px solid grey; border: 1px solid grey;
display: flex; display: flex;
border-radius: 25px; border-radius: 25px;
......
...@@ -14,4 +14,8 @@ export class VorgangSearchContainerComponent { ...@@ -14,4 +14,8 @@ export class VorgangSearchContainerComponent {
search(): void { search(): void {
this.formService.submit(); this.formService.submit();
} }
isSearchFieldFilled(): boolean {
return this.formService.hasSearchString();
}
} }
...@@ -24,6 +24,14 @@ export class VorgangSearchFormService { ...@@ -24,6 +24,14 @@ export class VorgangSearchFormService {
return this.service.search(this.getFormValue()); return this.service.search(this.getFormValue());
} }
reset(): void {
this.form.controls[this.SEARCH_FIELD].patchValue('');
}
hasSearchString(): boolean {
return !!this.form.controls[this.SEARCH_FIELD].value;
}
private getFormValue(){ private getFormValue(){
const formValue: string = this.form.value.search; const formValue: string = this.form.value.search;
return isEmpty(formValue) ? null : formValue; return isEmpty(formValue) ? null : formValue;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment