• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

IgniteUI / igniteui-angular / 13331632524

14 Feb 2025 02:51PM CUT coverage: 22.015% (-69.6%) from 91.622%
13331632524

Pull #15372

github

web-flow
Merge d52d57714 into bcb78ae0a
Pull Request #15372: chore(*): test ci passing

1990 of 15592 branches covered (12.76%)

431 of 964 new or added lines in 18 files covered. (44.71%)

19956 existing lines in 307 files now uncovered.

6452 of 29307 relevant lines covered (22.02%)

249.17 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

21.74
/projects/igniteui-angular/src/lib/grids/grid.rowEdit.directive.ts
1
import { Directive, ElementRef, HostListener, Inject } from '@angular/core';
2
import { GridType, IgxGridEmptyTemplateContext, IgxGridRowEditActionsTemplateContext, IgxGridRowEditTemplateContext, IgxGridRowEditTextTemplateContext, IGX_GRID_BASE } from './common/grid.interface';
3

4
/** @hidden @internal */
5
@Directive({
6
    selector: '[igxRowEdit]',
7
    standalone: true
8
})
9
export class IgxRowEditTemplateDirective {
2✔
10
    public static ngTemplateContextGuard(_directive: IgxRowEditTemplateDirective,
11
        context: unknown): context is IgxGridRowEditTemplateContext { 
12
        return true;
×
13
    }
14
 }
15

16
/** @hidden @internal */
17
@Directive({
18
    selector: '[igxRowEditText]',
19
    standalone: true
20
})
21
export class IgxRowEditTextDirective {
2✔
22
    public static ngTemplateContextGuard(_directive: IgxRowEditTextDirective,
23
        context: unknown): context is IgxGridRowEditTextTemplateContext { 
24
        return true;
×
25
    }
26
 }
27

28
/** @hidden @internal */
29
@Directive({
30
    selector: '[igxRowAddText]',
31
    standalone: true
32
})
33
export class IgxRowAddTextDirective {
2✔
34
    public static ngTemplateContextGuard(_directive: IgxRowAddTextDirective,
35
        context: unknown): context is IgxGridEmptyTemplateContext { 
36
        return true;
×
37
    }
38
 }
39

40
/** @hidden @internal */
41
@Directive({
42
    selector: '[igxRowEditActions]',
43
    standalone: true
44
})
45
export class IgxRowEditActionsDirective {
2✔
46
    public static ngTemplateContextGuard(_directive: IgxRowEditActionsDirective,
47
        context: unknown): context is IgxGridRowEditActionsTemplateContext { 
48
        return true;
×
49
    }
50
 }
51

52

53
// TODO: Refactor circular ref, deps and logic
54
/** @hidden @internal */
55
@Directive({
56
    selector: `[igxRowEditTabStop]`,
57
    standalone: true
58
})
59
export class IgxRowEditTabStopDirective {
2✔
60
    private currentCellIndex: number;
61

UNCOV
62
    constructor(@Inject(IGX_GRID_BASE) public grid: GridType, public element: ElementRef<HTMLElement>) {}
×
63

64
    @HostListener('keydown.Tab', [`$event`])
65
    @HostListener('keydown.Shift.Tab', [`$event`])
66
    public handleTab(event: KeyboardEvent): void {
UNCOV
67
        event.stopPropagation();
×
UNCOV
68
        if ((this.grid.rowEditTabs.last === this && !event.shiftKey) ||
×
69
            (this.grid.rowEditTabs.first === this && event.shiftKey)
70
        ) {
UNCOV
71
            this.move(event);
×
72
        }
73
    }
74

75
    @HostListener('keydown.Escape', [`$event`])
76
    public handleEscape(event: KeyboardEvent): void {
UNCOV
77
        this.grid.crudService.endEdit(false, event);
×
UNCOV
78
        this.grid.tbody.nativeElement.focus();
×
79
    }
80

81
    @HostListener('keydown.Enter', ['$event'])
82
    public handleEnter(event: KeyboardEvent): void {
83
        event.stopPropagation();
×
84
    }
85

86
    /**
87
     * Moves focus to first/last editable cell in the editable row and put the cell in edit mode.
88
     * If cell is out of view first scrolls to the cell
89
     *
90
     * @param event keyboard event containing information about whether SHIFT key was pressed
91
     */
92
    private move(event: KeyboardEvent) {
UNCOV
93
        event.preventDefault();
×
UNCOV
94
        this.currentCellIndex = event.shiftKey ? this.grid.lastEditableColumnIndex : this.grid.firstEditableColumnIndex;
×
UNCOV
95
        this.grid.navigation.activeNode.row = this.grid.crudService.rowInEditMode.index;
×
UNCOV
96
        this.grid.navigation.activeNode.column = this.currentCellIndex;
×
UNCOV
97
        this.grid.navigateTo(this.grid.crudService.rowInEditMode.index, this.currentCellIndex, (obj) => {
×
UNCOV
98
            obj.target.activate(event);
×
UNCOV
99
            this.grid.cdr.detectChanges();
×
100
        });
101
    }
102
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc