• 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

27.27
/src/layout/header.component.ts
1
import { NgClass, NgTemplateOutlet } from '@angular/common';
2
import { ChangeDetectionStrategy, Component, ContentChild, Directive, Input, TemplateRef } from '@angular/core';
3
import { ThyIcon } from 'ngx-tethys/icon';
4
import { coerceBooleanProperty } from 'ngx-tethys/util';
5

6
/**
7
 * 头部布局指令
8
 * @name thyHeader
9
 * @order 10
10
 */
11
@Directive({
12
    selector: '[thyHeader]',
1✔
13
    host: {
UNCOV
14
        class: `thy-layout-header`,
×
UNCOV
15
        '[class.thy-layout-header-sm]': `thySize === 'sm'`,
×
UNCOV
16
        '[class.thy-layout-header-lg]': `thySize === 'lg'`,
×
17
        '[class.thy-layout-header-xlg]': `thySize === 'xlg'`,
18
        '[class.thy-layout-header-shadow]': `thyShadow`,
UNCOV
19
        '[class.thy-layout-header-divided]': `divided`
×
20
    }
21
})
22
export class ThyHeaderDirective {
×
23
    /**
24
     * 头部大小
1✔
25
     * @type sm | md  | lg | xlg
26
     */
27
    @Input('thySize') thySize: 'sm' | 'md' | 'lg' | 'xlg' = 'md';
28

29
    /**
30
     * 底部是否有阴影
31
     * @default false
1✔
32
     */
33
    @Input({ transform: coerceBooleanProperty }) thyShadow = false;
34

35
    divided = false;
36

37
    /**
38
     * 底部是否有分割线
39
     */
40
    @Input({ transform: coerceBooleanProperty })
41
    set thyDivided(value: boolean) {
42
        this.divided = value;
43
    }
44

45
    /**
46
     * 底部是否有分割线,已废弃,请使用 thyDivided
47
     * @deprecated please use thyDivided
48
     */
49
    @Input({ transform: coerceBooleanProperty })
50
    set thyHasBorder(value: boolean) {
1✔
51
        this.divided = value;
UNCOV
52
    }
×
53
}
54

UNCOV
55
/**
×
UNCOV
56
 * 头部布局组件
×
57
 * @name thy-header
×
58
 * @order 11
59
 */
UNCOV
60
@Component({
×
61
    selector: 'thy-header',
62
    preserveWhitespaces: false,
63
    templateUrl: './header.component.html',
UNCOV
64
    changeDetection: ChangeDetectionStrategy.OnPush,
×
UNCOV
65
    hostDirectives: [
×
66
        {
67
            directive: ThyHeaderDirective,
68
            inputs: ['thySize', 'thyShadow', 'thyHasBorder', 'thyDivided']
1✔
69
        }
70
    ],
71
    imports: [NgTemplateOutlet, ThyIcon, NgClass]
72
})
73
export class ThyHeader {
74
    public iconClass: string;
75

76
    public svgIconName: string;
77

1✔
78
    /**
79
     * 头部标题
80
     */
81
    @Input() thyTitle: string;
82

83
    /**
84
     * 图标前缀,被弃用,图标使用 SVG 图标
85
     */
86
    @Input() thyIconPrefix = 'wtf';
87

88
    /**
89
     * 图标,SVG 图标名称
90
     */
91
    @Input('thyIcon')
92
    set thyIcon(value: string) {
93
        if (value) {
94
            if (value.includes('wtf')) {
95
                this.iconClass = `${this.thyIconPrefix} ${value}`;
96
            } else {
97
                this.svgIconName = value;
98
            }
99
        } else {
100
            this.iconClass = null;
101
            this.svgIconName = null;
102
        }
103
    }
104

105
    /**
106
     * 头部自定义标题模板,`<ng-template #headerTitle></ng-template>`
107
     * @type TemplateRef
108
     */
109
    @ContentChild('headerTitle')
110
    public titleTemplateRef: TemplateRef<any>;
111

112
    /**
113
     * 头部自定义内容模板,`<ng-template #headerContent></ng-template>`
114
     * @type TemplateRef
115
     */
116
    @ContentChild('headerContent')
117
    public contentTemplateRef: TemplateRef<any>;
118

119
    /**
120
     * 头部自定义操作模板,`<ng-template #headerOperation></ng-template>`
121
     * @type TemplateRef
122
     */
123
    @ContentChild('headerOperation')
124
    public operationTemplateRef: TemplateRef<any>;
125
}
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