schema-components 1.12.4 → 1.12.5
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/dist/react/headless.mjs +4 -1
- package/package.json +1 -1
package/dist/react/headless.mjs
CHANGED
|
@@ -249,6 +249,8 @@ function renderObject(props) {
|
|
|
249
249
|
updated[key] = v;
|
|
250
250
|
props.onChange(updated);
|
|
251
251
|
};
|
|
252
|
+
const child = toReactNode(props.renderChild(field, childValue, childOnChange));
|
|
253
|
+
if (child === null || child === void 0) return null;
|
|
252
254
|
return /* @__PURE__ */ jsxs("div", { children: [typeof field.meta.description === "string" && /* @__PURE__ */ jsxs("label", {
|
|
253
255
|
htmlFor: childId,
|
|
254
256
|
children: [field.meta.description, field.isOptional === false && /* @__PURE__ */ jsxs("span", {
|
|
@@ -256,7 +258,7 @@ function renderObject(props) {
|
|
|
256
258
|
style: { color: "#dc2626" },
|
|
257
259
|
children: [" ", "*"]
|
|
258
260
|
})]
|
|
259
|
-
}),
|
|
261
|
+
}), child] }, key);
|
|
260
262
|
})] });
|
|
261
263
|
}
|
|
262
264
|
function renderRecord(props) {
|
|
@@ -290,6 +292,7 @@ function renderArray(props) {
|
|
|
290
292
|
const arr = Array.isArray(props.value) ? props.value : [];
|
|
291
293
|
const element = props.element;
|
|
292
294
|
if (element === void 0) return null;
|
|
295
|
+
if (props.readOnly && arr.length === 0) return null;
|
|
293
296
|
return /* @__PURE__ */ jsx("div", {
|
|
294
297
|
role: "group",
|
|
295
298
|
"aria-label": props.meta.description ?? void 0,
|