• 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

75.0
/src/dropdown/dropdown-menu.component.ts
1
import { coerceCssPixelValue } from '@angular/cdk/coercion';
2
import { NgTemplateOutlet } from '@angular/common';
3
import {
4
    ChangeDetectionStrategy,
5
    Component,
6
    Directive,
7
    HostBinding,
1✔
8
    TemplateRef,
9
    ViewEncapsulation,
10
    input,
11
    viewChild
1✔
12
} from '@angular/core';
UNCOV
13
import { SafeAny } from 'ngx-tethys/types';
×
14
import { coerceBooleanProperty } from 'ngx-tethys/util';
15

1✔
16
export type ThyDropdownMenuDividerType = 'default' | 'crossing' | '';
17

18
export const THY_DROPDOWN_DEFAULT_WIDTH = '240px';
19

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

28
/**
1✔
29
 * 下拉菜单组件
UNCOV
30
 * @name thy-dropdown-menu
×
UNCOV
31
 * @order 20
×
UNCOV
32
 */
×
33
@Component({
34
    selector: 'thy-dropdown-menu',
1✔
35
    template: `
1✔
36
        @if (thyImmediateRender()) {
37
            <ng-container *ngTemplateOutlet="content"></ng-container>
38
        }
39
        <ng-template #dropdownMenu>
40
            <div class="thy-dropdown-menu" [style.width]="thyWidth()">
41
                <ng-container *ngTemplateOutlet="content"></ng-container>
1✔
42
            </div>
43
        </ng-template>
44
        <ng-template #content>
45
            <ng-content></ng-content>
46
        </ng-template>
47
    `,
48
    encapsulation: ViewEncapsulation.None,
49
    changeDetection: ChangeDetectionStrategy.OnPush,
50
    host: {
51
        '[class.thy-dropdown-menu]': 'thyImmediateRender()',
52
        '[style.width]': "thyImmediateRender() ? thyWidth() : ''"
53
    },
54
    imports: [NgTemplateOutlet]
55
})
56
export class ThyDropdownMenuComponent {
57
    readonly templateRef = viewChild.required<TemplateRef<SafeAny>>('dropdownMenu');
58

59
    /**
60
     * 设置菜单宽度
61
     */
62
    readonly thyWidth = input(THY_DROPDOWN_DEFAULT_WIDTH, { transform: coerceCssPixelValue });
63

64
    /**
65
     * 是否直接渲染 dropdown-menu 中的元素
66
     */
67
    readonly thyImmediateRender = input(false, { transform: coerceBooleanProperty });
68

69
    constructor() {}
70
}
71

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

94
    constructor() {}
95
}
96

97
/**
98
 * 下拉菜单分割线
99
 * @name thy-dropdown-menu-divider
100
 */
101
@Component({
1✔
102
    selector: 'thy-dropdown-menu-divider',
103
    template: ` <!-- <div class="dropdown-menu-divider-title">{{ title }}</div> --> `,
1✔
104
    host: {
105
        class: 'dropdown-menu-divider'
1✔
106
    },
107
    changeDetection: ChangeDetectionStrategy.OnPush
108
})
109
export class ThyDropdownMenuDivider {
110
    constructor() {}
111
}
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