synapse-react-client
Version:
[](https://badge.fury.io/js/synapse-react-client) [](https://github.com/prettier/prettie
56 lines (55 loc) • 1.46 kB
JavaScript
import { jsx as r, jsxs as i } from "react/jsx-runtime";
import { RJSFInputLabelWrapper as x } from "./RJSFInputLabel.js";
import { GridLegacy as y, InputLabel as I } from "@mui/material";
import { getUiOptions as T, getTemplate as j } from "@rjsf/utils";
function E(e) {
const {
id: n,
label: o,
children: a,
errors: d,
help: m,
description: c,
hidden: p,
required: h,
displayLabel: u,
registry: t,
uiSchema: f,
schema: b,
hideError: L,
rawErrors: l
} = e, g = T(f), N = j("WrapIfAdditionalTemplate", t, g);
if (p)
return /* @__PURE__ */ r("div", { className: "hidden", children: a });
const s = ["form-group", e.classNames || ""];
return !L && l && l.length > 0 && s.push("has-error"), /* @__PURE__ */ i(
N,
{
...e,
classNames: s.join(" ").trim(),
children: [
/* @__PURE__ */ i(
x,
{
hideLabel: !(u || b.type === "boolean"),
fieldLabel: /* @__PURE__ */ i(I, { htmlFor: n, children: [
o,
h && /* @__PURE__ */ r("span", { className: "required", children: "*" })
] }),
description: c,
registry: t,
children: [
a,
/* @__PURE__ */ r(y, { item: !0, xs: 12, children: d })
]
}
),
m
]
}
);
}
export {
E as FieldTemplate
};
//# sourceMappingURL=FieldTemplate.js.map