/
index.tsx
62 lines (56 loc) · 1.38 KB
/
index.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
import * as React from 'react'
import * as ReactDOM from 'react-dom'
import 'antd/dist/antd.css'
import {FormMaker, ProtoBench, WorkBench, EditBench} from '@ekoneko/form-maker'
import {item as InputField} from './components/FormFIelds/Input'
import {item as CheckboxField} from './components/FormFIelds/Checkbox'
import {item as RadioField} from './components/FormFIelds/Radio'
import {item as DatePicker} from './components/FormFIelds/DatePicker'
import {item as DateScope} from './components/FormFIelds/DateScope'
const formFields = [
InputField,
CheckboxField,
RadioField,
DatePicker,
DateScope,
]
const protoBenchStyle = {
width: '15%',
float: 'left',
padding: 10,
}
const workBenchStyle = {
float: 'left',
width: '60%',
height: 500,
border: '1px dashed #ccc',
padding: 10,
}
const editBenchStyle = {
float: 'left',
width: '15%',
padding: 10,
}
class App extends React.PureComponent<any, any> {
handleChange = (results) => {
// output struct
console.log(results)
}
render() {
return (
<FormMaker>
<ProtoBench
protoList={formFields}
style={protoBenchStyle}
/>
<WorkBench
onChange={this.handleChange}
style={workBenchStyle}
/>
<EditBench style={editBenchStyle} />
</FormMaker>
)
}
}
const root = document.getElementById('root')
ReactDOM.render(<App />, root)