@tsed/schema-formio
Version:
Transform Ts.ED Schema & JsonSchema to a valid Formio schema
20 lines (19 loc) • 442 B
JavaScript
import { CustomKey, JsonEntityFn } from "@tsed/schema";
import { Component } from "./component.js";
/**
* Change the label field
* @decorator
* @formio
* @property
* @schema
* @param label
*/
export function Label(label) {
return JsonEntityFn((entity) => {
return entity.decoratorType === "property"
? Component({
label
})
: CustomKey("x-formio-label", label);
});
}