• 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

24.0
/src/progress/progress-strip.component.ts
1
import { Component, HostBinding, Inject, InjectionToken, Input, TemplateRef, ViewEncapsulation } from '@angular/core';
2
import { useHostRenderer } from '@tethys/cdk/dom';
3
import { ThyProgressType } from './interfaces';
4
import { NgStyle } from '@angular/common';
5
import { InputNumber } from 'ngx-tethys/core';
6

7
export interface ThyParentProgress {
1✔
8
    max: number;
9
    bars: ThyProgressStripComponent[];
10
}
11
export const THY_PROGRESS_COMPONENT = new InjectionToken<ThyParentProgress>('THY_PROGRESS_COMPONENT');
1✔
12

13
/**
×
14
 * @private
15
 */
16
@Component({
×
17
    selector: 'thy-progress-bar',
×
18
    templateUrl: './progress-strip.component.html',
19
    encapsulation: ViewEncapsulation.None,
×
20
    standalone: true,
×
21
    imports: [NgStyle]
22
})
23
export class ThyProgressStripComponent {
×
24
    private value: number;
25

26
    private hostRenderer = useHostRenderer();
×
27

×
28
    color: string;
×
29

×
30
    @HostBinding(`class.progress-bar`) isProgressBar = true;
31

32
    @HostBinding('style.width.%') percent = 0;
×
33

34
    @Input() thyTips: string | TemplateRef<HTMLElement>;
1✔
35

36
    @Input() set thyType(type: ThyProgressType) {
37
        this.hostRenderer.updateClass(type ? [`progress-bar-${type}`] : []);
1✔
38
    }
39

40
    @Input()
41
    @InputNumber()
42
    set thyValue(value: number) {
43
        if (!value && value !== 0) {
44
            return;
45
        }
46
        this.value = value;
1✔
47
        this.recalculatePercentage();
48
    }
49

50
    @Input() set thyColor(color: string) {
51
        this.color = color || '';
1✔
52
    }
53

54
    constructor(@Inject(THY_PROGRESS_COMPONENT) private progress: ThyParentProgress) {}
55

56
    recalculatePercentage(): void {
57
        this.percent = +((this.value / this.progress.max) * 100).toFixed(2);
58
    }
59
}
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