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

atinc / ngx-tethys / 3033f133-0f0d-43eb-a07d-e1848354018a

07 Mar 2024 01:58AM UTC coverage: 90.58% (-0.02%) from 90.604%
3033f133-0f0d-43eb-a07d-e1848354018a

Pull #3022

circleci

web-flow
feat(schematics): improve schematics for select and custom-select in template #INFR-11735 (#3047)
Pull Request #3022: feat: upgrade ng to 17 #INFR-11427 (#3021)

5422 of 6642 branches covered (81.63%)

Branch coverage included in aggregate %.

328 of 338 new or added lines in 193 files covered. (97.04%)

141 existing lines in 29 files now uncovered.

13502 of 14250 relevant lines covered (94.75%)

982.04 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