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

atinc / ngx-tethys / b24ac894-184d-4e20-b545-47190193bd59

19 May 2025 08:18AM UTC coverage: 90.226% (+0.02%) from 90.209%
b24ac894-184d-4e20-b545-47190193bd59

push

circleci

web-flow
refactor(progress): migrate inputs to signal #TINFR-1759 (#3445)

5572 of 6836 branches covered (81.51%)

Branch coverage included in aggregate %.

47 of 47 new or added lines in 3 files covered. (100.0%)

1 existing line in 1 file now uncovered.

13591 of 14403 relevant lines covered (94.36%)

907.19 hits per line

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

88.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';
13
import { useHostRenderer } from '@tethys/cdk/dom';
27✔
14
import { ThyProgressType } from './interfaces';
27✔
15
import { NgStyle } from '@angular/common';
27✔
16

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

33✔
23
/**
33!
UNCOV
24
 * @private
×
25
 */
26
@Component({
33✔
27
    selector: 'thy-progress-bar',
28
    templateUrl: './progress-strip.component.html',
27✔
29
    encapsulation: ViewEncapsulation.None,
28✔
30
    imports: [NgStyle],
28✔
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

© 2026 Coveralls, Inc