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"
|
type="text"
|
||||||
[placeholder]="t('searchSeries')"
|
[placeholder]="t('searchSeries')"
|
||||||
[value]="searchTerm"
|
[value]="searchTerm"
|
||||||
(input)="onSearchChange($any($event.target).value)"
|
(input)="onSearchInput($event)"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="filter-controls">
|
<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="all">{{ t('allStatus') }}</option>
|
||||||
<option value="in-progress">{{ t('inProgress') }}</option>
|
<option value="in-progress">{{ t('inProgress') }}</option>
|
||||||
<option value="completed">{{ t('completed') }}</option>
|
<option value="completed">{{ t('completed') }}</option>
|
||||||
<option value="not-started">{{ t('notStarted') }}</option>
|
<option value="not-started">{{ t('notStarted') }}</option>
|
||||||
</select>
|
</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="progress">{{ t('sortByProgress') }}</option>
|
||||||
<option value="rating">{{ t('sortByRating') }}</option>
|
<option value="rating">{{ t('sortByRating') }}</option>
|
||||||
<option value="books">{{ t('sortByBooks') }}</option>
|
<option value="books">{{ t('sortByBooks') }}</option>
|
||||||
|
|||||||
+27
@@ -177,6 +177,33 @@ export class SeriesProgressChartComponent {
|
|||||||
|
|
||||||
public readonly chartData$: Observable<SeriesChartData> = this.chartDataSubject.asObservable();
|
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 {
|
onSearchChange(term: string): void {
|
||||||
this.searchTerm = term.toLowerCase().trim();
|
this.searchTerm = term.toLowerCase().trim();
|
||||||
this.currentPage = 0;
|
this.currentPage = 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user