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

atinc / ngx-tethys / 68ef226c-f83e-44c1-b8ed-e420a83c5d84

28 May 2025 10:31AM UTC coverage: 10.352% (-80.0%) from 90.316%
68ef226c-f83e-44c1-b8ed-e420a83c5d84

Pull #3460

circleci

pubuzhixing8
chore: xxx
Pull Request #3460: refactor(icon): migrate signal input #TINFR-1476

132 of 6823 branches covered (1.93%)

Branch coverage included in aggregate %.

10 of 14 new or added lines in 1 file covered. (71.43%)

11648 existing lines in 344 files now uncovered.

2078 of 14525 relevant lines covered (14.31%)

6.69 hits per line

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

20.0
/src/drag-drop/drag.directive.ts
1
import { Directive, NgZone, ElementRef, HostBinding, Input, OnDestroy, Renderer2, inject } from '@angular/core';
2
import { DragRef } from './drag-ref';
3
import { DOCUMENT } from '@angular/common';
4
import { ThyDragDropService } from './drag-drop.service';
5
import { IThyDragDirective, THY_DROP_CONTAINER_DIRECTIVE } from './drag-drop.token';
6
import { coerceBooleanProperty } from 'ngx-tethys/util';
7

8
/**
9
 * 拖拽项
10
 * @name thy-drag,[thyDrag]
11
 * @order 10
12
 * @deprecated please use @angular/cdk/drag-drop
13
 */
14
@Directive({
1✔
15
    selector: 'thy-drag,[thyDrag]'
UNCOV
16
})
×
17
export class ThyDragDirective<T = any> implements IThyDragDirective, OnDestroy {
18
    container = inject(THY_DROP_CONTAINER_DIRECTIVE, { optional: true })!;
UNCOV
19
    private elementRef = inject<ElementRef<HTMLElement>>(ElementRef);
×
UNCOV
20

×
21
    /**
22
     * 元数据
UNCOV
23
     * @type any
×
24
     */
25
    @Input('thyDrag')
UNCOV
26
    set dragData(data: T) {
×
UNCOV
27
        this.data = data;
×
UNCOV
28
    }
×
UNCOV
29

×
UNCOV
30
    /**
×
UNCOV
31
     * 元数据
×
UNCOV
32
     * @type any
×
UNCOV
33
     */
×
UNCOV
34
    @Input('thyDragData') data: T;
×
UNCOV
35

×
UNCOV
36
    @HostBinding('attr.draggable') isDraggable = true;
×
37

38
    private _disabled = false;
UNCOV
39

×
40
    /**
41
     * 是否禁用拖拽
1✔
42
     * @default false
1✔
43
     */
44
    @Input({ alias: 'thyDragDisabled', transform: coerceBooleanProperty })
45
    set disabled(isDisabled: boolean) {
46
        this._disabled = isDisabled;
47
        this.isDraggable = !isDisabled;
48
    }
49
    get disabled() {
1✔
50
        return this._disabled;
51
    }
52

53
    public dragRef: DragRef<T>;
54

55
    constructor() {
56
        const document = inject(DOCUMENT);
57
        const container = this.container;
58
        const ngZone = inject(NgZone);
59
        const elementRef = this.elementRef;
60
        const service = inject<ThyDragDropService<T>>(ThyDragDropService);
61
        const renderer = inject(Renderer2);
62

63
        this.dragRef = new DragRef<T>(elementRef, this, container, service, document, ngZone, renderer);
64
    }
65

66
    ngOnDestroy() {
67
        this.dragRef.dispose();
68
    }
69
}
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