onshore-forms 0.0.47 → 0.0.49
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/form-item-container/form-item-container.component.mjs +7 -1
- package/esm2020/lib/onshore-forms.service.mjs +3 -3
- package/fesm2015/onshore-forms.mjs +8 -2
- package/fesm2015/onshore-forms.mjs.map +1 -1
- package/fesm2020/onshore-forms.mjs +8 -2
- package/fesm2020/onshore-forms.mjs.map +1 -1
- package/lib/onshore-forms.service.d.ts +1 -1
- package/package.json +1 -1
|
@@ -156,7 +156,7 @@ class OnshoreFormsService {
|
|
|
156
156
|
formGroup(form, name) {
|
|
157
157
|
return form.get(name);
|
|
158
158
|
}
|
|
159
|
-
addFormArrayItem(formArray, item) {
|
|
159
|
+
addFormArrayItem(formArray, item, value = null) {
|
|
160
160
|
let formControls = {};
|
|
161
161
|
if (item) {
|
|
162
162
|
item.subformArray?.forEach((subitem) => {
|
|
@@ -169,7 +169,7 @@ class OnshoreFormsService {
|
|
|
169
169
|
}
|
|
170
170
|
}
|
|
171
171
|
else {
|
|
172
|
-
formControls[subitem.name] = new FormControl(subitem.default !== undefined ? subitem.default : '', {
|
|
172
|
+
formControls[subitem.name] = new FormControl(value ?? (subitem.default !== undefined ? subitem.default : ''), {
|
|
173
173
|
validators: subitem.validators || [],
|
|
174
174
|
updateOn: 'change'
|
|
175
175
|
});
|
|
@@ -401,6 +401,9 @@ class OnshoreFormItemContainer {
|
|
|
401
401
|
this.disabled = true;
|
|
402
402
|
}
|
|
403
403
|
this.layout = this.formTemplate.layout;
|
|
404
|
+
setTimeout(() => {
|
|
405
|
+
this.cdr.markForCheck();
|
|
406
|
+
}, 100);
|
|
404
407
|
}
|
|
405
408
|
ngAfterViewInit() {
|
|
406
409
|
this.onWindowResize();
|
|
@@ -427,6 +430,9 @@ class OnshoreFormItemContainer {
|
|
|
427
430
|
this.layout = this.formTemplate.layout;
|
|
428
431
|
this.onWindowResize();
|
|
429
432
|
}
|
|
433
|
+
if (previousValue?.labelStyle !== currentValue?.labelStyle) {
|
|
434
|
+
this.onWindowResize();
|
|
435
|
+
}
|
|
430
436
|
this.cdr.markForCheck();
|
|
431
437
|
}
|
|
432
438
|
}
|