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

IgniteUI / igniteui-angular / 13331632524

14 Feb 2025 02:51PM CUT coverage: 22.015% (-69.6%) from 91.622%
13331632524

Pull #15372

github

web-flow
Merge d52d57714 into bcb78ae0a
Pull Request #15372: chore(*): test ci passing

1990 of 15592 branches covered (12.76%)

431 of 964 new or added lines in 18 files covered. (44.71%)

19956 existing lines in 307 files now uncovered.

6452 of 29307 relevant lines covered (22.02%)

249.17 hits per line

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

26.32
/projects/igniteui-angular/src/lib/directives/notification/notifications.directive.ts
1
import { Directive, ElementRef, HostBinding, Input, OnDestroy, booleanAttribute } from '@angular/core';
2
import { IToggleView } from '../../core/navigation';
3
import { IPositionStrategy, OverlaySettings } from '../../services/public_api';
4
import { IgxOverlayOutletDirective, IgxToggleDirective } from '../toggle/toggle.directive';
5

6
@Directive()
7
export abstract class IgxNotificationsDirective extends IgxToggleDirective
2✔
8
    implements IToggleView, OnDestroy {
9
    /**
10
     * Sets/gets the `aria-live` attribute.
11
     * If not set, `aria-live` will have value `"polite"`.
12
     */
13
    @HostBinding('attr.aria-live')
14
    @Input()
15
    public ariaLive = 'polite';
37✔
16

17
    /**
18
     * Sets/gets whether the element will be hidden after the `displayTime` is over.
19
     * Default value is `true`.
20
     */
21
    @Input({ transform: booleanAttribute })
22
    public autoHide = true;
37✔
23

24
    /**
25
     * Sets/gets the duration of time span (in milliseconds) which the element will be visible
26
     * after it is being shown.
27
     * Default value is `4000`.
28
     */
29
    @Input()
30
    public displayTime = 4000;
37✔
31

32
    /**
33
     * Gets/Sets the container used for the element.
34
     *
35
     * @remarks
36
     *  `outlet` is an instance of `IgxOverlayOutletDirective` or an `ElementRef`.
37
     */
38
    @Input()
39
    public outlet: IgxOverlayOutletDirective | ElementRef<HTMLElement>;
40

41
    /**
42
     * Enables/Disables the visibility of the element.
43
     * If not set, the `isVisible` attribute will have value `false`.
44
     */
45
    @Input({ transform: booleanAttribute })
46
    public get isVisible() {
UNCOV
47
        return !this.collapsed;
×
48
    }
49

50
    public set isVisible(value) {
51
        if (value !== this.isVisible) {
×
52
            if (value) {
×
53
                requestAnimationFrame(() => {
×
54
                    this.open();
×
55
                });
56
            } else {
57
                this.close();
×
58
            }
59
        }
60
    }
61

62
    /**
63
     * @hidden
64
     * @internal
65
     */
66
    public textMessage = '';
37✔
67

68
    /**
69
     * @hidden
70
     */
71
    public timeoutId: number;
72

73
    /**
74
     * @hidden
75
     */
76
    protected strategy: IPositionStrategy;
77

78
    /**
79
     * @hidden
80
     */
81
    public override open() {
UNCOV
82
        clearInterval(this.timeoutId);
×
83

UNCOV
84
        const overlaySettings: OverlaySettings = {
×
85
            positionStrategy: this.strategy,
86
            closeOnEscape: false,
87
            closeOnOutsideClick: false,
88
            modal: false,
89
            outlet: this.outlet
90
        };
91

UNCOV
92
        super.open(overlaySettings);
×
93

UNCOV
94
        if (this.autoHide) {
×
UNCOV
95
            this.timeoutId = window.setTimeout(() => {
×
UNCOV
96
                this.close();
×
97
            }, this.displayTime);
98
        }
99
    }
100

101
    /**
102
     * Hides the element.
103
     */
104
    public override close() {
UNCOV
105
        clearTimeout(this.timeoutId);
×
UNCOV
106
        super.close();
×
107
    }
108
}
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