common-ui/src/lib/listing/table-content/table-content.component.html

46 lines
2.0 KiB
HTML

<div class="display-contents">
<cdk-virtual-scroll-viewport
[class.no-data]="listingComponent.noContent$ | async"
[itemSize]="itemSize"
[maxBufferPx]="3000"
[minBufferPx]="1000"
id="virtual-scroll"
iqserHasScrollbar
>
<ng-container *cdkVirtualFor="let entity of listingComponent.sortedDisplayedEntities$ | async; trackBy: trackBy">
<!-- mouseenter and mouseleave triggers change detection event if itemMouse functions are undefined -->
<!-- this little hack below ensures that change detection won't be triggered if functions are undefined -->
<div
(mouseenter)="itemMouseEnterFn && itemMouseEnterFn(entity)"
(mouseleave)="itemMouseLeaveFn && itemMouseLeaveFn(entity)"
*ngIf="itemMouseEnterFn || itemMouseLeaveFn; else withoutMouseEvents"
[class.help-mode]="helpModeService.isHelpModeActive$ | async"
[id]="'item-' + entity.id"
[ngClass]="getTableItemClasses(entity)"
[routerLink]="entity.routerLink"
>
<iqser-table-item
(click)="multiSelect(entity, $event)"
[entity]="entity"
[selectionEnabled]="selectionEnabled"
></iqser-table-item>
</div>
<ng-template #withoutMouseEvents>
<div
[class.help-mode]="helpModeService.isHelpModeActive$ | async"
[id]="'item-' + entity.id"
[ngClass]="getTableItemClasses(entity)"
[routerLink]="entity.routerLink"
>
<iqser-table-item
(click)="multiSelect(entity, $event)"
[entity]="entity"
[selectionEnabled]="selectionEnabled"
></iqser-table-item>
</div>
</ng-template>
</ng-container>
</cdk-virtual-scroll-viewport>
</div>