MITHRIL-UI-FORM
This library converts a JSON description to a form, allowing you to:
- Quickly create GUI forms without the normal hassle.
- Comes with basic validation support (it checks whether all required properties are specified).
- The form also supports arrays of objects or strings.
- Can optionally hide and disable elements using the
show
property, which can contain one or more expressions. See the editors array. - Can contain placeholders, e.g. {{ event }}, which will be replaced by the value of
event
. - Can generate IDs automatically (of type
GUID
or a shorter version). - Upon changes, the result object is updated.
Give it a go at the playground.
Use cases
While creating this, I had the following use cases in mind:
- I'm currently working on a scenario editor, which requires me to define a GUI for each message that can be send. Preferably, I would like to use a JSON form that will generate the GUI for me, so I can quickly add new message types.
- I'm also working on a Lessons' Learned Framework (LLF, a GUI with lesson's learned stored in a database). Since different organisations will have different kinds of lessons, it is easier if I make the LLF agnostic for the specific kind of form.
- A slight adaptation of the previous is an online questionnaire: Although there are many open or paid alternatives, like SurveyMonkey or Google Forms, they require you to host your service online. However, when security is important, this may not be an option, so it is better to host it locally on your Intranet or within your VPN.
- Yet another project involves a specification editor: The end user specifies the form, and a specification object is generated. This generated object is processed and rendered to a document. Features I still need to implement are presets, support for a map, and output generation.