forked from eclipsesource/jsonforms
-
Notifications
You must be signed in to change notification settings - Fork 0
/
form-fusebit.html
65 lines (60 loc) · 2.02 KB
/
form-fusebit.html
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
63
64
65
<!DOCTYPE html>
<html>
<head>
<script src="https://unpkg.com/@babel/standalone/babel.min.js"></script>
<script src="https://cdn.fusebit.io/fusebit/js/fusebit-form/latest/react.production.min.js"></script>
<script src="https://cdn.fusebit.io/fusebit/js/fusebit-form/latest/react-dom.production.min.js"></script>
<script src="https://cdn.fusebit.io/fusebit/js/fusebit-form/latest/material-ui.production.min.js"></script>
<script>
MaterialUI.default = MaterialUI;
</script>
<script src="https://cdn.fusebit.io/fusebit/js/fusebit-form/latest/jsonforms-core.js"></script>
<script src="https://cdn.fusebit.io/fusebit/js/fusebit-form/latest/jsonforms-react.js"></script>
<script src="https://cdn.fusebit.io/fusebit/js/fusebit-form/latest/jsonforms-material.js"></script>
</head>
<body>
<div id="root"></div>
<script type="text/babel" crossorigin>
const { createMuiTheme, ThemeProvider } = MaterialUI;
function App() {
const renderers = JSONFormsMaterial.materialRenderers;
const cells = JSONFormsMaterial.materialCells;
const schema = {
type: 'object',
properties: {
name: { label: 'schemalabel', type: 'string', minLength: 3 }
}
};
const uischema = {
type: 'VerticalLayout',
elements: [
{
type: 'Control',
label: 'uischemalabel',
scope: '#/properties/name'
}
]
};
const data = { name: 'John Doe' };
const id = 'foobar2';
return (
<div>
<JSONFormsReact.JsonForms
renderers={renderers}
cells={cells}
schema={schema}
uischema={uischema}
data={data}
/>
</div>
);
}
ReactDOM.render(
<ThemeProvider theme={createMuiTheme({})}>
<App />
</ThemeProvider>,
document.getElementById('root')
);
</script>
</body>
</html>