2022-04-04 10:06:34 +02:00
|
|
|
import {
|
|
|
|
AfterContentInit,
|
|
|
|
Component,
|
|
|
|
ContentChildren,
|
|
|
|
EventEmitter,
|
|
|
|
Input,
|
|
|
|
OnDestroy,
|
|
|
|
Output,
|
|
|
|
QueryList
|
|
|
|
} from "@angular/core";
|
|
|
|
import {InputComponent} from "../input/input.component";
|
|
|
|
|
|
|
|
@Component({
|
|
|
|
selector: 'advanced-search-input',
|
|
|
|
template: `
|
2022-04-06 17:24:14 +02:00
|
|
|
<div class="search-input" [ngClass]="searchInputClass" [class.small-vertical]="smallVertical">
|
2022-04-04 10:06:34 +02:00
|
|
|
<div class="uk-grid uk-flex-middle" uk-grid>
|
|
|
|
<div class="uk-width-expand">
|
|
|
|
<div class="uk-grid uk-grid-collapse inputs" uk-grid>
|
|
|
|
<ng-content></ng-content>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="uk-width-auto">
|
2022-04-06 17:24:14 +02:00
|
|
|
<div class="search-icon" [class.disabled]="disabled" (click)="searchEmitter.emit()">
|
|
|
|
<icon name="search" [flex]="true" ratio="1.3"></icon>
|
2022-04-04 10:06:34 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
`
|
|
|
|
})
|
|
|
|
export class AdvancedSearchInputComponent implements AfterContentInit, OnDestroy {
|
2022-04-05 14:33:38 +02:00
|
|
|
@ContentChildren(InputComponent) inputs: QueryList<InputComponent>;
|
2022-04-04 10:06:34 +02:00
|
|
|
@Input() disabled: boolean = false;
|
2022-04-06 17:24:14 +02:00
|
|
|
@Input() searchInputClass: string = 'inner'
|
|
|
|
@Input() smallVertical: boolean = false;
|
2022-04-04 10:06:34 +02:00
|
|
|
@Output() searchEmitter: EventEmitter<void> = new EventEmitter<void>();
|
|
|
|
|
|
|
|
constructor() {
|
|
|
|
}
|
|
|
|
|
|
|
|
ngAfterContentInit() {
|
|
|
|
this.inputs.forEach(input => {
|
2022-04-06 17:24:14 +02:00
|
|
|
input.inputClass = 'advanced-search';
|
2022-04-04 10:06:34 +02:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
ngOnDestroy() {
|
|
|
|
}
|
|
|
|
}
|