@tsed/schema-formio
Version:
Transform Ts.ED Schema & JsonSchema to a valid Formio schema
16 lines (15 loc) • 534 B
JavaScript
import { execMapper, registerFormioMapper } from "../registries/FormioMappersContainer.js";
export function mapToComponent(schema, options) {
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);