• 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

30.43
/src/cascader/cascader-search-option.component.ts
1
import { NgFor, NgIf } from '@angular/common';
2
import {
3
    ChangeDetectionStrategy,
4
    Component,
5
    EventEmitter,
6
    HostBinding,
7
    HostListener,
8
    Input,
9
    OnInit,
10
    Output,
11
    ViewEncapsulation
12
} from '@angular/core';
13
import { FormsModule } from '@angular/forms';
14
import { ThyBreadcrumbComponent, ThyBreadcrumbItemComponent } from 'ngx-tethys/breadcrumb';
1✔
15
import { ThyCheckboxComponent } from 'ngx-tethys/checkbox';
16
import { InputBoolean } from 'ngx-tethys/core';
×
17
import { ThyFlexibleTextComponent } from 'ngx-tethys/flexible-text';
×
18
import { ThyIconComponent } from 'ngx-tethys/icon';
19
import { ThyCascaderSearchOption } from './types';
×
20

21
/**
22
 * @internal
×
23
 */
×
24
@Component({
×
25
    changeDetection: ChangeDetectionStrategy.OnPush,
×
26
    encapsulation: ViewEncapsulation.None,
×
27
    // eslint-disable-next-line @angular-eslint/component-selector
28
    selector: '[thy-cascader-search-option]',
29
    templateUrl: './cascader-search-option.component.html',
30
    standalone: true,
31
    imports: [
×
32
        NgIf,
×
33
        NgFor,
×
34
        ThyFlexibleTextComponent,
35
        ThyCheckboxComponent,
36
        ThyBreadcrumbComponent,
37
        ThyBreadcrumbItemComponent,
×
38
        ThyIconComponent,
39
        FormsModule
1✔
40
    ]
1✔
41
})
42
export class ThyCascaderSearchOptionComponent implements OnInit {
43
    @Input() option: ThyCascaderSearchOption;
44

45
    @HostBinding('class.multiple')
46
    @Input()
47
    @InputBoolean()
48
    multiple = false;
49

50
    @Input()
1✔
51
    @InputBoolean()
52
    isOnlySelectLeaf = true;
53
    @HostBinding('class') className = 'thy-cascader-search-list-item px-4 d-flex align-items-center cursor-pointer';
54

1✔
55
    @HostBinding('class.active')
56
    @Input()
57
    @InputBoolean()
58
    active: boolean = false;
1✔
59

60
    @HostListener('click', ['$event'])
61
    public toggleClick($event: Event) {
62
        if (this.multiple) {
1✔
63
            return;
64
        }
65
        this.toggleSelectChange.emit(this.option);
66
    }
67

68
    @Output() toggleSelectChange: EventEmitter<ThyCascaderSearchOption> = new EventEmitter();
69

70
    constructor() {}
71

72
    ngOnInit() {}
73

74
    public clickCheckbox(event: Event) {
75
        // 已选中的在搜索情况下不能取消选择
76
        if (this.active) {
77
            event.preventDefault();
78
            event.stopPropagation();
79
        }
80
    }
81

82
    public toggleOption(value: boolean) {
83
        this.toggleSelectChange.emit(this.option);
84
    }
85
}
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