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

atinc / ngx-tethys / ba7e05e2-37c0-44c6-8725-6f617aa0d43e

pending completion
ba7e05e2-37c0-44c6-8725-6f617aa0d43e

Pull #2756

circleci

huanhuanwa
test(color-picker): add test #INFR-8673
Pull Request #2756: feat(color-picker): add popoverRef param when panel open and close #INFR-8673

187 of 6315 branches covered (2.96%)

Branch coverage included in aggregate %.

2 of 2 new or added lines in 1 file covered. (100.0%)

2645 of 13660 relevant lines covered (19.36%)

83.2 hits per line

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

16.67
/src/color-picker/parts/inputs/inputs.component.ts
1
import { Component, EventEmitter, HostBinding, Input, Output } from '@angular/core';
2
import { FormsModule } from '@angular/forms';
3
import { ThyInputDirective } from 'ngx-tethys/input';
4
import { ThyInputNumberComponent } from 'ngx-tethys/input-number';
5
import { ThyEnterDirective } from 'ngx-tethys/shared';
6
import ThyColor from '../../helpers/color.class';
7

8
/**
9
 * @internal
10
 */
11
@Component({
12
    selector: 'thy-color-inputs',
1✔
13
    templateUrl: './inputs.component.html',
14
    standalone: true,
×
15
    imports: [ThyInputDirective, FormsModule, ThyEnterDirective, ThyInputNumberComponent]
×
16
})
17
export class ThyColorInputsComponent {
18
    @HostBinding('class.thy-color-inputs') className = true;
×
19

×
20
    innerColor: ThyColor;
21

22
    @Input()
×
23
    set color(value: ThyColor) {
24
        this.alpha = Math.round(value.rgba.alpha * 100);
25
        this.innerColor = value;
26
    }
×
27

×
28
    get color() {
×
29
        return this.innerColor;
30
    }
×
31

32
    @Output()
33
    public colorChange = new EventEmitter<ThyColor>(false);
×
34

35
    alpha: number;
×
36

37
    onInputChange(event: Event, type: string) {
1✔
38
        let newColor;
39
        if (type === 'hex') {
40
            if (this.innerColor.displayValue.trim().slice(0, 1) !== '#') {
41
                this.innerColor.displayValue = `#${this.innerColor.displayValue}`;
42
            }
43
            newColor = new ThyColor(this.innerColor.displayValue);
1✔
44
        } else {
45
            newColor = new ThyColor().setRgba(
46
                this.innerColor.rgba.red,
47
                this.innerColor.rgba.green,
48
                this.innerColor.rgba.blue,
49
                this.alpha / 100
50
            );
51
        }
52
        this.colorChange.emit(newColor);
53
    }
54
}
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