@tsed/schema-formio
Version:
Transform Ts.ED Schema & JsonSchema to a valid Formio schema
47 lines (46 loc) • 822 B
JavaScript
import { Component } from "./component.js";
/**
* Adds a conditional display rule on the input form.
* @decorator
* @formio
* @property
* @schema
* @param conditional
*/
export function Conditional(conditional) {
return Component({
conditional
});
}
/**
* Adds a conditional display rule on the input form.
* @decorator
* @formio
* @property
* @schema
* @param property
* @param eq
*/
export function ShowWhen(property, eq) {
return Conditional({
show: true,
when: property,
eq
});
}
/**
* Adds a conditional display rule on the input form.
* @decorator
* @formio
* @property
* @schema
* @param property
* @param eq
*/
export function HideWhen(property, eq) {
return Conditional({
show: false,
when: property,
eq
});
}