• 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

16.0
/src/autocomplete/overlay/autocomplete-container.component.ts
1
import { ThyAbstractOverlayContainer, ThyClickDispatcher, ThyPortalOutlet } from 'ngx-tethys/core';
2
import { Observable } from 'rxjs';
3
import { filter } from 'rxjs/operators';
4

5
import { AnimationEvent } from '@angular/animations';
6
import { PortalModule } from '@angular/cdk/portal';
7
import { DOCUMENT } from '@angular/common';
8
import { AfterViewInit, ChangeDetectorRef, Component, ElementRef, EventEmitter, NgZone, ViewChild, inject } from '@angular/core';
9

10
import { thyAutocompleteAnimations } from './autocomplete-animations';
11
import { ThyAutocompleteConfig } from './autocomplete.config';
12
import { autocompleteAbstractOverlayOptions } from './autocomplete.options';
13

14
/**
1✔
15
 * @private
16
 */
17
@Component({
×
18
    selector: 'thy-autocomplete-container',
×
19
    templateUrl: './autocomplete-container.component.html',
×
20
    animations: [thyAutocompleteAnimations.autocompleteContainer],
×
21
    host: {
×
22
        class: 'thy-autocomplete-container',
×
23
        tabindex: '-1',
×
24
        '[attr.role]': `'autocomplete'`,
25
        '[@autocompleteContainer]': 'animationState',
×
26
        '(@autocompleteContainer.start)': 'onAnimationStart($event)',
27
        '(@autocompleteContainer.done)': 'onAnimationDone($event)'
×
28
    },
×
29
    imports: [PortalModule, ThyPortalOutlet]
×
30
})
31
export class ThyAutocompleteContainer extends ThyAbstractOverlayContainer implements AfterViewInit {
×
32
    private elementRef = inject(ElementRef);
×
33
    private document = inject(DOCUMENT);
34
    config = inject(ThyAutocompleteConfig);
35
    private thyClickDispatcher = inject(ThyClickDispatcher);
36
    private ngZone = inject(NgZone);
37

38
    @ViewChild(ThyPortalOutlet, { static: true })
×
39
    portalOutlet: ThyPortalOutlet;
40

41
    /** State of the autocomplete animation. */
42
    animationState: 'void' | 'enter' | 'exit' = 'enter';
×
43

44
    /** Emits when an animation state changes. */
45
    animationStateChanged = new EventEmitter<AnimationEvent>();
×
46

×
47
    animationOpeningDone: Observable<AnimationEvent>;
48
    animationClosingDone: Observable<AnimationEvent>;
1✔
49

1✔
50
    beforeAttachPortal(): void {}
51

52
    constructor() {
53
        const changeDetectorRef = inject(ChangeDetectorRef);
1✔
54

55
        super(autocompleteAbstractOverlayOptions, changeDetectorRef);
56

57
        this.animationOpeningDone = this.animationStateChanged.pipe(
58
            filter((event: AnimationEvent) => {
59
                return event.phaseName === 'done' && event.toState === 'enter';
60
            })
61
        );
62
        this.animationClosingDone = this.animationStateChanged.pipe(
63
            filter((event: AnimationEvent) => {
64
                return event.phaseName === 'done' && event.toState === 'exit';
65
            })
66
        );
67
    }
68

69
    ngAfterViewInit() {}
70

71
    /** Callback, invoked whenever an animation on the host completes. */
72
    onAnimationDone(event: AnimationEvent) {
73
        this.animationStateChanged.emit(event);
74
    }
75

76
    /** Callback, invoked when an animation on the host starts. */
77
    onAnimationStart(event: AnimationEvent) {
78
        this.animationStateChanged.emit(event);
79
    }
80

81
    startExitAnimation(): void {
82
        this.animationState = 'exit';
83
        this.changeDetectorRef.markForCheck();
84
    }
85
}
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