|
|
|
@ -22,7 +22,7 @@ import { |
|
|
|
import { MatButtonModule } from '@angular/material/button'; |
|
|
|
import { MatDialogModule } from '@angular/material/dialog'; |
|
|
|
import { MatPaginator, MatPaginatorModule } from '@angular/material/paginator'; |
|
|
|
import { MatSort, MatSortModule } from '@angular/material/sort'; |
|
|
|
import { MatSort, MatSortModule, SortDirection } from '@angular/material/sort'; |
|
|
|
import { MatTableDataSource, MatTableModule } from '@angular/material/table'; |
|
|
|
import { NgxSkeletonLoaderModule } from 'ngx-skeleton-loader'; |
|
|
|
|
|
|
|
@ -51,6 +51,7 @@ export class GfHoldingsTableComponent { |
|
|
|
public readonly hasPermissionToShowQuantities = input(true); |
|
|
|
public readonly hasPermissionToShowValues = input(true); |
|
|
|
public readonly holdings = input.required<PortfolioPosition[] | undefined>(); |
|
|
|
public readonly isSimplified = input(false); |
|
|
|
public readonly locale = input(getLocale()); |
|
|
|
public readonly pageSize = model(Number.MAX_SAFE_INTEGER); |
|
|
|
|
|
|
|
@ -62,6 +63,10 @@ export class GfHoldingsTableComponent { |
|
|
|
protected readonly dataSource = new MatTableDataSource<PortfolioPosition>([]); |
|
|
|
|
|
|
|
protected readonly displayedColumns = computed(() => { |
|
|
|
if (this.isSimplified()) { |
|
|
|
return ['icon', 'nameWithSymbol', 'performanceInPercentage']; |
|
|
|
} |
|
|
|
|
|
|
|
const columns = ['icon', 'nameWithSymbol', 'dateOfFirstActivity']; |
|
|
|
|
|
|
|
if (this.hasPermissionToShowQuantities()) { |
|
|
|
@ -82,7 +87,17 @@ export class GfHoldingsTableComponent { |
|
|
|
return columns; |
|
|
|
}); |
|
|
|
|
|
|
|
protected readonly isLoading = computed(() => !this.holdings()); |
|
|
|
protected readonly isLoading = computed(() => { |
|
|
|
return !this.holdings(); |
|
|
|
}); |
|
|
|
|
|
|
|
protected readonly sortActive = computed(() => { |
|
|
|
return this.isSimplified() ? 'assetProfile.name' : 'allocationInPercentage'; |
|
|
|
}); |
|
|
|
|
|
|
|
protected readonly sortDirection = computed<SortDirection>(() => { |
|
|
|
return this.isSimplified() ? 'asc' : 'desc'; |
|
|
|
}); |
|
|
|
|
|
|
|
public constructor() { |
|
|
|
this.dataSource.sortingDataAccessor = getLowercase; |
|
|
|
|