mmhglobal-dynamicform 2.7.0 → 2.7.1
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/README.md +5 -0
- package/esm2020/lib/services/main.service.mjs +2 -2
- package/esm2020/lib/zform/zform.component.mjs +8 -4
- package/esm2020/lib/zudf/zudf.component.mjs +6 -1
- package/fesm2015/mmhglobal-dynamicform.mjs +13 -4
- package/fesm2015/mmhglobal-dynamicform.mjs.map +1 -1
- package/fesm2020/mmhglobal-dynamicform.mjs +13 -4
- package/fesm2020/mmhglobal-dynamicform.mjs.map +1 -1
- package/lib/zudf/zudf.component.d.ts +1 -0
- package/package.json +1 -1
|
@@ -1611,7 +1611,7 @@ class ZformComponent {
|
|
|
1611
1611
|
console.error('Field Name Duplication: ' + field.Name + '; ', field);
|
|
1612
1612
|
}
|
|
1613
1613
|
}
|
|
1614
|
-
getFormControls(fieldArray, formControls) {
|
|
1614
|
+
getFormControls(fieldArray, formControls, containerIsVisible = true) {
|
|
1615
1615
|
fieldArray.forEach(field => {
|
|
1616
1616
|
if (!field.SubType) {
|
|
1617
1617
|
this.addToFieldIndex(field);
|
|
@@ -1623,13 +1623,17 @@ class ZformComponent {
|
|
|
1623
1623
|
}
|
|
1624
1624
|
else {
|
|
1625
1625
|
if (Array.isArray(field.Value)) {
|
|
1626
|
-
|
|
1626
|
+
const containerIsVisible = ZComponentHelper.isVisibleFormControl(this, field);
|
|
1627
|
+
this.getFormControls(field.Value, formControls, containerIsVisible);
|
|
1627
1628
|
}
|
|
1628
1629
|
else {
|
|
1629
|
-
this.fieldService.incrementComponentCounter(field.FieldElementName);
|
|
1630
1630
|
const isFormControl = ZComponentHelper.isFormControl(field);
|
|
1631
1631
|
const isVisible = ZComponentHelper.isVisibleFormControl(this, field);
|
|
1632
1632
|
const isRequired = ZComponentHelper.isRequiredFormControl(this, field);
|
|
1633
|
+
// if container || control visible == false, dont increase the counter.
|
|
1634
|
+
if (isVisible && containerIsVisible) {
|
|
1635
|
+
this.fieldService.incrementComponentCounter(field.FieldElementName);
|
|
1636
|
+
}
|
|
1633
1637
|
if (isFormControl === true) {
|
|
1634
1638
|
const validators = ZComponentHelper.getValidators(field, isVisible, isRequired);
|
|
1635
1639
|
formControls[field.Value] = new FormControl(this.group.zModel[field.Value], validators);
|
|
@@ -2646,7 +2650,7 @@ class MainService {
|
|
|
2646
2650
|
}
|
|
2647
2651
|
return of(false);
|
|
2648
2652
|
}
|
|
2649
|
-
updateAPIObservable = updateAPIObservable || this.webApiService.httpPut$(group.resourceURL + "/" + group.zModel.Id, group.zModel, false
|
|
2653
|
+
updateAPIObservable = updateAPIObservable || this.webApiService.httpPut$(group.resourceURL + "/" + group.zModel.Id, group.zModel, false).pipe(tap$1((res) => {
|
|
2650
2654
|
this.handleSuccess(res, resMessage);
|
|
2651
2655
|
}
|
|
2652
2656
|
//this.handleSuccess(res, "Record is updated successfully.")
|
|
@@ -11747,6 +11751,11 @@ class ZudfComponent extends ContainerFieldBase {
|
|
|
11747
11751
|
this.isLoading = false;
|
|
11748
11752
|
})).subscribe();
|
|
11749
11753
|
}
|
|
11754
|
+
ngOnDestroy() {
|
|
11755
|
+
if (this.subscription) {
|
|
11756
|
+
this.subscription.unsubscribe();
|
|
11757
|
+
}
|
|
11758
|
+
}
|
|
11750
11759
|
/**
|
|
11751
11760
|
* Renders the field element and sets up the form.
|
|
11752
11761
|
*/
|