• 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

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

5
import { AnimationEvent } from '@angular/animations';
6
import { CdkPortalOutlet, PortalModule } from '@angular/cdk/portal';
7
import { DOCUMENT } from '@angular/common';
8
import { AfterViewInit, ChangeDetectorRef, Component, ElementRef, EventEmitter, Inject, NgZone, ViewChild } 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
    standalone: true,
30
    imports: [PortalModule]
×
31
})
×
32
export class ThyAutocompleteContainerComponent extends ThyAbstractOverlayContainer implements AfterViewInit {
33
    @ViewChild(CdkPortalOutlet, { static: true })
34
    portalOutlet: CdkPortalOutlet;
35

36
    /** State of the autocomplete animation. */
37
    animationState: 'void' | 'enter' | 'exit' = 'enter';
×
38

39
    /** Emits when an animation state changes. */
40
    animationStateChanged = new EventEmitter<AnimationEvent>();
41

×
42
    animationOpeningDone: Observable<AnimationEvent>;
43
    animationClosingDone: Observable<AnimationEvent>;
44

×
45
    beforeAttachPortal(): void {}
×
46

47
    constructor(
1✔
48
        private elementRef: ElementRef,
49
        @Inject(DOCUMENT) private document: any,
50
        public config: ThyAutocompleteConfig,
51
        changeDetectorRef: ChangeDetectorRef,
52
        private thyClickDispatcher: ThyClickDispatcher,
53
        private ngZone: NgZone
54
    ) {
55
        super(autocompleteAbstractOverlayOptions, changeDetectorRef);
1✔
56

57
        this.animationOpeningDone = this.animationStateChanged.pipe(
58
            filter((event: AnimationEvent) => {
59
                return event.phaseName === 'done' && event.toState === 'enter';
1✔
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