@ethlete/cdk 5.0.0-next.45 → 5.0.0-next.46

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @ethlete/cdk
2
2
 
3
+ ## 5.0.0-next.46
4
+
5
+ ### Patch Changes
6
+
7
+ - Overlay: while the overlay enters, a backdrop click closes it; the second click of a double-click does not, so a double-click on the trigger no longer opens and closes it at once.
8
+
3
9
  ## 5.0.0-next.45
4
10
 
5
11
  ### Patch Changes
@@ -4,7 +4,7 @@ import * as i1$5 from "@angular/cdk/portal";
4
4
  import { CdkPortal, CdkPortalOutlet, ComponentPortal, PortalModule, TemplatePortal } from "@angular/cdk/portal";
5
5
  import { DomSanitizer, Title } from "@angular/platform-browser";
6
6
  import { outputFromObservable, outputToObservable, takeUntilDestroyed, toObservable, toSignal } from "@angular/core/rxjs-interop";
7
- import { BehaviorSubject, EMPTY, Observable, ReplaySubject, Subject, Subscription, asapScheduler, catchError, combineLatest, concatMap, debounceTime, distinctUntilChanged, filter, finalize, from, fromEvent, map, merge, observeOn, of, pairwise, shareReplay, skip, skipUntil, skipWhile, startWith, switchMap, take, takeUntil, takeWhile, tap, throwError, timer, withLatestFrom } from "rxjs";
7
+ import { BehaviorSubject, EMPTY, Observable, ReplaySubject, Subject, Subscription, asapScheduler, catchError, combineLatest, concatMap, debounceTime, distinctUntilChanged, filter, finalize, from, fromEvent, map, merge, observeOn, of, pairwise, shareReplay, skip, skipWhile, startWith, switchMap, take, takeUntil, takeWhile, tap, throwError, timer, withLatestFrom } from "rxjs";
8
8
  import { __decorate, __metadata } from "tslib";
9
9
  import { AsyncPipe, DOCUMENT as DOCUMENT$1, Location, NgClass, NgComponentOutlet, NgStyle, NgTemplateOutlet } from "@angular/common";
10
10
  import * as i1$4 from "@ethlete/core";
@@ -7074,7 +7074,8 @@ var OverlayRef = class {
7074
7074
  }
7075
7075
  setupCloseHandlers() {
7076
7076
  const lifecycleState$ = this._containerInstance.animatedLifecycle.state$;
7077
- merge(this.backdropClick().pipe(skipUntil(lifecycleState$.pipe(filter((e) => e === "entering"), switchMap(() => fromNextFrame())))), this.keydownEvents().pipe(filter((event) => event.keyCode === ESCAPE && !this.disableClose && !hasModifierKey(event)), concatMap((event) => this._containerInstance.animatedLifecycle.state() === "init" ? lifecycleState$.pipe(filter((state) => state !== "init"), take(1), observeOn(asapScheduler), map(() => event)) : of(event)))).pipe(takeUntil(this.afterClosed())).subscribe((event) => {
7077
+ const afterEnterStarted = (event) => this._containerInstance.animatedLifecycle.state() === "init" ? lifecycleState$.pipe(filter((state) => state !== "init"), take(1), observeOn(asapScheduler), map(() => event)) : of(event);
7078
+ merge(this.backdropClick().pipe(filter((event) => !this.isDoubleClickWhileEntering(event))), this.keydownEvents().pipe(filter((event) => event.keyCode === ESCAPE && !this.disableClose && !hasModifierKey(event)))).pipe(concatMap(afterEnterStarted), takeUntil(this.afterClosed())).subscribe((event) => {
7078
7079
  const isEscapeKey = event.type === "keydown";
7079
7080
  const isBackdropClick = !isEscapeKey;
7080
7081
  if (this._isEscCloseControlledExternally && isEscapeKey || this._isBackdropCloseControlledExternally && isBackdropClick) return;
@@ -7084,6 +7085,10 @@ var OverlayRef = class {
7084
7085
  }
7085
7086
  });
7086
7087
  }
7088
+ isDoubleClickWhileEntering(event) {
7089
+ const state = this._containerInstance.animatedLifecycle.state();
7090
+ return event.detail > 1 && (state === "init" || state === "entering");
7091
+ }
7087
7092
  finishOverlayClose() {
7088
7093
  this._ref.close(this._result, { focusOrigin: this._closeInteractionType });
7089
7094
  this.componentInstance = null;