2024-01-23 20:52:57 +00:00
|
|
|
import {Columns, Paragraph, Placeholder} from 'app/client/components/Forms/Columns';
|
|
|
|
import {Box, BoxType} from 'app/common/Forms';
|
2023-12-12 09:58:20 +00:00
|
|
|
/**
|
|
|
|
* Add any other element you whish to use in the form here.
|
|
|
|
* FormView will look for any exported BoxModel derived class in format `type` + `Model`, and use It
|
|
|
|
* to render and manage the element.
|
|
|
|
*/
|
|
|
|
export * from "./Paragraph";
|
|
|
|
export * from "./Section";
|
|
|
|
export * from './Field';
|
|
|
|
export * from './Columns';
|
|
|
|
export * from './Submit';
|
2024-01-18 17:23:50 +00:00
|
|
|
export * from './Label';
|
2023-12-12 09:58:20 +00:00
|
|
|
|
|
|
|
export function defaultElement(type: BoxType): Box {
|
|
|
|
switch(type) {
|
|
|
|
case 'Columns': return Columns();
|
|
|
|
case 'Placeholder': return Placeholder();
|
2024-01-23 20:52:57 +00:00
|
|
|
case 'Separator': return Paragraph('---');
|
|
|
|
case 'Header': return Paragraph('## **Header**', 'center');
|
2023-12-12 09:58:20 +00:00
|
|
|
default: return {type};
|
|
|
|
}
|
|
|
|
}
|