UNPKG

@tsed/schema-formio

Version:

Transform Ts.ED Schema & JsonSchema to a valid Formio schema

21 lines (20 loc) 652 B
import { sentenceCase } from "change-case"; import { execMapper, registerFormioMapper } from "../registries/FormioMappersContainer.js"; export function nestedToComponent(schema, options) { return { ...execMapper("default", schema, options), label: false, tableView: false, type: "form", display: "form", input: true, components: [ { key: "panel", label: options.parentKey && sentenceCase(options.parentKey), ...execMapper("panel", schema, options) } ] }; } registerFormioMapper("nested", nestedToComponent);