Polish 4 (#3363)
This commit is contained in:
parent
2d5a7a3606
commit
7c4d7dc821
26 changed files with 182 additions and 245 deletions
|
|
@ -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 => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue