mirror of
https://github.com/gristlabs/grist-core.git
synced 2024-10-20 09:04:08 +00:00
c6fd79ac1f
Summary: WIP Test Plan: Existing tests. Reviewers: jarek Reviewed By: jarek Subscribers: jarek Differential Revision: https://phab.getgrist.com/D4196
24 lines
859 B
TypeScript
24 lines
859 B
TypeScript
import {FormLayoutNode, FormLayoutNodeType} from 'app/client/components/FormRenderer';
|
|
import {Columns, Paragraph, Placeholder} from 'app/client/components/Forms/Columns';
|
|
/**
|
|
* 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';
|
|
export * from './Label';
|
|
|
|
export function defaultElement(type: FormLayoutNodeType): FormLayoutNode {
|
|
switch(type) {
|
|
case 'Columns': return Columns();
|
|
case 'Placeholder': return Placeholder();
|
|
case 'Separator': return Paragraph('---');
|
|
case 'Header': return Paragraph('## **Header**', 'center');
|
|
default: return {type};
|
|
}
|
|
}
|