@stemy/ngx-dynamic-form 13.1.18 → 13.1.19
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 +9 -4
- package/fesm2015/stemy-ngx-dynamic-form.mjs +7 -2
- package/fesm2015/stemy-ngx-dynamic-form.mjs.map +1 -1
- package/fesm2020/stemy-ngx-dynamic-form.mjs +8 -3
- package/fesm2020/stemy-ngx-dynamic-form.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -729,6 +729,7 @@ class DynamicFormService extends DynamicFormService$1 {
|
|
|
729
729
|
const subSchemas = findRefs(property).map(ref => this.schemas[ref]);
|
|
730
730
|
return Object.assign(this.getFormControlConfig(property, schema), {
|
|
731
731
|
groupFactory: () => mergeFormModels(subSchemas.map(s => this.getFormModelForSchemaDef(s, customizeModels))),
|
|
732
|
+
initialCount: property.initialCount || 0,
|
|
732
733
|
sortable: property.sortable || false,
|
|
733
734
|
useTabs: property.useTabs || false,
|
|
734
735
|
addItem: property.addItem !== false,
|
|
@@ -853,10 +854,14 @@ class DynamicFormService extends DynamicFormService$1 {
|
|
|
853
854
|
}
|
|
854
855
|
return new FormSelectSubject(async (selectModel, control) => {
|
|
855
856
|
this.api.cache[property.endpoint] = this.api.cache[property.endpoint] || this.api.list(property.endpoint, this.api.makeListParams(1, -1)).then(result => {
|
|
856
|
-
|
|
857
|
+
const items = ObjectUtils.isArray(result)
|
|
858
|
+
? result
|
|
859
|
+
: (ObjectUtils.isArray(result.items) ? result.items : []);
|
|
860
|
+
return items.map(i => {
|
|
861
|
+
const item = ObjectUtils.isObject(i) ? i : { id: i };
|
|
857
862
|
return {
|
|
858
|
-
...
|
|
859
|
-
value:
|
|
863
|
+
...item,
|
|
864
|
+
value: item.id || item._id, label: item[property.labelField] || item.label || item.id || item._id
|
|
860
865
|
};
|
|
861
866
|
});
|
|
862
867
|
});
|