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

atinc / ngx-tethys / #55

30 Jul 2025 07:08AM UTC coverage: 9.866% (-80.4%) from 90.297%
#55

push

why520crazy
feat(empty): add setMessage for update display text #TINFR-2616

92 of 6794 branches covered (1.35%)

Branch coverage included in aggregate %.

2014 of 14552 relevant lines covered (13.84%)

6.15 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

7.32
/src/skeleton/skeleton-circle.component.ts
1
import { Component, ChangeDetectionStrategy, ViewEncapsulation, Input, inject, input, computed } from '@angular/core';
2
import { ThySkeleton } from './skeleton.component';
3
import { coerceBooleanProperty, helpers, ThyBooleanInput } from 'ngx-tethys/util';
4
import { THY_SKELETON_CONFIG } from './skeleton.config';
5
import { isUndefinedOrNull } from 'ngx-tethys/util';
6
import { NgStyle } from '@angular/common';
7
import { coerceCssPixelValue } from '@angular/cdk/coercion';
8

9
/**
10
 * 骨架屏圆形组件
11
 * @name thy-skeleton-circle
12
 * @order 30
13
 */
14
@Component({
15
    selector: 'thy-skeleton-circle',
1✔
16
    host: {
17
        '[class.thy-skeleton]': 'true',
×
18
        '[class.thy-skeleton-circle]': 'true',
×
19
        '[style.background]': 'primaryColor()',
×
20
        '[style.width]': 'thySize()',
×
21
        '[style.height]': 'thySize()'
×
22
    },
×
23
    template: ` <div class="thy-skeleton-after" [ngStyle]="afterStyles()"></div> `,
×
24
    changeDetection: ChangeDetectionStrategy.OnPush,
×
25
    encapsulation: ViewEncapsulation.None,
×
26
    imports: [NgStyle]
27
})
×
28
export class ThySkeletonCircle {
×
29
    private skeletonConfigModel = inject(THY_SKELETON_CONFIG, { optional: true })!;
30

×
31
    private parent = inject(ThySkeleton, { optional: true })!;
×
32

33
    /**
×
34
     * 动画速度
×
35
     * @default 1.5s
×
36
     */
37
    readonly thyAnimatedInterval = input<string | number>();
×
38

×
39
    /**
40
     * 骨架尺寸
×
41
     * @default 20px
42
     */
×
43
    readonly thySize = input<string, string | number>(`20px`, { transform: coerceCssPixelValue });
×
44

×
45
    /**
46
     * 骨架主色
47
     * @default #F7F7F7
×
48
     */
49
    readonly thyPrimaryColor = input<string>();
50

51
    /**
1✔
52
     * 骨架次色
53
     * @default #aaaaaa
54
     */
55
    readonly thySecondaryColor = input<string>();
56

57
    /**
58
     * 是否展示动画
59
     * @default true
1✔
60
     */
61
    readonly thyAnimated = input<boolean, ThyBooleanInput>(undefined, { transform: coerceBooleanProperty });
62

63
    readonly animatedInterval = computed(() => {
64
        return this.thyAnimatedInterval() || this.parent?.thyAnimatedInterval() || this.skeletonConfigModel.thyAnimatedInterval;
65
    });
66

67
    readonly primaryColor = computed(() => {
68
        return this.thyPrimaryColor() || this.parent?.thyPrimaryColor() || this.skeletonConfigModel.thyPrimaryColor;
69
    });
70

71
    readonly secondaryColor = computed(() => {
72
        return this.thySecondaryColor() || this.parent?.thySecondaryColor() || this.skeletonConfigModel.thySecondaryColor;
73
    });
74

75
    readonly animated = computed(() => {
76
        if (!isUndefinedOrNull(this.thyAnimated())) {
77
            return this.thyAnimated();
78
        }
79
        if (!isUndefinedOrNull(this.parent?.thyAnimated())) {
80
            return this.parent.thyAnimated();
81
        }
82
        return this.skeletonConfigModel.thyAnimated;
83
    });
84

85
    readonly afterStyles = computed(() => {
86
        return {
87
            ...(this.secondaryColor() && {
88
                background: `linear-gradient(90deg, ${helpers.hexToRgb(this.secondaryColor(), 0)}, ${helpers.hexToRgb(
89
                    this.secondaryColor(),
90
                    0.15
91
                )}, ${helpers.hexToRgb(this.secondaryColor(), 0)}`
92
            }),
93
            animation: ![false, 'false'].includes(this.animated()) ? `thy-skeleton-animation ${this.animatedInterval()}s infinite` : 'none'
94
        };
95
    });
96
}
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

© 2026 Coveralls, Inc