|
|
|
@ -42,10 +42,19 @@ |
|
|
|
matSort [matSortActive]="sortOrderProperty" [matSortDirection]="pageLinkSortDirection()" matSortDisableClear> |
|
|
|
<ng-container [matColumnDef]="column.def" *ngFor="let column of columns; trackBy: trackByColumnDef;"> |
|
|
|
<mat-header-cell [ngStyle]="headerStyle(column)" *matHeaderCellDef mat-sort-header [disabled]="!column.sortable"> {{ column.title }} </mat-header-cell> |
|
|
|
<mat-cell *matCellDef="let entity; let row = index" |
|
|
|
[innerHTML]="cellContent(entity, column, row)" |
|
|
|
[ngStyle]="cellStyle(entity, column, row)"> |
|
|
|
</mat-cell> |
|
|
|
<ng-container *ngIf="useCellClickAction; else rowActionEnabled" > |
|
|
|
<mat-cell *matCellDef="let entity; let row = index" |
|
|
|
[innerHTML]="cellContent(entity, column, row)" |
|
|
|
[ngStyle]="cellStyle(entity, column, row)" |
|
|
|
(click)="onCellClick($event, entity, column, false)" (dblclick)="onCellClick($event, entity, column, true)"> |
|
|
|
</mat-cell> |
|
|
|
</ng-container> |
|
|
|
<ng-template #rowActionEnabled> |
|
|
|
<mat-cell *matCellDef="let entity; let row = index" |
|
|
|
[innerHTML]="cellContent(entity, column, row)" |
|
|
|
[ngStyle]="cellStyle(entity, column, row)"> |
|
|
|
</mat-cell> |
|
|
|
</ng-template> |
|
|
|
</ng-container> |
|
|
|
<ng-container matColumnDef="actions" [stickyEnd]="enableStickyAction"> |
|
|
|
<mat-header-cell *matHeaderCellDef [ngStyle.gt-md]="{ minWidth: (entityDatasource.countCellButtonAction * 48) + 'px', |
|
|
|
@ -87,12 +96,21 @@ |
|
|
|
</mat-cell> |
|
|
|
</ng-container> |
|
|
|
<mat-header-row *matHeaderRowDef="displayedColumns; sticky: enableStickyHeader"></mat-header-row> |
|
|
|
<mat-row [ngClass]="{'tb-current-entity': entityDatasource.isCurrentEntity(entity), |
|
|
|
'invisible': entityDatasource.dataLoading, |
|
|
|
'tb-pointer': hasRowAction}" |
|
|
|
*matRowDef="let entity; columns: displayedColumns; let row = index" |
|
|
|
[ngStyle]="rowStyle(entity, row)" |
|
|
|
(click)="onRowClick($event, entity)" (dblclick)="onRowClick($event, entity, true)"></mat-row> |
|
|
|
<ng-container *ngIf="useCellClickAction; else rowActionEnabled" > |
|
|
|
<mat-row [ngClass]="{'tb-current-entity': entityDatasource.isCurrentEntity(entity), |
|
|
|
'invisible': entityDatasource.dataLoading, |
|
|
|
'tb-pointer': hasRowAction}" |
|
|
|
*matRowDef="let entity; columns: displayedColumns; let row = index" |
|
|
|
[ngStyle]="rowStyle(entity, row)"></mat-row> |
|
|
|
</ng-container> |
|
|
|
<ng-template #rowActionEnabled> |
|
|
|
<mat-row [ngClass]="{'tb-current-entity': entityDatasource.isCurrentEntity(entity), |
|
|
|
'invisible': entityDatasource.dataLoading, |
|
|
|
'tb-pointer': hasRowAction}" |
|
|
|
*matRowDef="let entity; columns: displayedColumns; let row = index" |
|
|
|
[ngStyle]="rowStyle(entity, row)" |
|
|
|
(click)="onRowClick($event, entity)" (dblclick)="onRowClick($event, entity, true)"></mat-row> |
|
|
|
</ng-template> |
|
|
|
</table> |
|
|
|
<span [fxShow]="(entityDatasource.isEmpty() | async) && !entityDatasource.dataLoading" |
|
|
|
fxLayoutAlign="center center" |
|
|
|
|