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

atinc / ngx-tethys / #102

26 May 2026 08:11AM UTC coverage: 91.111% (+0.7%) from 90.407%
#102

push

web-flow
build: bump docgeni to 2.8.0-next.5 (#3809)

4571 of 5491 branches covered (83.25%)

Branch coverage included in aggregate %.

13141 of 13949 relevant lines covered (94.21%)

966.75 hits per line

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

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

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

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

39
    private hostRenderer = useHostRenderer();
27✔
40

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

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

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

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

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

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