• 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

10.81
/src/grid/thy-col.directive.ts
1
import { Directive, inject, input, computed, effect, afterNextRender } from '@angular/core';
2
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
3
import { useHostRenderer } from '@tethys/cdk/dom';
4
import { ThyRowDirective } from './thy-row.directive';
5

6
export interface ThyColEmbeddedProperty {
7
    span?: number;
8
    pull?: number;
9
    push?: number;
10
    offset?: number;
11
    order?: number;
12
}
1✔
13

UNCOV
14
export type ThySpan = number | null | 'auto';
×
UNCOV
15

×
UNCOV
16
/**
×
UNCOV
17
 * 栅格列指令
×
UNCOV
18
 * @name thyCol
×
UNCOV
19
 * @order 35
×
20
 */
UNCOV
21
@Directive({
×
UNCOV
22
    selector: '[thyCol]',
×
UNCOV
23
    host: {
×
UNCOV
24
        class: 'thy-col'
×
25
    }
UNCOV
26
})
×
UNCOV
27
export class ThyColDirective {
×
UNCOV
28
    thyRowDirective = inject(ThyRowDirective, { optional: true, host: true })!;
×
UNCOV
29

×
UNCOV
30
    /**
×
31
     * 栅格项的占位列数,thySpan 如果传递了值,以 thySpan 为准
UNCOV
32
     */
×
UNCOV
33
    readonly thyCol = input<ThySpan>();
×
UNCOV
34

×
35
    /**
UNCOV
36
     * 栅格项的占位列数
×
37
     */
×
38
    readonly thySpan = input<ThySpan>();
×
39

40
    protected readonly span = computed(() => {
41
        const span = this.thySpan() ?? this.thyCol();
42
        return span || 24;
43
    });
44

UNCOV
45
    private hostRenderer = useHostRenderer();
×
UNCOV
46

×
47
    private takeUntilDestroyed = takeUntilDestroyed();
48

49
    constructor() {
50
        effect(() => {
1✔
51
            this.updateHostClass();
1✔
52
        });
53

54
        afterNextRender(() => {
55
            if (this.thyRowDirective) {
56
                this.thyRowDirective.actualGutter$.pipe(this.takeUntilDestroyed).subscribe(([horizontalGutter, verticalGutter]) => {
1✔
57
                    const renderGutter = (name: string, gutter: number) => {
58
                        this.hostRenderer.setStyle(name, `${gutter / 2}px`);
59
                    };
60
                    if (horizontalGutter > 0) {
61
                        renderGutter('padding-left', horizontalGutter);
62
                        renderGutter('padding-right', horizontalGutter);
63
                    }
64
                    if (verticalGutter > 0) {
65
                        renderGutter('padding-top', verticalGutter);
66
                        renderGutter('padding-bottom', verticalGutter);
67
                    }
68
                });
69
            }
70
        });
71
    }
72

73
    private updateHostClass() {
74
        const span = this.span();
75
        this.hostRenderer.updateClassByMap({
76
            [`thy-col-${span}`]: true
77
        });
78
    }
79
}
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