• 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

22.73
/src/input/input.directive.ts
1
import { Directive, ElementRef, HostBinding, Input, OnInit, Renderer2, effect, inject, input } 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' | '';
6

1✔
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
17
 * @order 10
1✔
18
 */
UNCOV
19
@Directive({
×
20
    selector: 'input[thyInput], select[thyInput], textarea[thyInput]',
21
    exportAs: 'thyInput'
UNCOV
22
})
×
23
export class ThyInputDirective {
24
    private elementRef = inject(ElementRef);
UNCOV
25
    private render = inject(Renderer2);
×
UNCOV
26
    private control = inject(NgControl, { optional: true, self: true })!;
×
UNCOV
27

×
UNCOV
28
    @HostBinding('class.form-control') isFormControl = true;
×
UNCOV
29

×
UNCOV
30
    private hostRenderer = useHostRenderer();
×
UNCOV
31

×
UNCOV
32
    /**
×
UNCOV
33
     * 输入框大小
×
UNCOV
34
     * @type 'xs' | 'sm' | 'md' | 'default' | 'lg'
×
35
     * @default default
36
     */
UNCOV
37
    readonly thySize = input<ThyInputSize>(undefined);
×
38

39
    get ngControl() {
40
        return this.control;
41
    }
1✔
42

1✔
43
    get nativeElement(): HTMLInputElement {
44
        return this.elementRef.nativeElement;
45
    }
46

47
    constructor() {
1✔
48
        effect(() => {
49
            const size = this.thySize();
50
            if (size && inputGroupSizeMap[size]) {
51
                this.hostRenderer.updateClass(inputGroupSizeMap[size]);
52
            } else {
53
                this.hostRenderer.updateClass([]);
54
            }
55
        });
56
    }
57
}
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