@wizishop/angular-components 14.4.65 → 14.4.67
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/esm2020/lib/components/selects/select/value-change.service.mjs +11 -6
- package/fesm2015/wizishop-angular-components.mjs +9 -4
- package/fesm2015/wizishop-angular-components.mjs.map +1 -1
- package/fesm2020/wizishop-angular-components.mjs +9 -4
- package/fesm2020/wizishop-angular-components.mjs.map +1 -1
- package/package.json +1 -1
- package/wizishop-angular-components-14.4.67.tgz +0 -0
- package/wizishop-angular-components-14.4.65.tgz +0 -0
|
@@ -565,8 +565,13 @@ class ValueChangeService {
|
|
|
565
565
|
return this.value !== this.getSelectedOptionsValues()[0];
|
|
566
566
|
}
|
|
567
567
|
handleSelectedOptionsEvent() {
|
|
568
|
-
this.optionSelectedChangeListeners().subscribe(() => {
|
|
569
|
-
|
|
568
|
+
this.optionSelectedChangeListeners().subscribe((option) => {
|
|
569
|
+
const selectedOptionsValues = this.getSelectedOptionsValues();
|
|
570
|
+
if (this.multiple) {
|
|
571
|
+
this.value = selectedOptionsValues;
|
|
572
|
+
return;
|
|
573
|
+
}
|
|
574
|
+
this.value = option.selected ? option.value : undefined;
|
|
570
575
|
});
|
|
571
576
|
}
|
|
572
577
|
updateSelectPlaceholder() {
|
|
@@ -590,7 +595,7 @@ class ValueChangeService {
|
|
|
590
595
|
}
|
|
591
596
|
optionSelectedChangeListeners() {
|
|
592
597
|
const selectedChange$ = this.optionChildren.map((option) => {
|
|
593
|
-
return option.selectedChange.pipe(filter(() => !this.disabled));
|
|
598
|
+
return option.selectedChange.pipe(filter(() => !this.disabled), map(() => option));
|
|
594
599
|
});
|
|
595
600
|
return merge(...selectedChange$).pipe(takeUntil(this.resetListeners$));
|
|
596
601
|
}
|
|
@@ -606,7 +611,7 @@ class ValueChangeService {
|
|
|
606
611
|
* May not work with objects values
|
|
607
612
|
*/
|
|
608
613
|
isSelectedValue(value2) {
|
|
609
|
-
if (Array.isArray(this.value)) {
|
|
614
|
+
if (this.multiple && Array.isArray(this.value)) {
|
|
610
615
|
return this.value.includes(value2);
|
|
611
616
|
}
|
|
612
617
|
return this.value === value2;
|