This commit is contained in:
Joe Milazzo 2024-11-14 07:11:39 -06:00 committed by GitHub
parent 2d5a7a3606
commit 7c4d7dc821
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
26 changed files with 182 additions and 245 deletions

View file

@ -2,7 +2,7 @@ import {
ChangeDetectionStrategy,
ChangeDetectorRef,
Component,
DestroyRef,
DestroyRef, HostListener,
inject,
Input,
OnInit
@ -14,6 +14,7 @@ import {AsyncPipe, DecimalPipe, NgStyle} from "@angular/common";
import {TranslocoModule} from "@jsverse/transloco";
import {NgbTooltip} from "@ng-bootstrap/ng-bootstrap";
import {CardActionablesComponent} from "../../_single-module/card-actionables/card-actionables.component";
import {KEY_CODES} from "../../shared/_services/utility.service";
@Component({
selector: 'app-bulk-operations',
@ -55,7 +56,20 @@ export class BulkOperationsComponent implements OnInit {
public readonly bulkSelectionService = inject(BulkSelectionService);
protected readonly Action = Action;
constructor() { }
@HostListener('document:keydown.shift', ['$event'])
handleKeypress(event: KeyboardEvent) {
if (event.key === KEY_CODES.SHIFT) {
this.bulkSelectionService.isShiftDown = true;
}
// TODO: See if we can figure out a select all (Ctrl+A) by having each method handle the event or pass all the data into this component.
}
@HostListener('document:keyup.shift', ['$event'])
handleKeyUp(event: KeyboardEvent) {
if (event.key === KEY_CODES.SHIFT) {
this.bulkSelectionService.isShiftDown = false;
}
}
ngOnInit(): void {
this.bulkSelectionService.actions$.pipe(takeUntilDestroyed(this.destroyRef)).subscribe(actions => {