• 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

21.05
/src/radio/radio.component.ts
1
import { Component, forwardRef, OnInit, Input, Optional, ChangeDetectionStrategy, ChangeDetectorRef } from '@angular/core';
2
import { NG_VALUE_ACCESSOR } from '@angular/forms';
3
import { ThyTranslate } from 'ngx-tethys/core';
4
import { ThyFormCheckBaseComponent } from 'ngx-tethys/shared';
5
import { ThyRadioGroupComponent } from './group/radio-group.component';
6
import { coerceBooleanProperty } from 'ngx-tethys/util';
7
import { NgClass, NgIf } from '@angular/common';
8

9
/**
10
 * 单选框组件
11
 * @name thy-radio,[thyRadio]
12
 * @order 10
13
 */
14
@Component({
15
    // eslint-disable-next-line @angular-eslint/component-selector
16
    selector: '[thy-radio],[thyRadio]',
1✔
17
    templateUrl: './radio.component.html',
18
    providers: [
×
19
        {
×
20
            provide: NG_VALUE_ACCESSOR,
21
            useExisting: forwardRef(() => ThyRadioComponent),
22
            multi: true
×
23
        }
×
24
    ],
×
25
    changeDetection: ChangeDetectionStrategy.OnPush,
26
    standalone: true,
27
    imports: [NgClass, NgIf]
×
28
})
×
29
export class ThyRadioComponent extends ThyFormCheckBaseComponent implements OnInit {
30
    name: string;
31

32
    /**
×
33
     * 当和 thy-radio-group 配合使用时的值,选中后的 NgModel 值
×
34
     */
35
    @Input() thyValue: string;
36

×
37
    set thyChecked(value: boolean) {
38
        this.writeValue(coerceBooleanProperty(value));
39
        this.changeDetectorRef.markForCheck();
1✔
40
    }
41

42
    constructor(
43
        public thyTranslate: ThyTranslate,
44
        @Optional() public thyRadioGroupComponent: ThyRadioGroupComponent,
1✔
45
        changeDetectorRef: ChangeDetectorRef
46
    ) {
47
        super(thyTranslate, changeDetectorRef);
48
    }
1✔
49

50
    ngOnInit() {
51
        if (this.thyRadioGroupComponent) {
52
            this.thyRadioGroupComponent.addRadio(this);
53
        }
54
    }
55

56
    change() {
×
57
        if (this.thyRadioGroupComponent) {
58
            this.thyRadioGroupComponent.updateValue(this.thyValue, true);
59
        } else {
60
            this.updateValue(!this._innerValue);
61
        }
62
    }
63
}
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