mirror of https://github.com/ghostfolio/ghostfolio
committed by
Thomas Kaul
8 changed files with 216 additions and 56 deletions
@ -1,60 +1,101 @@ |
|||||
<table |
<form [formGroup]="accountBalanceForm" (ngSubmit)="onSubmitAccountBalance()"> |
||||
class="gf-table w-100" |
<table |
||||
mat-table |
class="gf-table w-100" |
||||
matSort |
mat-table |
||||
matSortActive="date" |
matSort |
||||
matSortDirection="desc" |
matSortActive="date" |
||||
[dataSource]="dataSource" |
matSortDirection="desc" |
||||
> |
[dataSource]="dataSource" |
||||
<ng-container matColumnDef="date"> |
> |
||||
<th *matHeaderCellDef class="px-2" mat-header-cell mat-sort-header> |
<ng-container matColumnDef="date"> |
||||
<ng-container i18n>Date</ng-container> |
<th *matHeaderCellDef class="px-2" mat-header-cell mat-sort-header> |
||||
</th> |
<ng-container i18n>Date</ng-container> |
||||
<td *matCellDef="let element" class="px-2" mat-cell> |
</th> |
||||
<gf-value [isDate]="true" [locale]="locale" [value]="element?.date" /> |
<td *matCellDef="let element" class="px-2" mat-cell> |
||||
</td> |
<gf-value [isDate]="true" [locale]="locale" [value]="element?.date" /> |
||||
</ng-container> |
</td> |
||||
|
<td *matFooterCellDef class="px-2" mat-footer-cell> |
||||
|
<mat-form-field appearance="outline"> |
||||
|
<mat-label i18n>Date</mat-label> |
||||
|
<input formControlName="date" matInput [matDatepicker]="date" /> |
||||
|
<mat-datepicker-toggle matSuffix [for]="date"> |
||||
|
<ion-icon |
||||
|
class="text-muted" |
||||
|
matDatepickerToggleIcon |
||||
|
name="calendar-clear-outline" |
||||
|
/> |
||||
|
</mat-datepicker-toggle> |
||||
|
<mat-datepicker #date disabled="false" /> |
||||
|
</mat-form-field> |
||||
|
</td> |
||||
|
</ng-container> |
||||
|
|
||||
<ng-container matColumnDef="value"> |
<ng-container matColumnDef="value"> |
||||
<th *matHeaderCellDef class="px-2 text-right" mat-header-cell> |
<th *matHeaderCellDef class="px-2 text-right" mat-header-cell> |
||||
<ng-container i18n>Value</ng-container> |
<ng-container i18n>Value</ng-container> |
||||
</th> |
</th> |
||||
<td *matCellDef="let element" class="px-2" mat-cell> |
<td *matCellDef="let element" class="px-2" mat-cell> |
||||
<div class="d-flex justify-content-end"> |
<div class="d-flex justify-content-end"> |
||||
<gf-value |
<gf-value |
||||
[isCurrency]="true" |
[isCurrency]="true" |
||||
[locale]="locale" |
[locale]="locale" |
||||
[unit]="element?.Account?.currency" |
[unit]="element?.Account?.currency" |
||||
[value]="element?.value" |
[value]="element?.value" |
||||
/> |
/> |
||||
</div> |
</div> |
||||
</td> |
</td> |
||||
</ng-container> |
<td *matFooterCellDef class="px-2" mat-footer-cell> |
||||
|
<div class="d-flex justify-content-end"> |
||||
|
<mat-form-field apperance="outline"> |
||||
|
<input |
||||
|
formControlName="balance" |
||||
|
matInput |
||||
|
placeholder="Value" |
||||
|
type="number" |
||||
|
/> |
||||
|
</mat-form-field> |
||||
|
</div> |
||||
|
</td> |
||||
|
</ng-container> |
||||
|
|
||||
<ng-container matColumnDef="actions" stickyEnd> |
<ng-container matColumnDef="actions" stickyEnd> |
||||
<th *matHeaderCellDef class="px-1 text-center" mat-header-cell></th> |
<th *matHeaderCellDef class="px-1 text-center" mat-header-cell></th> |
||||
<td *matCellDef="let element" class="px-1 text-center" mat-cell> |
<td *matCellDef="let element" class="px-1 text-center" mat-cell> |
||||
@if (showActions) { |
@if (showActions) { |
||||
|
<button |
||||
|
class="mx-1 no-min-width px-2" |
||||
|
mat-button |
||||
|
[matMenuTriggerFor]="accountBalanceMenu" |
||||
|
(click)="$event.stopPropagation()" |
||||
|
> |
||||
|
<ion-icon name="ellipsis-horizontal" /> |
||||
|
</button> |
||||
|
} |
||||
|
<mat-menu #accountBalanceMenu="matMenu" xPosition="before"> |
||||
|
<button mat-menu-item (click)="onDeleteAccountBalance(element.id)"> |
||||
|
<span class="align-items-center d-flex"> |
||||
|
<ion-icon class="mr-2" name="trash-outline" /> |
||||
|
<span i18n>Delete</span> |
||||
|
</span> |
||||
|
</button> |
||||
|
</mat-menu> |
||||
|
</td> |
||||
|
<td *matFooterCellDef class="px-1 text-center" mat-footer-cell> |
||||
<button |
<button |
||||
class="mx-1 no-min-width px-2" |
class="mx-1 no-min-width px-2" |
||||
mat-button |
color="primary" |
||||
[matMenuTriggerFor]="accountBalanceMenu" |
mat-flat-button |
||||
(click)="$event.stopPropagation()" |
type="submit" |
||||
|
[disabled]="accountBalanceForm.invalid" |
||||
> |
> |
||||
<ion-icon name="ellipsis-horizontal" /> |
<ion-icon name="add" /> |
||||
|
<span i18n>Add</span> |
||||
</button> |
</button> |
||||
} |
</td> |
||||
<mat-menu #accountBalanceMenu="matMenu" xPosition="before"> |
</ng-container> |
||||
<button mat-menu-item (click)="onDeleteAccountBalance(element.id)"> |
|
||||
<span class="align-items-center d-flex"> |
|
||||
<ion-icon class="mr-2" name="trash-outline" /> |
|
||||
<span i18n>Delete</span> |
|
||||
</span> |
|
||||
</button> |
|
||||
</mat-menu> |
|
||||
</td> |
|
||||
</ng-container> |
|
||||
|
|
||||
<tr *matHeaderRowDef="displayedColumns" mat-header-row></tr> |
<tr *matHeaderRowDef="displayedColumns" mat-header-row></tr> |
||||
<tr *matRowDef="let row; columns: displayedColumns" mat-row></tr> |
<tr *matRowDef="let row; columns: displayedColumns" mat-row></tr> |
||||
</table> |
<tr *matFooterRowDef="displayedColumns" mat-footer-row></tr> |
||||
|
</table> |
||||
|
</form> |
||||
|
@ -1,3 +1,10 @@ |
|||||
:host { |
:host { |
||||
display: block; |
display: block; |
||||
} |
} |
||||
|
|
||||
|
:host-context(.is-dark-theme) { |
||||
|
input { |
||||
|
color: rgb(var(--light-primary-text)); |
||||
|
background-color: rgb(var(--palette-foreground-text-light)); |
||||
|
} |
||||
|
} |
||||
|
Loading…
Reference in new issue