chore: update Angular cache and TypeScript build info files
This commit is contained in:
parent
fff9b88663
commit
a74f18ee78
2
.angular/cache/20.2.2/app/.tsbuildinfo
vendored
2
.angular/cache/20.2.2/app/.tsbuildinfo
vendored
File diff suppressed because one or more lines are too long
BIN
db/newtube.db
BIN
db/newtube.db
Binary file not shown.
@ -185,6 +185,7 @@ export class HeaderComponent {
|
||||
const theme = this.themes.activeSlug();
|
||||
const qp: any = { q, provider };
|
||||
if (theme) qp.theme = theme;
|
||||
this.suggestionsOpen.set(false); // Fermer le menu des suggestions
|
||||
this.router.navigate(['/search'], { queryParams: qp });
|
||||
}
|
||||
|
||||
|
@ -27,6 +27,17 @@
|
||||
</div>
|
||||
}
|
||||
|
||||
<input
|
||||
#searchInput
|
||||
type="text"
|
||||
class="flex-1 bg-slate-900 text-slate-100 border border-slate-700 rounded-l-full px-4 py-2 focus:outline-none focus:ring-2 focus:ring-red-500"
|
||||
placeholder="Rechercher..."
|
||||
[value]="q()"
|
||||
(input)="onSearchInput($event)"
|
||||
(keydown.enter)="onSearchEnter($event)"
|
||||
(keydown.escape)="closeSearchResults()"
|
||||
/>
|
||||
|
||||
@if (loading()) {
|
||||
<div class="grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-6">
|
||||
@for (item of [1,2,3,4,5,6,7,8]; track item) {
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { ChangeDetectionStrategy, Component, computed, effect, inject, signal, untracked } from '@angular/core';
|
||||
import { ChangeDetectionStrategy, Component, computed, effect, ElementRef, inject, signal, untracked, ViewChild } from '@angular/core';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { ActivatedRoute, RouterLink } from '@angular/router';
|
||||
import { YoutubeApiService } from '../../services/youtube-api.service';
|
||||
@ -358,4 +358,39 @@ export class SearchComponent {
|
||||
setFilterTag(key: string) {
|
||||
this.filterTag.set(key);
|
||||
}
|
||||
|
||||
@ViewChild('searchInput') searchInput?: ElementRef<HTMLInputElement>;
|
||||
|
||||
onSearchEnter(event: Event) {
|
||||
const keyboardEvent = event as KeyboardEvent;
|
||||
keyboardEvent.preventDefault();
|
||||
const query = this.q().trim();
|
||||
if (query) {
|
||||
// Utiliser reloadSearch() pour effectuer une nouvelle recherche
|
||||
this.reloadSearch();
|
||||
this.closeSearchResults();
|
||||
// Retirer le focus de l'input
|
||||
if (this.searchInput) {
|
||||
this.searchInput.nativeElement.blur();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
closeSearchResults() {
|
||||
// Cette méthode sera appelée pour fermer les résultats de recherche
|
||||
// Vous pouvez ajouter une logique supplémentaire si nécessaire
|
||||
// Par exemple, si vous avez un état pour afficher/cacher les résultats
|
||||
// this.showResults.set(false);
|
||||
}
|
||||
|
||||
onSearchInput(event: Event) {
|
||||
const input = event.target as HTMLInputElement;
|
||||
this.q.set(input.value);
|
||||
// Vous pouvez ajouter ici la logique de recherche au fur et à mesure si nécessaire
|
||||
}
|
||||
|
||||
performSearch(query: string) {
|
||||
// Cette méthode sera appelée pour effectuer la recherche
|
||||
// Vous pouvez ajouter ici la logique de recherche
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user