@coolon/angular-ui-powerups 14.38.1 → 14.38.2
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/forms/multiple-select-input/multiple-select-input.component.mjs +5 -3
- package/esm2020/lib/components/forms/select-input/select-input.component.mjs +5 -5
- package/fesm2015/coolon-angular-ui-powerups.mjs +7 -6
- package/fesm2015/coolon-angular-ui-powerups.mjs.map +1 -1
- package/fesm2020/coolon-angular-ui-powerups.mjs +7 -6
- package/fesm2020/coolon-angular-ui-powerups.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -2059,8 +2059,10 @@ class MultipleSelectInputComponent extends AbstractListInputComponent {
|
|
|
2059
2059
|
const lookup = chain(this.options$).indexUsing(this.options$.identityOf);
|
|
2060
2060
|
const self = this;
|
|
2061
2061
|
this.registerDisposable(new Binding(this.componentList$, this.ids$, {
|
|
2062
|
-
toLeft(
|
|
2063
|
-
|
|
2062
|
+
toLeft(selectedItems, currentLeftValue) {
|
|
2063
|
+
const newValues = selectedItems.map(it => lookup.get(it)).filter(it => !it);
|
|
2064
|
+
// if our lookup didn't find anything then we return the previous values so we don't clobber selections when the options go empty
|
|
2065
|
+
return newValues.length < 1 && selectedItems.length > 0 ? currentLeftValue : newValues;
|
|
2064
2066
|
},
|
|
2065
2067
|
leftDependsOn: lookup,
|
|
2066
2068
|
toRight(leftValue, currentRightValue) {
|
|
@@ -2165,10 +2167,9 @@ class SelectInputComponent extends AbstractValueInputComponent {
|
|
|
2165
2167
|
const lookup = chain(this.options$).indexUsing(this.options$.identityOf);
|
|
2166
2168
|
const self = this;
|
|
2167
2169
|
this.registerDisposable(new Binding(this.componentValue$, this.id$, {
|
|
2168
|
-
toLeft(
|
|
2169
|
-
const
|
|
2170
|
-
|
|
2171
|
-
return value;
|
|
2170
|
+
toLeft(currentId, currentValue) {
|
|
2171
|
+
const newValue = lookup.get(currentId); // the list is empty or we're missing form it so don't touch the real value.
|
|
2172
|
+
return isNil(newValue) ? currentValue : newValue;
|
|
2172
2173
|
},
|
|
2173
2174
|
leftDependsOn: lookup,
|
|
2174
2175
|
toRight(leftValue, currentRightValue) {
|