@coreui/angular-pro 5.2.5 → 5.2.6
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.
|
@@ -10227,7 +10227,7 @@ class MultiSelectComponent {
|
|
|
10227
10227
|
* @default { '=1': 'item selected', 'other': 'items selected' }
|
|
10228
10228
|
*/
|
|
10229
10229
|
this.selectionTypeCounterTextPluralMap = { '=1': 'item selected', other: 'items selected' };
|
|
10230
|
-
this.#value = [];
|
|
10230
|
+
this.#value = signal([]);
|
|
10231
10231
|
/**
|
|
10232
10232
|
* Emits valueChange
|
|
10233
10233
|
* @type TValue | TValue[]
|
|
@@ -10262,7 +10262,7 @@ class MultiSelectComponent {
|
|
|
10262
10262
|
this._subtreeFocused = this.focusOrigin(null);
|
|
10263
10263
|
this.userOptions = this.multiSelectService.getUserOptions();
|
|
10264
10264
|
this.activeOption = null;
|
|
10265
|
-
this.differ = this.iterableDiffers.find(this.#value).create();
|
|
10265
|
+
this.differ = this.iterableDiffers.find(this.#value()).create();
|
|
10266
10266
|
this.multiSelectService.setSelectionModel(this.multiple);
|
|
10267
10267
|
this.optionsArray$ = this.multiSelectService.getOptionsArray();
|
|
10268
10268
|
}
|
|
@@ -10363,22 +10363,22 @@ class MultiSelectComponent {
|
|
|
10363
10363
|
}
|
|
10364
10364
|
/**
|
|
10365
10365
|
* Initial value of multi-select
|
|
10366
|
-
* @type TValue | TValue[]
|
|
10366
|
+
* @type (TValue | TValue[])
|
|
10367
10367
|
*/
|
|
10368
10368
|
set value(value) {
|
|
10369
10369
|
const newValue = Array.isArray(value) ? [...value] : [value];
|
|
10370
|
-
if (this.differ) {
|
|
10371
|
-
|
|
10372
|
-
|
|
10373
|
-
|
|
10374
|
-
|
|
10375
|
-
|
|
10376
|
-
|
|
10377
|
-
}
|
|
10370
|
+
// if (this.differ) {
|
|
10371
|
+
const changes = this.differ?.diff(newValue);
|
|
10372
|
+
if (changes) {
|
|
10373
|
+
this.#value.set([...newValue]);
|
|
10374
|
+
this.value$.next([...newValue]);
|
|
10375
|
+
this.onChange(this.value);
|
|
10376
|
+
// this.valueChange.emit(this.value);
|
|
10378
10377
|
}
|
|
10378
|
+
// }
|
|
10379
10379
|
}
|
|
10380
10380
|
get value() {
|
|
10381
|
-
const value = this.multiSelectService.selectionModel?.selected ?? [...this.#value];
|
|
10381
|
+
const value = this.multiSelectService.selectionModel?.selected ?? [...this.#value()];
|
|
10382
10382
|
return this.multiple ? [...value] : value[0];
|
|
10383
10383
|
}
|
|
10384
10384
|
#value;
|
|
@@ -10674,7 +10674,7 @@ class MultiSelectComponent {
|
|
|
10674
10674
|
}), takeUntilDestroyed(this.#destroyRef))
|
|
10675
10675
|
.subscribe();
|
|
10676
10676
|
// set initial values
|
|
10677
|
-
this.multiSelectService.selectionModel.select(...this.#value);
|
|
10677
|
+
this.multiSelectService.selectionModel.select(...this.#value());
|
|
10678
10678
|
this.value$.pipe(takeUntilDestroyed(this.#destroyRef)).subscribe((value) => {
|
|
10679
10679
|
if (!value.length) {
|
|
10680
10680
|
this.clearAllOptions();
|
|
@@ -10685,7 +10685,7 @@ class MultiSelectComponent {
|
|
|
10685
10685
|
});
|
|
10686
10686
|
});
|
|
10687
10687
|
this.value$
|
|
10688
|
-
.pipe(debounceTime(100), tap((value) => {
|
|
10688
|
+
.pipe(debounceTime(100), distinctUntilChanged(), tap((value) => {
|
|
10689
10689
|
this.valueChange.emit(this.value);
|
|
10690
10690
|
}), takeUntilDestroyed(this.#destroyRef))
|
|
10691
10691
|
.subscribe();
|
|
@@ -10737,8 +10737,8 @@ class MultiSelectComponent {
|
|
|
10737
10737
|
}
|
|
10738
10738
|
makeOptions(options) {
|
|
10739
10739
|
if (this.search === 'external' && this.searchValue.length) {
|
|
10740
|
-
this.#options.forEach((
|
|
10741
|
-
|
|
10740
|
+
this.#options.forEach((option, key) => {
|
|
10741
|
+
option.visible = false;
|
|
10742
10742
|
});
|
|
10743
10743
|
}
|
|
10744
10744
|
options.forEach((option) => {
|
|
@@ -10812,6 +10812,9 @@ class MultiSelectComponent {
|
|
|
10812
10812
|
.subscribe((next) => {
|
|
10813
10813
|
this.visibleOptions.set(this.multiSelectOptionsContent?.some((option) => option.visible));
|
|
10814
10814
|
if (this.visibleOptions()) {
|
|
10815
|
+
if (!this.virtualScroller) {
|
|
10816
|
+
this.#options.clear();
|
|
10817
|
+
}
|
|
10815
10818
|
this.makeOptions(this.multiSelectOptionsContent.toArray());
|
|
10816
10819
|
}
|
|
10817
10820
|
});
|