UNPKG

jsonform

Version:

Client-side JavaScript library that generates HTML forms from structured data models expressed using a JSON schema, possibly completed by a form layout description.

74 lines (73 loc) 1.37 kB
var tests = [ { name: 'minimal', jsonform: { schema: { text: { type: 'string', title: 'Text field' }, nb: { type: 'number', title: 'Number' } }, form: [ { type: 'section', title: 'Section that contains fields', items: [ 'text', 'nb' ] } ] } }, { name: 'tabarray', jsonform: { schema: { arr: { type: 'array', title: 'An array', items: { type: 'object', title: 'Array item', properties: { name: { type: 'string', title: 'Name' }, age: { type: 'number', title: 'Age' } } } } }, form: [ { type: 'tabarray', items: [ { type: 'section', title: 'Number {{idx}}', items: [ { key: 'arr[].name', title: 'Name' }, { key: 'arr[].age', title: 'Age' } ] } ] } ] } } ];