Feature: Filtering and tagging now available in Ledger

This commit is contained in:
tanshu committed 2024-07-28 17:32:16 +05:30
1 parent 336a8f59c5
commit c0eca311c7
40 files changed
+973 -72

No files matched your search

+46 -7
View File
@@ -55,12 +55,42 @@
</mat-form-field>
<button mat-raised-button class="flex-auto basis-1/5" color="primary" (click)="show()">Show</button>
</div>
<div class="flex flex-row justify-around content-start items-start sm:max-lg:flex-col">
<mat-form-field class="flex-auto basis-4/5 mr-5">
<mat-label>Tags</mat-label>
<mat-select formControlName="tags" multiple (selectionChange)="tagChanges($event.value)">
@for (tag of tags; track tag) {
<mat-option [value]="tag">{{ tag }}</mat-option>
}
</mat-select>
</mat-form-field>
<button mat-raised-button tabindex="-1" extended class="flex-auto basis-1/5" (click)="labels()">
<mat-icon>label</mat-icon>
Manage Labels
</button>
</div>
</form>
<mat-table #table [dataSource]="dataSource" matSort aria-label="Elements">
<!-- Date Column -->
<ng-container matColumnDef="date">
<mat-header-cell *matHeaderCellDef mat-sort-header>Date</mat-header-cell>
<mat-cell *matCellDef="let row">{{ row.date }}</mat-cell>
<mat-header-cell *matHeaderCellDef>
<mat-checkbox
(change)="$event ? toggleAllRows() : null"
[checked]="selection.hasValue() && isAllSelected()"
[indeterminate]="selection.hasValue() && !isAllSelected()"
>
</mat-checkbox>
Date
</mat-header-cell>
<mat-cell *matCellDef="let row">
<mat-checkbox
(click)="$event.stopPropagation()"
(change)="$event ? selection.toggle(row) : null"
[checked]="selection.isSelected(row)"
>
</mat-checkbox>
{{ row.date }}
</mat-cell>
<mat-footer-cell *matFooterCellDef></mat-footer-cell>
</ng-container>
@@ -82,8 +112,15 @@
<!-- Narration Column -->
<ng-container matColumnDef="narration">
<mat-header-cell *matHeaderCellDef mat-sort-header>Narration</mat-header-cell>
<mat-cell *matCellDef="let row">{{ row.narration }}</mat-cell>
<mat-header-cell *matHeaderCellDef>Narration</mat-header-cell>
<mat-cell *matCellDef="let row"
>{{ row.narration }}
<mat-chip-set>
@for (tag of row.tags; track tag) {
<mat-chip>{{ tag }}</mat-chip>
}
</mat-chip-set></mat-cell
>
<mat-footer-cell *matFooterCellDef></mat-footer-cell>
</ng-container>
@@ -91,21 +128,23 @@
<ng-container matColumnDef="debit">
<mat-header-cell *matHeaderCellDef mat-sort-header class="right">Debit</mat-header-cell>
<mat-cell *matCellDef="let row" class="right">{{ row.debit | currency: 'INR' | clear }}</mat-cell>
<mat-footer-cell *matFooterCellDef class="right">{{ debit | currency: 'INR' }}</mat-footer-cell>
<mat-footer-cell *matFooterCellDef class="right">{{ dataSource.debit | currency: 'INR' }}</mat-footer-cell>
</ng-container>
<!-- Credit Column -->
<ng-container matColumnDef="credit">
<mat-header-cell *matHeaderCellDef mat-sort-header class="right">Credit</mat-header-cell>
<mat-cell *matCellDef="let row" class="right">{{ row.credit | currency: 'INR' | clear }}</mat-cell>
<mat-footer-cell *matFooterCellDef class="right">{{ credit | currency: 'INR' }}</mat-footer-cell>
<mat-footer-cell *matFooterCellDef class="right">{{ dataSource.credit | currency: 'INR' }}</mat-footer-cell>
</ng-container>
<!-- Running Column -->
<ng-container matColumnDef="running">
<mat-header-cell *matHeaderCellDef class="right">Running</mat-header-cell>
<mat-cell *matCellDef="let row" class="right">{{ row.running | currency: 'INR' | accounting }}</mat-cell>
<mat-footer-cell *matFooterCellDef class="right">{{ running | currency: 'INR' | accounting }}</mat-footer-cell>
<mat-footer-cell *matFooterCellDef class="right">{{
dataSource.running | currency: 'INR' | accounting
}}</mat-footer-cell>
</ng-container>
<mat-header-row *matHeaderRowDef="displayedColumns"></mat-header-row>