Created
February 17, 2018 18:28
-
-
Save cannap/50151c66c1373ca4b31fe7e6f41facdd to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { generateModel } from './components/FormBuilder/utils' | |
const step1 = [ | |
{ | |
type: 'input', | |
inputType: 'text', | |
label: 'Firstname', | |
default: 'wtf', | |
model: 'personal.firstname', | |
placeholder: 'yoo', | |
validator: { | |
rules: 'required', | |
messages: { | |
required: 'Field Required' | |
} | |
} | |
}, | |
{ | |
type: 'input', | |
inputType: 'text', | |
label: 'Lastname', | |
model: 'personal.lastname', | |
placeholder: 'yoo', | |
validator: { | |
rules: 'required', | |
messages: { | |
required: 'Field Required name', | |
number: 'ÔMG' | |
} | |
} | |
}, | |
{ | |
type: 'Checklist', | |
label: 'Art des Projects?', | |
model: 'project.type', | |
values: [ | |
{ | |
value: 'webapp', | |
name: 'Web Application' | |
}, | |
{ | |
value: 'fefef', | |
name: 'Web Application 2' | |
} | |
] | |
} | |
] | |
const step2 = [ | |
{ | |
required: true, | |
type: 'input', | |
inputType: 'text', | |
label: 'Art', | |
model: 'art.some', | |
placeholder: 'yoo' | |
} | |
] | |
const schema = { | |
fields: [ | |
{ | |
required: true, | |
type: 'input', | |
inputType: 'text', | |
label: 'Art', | |
model: 'sigle.field', | |
placeholder: 'yoo' | |
} | |
], | |
groups: [ | |
{ | |
title: 'Step 1', | |
fields: step1 | |
}, | |
{ | |
title: 'Step 2', | |
visible: { | |
field: 'personal.lastname', | |
compare: '===', | |
value: 'yo' | |
}, | |
fields: step2 | |
} | |
] | |
} | |
const model = generateModel(schema) | |
const data = { | |
model, | |
schema | |
} | |
export default data |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment