@rxap/forms 13.0.3 → 13.0.4
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/form-array.mjs +12 -11
- package/esm2020/lib/types.mjs +1 -1
- package/fesm2015/rxap-forms.mjs +11 -10
- package/fesm2015/rxap-forms.mjs.map +1 -1
- package/fesm2020/rxap-forms.mjs +11 -10
- package/fesm2020/rxap-forms.mjs.map +1 -1
- package/lib/types.d.ts +1 -7
- package/package.json +1 -1
package/fesm2020/rxap-forms.mjs
CHANGED
|
@@ -241,18 +241,19 @@ class RxapFormArray extends FormArray {
|
|
|
241
241
|
// `undefined` as a value.
|
|
242
242
|
if (value == null /* both `null` and `undefined` */)
|
|
243
243
|
return;
|
|
244
|
-
|
|
244
|
+
if (options?.strict) {
|
|
245
|
+
if (this.length > value.length) {
|
|
246
|
+
for (let index = this.length - 1; index >= value.length; index--) {
|
|
247
|
+
this.removeAt(index);
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
}
|
|
245
251
|
value.forEach((newValue, index) => {
|
|
246
|
-
if (
|
|
247
|
-
this.
|
|
252
|
+
if (this.at(index)) {
|
|
253
|
+
this.at(index).patchValue(newValue, { ...(options ?? {}), onlySelf: true });
|
|
248
254
|
}
|
|
249
|
-
else {
|
|
250
|
-
|
|
251
|
-
this.at(index).patchValue(newValue, { ...(options ?? {}), onlySelf: true });
|
|
252
|
-
}
|
|
253
|
-
else if (options?.coerce) {
|
|
254
|
-
this.insertAt(index, value[index]);
|
|
255
|
-
}
|
|
255
|
+
else if (options?.coerce) {
|
|
256
|
+
this.insertAt(index, value[index]);
|
|
256
257
|
}
|
|
257
258
|
});
|
|
258
259
|
this.updateValueAndValidity(options);
|