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

IgniteUI / igniteui-angular / 13784630843

11 Mar 2025 09:28AM CUT coverage: 4.027% (-87.6%) from 91.657%
13784630843

Pull #15465

github

web-flow
Merge c3f73a0e2 into 9898d98a6
Pull Request #15465: [Query Builder] drag and drop refactor without DOM manipulations

124 of 15563 branches covered (0.8%)

0 of 160 new or added lines in 2 files covered. (0.0%)

25607 existing lines in 325 files now uncovered.

1180 of 29304 relevant lines covered (4.03%)

0.29 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