mmhglobal-dynamicform 2.3.0 → 2.3.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/README.md +6 -0
- package/esm2020/lib/zudf/zudf.component.mjs +19 -17
- package/fesm2015/mmhglobal-dynamicform.mjs +19 -17
- package/fesm2015/mmhglobal-dynamicform.mjs.map +1 -1
- package/fesm2020/mmhglobal-dynamicform.mjs +18 -16
- package/fesm2020/mmhglobal-dynamicform.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -11750,22 +11750,24 @@ class ZudfComponent extends ContainerFieldBase {
|
|
|
11750
11750
|
this.subscription = this.componentService.componentLoaded$.subscribe(() => {
|
|
11751
11751
|
// All components have finished loading
|
|
11752
11752
|
const zudfGroup = this.group[this.componentScopeName];
|
|
11753
|
-
zudfGroup['linkedComponent']
|
|
11754
|
-
|
|
11755
|
-
|
|
11756
|
-
|
|
11757
|
-
|
|
11758
|
-
|
|
11759
|
-
|
|
11760
|
-
|
|
11761
|
-
|
|
11762
|
-
|
|
11763
|
-
|
|
11764
|
-
|
|
11765
|
-
|
|
11766
|
-
|
|
11767
|
-
|
|
11768
|
-
|
|
11753
|
+
if (zudfGroup['linkedComponent']) {
|
|
11754
|
+
zudfGroup['linkedComponent'].forEach(item => {
|
|
11755
|
+
const linkedComponentSegments = item.value.split('_');
|
|
11756
|
+
const parentComponentName = linkedComponentSegments.slice(0, 2).join('_') + '_' + item.linkedComponent;
|
|
11757
|
+
const parentComponent = ZComponentHelper.getComponentByValue(this.group, parentComponentName);
|
|
11758
|
+
const childComponent = ZComponentHelper.getComponentByValue(this.group, item.value);
|
|
11759
|
+
if (parentComponent && childComponent) {
|
|
11760
|
+
const originalSelectOptions = childComponent.data['originalSelectOptions'] ?? Object.assign([], childComponent.data.SelectOptions);
|
|
11761
|
+
const filteredSelectionOptions = originalSelectOptions.filter(option => option.parentExpression == zudfGroup.zModel[parentComponentName]);
|
|
11762
|
+
// Manually patch the component form control value
|
|
11763
|
+
const zudfForm = zudfGroup.form;
|
|
11764
|
+
const componentFormControl = zudfForm.controls[item.value];
|
|
11765
|
+
childComponent.setSelectOption(filteredSelectionOptions);
|
|
11766
|
+
componentFormControl.patchValue(zudfGroup.zModel[item.value]);
|
|
11767
|
+
this.cdr.detectChanges();
|
|
11768
|
+
}
|
|
11769
|
+
});
|
|
11770
|
+
}
|
|
11769
11771
|
// To consider: Trigger the "onchange" event or perform any other necessary actions here
|
|
11770
11772
|
});
|
|
11771
11773
|
}
|