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

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.47
4
+
5
+ ### Patch Changes
6
+
7
+ - The combobox no longer clears the text you typed when its first options arrive, so that text is still used as the filter.
8
+ - The `migrate-from-cdk` generator now knows the tab group classes of `@ethlete/components`.
9
+
3
10
  ## 5.0.0-next.46
4
11
 
5
12
  ### Patch Changes
@@ -20171,6 +20171,7 @@ var ComboboxDirective = class ComboboxDirective {
20171
20171
  this.colorProvider = inject(COLOR_PROVIDER, { optional: true });
20172
20172
  this._initialValue$ = new BehaviorSubject(null);
20173
20173
  this._hasReceivedSelectionValue = false;
20174
+ this._hasTypedSinceSelectionSync = false;
20174
20175
  this._filterInternal$ = new BehaviorSubject(false);
20175
20176
  this._loading$ = new BehaviorSubject(false);
20176
20177
  this.loading$ = this._loading$.asObservable();
@@ -20254,15 +20255,16 @@ var ComboboxDirective = class ComboboxDirective {
20254
20255
  this._debugValidateComboboxConfig();
20255
20256
  this._debugValidateOptionAndInitialValueSchema();
20256
20257
  }
20257
- this._selectionModel.setSelectionFromValue$(this._input.value);
20258
+ this._syncSelectionFromInputValue();
20258
20259
  const hasInitialControlValue = this._input.value !== null && this._input.value !== void 0;
20259
20260
  this._selectionModel.value$.pipe(takeUntil(this._destroy$), tap((value) => {
20260
20261
  const isInitialEmission = !this._hasReceivedSelectionValue;
20261
20262
  this._hasReceivedSelectionValue = true;
20262
20263
  if (!(this._selectionModel.isSyncingSelectionFromValue || isInitialEmission && hasInitialControlValue)) this._input._updateValue(value);
20264
+ if (this._selectionModel.isSyncingSelectionFromValue && value === null && this._hasTypedSinceSelectionSync) return;
20263
20265
  this._setFilterFromInputValue();
20264
20266
  })).subscribe();
20265
- this._input.onExternalUpdate$.pipe(takeUntil(this._destroy$), tap(() => this._selectionModel.setSelectionFromValue$(this._input.value))).subscribe();
20267
+ this._input.onExternalUpdate$.pipe(takeUntil(this._destroy$), tap(() => this._syncSelectionFromInputValue())).subscribe();
20266
20268
  }
20267
20269
  setBodyComponent(component) {
20268
20270
  this._comboboxBodyComponent = component;
@@ -20426,6 +20428,7 @@ var ComboboxDirective = class ComboboxDirective {
20426
20428
  }
20427
20429
  _processInputEvent(event) {
20428
20430
  const value = event.target.value;
20431
+ this._hasTypedSinceSelectionSync = true;
20429
20432
  this._updateFilter(value);
20430
20433
  }
20431
20434
  _handleBlurEvent() {
@@ -20483,6 +20486,10 @@ var ComboboxDirective = class ComboboxDirective {
20483
20486
  this.userInteraction.emit();
20484
20487
  }
20485
20488
  }
20489
+ _syncSelectionFromInputValue() {
20490
+ this._hasTypedSinceSelectionSync = false;
20491
+ this._selectionModel.setSelectionFromValue$(this._input.value);
20492
+ }
20486
20493
  _initDispatchFilterChanges() {
20487
20494
  this._currentFilter$.pipe(skipWhile(() => this.filterInternal), debounceTime(300), distinctUntilChanged(), takeUntil(this._destroy$), tap((v) => this.filterChange.emit(v))).subscribe();
20488
20495
  }