mirror of https://github.com/ghostfolio/ghostfolio
				
				
			
			You can not select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
					
					
						
							227 lines
						
					
					
						
							5.9 KiB
						
					
					
				
			
		
		
		
			
			
			
		
		
	
	
							227 lines
						
					
					
						
							5.9 KiB
						
					
					
				
								<div *ngIf="chipsAccount.length > 1">
							 | 
						|
								  <mat-chip-list aria-label="Account selection" class="d-block mb-4">
							 | 
						|
								    <mat-chip
							 | 
						|
								      [selected]="true"
							 | 
						|
								      #c="matChip"
							 | 
						|
								      (click)="!c.selected && c.toggleSelected()"
							 | 
						|
								      (selectionChange)="applyAccountFilter($event)"
							 | 
						|
								    >
							 | 
						|
								      All
							 | 
						|
								    </mat-chip>
							 | 
						|
								    <mat-chip
							 | 
						|
								      #c="matChip"
							 | 
						|
								      *ngFor="let account of chipsAccount"
							 | 
						|
								      (click)="!c.selected && c.toggleSelected()"
							 | 
						|
								      (selectionChange)="applyAccountFilter($event)"
							 | 
						|
								    >
							 | 
						|
								      {{ account }}
							 | 
						|
								    </mat-chip>
							 | 
						|
								  </mat-chip-list>
							 | 
						|
								</div>
							 | 
						|
								
							 | 
						|
								<mat-form-field appearance="outline" class="w-100">
							 | 
						|
								  <input
							 | 
						|
								    #input
							 | 
						|
								    autocomplete="off"
							 | 
						|
								    matInput
							 | 
						|
								    placeholder="Search for transactions..."
							 | 
						|
								    (keyup)="applyFilter($event)"
							 | 
						|
								  />
							 | 
						|
								  <ion-icon class="mr-1" matPrefix name="search-outline"></ion-icon>
							 | 
						|
								</mat-form-field>
							 | 
						|
								
							 | 
						|
								<table
							 | 
						|
								  class="w-100"
							 | 
						|
								  matSort
							 | 
						|
								  matSortActive="date"
							 | 
						|
								  matSortDirection="desc"
							 | 
						|
								  mat-table
							 | 
						|
								  [dataSource]="dataSource"
							 | 
						|
								>
							 | 
						|
								  <ng-container matColumnDef="account">
							 | 
						|
								    <th *matHeaderCellDef i18n mat-header-cell mat-sort-header>Account</th>
							 | 
						|
								    <td *matCellDef="let element" mat-cell>
							 | 
						|
								      <div class="d-flex">
							 | 
						|
								        <gf-symbol-icon
							 | 
						|
								          *ngIf="element.Account?.Platform?.url"
							 | 
						|
								          class="mr-1"
							 | 
						|
								          [tooltip]="element.Account?.Platform?.name"
							 | 
						|
								          [url]="element.Account?.Platform?.url"
							 | 
						|
								        ></gf-symbol-icon>
							 | 
						|
								        <span class="d-none d-lg-block">{{ element.Account?.name }}</span>
							 | 
						|
								      </div>
							 | 
						|
								    </td>
							 | 
						|
								  </ng-container>
							 | 
						|
								
							 | 
						|
								  <ng-container matColumnDef="date">
							 | 
						|
								    <th
							 | 
						|
								      *matHeaderCellDef
							 | 
						|
								      class="justify-content-center"
							 | 
						|
								      i18n
							 | 
						|
								      mat-header-cell
							 | 
						|
								      mat-sort-header
							 | 
						|
								    >
							 | 
						|
								      Date
							 | 
						|
								    </th>
							 | 
						|
								    <td mat-cell *matCellDef="let element">
							 | 
						|
								      <div class="d-flex justify-content-center">
							 | 
						|
								        {{ element.date | date: defaultDateFormat }}
							 | 
						|
								      </div>
							 | 
						|
								    </td>
							 | 
						|
								  </ng-container>
							 | 
						|
								
							 | 
						|
								  <ng-container matColumnDef="type">
							 | 
						|
								    <th
							 | 
						|
								      *matHeaderCellDef
							 | 
						|
								      class="justify-content-center"
							 | 
						|
								      i18n
							 | 
						|
								      mat-header-cell
							 | 
						|
								      mat-sort-header
							 | 
						|
								    >
							 | 
						|
								      Type
							 | 
						|
								    </th>
							 | 
						|
								    <td mat-cell *matCellDef="let element" class="text-center">
							 | 
						|
								      <div
							 | 
						|
								        class="d-inline-flex justify-content-center pl-1 pr-2 py-1 type-badge"
							 | 
						|
								        [ngClass]="element.type == 'BUY' ? 'buy' : 'sell'"
							 | 
						|
								      >
							 | 
						|
								        <ion-icon
							 | 
						|
								          class="mr-1"
							 | 
						|
								          [name]="
							 | 
						|
								            element.type === 'BUY'
							 | 
						|
								              ? 'arrow-forward-circle-outline'
							 | 
						|
								              : 'arrow-back-circle-outline'
							 | 
						|
								          "
							 | 
						|
								        ></ion-icon>
							 | 
						|
								        <span>{{ element.type }}</span>
							 | 
						|
								      </div>
							 | 
						|
								    </td>
							 | 
						|
								  </ng-container>
							 | 
						|
								
							 | 
						|
								  <ng-container matColumnDef="symbol">
							 | 
						|
								    <th *matHeaderCellDef i18n mat-header-cell mat-sort-header>Symbol</th>
							 | 
						|
								    <td mat-cell *matCellDef="let element">{{ element.symbol | gfSymbol }}</td>
							 | 
						|
								  </ng-container>
							 | 
						|
								
							 | 
						|
								  <ng-container matColumnDef="currency">
							 | 
						|
								    <th
							 | 
						|
								      *matHeaderCellDef
							 | 
						|
								      class="d-none d-lg-table-cell justify-content-center"
							 | 
						|
								      mat-header-cell
							 | 
						|
								      i18n
							 | 
						|
								      mat-sort-header
							 | 
						|
								    >
							 | 
						|
								      Currency
							 | 
						|
								    </th>
							 | 
						|
								    <td class="d-none d-lg-table-cell" mat-cell *matCellDef="let element">
							 | 
						|
								      <div class="d-flex justify-content-center">
							 | 
						|
								        {{ element.currency }}
							 | 
						|
								      </div>
							 | 
						|
								    </td>
							 | 
						|
								  </ng-container>
							 | 
						|
								
							 | 
						|
								  <ng-container matColumnDef="quantity">
							 | 
						|
								    <th
							 | 
						|
								      *matHeaderCellDef
							 | 
						|
								      class="d-none d-lg-table-cell justify-content-end"
							 | 
						|
								      i18n
							 | 
						|
								      mat-header-cell
							 | 
						|
								      mat-sort-header
							 | 
						|
								    >
							 | 
						|
								      Quantity
							 | 
						|
								    </th>
							 | 
						|
								    <td *matCellDef="let element" class="d-none d-lg-table-cell" mat-cell>
							 | 
						|
								      <div class="d-flex justify-content-end">
							 | 
						|
								        <gf-value
							 | 
						|
								          [isCurrency]="true"
							 | 
						|
								          [locale]="locale"
							 | 
						|
								          [value]="isLoading ? undefined : element.quantity"
							 | 
						|
								        ></gf-value>
							 | 
						|
								      </div>
							 | 
						|
								    </td>
							 | 
						|
								  </ng-container>
							 | 
						|
								
							 | 
						|
								  <ng-container matColumnDef="unitPrice">
							 | 
						|
								    <th
							 | 
						|
								      *matHeaderCellDef
							 | 
						|
								      class="d-none d-lg-table-cell justify-content-end"
							 | 
						|
								      i18n
							 | 
						|
								      mat-header-cell
							 | 
						|
								      mat-sort-header
							 | 
						|
								    >
							 | 
						|
								      Unit Price
							 | 
						|
								    </th>
							 | 
						|
								    <td *matCellDef="let element" class="d-none d-lg-table-cell" mat-cell>
							 | 
						|
								      <div class="d-flex justify-content-end">
							 | 
						|
								        <gf-value
							 | 
						|
								          [isCurrency]="true"
							 | 
						|
								          [locale]="locale"
							 | 
						|
								          [value]="isLoading ? undefined : element.unitPrice"
							 | 
						|
								        ></gf-value>
							 | 
						|
								      </div>
							 | 
						|
								    </td>
							 | 
						|
								  </ng-container>
							 | 
						|
								
							 | 
						|
								  <ng-container matColumnDef="fee">
							 | 
						|
								    <th
							 | 
						|
								      *matHeaderCellDef
							 | 
						|
								      class="d-none d-lg-table-cell justify-content-end"
							 | 
						|
								      i18n
							 | 
						|
								      mat-header-cell
							 | 
						|
								      mat-sort-header
							 | 
						|
								    >
							 | 
						|
								      Fee
							 | 
						|
								    </th>
							 | 
						|
								    <td class="d-none d-lg-table-cell" mat-cell *matCellDef="let element">
							 | 
						|
								      <div class="d-flex justify-content-end">
							 | 
						|
								        <gf-value
							 | 
						|
								          [isCurrency]="true"
							 | 
						|
								          [locale]="locale"
							 | 
						|
								          [value]="isLoading ? undefined : element.fee"
							 | 
						|
								        ></gf-value>
							 | 
						|
								      </div>
							 | 
						|
								    </td>
							 | 
						|
								  </ng-container>
							 | 
						|
								
							 | 
						|
								  <ng-container matColumnDef="actions">
							 | 
						|
								    <th *matHeaderCellDef class="px-0 text-center" i18n mat-header-cell></th>
							 | 
						|
								    <td *matCellDef="let element" class="px-0 text-center" mat-cell>
							 | 
						|
								      <button
							 | 
						|
								        class="mx-1 no-min-width px-2"
							 | 
						|
								        mat-button
							 | 
						|
								        [matMenuTriggerFor]="accountMenu"
							 | 
						|
								        (click)="$event.stopPropagation()"
							 | 
						|
								      >
							 | 
						|
								        <ion-icon name="ellipsis-vertical"></ion-icon>
							 | 
						|
								      </button>
							 | 
						|
								      <mat-menu #accountMenu="matMenu" xPosition="before">
							 | 
						|
								        <button i18n mat-menu-item (click)="onUpdateTransaction(element)">
							 | 
						|
								          Edit
							 | 
						|
								        </button>
							 | 
						|
								        <button i18n mat-menu-item (click)="onCloneTransaction(element)">
							 | 
						|
								          Clone
							 | 
						|
								        </button>
							 | 
						|
								        <button i18n mat-menu-item (click)="onDeleteTransaction(element.id)">
							 | 
						|
								          Delete
							 | 
						|
								        </button>
							 | 
						|
								      </mat-menu>
							 | 
						|
								    </td>
							 | 
						|
								  </ng-container>
							 | 
						|
								
							 | 
						|
								  <tr *matHeaderRowDef="displayedColumns" mat-header-row></tr>
							 | 
						|
								  <tr
							 | 
						|
								    *matRowDef="let row; columns: displayedColumns"
							 | 
						|
								    mat-row
							 | 
						|
								    (click)="onOpenPositionDialog({ symbol: row.symbol, title: '' })"
							 | 
						|
								  ></tr>
							 | 
						|
								</table>
							 | 
						|
								
							 | 
						|
								<ngx-skeleton-loader
							 | 
						|
								  *ngIf="isLoading"
							 | 
						|
								  animation="pulse"
							 | 
						|
								  class="px-4 py-3"
							 | 
						|
								  [theme]="{
							 | 
						|
								    height: '1.5rem',
							 | 
						|
								    width: '100%'
							 | 
						|
								  }"
							 | 
						|
								></ngx-skeleton-loader>
							 | 
						|
								
							 |