@ethlete/cdk 5.0.0-next.47 → 5.0.0-next.48

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,12 @@
1
1
  # @ethlete/cdk
2
2
 
3
+ ## 5.0.0-next.48
4
+
5
+ ### Patch Changes
6
+
7
+ - Apply a carousel `goTo()` called during the navigation lock once the lock ends instead of dropping it.
8
+ - Closing a query-param overlay no longer cancels a pending navigation that already drops its query param, such as a `routerLink` inside the overlay.
9
+
3
10
  ## 5.0.0-next.47
4
11
 
5
12
  ### Patch Changes
@@ -9251,6 +9251,8 @@ const createOverlayHandlerWithQueryParamLifecycle = (config) => {
9251
9251
  let fnCalled = false;
9252
9252
  let router = null;
9253
9253
  const updateQueryParam = (value) => {
9254
+ const navigation = router?.currentNavigation();
9255
+ if (value === null && navigation && !navigation.extractedUrl.queryParamMap.has(config.queryParamKey)) return;
9254
9256
  router?.navigate([], {
9255
9257
  queryParams: { [config.queryParamKey]: value },
9256
9258
  queryParamsHandling: "merge"
@@ -14765,6 +14767,7 @@ var CarouselDirective = class CarouselDirective {
14765
14767
  this.isAutoPlayPausedByInternalVisibility = signal(false, ...ngDevMode ? [{ debugName: "isAutoPlayPausedByInternalVisibility" }] : /* istanbul ignore next */ []);
14766
14768
  this.hostElementIntersection = signalHostElementIntersection();
14767
14769
  this.isNavigationLocked = toSignal(toObservable(this.activeIndex).pipe(switchMap(() => merge(of(true), timer(this.transitionDuration()).pipe(map(() => false))))), { initialValue: false });
14770
+ this.pendingGoToIndex = signal(null, ...ngDevMode ? [{ debugName: "pendingGoToIndex" }] : /* istanbul ignore next */ []);
14768
14771
  this.items = contentChildren(CAROUSEL_ITEM_TOKEN, ...ngDevMode ? [{ debugName: "items" }] : /* istanbul ignore next */ []);
14769
14772
  this.activeItem = computed(() => this.items()[this.activeIndex()] || null, ...ngDevMode ? [{ debugName: "activeItem" }] : /* istanbul ignore next */ []);
14770
14773
  this.isAtStart = computed(() => this.activeIndex() === 0, ...ngDevMode ? [{ debugName: "isAtStart" }] : /* istanbul ignore next */ []);
@@ -14796,6 +14799,15 @@ var CarouselDirective = class CarouselDirective {
14796
14799
  if (!this.autoPlay()) return false;
14797
14800
  return this.activeItemAutoPlayProgress() === 1;
14798
14801
  }, ...ngDevMode ? [{ debugName: "shouldPlayNextItem" }] : /* istanbul ignore next */ []);
14802
+ effect(() => {
14803
+ if (this.isNavigationLocked()) return;
14804
+ const pending = this.pendingGoToIndex();
14805
+ if (pending === null) return;
14806
+ untracked(() => {
14807
+ this.pendingGoToIndex.set(null);
14808
+ this.goTo(pending);
14809
+ });
14810
+ });
14799
14811
  effect(() => {
14800
14812
  const entries = this.hostElementIntersection();
14801
14813
  if (!this.pauseAutoPlayOnHidden()) {
@@ -14846,7 +14858,11 @@ var CarouselDirective = class CarouselDirective {
14846
14858
  });
14847
14859
  }
14848
14860
  goTo(index) {
14849
- if (this.isNavigationLocked()) return;
14861
+ if (this.isNavigationLocked()) {
14862
+ this.pendingGoToIndex.set(index);
14863
+ return;
14864
+ }
14865
+ this.pendingGoToIndex.set(null);
14850
14866
  this.transitionDirection.set(this.activeIndex() < index ? "right" : "left");
14851
14867
  nextFrame(() => {
14852
14868
  this.activeIndex.set(index);