From 8978e1df8074acd82ad34082f2234951b8a414a0 Mon Sep 17 00:00:00 2001 From: "k.triantafyllou" Date: Tue, 5 Apr 2022 15:33:38 +0300 Subject: [PATCH] Fix some issues in input. Change class in advanced search input --- .../advanced-search-input.component.ts | 5 +- sharedComponents/input/input.component.ts | 20 +++--- .../search-input/search-input.component.css | 63 ------------------- 3 files changed, 14 insertions(+), 74 deletions(-) delete mode 100644 sharedComponents/search-input/search-input.component.css diff --git a/sharedComponents/advanced-search-input/advanced-search-input.component.ts b/sharedComponents/advanced-search-input/advanced-search-input.component.ts index 542461ca..f115d0a1 100644 --- a/sharedComponents/advanced-search-input/advanced-search-input.component.ts +++ b/sharedComponents/advanced-search-input/advanced-search-input.component.ts @@ -13,7 +13,7 @@ import {InputComponent} from "../input/input.component"; @Component({ selector: 'advanced-search-input', template: ` -
+
@@ -30,8 +30,9 @@ import {InputComponent} from "../input/input.component"; ` }) export class AdvancedSearchInputComponent implements AfterContentInit, OnDestroy { - @ContentChildren(InputComponent) inputs: QueryList + @ContentChildren(InputComponent) inputs: QueryList; @Input() disabled: boolean = false; + @Input() inputClass: string = 'inner' @Output() searchEmitter: EventEmitter = new EventEmitter(); constructor() { diff --git a/sharedComponents/input/input.component.ts b/sharedComponents/input/input.component.ts index 1e533847..2a680596 100644 --- a/sharedComponents/input/input.component.ts +++ b/sharedComponents/input/input.component.ts @@ -44,7 +44,7 @@ declare var UIkit;
@@ -57,7 +57,7 @@ declare var UIkit; [formControl]="formAsControl"> - @@ -89,7 +89,7 @@ declare var UIkit;
+ class="uk-margin-left uk-margin-right icon"> @@ -288,11 +288,13 @@ export class InputComponent implements OnInit, OnDestroy, AfterViewInit, OnChang } ngOnChanges(changes: SimpleChanges) { - if(changes.value && this.formControl) { - this.formControl.setValue(this.value); - } - if (changes.formControl || changes.validators || changes.options) { - this.reset(); + if(this.formControl) { + if (changes.value) { + this.formControl.setValue(this.value); + } + if (changes.formControl || changes.validators || changes.options) { + this.reset(); + } } } @@ -342,7 +344,7 @@ export class InputComponent implements OnInit, OnDestroy, AfterViewInit, OnChang } })); } - if (this.formControl && this.formControl.validator) { + if (this.formControl.validator) { let validator = this.formControl.validator({} as AbstractControl); this.required = (validator && validator.required); } diff --git a/sharedComponents/search-input/search-input.component.css b/sharedComponents/search-input/search-input.component.css deleted file mode 100644 index f673a600..00000000 --- a/sharedComponents/search-input/search-input.component.css +++ /dev/null @@ -1,63 +0,0 @@ -input, input:focus { - background: transparent 0 0 no-repeat padding-box; - border-radius: 4px; - padding: 15px; - border: none; - outline: none; -} - -input::placeholder { - color: #a3a3a3; - font-weight: 600; -} - -@media only screen and (min-width: 960px) { - .bordered.focused { - border-bottom: 1px solid currentColor !important; - } - .bordered:not(.focused) { - border-bottom: 1px solid #a3a3a3 !important; - } -} - -@media only screen and (max-width: 959px) { - input { - font-size: 14px; - } - - .search-input { - padding-bottom: 5px; - border-bottom: 2px solid currentColor; - } -} - -button.search, button.search:hover { - color: #1a1a1a; - font-weight: 700; - border: none; - outline: none; - background-color: transparent; - font-family: "Roboto", sans-serif; - font-size: 16px; -} - -button.search:hover { - color: currentColor; -} - -button.search .icon-bg { - width: 56px; - height: 56px; - position: relative; - background: white; - border-radius: 50%; -} - -.selected { - color: #1a1a1a; -} - -.overlay { - margin-left: -13px; - z-index: 1; -}