• 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

38.1
/src/space/space.component.ts
1
import { useHostRenderer } from '@tethys/cdk/dom';
2

3
import {
4
    AfterContentInit,
5
    ChangeDetectionStrategy,
6
    ChangeDetectorRef,
7
    Component,
8
    DestroyRef,
9
    Directive,
10
    inject,
11
    input,
12
    OnInit,
13
    TemplateRef,
14
    computed,
1✔
15
    effect,
16
    contentChildren
17
} from '@angular/core';
1✔
18
import { ThySpacingSize, getNumericSize } from 'ngx-tethys/core';
19
import { NgTemplateOutlet } from '@angular/common';
1✔
20
import { coerceBooleanProperty } from 'ngx-tethys/util';
21

22
/**
23
 * 间距组件项,使用结构性指令 *thySpaceItem 传入模板
24
 * @name thySpaceItem
1✔
25
 * @order 20
26
 */
27
@Directive({ selector: '[thySpaceItem]', host: { class: 'thy-space-item' } })
28
export class ThySpaceItemDirective implements OnInit {
29
    constructor() {}
30

1✔
31
    ngOnInit(): void {}
UNCOV
32
}
×
UNCOV
33

×
UNCOV
34
const DEFAULT_SIZE: ThySpacingSize = 'md';
×
UNCOV
35

×
UNCOV
36
/**
×
UNCOV
37
 * 间距组件
×
38
 * @name thy-space
UNCOV
39
 * @order 10
×
UNCOV
40
 */
×
UNCOV
41
@Component({
×
UNCOV
42
    selector: 'thy-space',
×
UNCOV
43
    templateUrl: './space.component.html',
×
44
    changeDetection: ChangeDetectionStrategy.OnPush,
45
    host: {
46
        '[class.thy-space]': 'true',
47
        '[class.thy-space-vertical]': 'thyVertical()'
48
    },
1✔
49
    imports: [NgTemplateOutlet]
1✔
50
})
51
export class ThySpace implements OnInit, AfterContentInit {
52
    private cdr = inject(ChangeDetectorRef);
53

54
    private readonly destroyRef = inject(DestroyRef);
55

56
    private hostRenderer = useHostRenderer();
1✔
57

58
    /**
59
     * 大小,支持 `zero` | `xxs` | `xs` | `sm` | `md` | `lg` | `xlg` 和自定义数字大小
60
     * @type string | number
61
     */
62
    readonly thySize = input<ThySpacingSize>(DEFAULT_SIZE);
63

64
    space = computed(() => {
65
        return getNumericSize(this.thySize(), DEFAULT_SIZE);
66
    });
67

68
    /**
69
     * 间距垂直方向,默认是水平方向
70
     */
71
    readonly thyVertical = input<string | boolean, boolean>(false, { transform: coerceBooleanProperty });
72

73
    // @ClassBinding(`align-items-{{value}}`)
74
    /**
75
     * 对齐方式,可选择 `start` | `end` | `baseline` | `center`
76
     */
77
    readonly thyAlign = input<string>();
78

79
    items = contentChildren(ThySpaceItemDirective, { read: TemplateRef<HTMLElement> });
80

81
    constructor() {
82
        effect(() => {
83
            this.hostRenderer.updateClass(this.thyAlign() ? [`align-items-${this.thyAlign()}`] : []);
84
        });
85
    }
86

87
    ngOnInit(): void {}
88

89
    ngAfterContentInit(): void {}
90
}
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