• 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

47.62
/src/space/space.component.ts
1
import { Constructor, InputBoolean, MixinBase, mixinUnsubscribe, ThyUnsubscribe } from 'ngx-tethys/core';
2
import { useHostRenderer } from '@tethys/cdk/dom';
3
import { takeUntil } from 'rxjs/operators';
4

5
import {
6
    AfterContentInit,
7
    ChangeDetectionStrategy,
8
    ChangeDetectorRef,
9
    Component,
10
    ContentChildren,
11
    Directive,
12
    HostBinding,
13
    Input,
14
    OnInit,
1✔
15
    QueryList,
16
    TemplateRef
17
} from '@angular/core';
1✔
18
import { ThySpacingSize, getNumericSize } from 'ngx-tethys/core';
19
import { NgFor, NgTemplateOutlet } from '@angular/common';
1✔
20

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

36
    ngOnInit(): void {}
37
}
1✔
38

39
const DEFAULT_SIZE: ThySpacingSize = 'md';
×
40

41
const _MixinBase: Constructor<ThyUnsubscribe> & typeof MixinBase = mixinUnsubscribe(MixinBase);
42

×
43
/**
44
 * 间距组件
45
 * @name thy-space
×
46
 * @order 10
×
47
 */
×
48
@Component({
×
49
    selector: 'thy-space',
×
50
    templateUrl: './space.component.html',
51
    changeDetection: ChangeDetectionStrategy.OnPush,
52
    host: {
53
        class: 'thy-space'
×
54
    },
×
55
    standalone: true,
56
    imports: [NgFor, NgTemplateOutlet]
57
})
1✔
58
export class ThySpaceComponent extends _MixinBase implements OnInit, AfterContentInit {
59
    public space: number = getNumericSize(DEFAULT_SIZE);
60

1✔
61
    private hostRenderer = useHostRenderer();
62

63
    /**
64
     * 大小,支持 `zero` | `xxs` | `xs` | `sm` | `md` | `lg` | `xlg` 和自定义数字大小
65
     * @type string | number
66
     */
67
    @Input() set thySize(size: ThySpacingSize) {
1✔
68
        this.space = getNumericSize(size, DEFAULT_SIZE);
69
    }
70

71
    /**
1✔
72
     * 间距垂直方向,默认是水平方向
73
     */
74
    @HostBinding(`class.thy-space-vertical`)
75
    @Input()
76
    @InputBoolean()
77
    thyVertical: boolean = false;
78

79
    // @ClassBinding(`align-items-{{value}}`)
80
    /**
81
     * 对齐方式,可选择 `start` | `end` | `baseline` | `center`
82
     */
83
    @Input()
84
    set thyAlign(align: string) {
85
        this.hostRenderer.updateClass(align ? [`align-items-${align}`] : []);
86
    }
87

88
    @ContentChildren(ThySpaceItemDirective, { read: TemplateRef }) items!: QueryList<TemplateRef<HTMLElement>>;
89

90
    constructor(private cdr: ChangeDetectorRef) {
91
        super();
92
    }
93

94
    ngOnInit(): void {}
95

96
    ngAfterContentInit(): void {
97
        this.items.changes.pipe(takeUntil(this.ngUnsubscribe$)).subscribe(() => {
98
            this.cdr.markForCheck();
99
        });
100
    }
101
}
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