• 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/progress/progress-strip.component.ts
1
import {
2
    Component,
3
    InjectionToken,
4
    computed,
5
    TemplateRef,
6
    ViewEncapsulation,
7
    numberAttribute,
1✔
8
    inject,
9
    input,
10
    effect,
11
    Signal
1✔
12
} from '@angular/core';
UNCOV
13
import { useHostRenderer } from '@tethys/cdk/dom';
×
UNCOV
14
import { ThyProgressType } from './interfaces';
×
UNCOV
15
import { NgStyle } from '@angular/common';
×
UNCOV
16

×
UNCOV
17
export interface ThyParentProgress {
×
18
    readonly max: Signal<number>;
19
    readonly bars: Signal<readonly ThyProgressStrip[]>;
UNCOV
20
}
×
UNCOV
21
export const THY_PROGRESS_COMPONENT = new InjectionToken<ThyParentProgress>('THY_PROGRESS_COMPONENT');
×
UNCOV
22

×
UNCOV
23
/**
×
24
 * @private
×
25
 */
UNCOV
26
@Component({
×
27
    selector: 'thy-progress-bar',
UNCOV
28
    templateUrl: './progress-strip.component.html',
×
UNCOV
29
    encapsulation: ViewEncapsulation.None,
×
UNCOV
30
    imports: [NgStyle],
×
31
    host: {
32
        class: 'progress-bar',
33
        '[style.width.%]': 'percent()'
1✔
34
    }
1✔
35
})
36
export class ThyProgressStrip {
37
    private progress = inject(THY_PROGRESS_COMPONENT);
38

39
    private hostRenderer = useHostRenderer();
40

41
    readonly thyTips = input<string | TemplateRef<HTMLElement>>(undefined);
1✔
42

43
    readonly thyType = input<ThyProgressType>();
44

45
    readonly thyValue = input(0, {
46
        transform: numberAttribute
47
    });
48

49
    readonly thyColor = input<string>();
50

51
    protected readonly percent = computed(() => {
52
        const value = this.thyValue();
53
        if (!value && value !== 0) {
54
            return 0;
55
        }
56
        return +((value / this.progress.max()) * 100).toFixed(2);
57
    });
58

59
    constructor() {
60
        effect(() => {
61
            const type = this.thyType();
62
            this.hostRenderer.updateClass(type ? [`progress-bar-${type}`] : []);
63
        });
64
    }
65
}
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