Chore: Eslint v9

Chore: Angular Zoneless
Chore: Removed Angular-Hotkeys dependency
Fix: Localization works properly now
Chore: Using Material 3 theme now
Chore: Removed toaster service to use snackbar directly
Fix: F2 Date working on all components now
This commit is contained in:
2024-07-25 10:16:48 +05:30
parent c07c79ffda
commit 336a8f59c5
94 changed files with 846 additions and 1030 deletions
@@ -9,8 +9,8 @@
<mat-label>Start Date</mat-label>
<input
matInput
#startDateElement
[matDatepicker]="startDate"
(focus)="startDate.open()"
formControlName="startDate"
autocomplete="off"
/>
@@ -19,13 +19,7 @@
</mat-form-field>
<mat-form-field class="flex-auto basis-2/5 mr-5">
<mat-label>Finish Date</mat-label>
<input
matInput
[matDatepicker]="finishDate"
(focus)="finishDate.open()"
formControlName="finishDate"
autocomplete="off"
/>
<input matInput [matDatepicker]="finishDate" formControlName="finishDate" autocomplete="off" />
<mat-datepicker-toggle matSuffix [for]="finishDate"></mat-datepicker-toggle>
<mat-datepicker #finishDate></mat-datepicker>
</mat-form-field>
@@ -1,5 +1,5 @@
import { CurrencyPipe } from '@angular/common';
import { Component, OnInit, ViewChild } from '@angular/core';
import { Component, ElementRef, HostListener, OnInit, ViewChild } from '@angular/core';
import { FormControl, FormGroup, ReactiveFormsModule } from '@angular/forms';
import { MatButton } from '@angular/material/button';
import { MatCard, MatCardHeader, MatCardTitle, MatCardContent } from '@angular/material/card';
@@ -65,10 +65,11 @@ import { NetTransactionsDataSource } from './net-transactions-datasource';
],
})
export class NetTransactionsComponent implements OnInit {
@ViewChild(MatPaginator, { static: true }) paginator?: MatPaginator;
@ViewChild(MatSort, { static: true }) sort?: MatSort;
@ViewChild(MatPaginator, { static: true }) paginator!: MatPaginator;
@ViewChild(MatSort, { static: true }) sort!: MatSort;
@ViewChild('startDateElement', { static: true }) startDate!: ElementRef<HTMLInputElement>;
info: NetTransactions = new NetTransactions();
dataSource: NetTransactionsDataSource = new NetTransactionsDataSource(this.info.body);
dataSource: NetTransactionsDataSource = new NetTransactionsDataSource(this.info.body, this.paginator, this.sort);
form: FormGroup<{
startDate: FormControl<Date>;
finishDate: FormControl<Date>;
@@ -78,6 +79,13 @@ export class NetTransactionsComponent implements OnInit {
/** Columns displayed in the table. Columns IDs can be added, removed, or reordered. */
displayedColumns = ['type', 'name', 'debit', 'credit'];
@HostListener('window:keydown.f2', ['$event'])
focusDate(event: KeyboardEvent) {
event.preventDefault();
this.startDate.nativeElement.focus();
this.startDate.nativeElement.select();
}
constructor(
private route: ActivatedRoute,
private router: Router,