• 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

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
 */
UNCOV
17
@Component({
×
UNCOV
18
    selector: 'thy-autocomplete-container',
×
UNCOV
19
    templateUrl: './autocomplete-container.component.html',
×
UNCOV
20
    animations: [thyAutocompleteAnimations.autocompleteContainer],
×
UNCOV
21
    host: {
×
UNCOV
22
        class: 'thy-autocomplete-container',
×
UNCOV
23
        tabindex: '-1',
×
24
        '[attr.role]': `'autocomplete'`,
UNCOV
25
        '[@autocompleteContainer]': 'animationState',
×
26
        '(@autocompleteContainer.start)': 'onAnimationStart($event)',
UNCOV
27
        '(@autocompleteContainer.done)': 'onAnimationDone($event)'
×
UNCOV
28
    },
×
UNCOV
29
    imports: [PortalModule, ThyPortalOutlet]
×
30
})
UNCOV
31
export class ThyAutocompleteContainer extends ThyAbstractOverlayContainer implements AfterViewInit {
×
UNCOV
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

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

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

44
    /** Emits when an animation state changes. */
UNCOV
45
    animationStateChanged = new EventEmitter<AnimationEvent>();
×
UNCOV
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

© 2025 Coveralls, Inc