@ethlete/cdk 5.0.0-next.46 → 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,19 @@
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
+
10
+ ## 5.0.0-next.47
11
+
12
+ ### Patch Changes
13
+
14
+ - The combobox no longer clears the text you typed when its first options arrive, so that text is still used as the filter.
15
+ - The `migrate-from-cdk` generator now knows the tab group classes of `@ethlete/components`.
16
+
3
17
  ## 5.0.0-next.46
4
18
 
5
19
  ### 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);
@@ -20171,6 +20187,7 @@ var ComboboxDirective = class ComboboxDirective {
20171
20187
  this.colorProvider = inject(COLOR_PROVIDER, { optional: true });
20172
20188
  this._initialValue$ = new BehaviorSubject(null);
20173
20189
  this._hasReceivedSelectionValue = false;
20190
+ this._hasTypedSinceSelectionSync = false;
20174
20191
  this._filterInternal$ = new BehaviorSubject(false);
20175
20192
  this._loading$ = new BehaviorSubject(false);
20176
20193
  this.loading$ = this._loading$.asObservable();
@@ -20254,15 +20271,16 @@ var ComboboxDirective = class ComboboxDirective {
20254
20271
  this._debugValidateComboboxConfig();
20255
20272
  this._debugValidateOptionAndInitialValueSchema();
20256
20273
  }
20257
- this._selectionModel.setSelectionFromValue$(this._input.value);
20274
+ this._syncSelectionFromInputValue();
20258
20275
  const hasInitialControlValue = this._input.value !== null && this._input.value !== void 0;
20259
20276
  this._selectionModel.value$.pipe(takeUntil(this._destroy$), tap((value) => {
20260
20277
  const isInitialEmission = !this._hasReceivedSelectionValue;
20261
20278
  this._hasReceivedSelectionValue = true;
20262
20279
  if (!(this._selectionModel.isSyncingSelectionFromValue || isInitialEmission && hasInitialControlValue)) this._input._updateValue(value);
20280
+ if (this._selectionModel.isSyncingSelectionFromValue && value === null && this._hasTypedSinceSelectionSync) return;
20263
20281
  this._setFilterFromInputValue();
20264
20282
  })).subscribe();
20265
- this._input.onExternalUpdate$.pipe(takeUntil(this._destroy$), tap(() => this._selectionModel.setSelectionFromValue$(this._input.value))).subscribe();
20283
+ this._input.onExternalUpdate$.pipe(takeUntil(this._destroy$), tap(() => this._syncSelectionFromInputValue())).subscribe();
20266
20284
  }
20267
20285
  setBodyComponent(component) {
20268
20286
  this._comboboxBodyComponent = component;
@@ -20426,6 +20444,7 @@ var ComboboxDirective = class ComboboxDirective {
20426
20444
  }
20427
20445
  _processInputEvent(event) {
20428
20446
  const value = event.target.value;
20447
+ this._hasTypedSinceSelectionSync = true;
20429
20448
  this._updateFilter(value);
20430
20449
  }
20431
20450
  _handleBlurEvent() {
@@ -20483,6 +20502,10 @@ var ComboboxDirective = class ComboboxDirective {
20483
20502
  this.userInteraction.emit();
20484
20503
  }
20485
20504
  }
20505
+ _syncSelectionFromInputValue() {
20506
+ this._hasTypedSinceSelectionSync = false;
20507
+ this._selectionModel.setSelectionFromValue$(this._input.value);
20508
+ }
20486
20509
  _initDispatchFilterChanges() {
20487
20510
  this._currentFilter$.pipe(skipWhile(() => this.filterInternal), debounceTime(300), distinctUntilChanged(), takeUntil(this._destroy$), tap((v) => this.filterChange.emit(v))).subscribe();
20488
20511
  }