@nolwenture/formik-jsonschema-form 1.3.9 → 1.4.0
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.
|
@@ -105,14 +105,11 @@ const ObjectField = (props) => {
|
|
|
105
105
|
}, style: { display: "none" } }, child));
|
|
106
106
|
}), showAdditionalProperties &&
|
|
107
107
|
orderedAdditionalProperties.map((childName, index) => {
|
|
108
|
-
let correctUiSchema =
|
|
109
|
-
|
|
110
|
-
uiSchema?.
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
"ui:order": uiSchema.properties?.["ui:order"],
|
|
114
|
-
};
|
|
115
|
-
}
|
|
108
|
+
let correctUiSchema = {
|
|
109
|
+
...(uiSchema?.additionalProperties ?? {}),
|
|
110
|
+
...(uiSchema?.properties ?? {}),
|
|
111
|
+
...(uiSchema?.[childName] ?? {}),
|
|
112
|
+
};
|
|
116
113
|
return ((0, jsx_runtime_1.jsxs)(ObjectFieldItem, { children: [(0, jsx_runtime_1.jsx)(SchemaField, { required: required?.includes(childName), name: name ? [name, childName].join(".") : childName, schema: prepareChildSchema(schema.additionalProperties, schema), uiSchema: correctUiSchema }, childName), (0, jsx_runtime_1.jsxs)(ObjectFieldItemButtons, { children: [onAdditionalPropertyOrderChange &&
|
|
117
114
|
index > 0 &&
|
|
118
115
|
getObjectFieldButton({
|
|
@@ -14,9 +14,8 @@ function solveReferences(schema, definitions, uiSchema, uiSchemaDefinitions) {
|
|
|
14
14
|
const path = pathParts.slice(2).join(".");
|
|
15
15
|
const uiPath = pathParts
|
|
16
16
|
.slice(2)
|
|
17
|
-
.join(".")
|
|
18
|
-
.replaceAll(/\.
|
|
19
|
-
.replaceAll(/\.additionalItems/g, ".items");
|
|
17
|
+
.join(".")
|
|
18
|
+
.replaceAll(/\.properties(\.\w+)?/g, "$1");
|
|
20
19
|
// TODO: Should we overwrite rather than merge? Maybe add a flag for choosing the behavior?
|
|
21
20
|
solvedSchema = (0, mergeSchemas_1.mergeSchemas)((0, formik_1.getIn)(definitions, path) ?? {}, schema ?? {});
|
|
22
21
|
delete solvedSchema.$ref;
|
|
@@ -102,14 +102,11 @@ export const ObjectField = (props) => {
|
|
|
102
102
|
}, style: { display: "none" } }, child));
|
|
103
103
|
}), showAdditionalProperties &&
|
|
104
104
|
orderedAdditionalProperties.map((childName, index) => {
|
|
105
|
-
let correctUiSchema =
|
|
106
|
-
|
|
107
|
-
uiSchema?.
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
"ui:order": uiSchema.properties?.["ui:order"],
|
|
111
|
-
};
|
|
112
|
-
}
|
|
105
|
+
let correctUiSchema = {
|
|
106
|
+
...(uiSchema?.additionalProperties ?? {}),
|
|
107
|
+
...(uiSchema?.properties ?? {}),
|
|
108
|
+
...(uiSchema?.[childName] ?? {}),
|
|
109
|
+
};
|
|
113
110
|
return (_jsxs(ObjectFieldItem, { children: [_jsx(SchemaField, { required: required?.includes(childName), name: name ? [name, childName].join(".") : childName, schema: prepareChildSchema(schema.additionalProperties, schema), uiSchema: correctUiSchema }, childName), _jsxs(ObjectFieldItemButtons, { children: [onAdditionalPropertyOrderChange &&
|
|
114
111
|
index > 0 &&
|
|
115
112
|
getObjectFieldButton({
|
|
@@ -11,9 +11,8 @@ export function solveReferences(schema, definitions, uiSchema, uiSchemaDefinitio
|
|
|
11
11
|
const path = pathParts.slice(2).join(".");
|
|
12
12
|
const uiPath = pathParts
|
|
13
13
|
.slice(2)
|
|
14
|
-
.join(".")
|
|
15
|
-
.replaceAll(/\.
|
|
16
|
-
.replaceAll(/\.additionalItems/g, ".items");
|
|
14
|
+
.join(".")
|
|
15
|
+
.replaceAll(/\.properties(\.\w+)?/g, "$1");
|
|
17
16
|
// TODO: Should we overwrite rather than merge? Maybe add a flag for choosing the behavior?
|
|
18
17
|
solvedSchema = mergeSchemas(getIn(definitions, path) ?? {}, schema ?? {});
|
|
19
18
|
delete solvedSchema.$ref;
|