UNPKG

@tsed/schema-formio

Version:

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

18 lines (15 loc) 498 B
import {execMapper, registerFormioMapper} from "../registries/FormioMappersContainer.js"; export function mapToComponent(schema: any, options: any) { return { ...execMapper("default", schema, options), type: "datamap", tableView: false, input: true, valueComponent: { ...(schema.additionalProperties ? execMapper("any", schema.additionalProperties, options) : {}), hideLabel: true, tableView: true } }; } registerFormioMapper("map", mapToComponent);