@cqa-lib/cqa-ui 1.0.20 → 1.0.21
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/dynamic-select/dynamic-select-field.component.mjs +6 -13
- package/fesm2015/cqa-lib-cqa-ui.mjs +6 -13
- package/fesm2015/cqa-lib-cqa-ui.mjs.map +1 -1
- package/fesm2020/cqa-lib-cqa-ui.mjs +5 -12
- package/fesm2020/cqa-lib-cqa-ui.mjs.map +1 -1
- package/package.json +1 -1
- package/styles.css +1 -1
|
@@ -1266,8 +1266,7 @@ class DynamicSelectFieldComponent {
|
|
|
1266
1266
|
if (!key || !this.form)
|
|
1267
1267
|
return this.config?.placeholder;
|
|
1268
1268
|
const controlValue = this.form.get(key)?.value;
|
|
1269
|
-
|
|
1270
|
-
return this.hasExistingValue(value) ? undefined : this.config?.placeholder;
|
|
1269
|
+
return this.hasExistingValue(controlValue) ? undefined : this.config?.placeholder;
|
|
1271
1270
|
}
|
|
1272
1271
|
ngOnChanges(changes) {
|
|
1273
1272
|
if ('config' in changes) {
|
|
@@ -1331,19 +1330,13 @@ class DynamicSelectFieldComponent {
|
|
|
1331
1330
|
if (!control)
|
|
1332
1331
|
return;
|
|
1333
1332
|
const selectedValue = this.config?.selectedValue;
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
if (this.isMultiple && control.value !== null && control.value !== undefined && control.value.length) {
|
|
1337
|
-
control.setValue([], { emitEvent: false });
|
|
1338
|
-
}
|
|
1339
|
-
else if (!this.isMultiple && this.hasExistingValue(control.value)) {
|
|
1340
|
-
control.setValue(null, { emitEvent: false });
|
|
1341
|
-
}
|
|
1333
|
+
const currentValue = control.value;
|
|
1334
|
+
if (this.hasExistingValue(currentValue)) {
|
|
1342
1335
|
return;
|
|
1343
1336
|
}
|
|
1344
|
-
|
|
1345
|
-
if (this.hasExistingValue(currentValue))
|
|
1337
|
+
if (selectedValue === undefined || selectedValue === null) {
|
|
1346
1338
|
return;
|
|
1339
|
+
}
|
|
1347
1340
|
if (this.isMultiple) {
|
|
1348
1341
|
const normalized = (Array.isArray(selectedValue) ? selectedValue : [selectedValue]).filter((val) => val !== undefined);
|
|
1349
1342
|
if (!normalized.length)
|