@coreui/angular-pro 5.5.21 → 5.5.22
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.
|
@@ -4248,7 +4248,7 @@ class AutocompleteDirective {
|
|
|
4248
4248
|
}), tap((value) => {
|
|
4249
4249
|
this.handleSelect(null);
|
|
4250
4250
|
this.handleSearch(value);
|
|
4251
|
-
this.#inputValue.set(value);
|
|
4251
|
+
this.#inputValue.set({ value, origin: 'event' });
|
|
4252
4252
|
}), takeUntilDestroyed(this.#destroyRef))
|
|
4253
4253
|
.subscribe();
|
|
4254
4254
|
ngOnInit() {
|
|
@@ -4429,17 +4429,22 @@ class AutocompleteDirective {
|
|
|
4429
4429
|
else {
|
|
4430
4430
|
// this.#autocompleteService.hint.set(undefined);
|
|
4431
4431
|
}
|
|
4432
|
-
this.#inputValue.set(
|
|
4432
|
+
this.#inputValue.set({
|
|
4433
|
+
value: option ? getOptionLabel(option) : (this.#autocompleteService.searchValue() ?? ''),
|
|
4434
|
+
origin: 'program'
|
|
4435
|
+
});
|
|
4433
4436
|
this.#autocompleteService.selected.set(option ?? null);
|
|
4434
4437
|
}
|
|
4435
|
-
#inputValue = signal('', ...(ngDevMode ? [{ debugName: "#inputValue" }] : []));
|
|
4438
|
+
#inputValue = signal({ value: '', origin: 'init' }, ...(ngDevMode ? [{ debugName: "#inputValue" }] : []));
|
|
4436
4439
|
#inputValuePrev = '';
|
|
4437
4440
|
#inputValueEffect = effect(() => {
|
|
4438
|
-
const
|
|
4439
|
-
if (this.#inputValuePrev !==
|
|
4440
|
-
this.#inputValuePrev =
|
|
4441
|
-
this.#hostElement.nativeElement.value =
|
|
4442
|
-
|
|
4441
|
+
const { value = '', origin } = { ...this.#inputValue() };
|
|
4442
|
+
if (this.#inputValuePrev !== value) {
|
|
4443
|
+
this.#inputValuePrev = value;
|
|
4444
|
+
this.#hostElement.nativeElement.value = value;
|
|
4445
|
+
if (origin === 'event' || value === '') {
|
|
4446
|
+
this.inputChange.emit(value);
|
|
4447
|
+
}
|
|
4443
4448
|
}
|
|
4444
4449
|
}, ...(ngDevMode ? [{ debugName: "#inputValueEffect" }] : []));
|
|
4445
4450
|
dispatchInputEvent(value) {
|