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

atinc / ngx-tethys / d9ae709b-3c27-4b69-b125-b8b80b54f90b

pending completion
d9ae709b-3c27-4b69-b125-b8b80b54f90b

Pull #2757

circleci

mengshuicmq
fix: fix code review
Pull Request #2757: feat(color-picker): color-picker support disabled (#INFR-8645)

98 of 6315 branches covered (1.55%)

Branch coverage included in aggregate %.

1 of 1 new or added line in 1 file covered. (100.0%)

2392 of 13661 relevant lines covered (17.51%)

83.12 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, NgIf, NgTemplateOutlet } from '@angular/common';
2
import { ChangeDetectionStrategy, Component, ContentChild, Input, OnInit, TemplateRef } from '@angular/core';
3
import { InputBoolean } from 'ngx-tethys/core';
4
import { ThyIconComponent } from 'ngx-tethys/icon';
5
import { coerceBooleanProperty } from 'ngx-tethys/util';
6

7
/**
8
 * 布局头部组件
9
 * @name thy-header
10
 * @order 10
11
 */
12
@Component({
13
    selector: 'thy-header',
1✔
14
    preserveWhitespaces: false,
15
    templateUrl: './header.component.html',
×
16
    changeDetection: ChangeDetectionStrategy.OnPush,
17
    host: {
18
        class: `thy-layout-header`,
×
19
        '[class.thy-layout-header-sm]': `thySize === 'sm'`,
20
        '[class.thy-layout-header-lg]': `thySize === 'lg'`,
21
        '[class.thy-layout-header-xlg]': `thySize === 'xlg'`,
×
22
        '[class.thy-layout-header-divided]': `divided`,
×
23
        '[class.thy-layout-header-shadow]': `thyShadow`
×
24
    },
25
    standalone: true,
26
    imports: [NgTemplateOutlet, NgIf, ThyIconComponent, NgClass]
×
27
})
28
export class ThyHeaderComponent implements OnInit {
29
    public iconClass: string;
30

×
31
    public svgIconName: string;
×
32

33
    divided = false;
34

35
    /**
×
36
     * 底部是否有分割线,已废弃,请使用 thyDivided
×
37
     * @deprecated please use thyDivided
×
38
     */
×
39
    @Input('thyHasBorder')
40
    set thyHasBorder(value: string) {
41
        this.divided = coerceBooleanProperty(value);
1✔
42
    }
1✔
43

44
    /**
45
     * 底部是否有分割线
46
     */
47
    @Input()
48
    @InputBoolean()
49
    set thyDivided(value: string | boolean) {
50
        this.divided = value as boolean;
51
    }
52

53
    /**
54
     * 头部大小
55
     * @type md | sm | lg | xlg
1✔
56
     */
57
    @Input('thySize') thySize: 'sm' | 'md' | 'lg' | 'xlg' = 'md';
58

59
    /**
60
     * 头部标题
1✔
61
     */
62
    @Input() thyTitle: string;
63

64
    /**
1✔
65
     * 图标前缀,被弃用,图标使用 SVG 图标
66
     */
67
    @Input() thyIconPrefix = 'wtf';
68

69
    /**
70
     * 图标,SVG 图标名称
71
     */
72
    @Input('thyIcon')
73
    set thyIcon(value: string) {
74
        if (value) {
75
            if (value.includes('wtf')) {
76
                this.iconClass = `${this.thyIconPrefix} ${value}`;
77
            } else {
78
                this.svgIconName = value;
79
            }
80
        } else {
81
            this.iconClass = null;
82
            this.svgIconName = null;
83
        }
84
    }
85

86
    /**
87
     * 底部是否有阴影
88
     * @default false
89
     */
90
    @Input() @InputBoolean() thyShadow = false;
91

92
    /**
93
     * 头部自定义标题模板,`<ng-template #headerTitle></ng-template>`
94
     * @type TemplateRef
95
     */
96
    @ContentChild('headerTitle')
97
    public titleTemplateRef: TemplateRef<any>;
98

99
    /**
100
     * 头部自定义内容模板,`<ng-template #headerContent></ng-template>`
101
     * @type TemplateRef
102
     */
103
    @ContentChild('headerContent')
104
    public contentTemplateRef: TemplateRef<any>;
105

106
    /**
107
     * 头部自定义操作模板,`<ng-template #headerOperation></ng-template>`
108
     * @type TemplateRef
109
     */
110
    @ContentChild('headerOperation')
111
    public operationTemplateRef: TemplateRef<any>;
112

113
    constructor() {}
114

115
    ngOnInit() {}
116
}
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