@mitcsutt/kiln-forms
Version:
Kiln forms: typed React forms on TanStack Form, in component or JSON schema mode, rendered through kiln-ui
50 lines (49 loc) • 1.02 kB
JavaScript
import { defaultLayouts as e } from "./layouts.js";
import { SchemaFormRenderer as t, SchemaNodeRenderer as n } from "./SchemaForm.js";
import { jsx as r } from "react/jsx-runtime";
//#region src/schema/render/kitSchema.tsx
function i(e) {
let t = {};
for (let [n, r] of Object.entries(e ?? {})) r !== void 0 && (t[n] = r);
return t;
}
function a(t, n) {
return {
fields: t,
layouts: {
...e,
...i(n.layouts)
},
loaders: i(n.loaders),
validators: i(n.validators),
computers: i(n.computers),
nodes: i(n.nodes)
};
}
function o(e) {
function i(n) {
return /* @__PURE__ */ r(t, {
form: n.form,
schema: n.schema,
context: n.context,
registries: e
});
}
function a(t) {
return /* @__PURE__ */ r(n, {
form: t.form,
schema: t.schema,
context: t.context,
registries: e,
id: t.id,
prefix: t.prefix
});
}
return {
SchemaForm: i,
SchemaNode: a
};
}
//#endregion
export { o as createSchemaComponents, a as schemaRegistries };
//# sourceMappingURL=kitSchema.js.map