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

114 lines
2.9 KiB
HTML
Raw Normal View History

2021-04-13 21:53:58 +02:00
<!--<mat-form-field appearance="outline" class="w-100">
<input #input autocomplete="off" matInput (keyup)="applyFilter($event)" />
<ion-icon class="mr-1" matPrefix name="search-outline"></ion-icon>
</mat-form-field>-->
<table
class="w-100"
matSort
matSortActive="shareCurrent"
matSortDirection="desc"
mat-table
[dataSource]="dataSource"
>
<ng-container matColumnDef="symbol">
<th mat-header-cell *matHeaderCellDef mat-sort-header i18n>Symbol</th>
2021-04-21 21:15:49 +02:00
<td mat-cell *matCellDef="let element">{{ 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 text-right"
i18n
mat-header-cell
>
Performance
</th>
<td class="d-none d-lg-table-cell" mat-cell *matCellDef="let element">
<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="shareInvestment">
<th
*matHeaderCellDef
class="justify-content-end"
i18n
mat-header-cell
mat-sort-header
>
Initial Share
</th>
<td mat-cell *matCellDef="let element">
<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.shareInvestment"
></gf-value>
</div>
</td>
</ng-container>
<ng-container matColumnDef="shareCurrent">
<th
*matHeaderCellDef
class="justify-content-end"
i18n
mat-header-cell
mat-sort-header
>
Current Share
</th>
<td mat-cell *matCellDef="let element">
<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.shareCurrent"
></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>