ghostfolio/apps/client/src/app/components/positions-table/positions-table.component.html

113 lines
2.8 KiB
HTML
Raw Normal View History

2021-04-13 21:53:58 +02:00
<table
class="gf-table w-100"
2021-04-13 21:53:58 +02:00
matSort
matSortActive="allocationCurrent"
2021-04-13 21:53:58 +02:00
matSortDirection="desc"
mat-table
[dataSource]="dataSource"
>
<ng-container matColumnDef="symbol">
<th *matHeaderCellDef class="px-1" i18n mat-header-cell mat-sort-header>
Symbol
</th>
<td *matCellDef="let element" class="px-1" mat-cell>
{{ element.symbol | gfSymbol }}
</td>
2021-04-13 21:53:58 +02:00
</ng-container>
<ng-container matColumnDef="performance">
<th
*matHeaderCellDef
class="d-none d-lg-table-cell px-1 text-right"
2021-04-13 21:53:58 +02:00
i18n
mat-header-cell
>
Performance
</th>
<td class="d-none d-lg-table-cell px-1" mat-cell *matCellDef="let element">
2021-04-13 21:53:58 +02:00
<div class="d-flex justify-content-end">
<gf-value
2021-04-25 17:41:53 +02:00
[colorizeSign]="true"
[isPercent]="true"
2021-04-13 21:53:58 +02:00
[locale]="locale"
[value]="isLoading ? undefined : element.grossPerformancePercent"
></gf-value>
</div>
</td>
</ng-container>
<ng-container matColumnDef="allocationInvestment">
2021-04-13 21:53:58 +02:00
<th
*matHeaderCellDef
class="justify-content-end px-1"
2021-04-13 21:53:58 +02:00
i18n
mat-header-cell
mat-sort-header
>
Initial Allocation
2021-04-13 21:53:58 +02:00
</th>
<td mat-cell *matCellDef="let element">
<div class="d-flex justify-content-end px-1">
2021-04-13 21:53:58 +02:00
<gf-value
2021-04-25 17:41:53 +02:00
[isPercent]="true"
2021-04-13 21:53:58 +02:00
[locale]="locale"
[value]="isLoading ? undefined : element.allocationInvestment"
2021-04-13 21:53:58 +02:00
></gf-value>
</div>
</td>
</ng-container>
<ng-container matColumnDef="allocationCurrent">
2021-04-13 21:53:58 +02:00
<th
*matHeaderCellDef
class="justify-content-end px-1"
2021-04-13 21:53:58 +02:00
i18n
mat-header-cell
mat-sort-header
>
Current Allocation
2021-04-13 21:53:58 +02:00
</th>
<td *matCellDef="let element" class="px-1" mat-cell>
2021-04-13 21:53:58 +02:00
<div class="d-flex justify-content-end">
<gf-value
2021-04-25 17:41:53 +02:00
[isPercent]="true"
2021-04-13 21:53:58 +02:00
[locale]="locale"
[value]="isLoading ? undefined : element.allocationCurrent"
2021-04-13 21:53:58 +02:00
></gf-value>
</div>
</td>
</ng-container>
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
<tr
*matRowDef="let row; columns: displayedColumns"
mat-row
(click)="onOpenPositionDialog({ symbol: row.symbol, title: row.name })"
></tr>
</table>
<ngx-skeleton-loader
*ngIf="isLoading"
animation="pulse"
class="px-4 py-3"
[theme]="{
height: '1.5rem',
width: '100%'
}"
></ngx-skeleton-loader>
<div *ngIf="dataSource.data.length === 0 && !isLoading" class="p-3 text-center">
<gf-no-transactions-info-indicator></gf-no-transactions-info-indicator>
</div>
<div
*ngIf="dataSource.data.length > pageSize && !isLoading"
class="my-3 text-center"
>
<button i18n mat-stroked-button (click)="onShowAllPositions()">
Show all positions...
</button>
</div>
<mat-paginator class="d-none" [pageSize]="pageSize"></mat-paginator>