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

atinc / ngx-tethys / 5ba5b9d7-3ca9-4ff2-bbba-bde58c0f849f

22 Feb 2024 09:41AM UTC coverage: 90.604%. Remained the same
5ba5b9d7-3ca9-4ff2-bbba-bde58c0f849f

Pull #3027

circleci

minlovehua
feat(schematics): provide schematics for removing the suffix of standalone components #INFR-11662
Pull Request #3027: refactor: remove the component suffix for standalone components and provide schematics #INFR-10654

5425 of 6642 branches covered (81.68%)

Branch coverage included in aggregate %.

323 of 333 new or added lines in 193 files covered. (97.0%)

36 existing lines in 8 files now uncovered.

13504 of 14250 relevant lines covered (94.76%)

981.28 hits per line

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

82.61
/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 { ThyBreadcrumb, ThyBreadcrumbItem } from 'ngx-tethys/breadcrumb';
1✔
15
import { ThyCheckbox } from 'ngx-tethys/checkbox';
16
import { InputBoolean } from 'ngx-tethys/core';
1!
NEW
17
import { ThyFlexibleText } from 'ngx-tethys/flexible-text';
×
18
import { ThyIcon } from 'ngx-tethys/icon';
19
import { ThyCascaderSearchOption } from './types';
1✔
20

21
/**
22
 * @internal
4✔
23
 */
4✔
24
@Component({
4✔
25
    changeDetection: ChangeDetectionStrategy.OnPush,
4✔
26
    encapsulation: ViewEncapsulation.None,
4✔
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: [NgIf, NgFor, ThyFlexibleText, ThyCheckbox, ThyBreadcrumb, ThyBreadcrumbItem, ThyIcon, FormsModule]
1!
32
})
1✔
33
export class ThyCascaderSearchOptionComponent implements OnInit {
1✔
34
    @Input() option: ThyCascaderSearchOption;
35

36
    @HostBinding('class.multiple')
UNCOV
37
    @Input()
×
38
    @InputBoolean()
39
    multiple = false;
1✔
40

1✔
41
    @Input()
42
    @InputBoolean()
43
    isOnlySelectLeaf = true;
44
    @HostBinding('class') className = 'thy-cascader-search-list-item px-4 d-flex align-items-center cursor-pointer';
45

46
    @HostBinding('class.active')
47
    @Input()
48
    @InputBoolean()
49
    active: boolean = false;
50

1✔
51
    @HostListener('click', ['$event'])
52
    public toggleClick($event: Event) {
53
        if (this.multiple) {
54
            return;
1✔
55
        }
56
        this.toggleSelectChange.emit(this.option);
57
    }
58

1✔
59
    @Output() toggleSelectChange: EventEmitter<ThyCascaderSearchOption> = new EventEmitter();
60

61
    constructor() {}
62

1✔
63
    ngOnInit() {}
64

65
    public clickCheckbox(event: Event) {
66
        // 已选中的在搜索情况下不能取消选择
67
        if (this.active) {
68
            event.preventDefault();
69
            event.stopPropagation();
70
        }
71
    }
72

73
    public toggleOption(value: boolean) {
74
        this.toggleSelectChange.emit(this.option);
75
    }
76
}
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