• 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

0.0
/projects/igniteui-angular/src/lib/directives/drag-drop/drag-drop.strategy.ts
1
import { Renderer2 } from '@angular/core';
2
import { IgxDragDirective, IgxDropDirective } from './drag-drop.directive';
3

4

5
export interface IDropStrategy {
6
    dropAction: (drag: IgxDragDirective, drop: IgxDropDirective, atIndex: number) => void;
7
}
8

9
// @dynamic
10
export class IgxDefaultDropStrategy implements IDropStrategy {
11

12
    public dropAction(_drag: IgxDragDirective, _drop: IgxDropDirective, _atIndex: number) { }
13
}
14

15
// @dynamic
16
export class IgxAppendDropStrategy implements IDropStrategy {
17

UNCOV
18
    constructor(private _renderer: Renderer2) { }
×
19

20
    public dropAction(drag: IgxDragDirective, drop: IgxDropDirective, _atIndex: number) {
UNCOV
21
        const dragElement = drag.element.nativeElement;
×
UNCOV
22
        const dropAreaElement = drop.element.nativeElement;
×
UNCOV
23
        this._renderer.removeChild(dragElement.parentNode, dragElement);
×
UNCOV
24
        this._renderer.appendChild(dropAreaElement, dragElement);
×
25
    }
26
}
27

28
// @dynamic
29
export class IgxPrependDropStrategy implements IDropStrategy {
30

UNCOV
31
    constructor(private _renderer: Renderer2) { }
×
32

33
    public dropAction(drag: IgxDragDirective, drop: IgxDropDirective, _atIndex: number) {
UNCOV
34
        const dragElement = drag.element.nativeElement;
×
UNCOV
35
        const dropAreaElement = drop.element.nativeElement;
×
UNCOV
36
        this._renderer.removeChild(dragElement.parentNode, dragElement);
×
UNCOV
37
        if (dropAreaElement.children.length) {
×
UNCOV
38
            this._renderer.insertBefore(dropAreaElement, dragElement, dropAreaElement.children[0]);
×
39
        } else {
40
            this._renderer.appendChild(dropAreaElement, dragElement);
×
41
        }
42
    }
43
}
44

45
// @dynamic
46
export class IgxInsertDropStrategy implements IDropStrategy {
47

UNCOV
48
    constructor(private _renderer: Renderer2) { }
×
49

50
    public dropAction(drag: IgxDragDirective, drop: IgxDropDirective, atIndex: number) {
UNCOV
51
        if (drag.element.nativeElement.parentElement === drop.element.nativeElement && atIndex === -1) {
×
52
            return;
×
53
        }
54

UNCOV
55
        const dragElement = drag.element.nativeElement;
×
UNCOV
56
        const dropAreaElement = drop.element.nativeElement;
×
UNCOV
57
        this._renderer.removeChild(dragElement.parentNode, dragElement);
×
UNCOV
58
        if (atIndex !== -1 && dropAreaElement.children.length > atIndex) {
×
UNCOV
59
            this._renderer.insertBefore(dropAreaElement, dragElement, dropAreaElement.children[atIndex]);
×
60
        } else {
UNCOV
61
            this._renderer.appendChild(dropAreaElement, dragElement);
×
62
        }
63
    }
64
}
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