chore(ui): remove remaining series chart template casts
- Series progress chart: - replace the remaining `$any($event.target)` template casts with typed input and select handlers - keep the search, filter, and sort behavior unchanged while removing leftover template conversion debt - Validation: - `just ui check` - `just ui typecheck` - `just ui test`
This commit is contained in:
+3
-3
@@ -72,19 +72,19 @@
|
||||
type="text"
|
||||
[placeholder]="t('searchSeries')"
|
||||
[value]="searchTerm"
|
||||
(input)="onSearchChange($any($event.target).value)"
|
||||
(input)="onSearchInput($event)"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="filter-controls">
|
||||
<select class="filter-select" [value]="filterStatus" (change)="onFilterChange($any($event.target).value)">
|
||||
<select class="filter-select" [value]="filterStatus" (change)="onFilterSelect($event)">
|
||||
<option value="all">{{ t('allStatus') }}</option>
|
||||
<option value="in-progress">{{ t('inProgress') }}</option>
|
||||
<option value="completed">{{ t('completed') }}</option>
|
||||
<option value="not-started">{{ t('notStarted') }}</option>
|
||||
</select>
|
||||
|
||||
<select class="sort-select" [value]="sortBy" (change)="onSortChange($any($event.target).value)">
|
||||
<select class="sort-select" [value]="sortBy" (change)="onSortSelect($event)">
|
||||
<option value="progress">{{ t('sortByProgress') }}</option>
|
||||
<option value="rating">{{ t('sortByRating') }}</option>
|
||||
<option value="books">{{ t('sortByBooks') }}</option>
|
||||
|
||||
+27
@@ -177,6 +177,33 @@ export class SeriesProgressChartComponent {
|
||||
|
||||
public readonly chartData$: Observable<SeriesChartData> = this.chartDataSubject.asObservable();
|
||||
|
||||
onSearchInput(event: Event): void {
|
||||
const target = event.target;
|
||||
if (!(target instanceof HTMLInputElement)) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.onSearchChange(target.value);
|
||||
}
|
||||
|
||||
onFilterSelect(event: Event): void {
|
||||
const target = event.target;
|
||||
if (!(target instanceof HTMLSelectElement)) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.onFilterChange(target.value as typeof this.filterStatus);
|
||||
}
|
||||
|
||||
onSortSelect(event: Event): void {
|
||||
const target = event.target;
|
||||
if (!(target instanceof HTMLSelectElement)) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.onSortChange(target.value as typeof this.sortBy);
|
||||
}
|
||||
|
||||
onSearchChange(term: string): void {
|
||||
this.searchTerm = term.toLowerCase().trim();
|
||||
this.currentPage = 0;
|
||||
|
||||
Reference in New Issue
Block a user