• 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

11.43
/src/notify/notify.component.ts
1
import { Component, Input, HostBinding, NgZone, OnInit, inject } from '@angular/core';
2
import { trigger, state, style, animate, transition } from '@angular/animations';
3
import { helpers, isString } from 'ngx-tethys/util';
4
import { ThyNotifyConfig, ThyNotifyDetail, ThyNotifyPlacement } from './notify.config';
5
import { ANIMATION_IN_DURATION, ANIMATION_OUT_DURATION, HIDE_STYLE, ThyAbstractMessageComponent } from 'ngx-tethys/message';
6
import { ThyNotifyQueue } from './notify-queue.service';
7
import { ThyViewOutletDirective } from 'ngx-tethys/shared';
8
import { ThyIcon } from 'ngx-tethys/icon';
9
import { NgClass, NgTemplateOutlet } from '@angular/common';
10

11
/**
12
 * @private
13
 */
14
@Component({
1✔
15
    selector: 'thy-notify',
UNCOV
16
    templateUrl: './notify.component.html',
×
UNCOV
17
    animations: [
×
UNCOV
18
        trigger('flyInOut', [
×
UNCOV
19
            state('flyInOutRight', style({ transform: 'translateX(0)', opacity: 1, height: '*' })),
×
UNCOV
20
            transition('void => flyInOutRight', [
×
21
                style({ transform: 'translateX(100%)', opacity: 0, height: '*' }),
22
                animate(ANIMATION_IN_DURATION)
UNCOV
23
            ]),
×
24
            transition('flyInOutRight => componentHide', [animate(ANIMATION_OUT_DURATION, style(HIDE_STYLE))]),
UNCOV
25
            state('flyInOutLeft', style({ transform: 'translateX(0)', opacity: 1, height: '*' })),
×
26
            transition('void => flyInOutLeft', [
27
                style({ transform: 'translateX(-100%)', opacity: 0, height: '*' }),
UNCOV
28
                animate(ANIMATION_IN_DURATION)
×
UNCOV
29
            ]),
×
UNCOV
30
            transition('flyInOutLeft => componentHide', [animate(ANIMATION_OUT_DURATION, style(HIDE_STYLE))]),
×
UNCOV
31
            state('componentHide', style(HIDE_STYLE))
×
UNCOV
32
        ])
×
UNCOV
33
    ],
×
34
    imports: [ThyIcon, NgClass, ThyViewOutletDirective, NgTemplateOutlet]
35
})
UNCOV
36
export class ThyNotify extends ThyAbstractMessageComponent<ThyNotifyConfig> implements OnInit {
×
UNCOV
37
    @HostBinding('@flyInOut') animationState: string;
×
38

39
    @HostBinding('class') className = '';
UNCOV
40

×
41
    config: ThyNotifyConfig;
42

UNCOV
43
    extendContentClass = false;
×
44

45
    isShowDetail = false;
UNCOV
46

×
UNCOV
47
    contentIsString = false;
×
48

UNCOV
49
    placement: ThyNotifyPlacement;
×
UNCOV
50

×
51
    @Input()
52
    set thyConfig(value: ThyNotifyConfig) {
53
        this.config = value;
1✔
54
        const type = value.type;
1✔
55
        this.placement = value.placement || 'topRight';
56
        if (this.placement === 'topLeft' || this.placement === 'bottomLeft') {
57
            this.animationState = 'flyInOutLeft';
58
        } else {
59
            this.animationState = 'flyInOutRight';
60
        }
1✔
61
        this.className = `thy-notify thy-notify-${type}`;
62
    }
63

64
    constructor() {
65
        const notifyQueue = inject(ThyNotifyQueue);
66
        super(notifyQueue);
67
    }
68

69
    ngOnInit() {
70
        super.ngOnInit();
71
        this.contentIsString = isString(this.config.content);
72
    }
73

74
    extendContent() {
75
        this.extendContentClass = true;
76
    }
77

78
    showDetailToggle() {
79
        this.isShowDetail = !this.isShowDetail;
80
    }
81

82
    triggerDetail() {
83
        if (helpers.isFunction((this.config.detail as ThyNotifyDetail).action)) {
84
            (this.config.detail as ThyNotifyDetail).action();
85
        }
86
        if ((this.config.detail as ThyNotifyDetail).content) {
87
            this.showDetailToggle();
88
        }
89
    }
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