Skip to content
This repository was archived by the owner on Jun 1, 2020. It is now read-only.

Commit 1a17c39

Browse files
committed
Add more examples. Fix number type property
Add margin-top on TitleField Fixes: #26
1 parent 8c7d334 commit 1a17c39

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+1015
-4
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"currentColor": "#00ff00",
3+
"colorMask": ["#0000ff"],
4+
"colorPalette": ["#ff0000"],
5+
"blendMode": "screen"
6+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import schema from './schema.json';
2+
import uiSchema from './ui-schema.json';
3+
import formData from './form-data.json';
4+
5+
export default {
6+
title: 'Alternatives',
7+
schema,
8+
uiSchema,
9+
formData,
10+
};
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
{
2+
"definitions": {
3+
"Color": {
4+
"title": "Color",
5+
"type": "string",
6+
"anyOf": [
7+
{
8+
"type": "string",
9+
"enum": ["#ff0000"],
10+
"title": "Red"
11+
},
12+
{
13+
"type": "string",
14+
"enum": ["#00ff00"],
15+
"title": "Green"
16+
},
17+
{
18+
"type": "string",
19+
"enum": ["#0000ff"],
20+
"title": "Blue"
21+
}
22+
]
23+
},
24+
"Toggle": {
25+
"title": "Toggle",
26+
"type": "boolean",
27+
"oneOf": [
28+
{
29+
"title": "Enable",
30+
"const": true
31+
},
32+
{
33+
"title": "Disable",
34+
"const": false
35+
}
36+
]
37+
}
38+
},
39+
"title": "Image editor",
40+
"type": "object",
41+
"required": ["currentColor", "colorMask", "blendMode"],
42+
"properties": {
43+
"currentColor": {
44+
"$ref": "#/definitions/Color",
45+
"title": "Brush color"
46+
},
47+
"colorMask": {
48+
"type": "array",
49+
"uniqueItems": true,
50+
"items": {
51+
"$ref": "#/definitions/Color"
52+
},
53+
"title": "Color mask"
54+
},
55+
"toggleMask": {
56+
"title": "Apply color mask",
57+
"$ref": "#/definitions/Toggle"
58+
},
59+
"colorPalette": {
60+
"type": "array",
61+
"title": "Color palette",
62+
"items": {
63+
"$ref": "#/definitions/Color"
64+
}
65+
},
66+
"blendMode": {
67+
"title": "Blend mode",
68+
"type": "string",
69+
"enum": ["screen", "multiply", "overlay"],
70+
"enumNames": ["Screen", "Multiply", "Overlay"]
71+
}
72+
}
73+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"blendMode": {
3+
"ui:enumDisabled": ["multiply"]
4+
},
5+
"toggleMask": {
6+
"ui:widget": "radio"
7+
}
8+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"firstName": "Chuck"
3+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import schema from './schema.json';
2+
import uiSchema from './ui-schema.json';
3+
import formData from './form-data.json';
4+
5+
export default {
6+
title: 'Any Of',
7+
schema,
8+
uiSchema,
9+
formData,
10+
};
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
{
2+
"type": "object",
3+
"properties": {
4+
"age": {
5+
"type": "integer",
6+
"title": "Age"
7+
},
8+
"items": {
9+
"type": "array",
10+
"items": {
11+
"type": "object",
12+
"anyOf": [
13+
{
14+
"properties": {
15+
"foo": {
16+
"type": "string"
17+
}
18+
}
19+
},
20+
{
21+
"properties": {
22+
"bar": {
23+
"type": "string"
24+
}
25+
}
26+
}
27+
]
28+
}
29+
}
30+
},
31+
"anyOf": [
32+
{
33+
"title": "First method of identification",
34+
"properties": {
35+
"firstName": {
36+
"type": "string",
37+
"title": "First name",
38+
"default": "Chuck"
39+
},
40+
"lastName": {
41+
"type": "string",
42+
"title": "Last name"
43+
}
44+
}
45+
},
46+
{
47+
"title": "Second method of identification",
48+
"properties": {
49+
"idCode": {
50+
"type": "string",
51+
"title": "ID code"
52+
}
53+
}
54+
}
55+
]
56+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
["react", "jsonschema", "form"]
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import schema from './schema.json';
2+
import uiSchema from './ui-schema.json';
3+
import formData from './form-data.json';
4+
5+
export default {
6+
title: 'Custom Array',
7+
schema,
8+
uiSchema,
9+
formData,
10+
};

0 commit comments

Comments
 (0)