@jsonforms/material-renderers 3.0.0-beta.2 → 3.0.0-beta.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +71 -13
- package/docs/assets/js/search.json +1 -1
- package/docs/globals.html +103 -52
- package/docs/index.html +79 -13
- package/docs/interfaces/inputref.html +168 -0
- package/lib/additional/MaterialListWithDetailRenderer.d.ts +1 -1
- package/lib/jsonforms-react-material.cjs.js +47 -19
- package/lib/jsonforms-react-material.cjs.js.map +1 -1
- package/lib/jsonforms-react-material.esm.js +50 -15
- package/lib/jsonforms-react-material.esm.js.map +1 -1
- package/lib/layouts/MaterialArrayLayoutRenderer.d.ts +1 -1
- package/lib/util/datejs.d.ts +17 -1
- package/package.json +7 -7
- package/src/additional/MaterialListWithDetailRenderer.tsx +5 -3
- package/src/complex/MaterialTableControl.tsx +1 -1
- package/src/controls/MaterialDateControl.tsx +23 -6
- package/src/controls/MaterialDateTimeControl.tsx +23 -6
- package/src/controls/MaterialTimeControl.tsx +24 -7
- package/src/layouts/ExpandPanelRenderer.tsx +2 -1
- package/src/layouts/MaterialArrayLayoutRenderer.tsx +3 -25
- package/src/mui-controls/MuiAutocomplete.tsx +1 -0
- package/src/util/datejs.tsx +73 -0
- package/stats.html +1 -1
- package/test/renderers/MaterialArrayLayout.test.tsx +32 -1
- package/test/renderers/MaterialDateControl.test.tsx +27 -0
- package/test/renderers/MaterialDateTimeControl.test.tsx +27 -0
- package/test/renderers/MaterialTimeControl.test.tsx +27 -0
- package/src/util/datejs.ts +0 -32
package/README.md
CHANGED
|
@@ -10,7 +10,7 @@ This is the JSON Forms Material Renderers Package. This package only contains re
|
|
|
10
10
|
|
|
11
11
|
See the official [documentation](https://jsonforms.io/docs/integrations/react/) and the JSON Forms React [seed repository](https://github.com/eclipsesource/jsonforms-react-seed) for examples on how to integrate JSON Forms with your application.
|
|
12
12
|
|
|
13
|
-
You can combine [JSON Forms React](https://github.com/eclipsesource/jsonforms/blob/master/packages/react) with other renderers too, for example with the [Vanilla Renderers](https://github.com/eclipsesource/jsonforms/
|
|
13
|
+
You can combine [JSON Forms React](https://github.com/eclipsesource/jsonforms/blob/master/packages/react) with other renderers too, for example with the [Vanilla Renderers](https://github.com/eclipsesource/jsonforms/tree/master/packages/vanilla).
|
|
14
14
|
|
|
15
15
|
Check <https://www.npmjs.com/search?q=%40jsonforms> for all published JSONForms packages.
|
|
16
16
|
|
|
@@ -24,24 +24,78 @@ npm i --save @jsonforms/core @jsonforms/react @jsonforms/material-renderers
|
|
|
24
24
|
|
|
25
25
|
Use the `JsonForms` component for each form you want to render and hand over the renderer set.
|
|
26
26
|
|
|
27
|
-
|
|
27
|
+
|
|
28
|
+
```ts
|
|
28
29
|
import React, { useState } from 'react';
|
|
30
|
+
import {
|
|
31
|
+
materialRenderers,
|
|
32
|
+
materialCells
|
|
33
|
+
} from '@jsonforms/material-renderers';
|
|
29
34
|
import { JsonForms } from '@jsonforms/react';
|
|
30
|
-
|
|
35
|
+
|
|
36
|
+
const schema = {
|
|
37
|
+
type: 'object',
|
|
38
|
+
properties: {
|
|
39
|
+
name: {
|
|
40
|
+
type: 'string',
|
|
41
|
+
minLength: 1
|
|
42
|
+
},
|
|
43
|
+
done: {
|
|
44
|
+
type: 'boolean'
|
|
45
|
+
},
|
|
46
|
+
due_date: {
|
|
47
|
+
type: 'string',
|
|
48
|
+
format: 'date'
|
|
49
|
+
},
|
|
50
|
+
recurrence: {
|
|
51
|
+
type: 'string',
|
|
52
|
+
enum: ['Never', 'Daily', 'Weekly', 'Monthly']
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
required: ['name', 'due_date']
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
const uischema = {
|
|
59
|
+
type: 'VerticalLayout',
|
|
60
|
+
elements: [
|
|
61
|
+
{
|
|
62
|
+
type: 'Control',
|
|
63
|
+
label: false,
|
|
64
|
+
scope: '#/properties/done'
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
type: 'Control',
|
|
68
|
+
scope: '#/properties/name'
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
type: 'HorizontalLayout',
|
|
72
|
+
elements: [
|
|
73
|
+
{
|
|
74
|
+
type: 'Control',
|
|
75
|
+
scope: '#/properties/due_date'
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
type: 'Control',
|
|
79
|
+
scope: '#/properties/recurrence'
|
|
80
|
+
}
|
|
81
|
+
]
|
|
82
|
+
}
|
|
83
|
+
]
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
const initialData = {};
|
|
31
87
|
|
|
32
88
|
function App() {
|
|
33
89
|
const [data, setData] = useState(initialData);
|
|
34
90
|
return (
|
|
35
|
-
<
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
/>
|
|
44
|
-
</div>
|
|
91
|
+
<JsonForms
|
|
92
|
+
schema={schema}
|
|
93
|
+
uischema={uischema}
|
|
94
|
+
data={data}
|
|
95
|
+
renderers={materialRenderers}
|
|
96
|
+
cells={materialCells}
|
|
97
|
+
onChange={({ data, _errors }) => setData(data)}
|
|
98
|
+
/>
|
|
45
99
|
);
|
|
46
100
|
}
|
|
47
101
|
```
|
|
@@ -62,3 +116,7 @@ If you encounter any problems feel free to [open an issue](https://github.com/ec
|
|
|
62
116
|
For questions and discussions please use the [JSON Forms board](https://jsonforms.discourse.group).
|
|
63
117
|
You can also reach us via [email](mailto:jsonforms@eclipsesource.com?subject=JSON%20Forms).
|
|
64
118
|
In addition, EclipseSource also offers [professional support](https://jsonforms.io/support) for JSON Forms.
|
|
119
|
+
|
|
120
|
+
## Migration
|
|
121
|
+
|
|
122
|
+
See our [migration guide](https://github.com/eclipsesource/jsonforms/blob/master/MIGRATION.md) when updating JSON Forms.
|