• 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

11.76
/src/notify/notify.component.ts
1
import { Component, Input, HostBinding, NgZone, OnInit } 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 { ThyIconComponent } from 'ngx-tethys/icon';
9
import { NgIf, NgClass, NgTemplateOutlet } from '@angular/common';
10

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

×
40
    @HostBinding('class') className = '';
41

42
    config: ThyNotifyConfig;
×
43

44
    extendContentClass = false;
45

×
46
    isShowDetail = false;
×
47

48
    contentIsString = false;
×
49

×
50
    placement: ThyNotifyPlacement;
51

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

65
    constructor(ngZone: NgZone, notifyQueue: ThyNotifyQueue) {
66
        super(ngZone, 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