RED-9776 - added active entity class

This commit is contained in:
Valentin Mihai 2024-08-04 12:30:14 +03:00
parent 0fa39cf900
commit 66277814c5
3 changed files with 5 additions and 0 deletions

View File

@ -15,6 +15,7 @@
(mouseenter)="itemMouseEnterFn && itemMouseEnterFn(entity)"
(mouseleave)="itemMouseLeaveFn && itemMouseLeaveFn(entity)"
[class.help-mode-active]="helpModeService?.isHelpModeActive$ | async"
[class.active-entity]="activeListingEntityService.activeEntity() === entity.id"
[id]="rowIdPrefix + '-' + ((entity[namePropertyKey] | snakeCase) ?? entity.id)"
[ngClass]="getTableItemClasses(entity)"
[routerLink]="entity.routerLink"
@ -28,6 +29,7 @@
} @else {
<div
[class.help-mode-active]="helpModeService?.isHelpModeActive$ | async"
[class.active-entity]="activeListingEntityService.activeEntity() === entity.id"
[id]="rowIdPrefix + '-' + ((entity[namePropertyKey] | snakeCase) ?? entity.id)"
[ngClass]="getTableItemClasses(entity)"
[routerLink]="entity.routerLink"

View File

@ -33,6 +33,7 @@
}
&:hover,
&.active-entity,
&.help-mode-active {
.selection-column iqser-round-checkbox .wrapper {
opacity: 1;

View File

@ -15,6 +15,7 @@ import { IListable } from '../models/listable';
import { Id } from '../models/trackable';
import { ListingService } from '../services/listing.service';
import { TableItemComponent } from './table-item/table-item.component';
import { ActiveListingEntityService } from '../../../../../../apps/red-ui/src/app/services/active-listing-entity.service';
@Component({
selector: 'iqser-table-content',
@ -53,6 +54,7 @@ export class TableContentComponent<Class extends IListable<PrimaryKey>, PrimaryK
constructor(
@Inject(forwardRef(() => ListingComponent)) readonly listingComponent: ListingComponent<Class>,
readonly listingService: ListingService<Class>,
readonly activeListingEntityService: ActiveListingEntityService,
@Optional() readonly helpModeService: HelpModeService,
) {
super();