@stemy/ngx-dynamic-form 13.3.8 → 13.3.10
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/ngx-dynamic-form/services/dynamic-form.service.mjs +17 -3
- package/fesm2015/stemy-ngx-dynamic-form.mjs +16 -2
- package/fesm2015/stemy-ngx-dynamic-form.mjs.map +1 -1
- package/fesm2020/stemy-ngx-dynamic-form.mjs +15 -2
- package/fesm2020/stemy-ngx-dynamic-form.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -668,9 +668,18 @@ class DynamicFormService extends DynamicFormService$1 {
|
|
|
668
668
|
};
|
|
669
669
|
const schema = this.schemas[name];
|
|
670
670
|
const controls = await this.getFormModelForSchemaDef(schema, fieldSets, customizeModels);
|
|
671
|
+
const idFields = [
|
|
672
|
+
createFormInput("id", { hidden: true }),
|
|
673
|
+
createFormInput("_id", { hidden: true })
|
|
674
|
+
].filter(t => !controls.some(c => c.id == t.id));
|
|
671
675
|
const config = {
|
|
672
676
|
id: "root",
|
|
673
|
-
group: [
|
|
677
|
+
group: [
|
|
678
|
+
// -- Hidden id fields --
|
|
679
|
+
...idFields,
|
|
680
|
+
// -- Main form controls --
|
|
681
|
+
...controls
|
|
682
|
+
],
|
|
674
683
|
fieldSets
|
|
675
684
|
};
|
|
676
685
|
const root = await customizeModels({
|
|
@@ -931,7 +940,11 @@ class DynamicFormService extends DynamicFormService$1 {
|
|
|
931
940
|
});
|
|
932
941
|
}
|
|
933
942
|
return new FormSelectSubject(async (selectModel, control) => {
|
|
934
|
-
|
|
943
|
+
const entries = Object.entries(control.root?.value || {});
|
|
944
|
+
const endpoint = entries.reduce((res, [key, value]) => {
|
|
945
|
+
return res.replace(new RegExp(`$${key}`, "gi"), `${value}`);
|
|
946
|
+
}, `${property.endpoint}`);
|
|
947
|
+
this.api.cache[endpoint] = this.api.cache[endpoint] || this.api.list(endpoint, this.api.makeListParams(1, -1)).then(result => {
|
|
935
948
|
const items = ObjectUtils.isArray(result)
|
|
936
949
|
? result
|
|
937
950
|
: (ObjectUtils.isArray(result.items) ? result.items : []);
|