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

atinc / ngx-tethys / d9ae709b-3c27-4b69-b125-b8b80b54f90b

pending completion
d9ae709b-3c27-4b69-b125-b8b80b54f90b

Pull #2757

circleci

mengshuicmq
fix: fix code review
Pull Request #2757: feat(color-picker): color-picker support disabled (#INFR-8645)

98 of 6315 branches covered (1.55%)

Branch coverage included in aggregate %.

1 of 1 new or added line in 1 file covered. (100.0%)

2392 of 13661 relevant lines covered (17.51%)

83.12 hits per line

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

33.33
/src/drag-drop/drag.directive.ts
1
import { Directive, NgZone, ElementRef, HostBinding, Input, Inject, OnDestroy, Optional, Renderer2 } from '@angular/core';
2
import { DragRef } from './drag-ref';
3
import { DOCUMENT } from '@angular/common';
4
import { ThyDragDropService } from './drag-drop.service';
5
import { mixinUnsubscribe, MixinBase, Constructor, ThyUnsubscribe, InputBoolean } from 'ngx-tethys/core';
6
import { THY_DROP_CONTAINER_DIRECTIVE, IThyDropContainerDirective } from './drop-container.class';
7

8
const _MixinBase: Constructor<ThyUnsubscribe> & typeof MixinBase = mixinUnsubscribe(MixinBase);
1✔
9

10
/**
11
 * 拖拽项
12
 * @name thy-drag,[thyDrag]
13
 * @order 10
14
 */
1✔
15
@Directive({
16
    selector: 'thy-drag,[thyDrag]',
×
17
    standalone: true
18
})
19
export class ThyDragDirective<T = any> extends _MixinBase implements OnDestroy {
×
20
    /**
×
21
     * 元数据
22
     * @type any
23
     */
×
24
    @Input('thyDrag')
25
    set dragData(data: T) {
26
        this.data = data;
×
27
    }
×
28

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

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

37
    private _disabled = false;
1✔
38

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

1✔
53
    public dragRef: DragRef<T>;
54

55
    constructor(
56
        @Inject(DOCUMENT) document: any,
57
        @Optional() @Inject(THY_DROP_CONTAINER_DIRECTIVE) public container: IThyDropContainerDirective,
1✔
58
        ngZone: NgZone,
59
        private elementRef: ElementRef<HTMLElement>,
60
        service: ThyDragDropService<T>,
61
        renderer: Renderer2
62
    ) {
63
        super();
64
        this.dragRef = new DragRef<T>(elementRef, this, container, service, document, ngZone, renderer);
65
    }
66

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