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

atinc / ngx-tethys / b6c4484c-5c19-4202-b0d2-de7cfad933aa

pending completion
b6c4484c-5c19-4202-b0d2-de7cfad933aa

push

circleci

web-flow
Merge pull request #2774 from atinc/release-auto-v15.3.20

5104 of 6317 branches covered (80.8%)

Branch coverage included in aggregate %.

12903 of 13656 relevant lines covered (94.49%)

974.86 hits per line

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

95.0
/src/dropdown/dropdown-menu.component.ts
1
import {
2
    Directive,
3
    HostBinding,
4
    Input,
5
    Component,
6
    ViewEncapsulation,
7
    ChangeDetectionStrategy,
8
    ViewChild,
1✔
9
    TemplateRef
10
} from '@angular/core';
1✔
11
import { SafeAny } from 'ngx-tethys/types';
12
import { InputBoolean } from 'ngx-tethys/core';
1✔
13
import { NgIf } from '@angular/common';
14

15
export type ThyDropdownMenuDividerType = 'default' | 'crossing' | '';
16

1✔
17
/**
18
 * @private
19
 */
20
@Directive()
21
export class ThyDropdownAbstractMenu {
22
    @HostBinding('class.thy-dropdown-menu') addDropdownMenuClass = true;
23
}
24

25
/**
1✔
26
 * 下拉菜单组件
27
 * @name thy-dropdown-menu
×
28
 * @order 20
29
 */
30
@Component({
7✔
31
    selector: 'thy-dropdown-menu',
32
    template: `
33
        <ng-container *ngIf="thyImmediateRender; then dropdownMenu"></ng-container>
39✔
34
        <ng-template #dropdownMenu>
35
            <div class="thy-dropdown-menu" [style.width.px]="width">
1✔
36
                <ng-content></ng-content>
1✔
37
            </div>
38
        </ng-template>
39
    `,
40
    encapsulation: ViewEncapsulation.None,
41
    changeDetection: ChangeDetectionStrategy.OnPush,
42
    host: {},
1✔
43
    standalone: true,
44
    imports: [NgIf]
45
})
46
export class ThyDropdownMenuComponent {
1✔
47
    width: number;
48

49
    get template() {
50
        return this.templateRef;
51
    }
52

53
    @ViewChild('dropdownMenu', { static: true }) templateRef!: TemplateRef<SafeAny>;
54

55
    /**
56
     * 设置菜单宽度
57
     * @default 240px
58
     */
59
    @Input() set thyWidth(value: number) {
60
        this.width = value;
61
    }
62

63
    /**
64
     * 是否直接渲染 dropdown-menu 中的元素
65
     * @default false
66
     */
67
    @Input() @InputBoolean() thyImmediateRender = false;
68

69
    constructor() {}
70
}
71

1✔
72
/**
73
 * 下拉菜单分组
6✔
74
 * @name thy-dropdown-menu-group
75
 * @order 50
76
 */
1✔
77
@Component({
1✔
78
    selector: 'thy-dropdown-menu-group',
79
    template: `
80
        <div class="dropdown-menu-group-title">{{ title }}</div>
81
        <ng-content></ng-content>
1✔
82
    `,
83
    changeDetection: ChangeDetectionStrategy.OnPush,
84
    host: {
85
        class: 'dropdown-menu-group'
86
    },
87
    standalone: true
88
})
89
export class ThyDropdownMenuGroupComponent {
90
    title: string;
91

92
    /**
93
     * 分组标题
94
     */
95
    @Input()
96
    set thyTitle(value: string) {
97
        this.title = value;
98
    }
99

100
    constructor() {}
101
}
1✔
102

103
/**
1✔
104
 * 下拉菜单分割线
105
 * @name thy-dropdown-menu-divider
1✔
106
 */
107
@Component({
108
    selector: 'thy-dropdown-menu-divider',
109
    template: ` <!-- <div class="dropdown-menu-divider-title">{{ title }}</div> --> `,
110
    host: {
111
        class: 'dropdown-menu-divider'
112
    },
113
    changeDetection: ChangeDetectionStrategy.OnPush,
114
    standalone: true
115
})
116
export class ThyDropdownMenuDividerComponent {
117
    constructor() {}
118
}
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

© 2026 Coveralls, Inc