• 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

23.81
/src/input/input.directive.ts
1
import { Directive, ElementRef, HostBinding, Input, OnInit, Optional, Renderer2, Self } from '@angular/core';
2
import { NgControl } from '@angular/forms';
3
import { useHostRenderer } from '@tethys/cdk/dom';
4

5
export type ThyInputSize = 'xs' | 'sm' | 'md' | 'lg' | '';
1✔
6

7
const inputGroupSizeMap = {
8
    xs: ['form-control-xs'],
9
    sm: ['form-control-sm'],
10
    md: ['form-control-md'],
11
    lg: ['form-control-lg']
12
};
13

14
/**
15
 * 输入框指令
16
 * @name thyInput
1✔
17
 * @order 10
18
 */
×
19
@Directive({
×
20
    selector: 'input[thyInput], select[thyInput], textarea[thyInput]',
21
    exportAs: 'thyInput',
22
    standalone: true
×
23
})
24
export class ThyInputDirective implements OnInit {
25
    @HostBinding('class.form-control') isFormControl = true;
26

×
27
    private initialized = false;
28

29
    private hostRenderer = useHostRenderer();
×
30

31
    /**
32
     * 输入框大小
×
33
     * @type 'xs' | 'sm' | 'md' | 'default' | 'lg'
×
34
     * @default default
×
35
     */
×
36
    @Input()
×
37
    set thySize(size: ThyInputSize) {
×
38
        if (size && inputGroupSizeMap[size]) {
39
            this.hostRenderer.updateClass(inputGroupSizeMap[size]);
40
        } else {
×
41
            this.hostRenderer.updateClass([]);
42
        }
1✔
43
    }
44

45
    get ngControl() {
46
        return this.control;
47
    }
1✔
48

49
    get nativeElement(): HTMLInputElement {
50
        return this.elementRef.nativeElement;
51
    }
52

1✔
53
    constructor(private elementRef: ElementRef, private render: Renderer2, @Optional() @Self() private control: NgControl) {}
54

55
    ngOnInit() {
56
        this.initialized = true;
57
    }
58
}
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