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

atinc / ngx-tethys / #71

06 Aug 2025 02:34AM UTC coverage: 9.672% (-80.6%) from 90.298%
#71

push

web-flow
feat(date-picker): add dateCellRender #TINFR-2386 (#3495) (#3499)

104 of 6813 branches covered (1.53%)

Branch coverage included in aggregate %.

1969 of 14620 relevant lines covered (13.47%)

6.13 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, HostBinding, effect, inject, signal, computed } 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',
16
    templateUrl: './notify.component.html',
×
17
    host: {
×
18
        '[class]': "'thy-notify thy-notify-' + config().type"
×
19
    },
×
20
    animations: [
×
21
        trigger('flyInOut', [
×
22
            state('flyInOutRight', style({ transform: 'translateX(0)', opacity: 1, height: '*' })),
×
23
            transition('void => flyInOutRight', [
×
24
                style({ transform: 'translateX(100%)', opacity: 0, height: '*' }),
25
                animate(ANIMATION_IN_DURATION)
×
26
            ]),
×
27
            transition('flyInOutRight => componentHide', [animate(ANIMATION_OUT_DURATION, style(HIDE_STYLE))]),
×
28
            state('flyInOutLeft', style({ transform: 'translateX(0)', opacity: 1, height: '*' })),
×
29
            transition('void => flyInOutLeft', [
30
                style({ transform: 'translateX(-100%)', opacity: 0, height: '*' }),
31
                animate(ANIMATION_IN_DURATION)
×
32
            ]),
33
            transition('flyInOutLeft => componentHide', [animate(ANIMATION_OUT_DURATION, style(HIDE_STYLE))]),
34
            state('componentHide', style(HIDE_STYLE))
35
        ])
36
    ],
×
37
    imports: [ThyIcon, NgClass, ThyViewOutletDirective, NgTemplateOutlet]
38
})
39
export class ThyNotify extends ThyAbstractMessageComponent<ThyNotifyConfig> {
×
40
    @HostBinding('@flyInOut') animationState: string;
41

42
    extendContentClass = signal(false);
×
43

×
44
    isShowDetail = signal(false);
×
45

46
    readonly contentIsString = computed(() => isString(this.config().content));
×
47

×
48
    private placement = computed<ThyNotifyPlacement>(() => {
49
        const config = this.config();
50
        return config.placement || 'topRight';
1✔
51
    });
1✔
52

53
    constructor() {
54
        const notifyQueue = inject(ThyNotifyQueue);
55
        super(notifyQueue);
1✔
56

57
        effect(() => {
58
            const placement = this.placement();
59
            if (placement === 'topLeft' || placement === 'bottomLeft') {
60
                this.animationState = 'flyInOutLeft';
61
            } else {
62
                this.animationState = 'flyInOutRight';
63
            }
64
        });
65
    }
66

67
    extendContent() {
68
        this.extendContentClass.set(true);
69
    }
70

71
    showDetailToggle() {
72
        this.isShowDetail.set(!this.isShowDetail());
73
    }
74

75
    triggerDetail() {
76
        const config = this.config();
77
        if (helpers.isFunction((config.detail as ThyNotifyDetail).action)) {
78
            (config.detail as ThyNotifyDetail).action();
79
        }
80
        if ((config.detail as ThyNotifyDetail).content) {
81
            this.showDetailToggle();
82
        }
83
    }
84
}
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