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

atinc / ngx-tethys / 68ef226c-f83e-44c1-b8ed-e420a83c5d84

28 May 2025 10:31AM UTC coverage: 10.352% (-80.0%) from 90.316%
68ef226c-f83e-44c1-b8ed-e420a83c5d84

Pull #3460

circleci

pubuzhixing8
chore: xxx
Pull Request #3460: refactor(icon): migrate signal input #TINFR-1476

132 of 6823 branches covered (1.93%)

Branch coverage included in aggregate %.

10 of 14 new or added lines in 1 file covered. (71.43%)

11648 existing lines in 344 files now uncovered.

2078 of 14525 relevant lines covered (14.31%)

6.69 hits per line

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

19.05
/src/cascader/cascader-search-option.component.ts
1
import { NgClass, NgTemplateOutlet } from '@angular/common';
2
import { ChangeDetectionStrategy, Component, HostListener, OnInit, TemplateRef, ViewEncapsulation, input, output } from '@angular/core';
3
import { FormsModule } from '@angular/forms';
4
import { ThyBreadcrumb, ThyBreadcrumbItem } from 'ngx-tethys/breadcrumb';
5
import { ThyCheckbox } from 'ngx-tethys/checkbox';
6
import { ThyFlexibleText } from 'ngx-tethys/flexible-text';
7
import { ThyCascaderSearchOption } from './types';
8
import { SafeAny } from 'ngx-tethys/types';
9
import { coerceBooleanProperty } from 'ngx-tethys/util';
10

11
/**
12
 * @internal
13
 */
14
@Component({
1✔
15
    changeDetection: ChangeDetectionStrategy.OnPush,
UNCOV
16
    encapsulation: ViewEncapsulation.None,
×
17
    // eslint-disable-next-line @angular-eslint/component-selector
×
18
    selector: '[thy-cascader-search-option]',
UNCOV
19
    templateUrl: './cascader-search-option.component.html',
×
20
    imports: [NgClass, ThyFlexibleText, ThyCheckbox, ThyBreadcrumb, ThyBreadcrumbItem, FormsModule, NgTemplateOutlet],
21
    host: {
UNCOV
22
        class: 'thy-cascader-search-list-item px-4 d-flex align-items-center cursor-pointer',
×
UNCOV
23
        '[class.multiple]': 'multiple()',
×
UNCOV
24
        '[class.active]': 'active()'
×
UNCOV
25
    }
×
UNCOV
26
})
×
UNCOV
27
export class ThyCascaderSearchOptionComponent implements OnInit {
×
28
    readonly option = input<ThyCascaderSearchOption>();
29

30
    readonly multiple = input(false, { transform: coerceBooleanProperty });
31

UNCOV
32
    readonly isOnlySelectLeaf = input(true, { transform: coerceBooleanProperty });
×
UNCOV
33

×
UNCOV
34
    readonly active = input(false, { transform: coerceBooleanProperty });
×
35

36
    readonly optionRender = input<TemplateRef<SafeAny>>(undefined);
37

38
    @HostListener('click', ['$event'])
×
39
    public toggleClick($event: Event) {
40
        if (this.multiple()) {
1✔
41
            return;
1✔
42
        }
43
        this.toggleSelectChange.emit(this.option());
44
    }
45

46
    readonly toggleSelectChange = output<ThyCascaderSearchOption>();
47

48
    constructor() {}
49

50
    ngOnInit() {}
51

1✔
52
    public clickCheckbox(event: Event) {
53
        // 已选中的在搜索情况下不能取消选择
54
        if (this.active()) {
55
            event.preventDefault();
56
            event.stopPropagation();
57
        }
58
    }
59

60
    public toggleOption(value: boolean) {
61
        this.toggleSelectChange.emit(this.option());
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