Skip to content

Commit 29b2bc8

Browse files
committed
Merge pull request #4 from mozilla-services/fields-widgets
Fields & widgets
2 parents 930267d + e1b7a1a commit 29b2bc8

Some content is hidden

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

52 files changed

+604
-135
lines changed

dist/react-jsonschema-form-0.2.0.js

Lines changed: 2 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/react-jsonschema-form-0.2.0.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

fixtures/CheckboxField/default.js

Lines changed: 0 additions & 4 deletions
This file was deleted.

fixtures/ErrorList/index.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
module.exports = {
2+
errors: [
3+
{stack: "error message 1"},
4+
{stack: "error message 2"},
5+
]
6+
};

fixtures/Form/nested-formData.js

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
module.exports = {
2+
schema: {
3+
title: "Todo Tasks",
4+
description: "Tasks collection.",
5+
type: "object",
6+
additionalProperties: false,
7+
required: [
8+
"title", "tasks"
9+
],
10+
properties: {
11+
title: {
12+
type: "string",
13+
title: "Tasks list title",
14+
},
15+
tasks: {
16+
type: "array",
17+
title: "Tasks list",
18+
items: {
19+
type: "object",
20+
properties: {
21+
done: {
22+
type: "boolean",
23+
title: "Done?",
24+
description: "Is that task done already?"
25+
},
26+
title: {
27+
type: "string",
28+
title: "Title",
29+
description: "The task title.",
30+
minLength: 1
31+
}
32+
}
33+
}
34+
}
35+
}
36+
},
37+
formData: {
38+
title: "My tasks",
39+
tasks: [
40+
{title: "Enjoying JSONSchema", done: true},
41+
{title: "Enjoying React", done: true},
42+
{title: "Enjoying react-jsonschema-form", done: false},
43+
]
44+
},
45+
onSubmit: console.log.bind(console, "submit"),
46+
onError: console.log.bind(console, "errors")
47+
};

fixtures/Form/nested-index.js

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
module.exports = {
2+
schema: {
3+
title: "Todo Tasks",
4+
description: "Tasks collection.",
5+
type: "object",
6+
additionalProperties: false,
7+
required: [
8+
"title", "tasks"
9+
],
10+
properties: {
11+
title: {
12+
type: "string",
13+
title: "Tasks list title",
14+
},
15+
tasks: {
16+
type: "array",
17+
title: "Tasks list",
18+
items: {
19+
type: "object",
20+
properties: {
21+
done: {
22+
type: "boolean",
23+
title: "Done?",
24+
description: "Is that task done already?"
25+
},
26+
title: {
27+
type: "string",
28+
title: "Title",
29+
description: "The task title.",
30+
minLength: 1
31+
}
32+
}
33+
}
34+
}
35+
}
36+
},
37+
onSubmit: console.log.bind(console, "submit"),
38+
onError: console.log.bind(console, "errors")
39+
};

fixtures/Form/with-form-data.js renamed to fixtures/Form/simple-formData.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,7 @@ module.exports = {
2424
formData: {
2525
title: "My task",
2626
done: true
27-
}
27+
},
28+
onSubmit: console.log.bind(console, "submit"),
29+
onError: console.log.bind(console, "errors")
2830
};

fixtures/Form/index.js renamed to fixtures/Form/simple-index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,7 @@ module.exports = {
2222
default: "default value"
2323
}
2424
}
25-
}
25+
},
26+
onSubmit: console.log.bind(console, "submit"),
27+
onError: console.log.bind(console, "errors")
2628
};

fixtures/Form/no-default.js renamed to fixtures/Form/simple-nodefault.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,7 @@ module.exports = {
2020
minLength: 1
2121
}
2222
}
23-
}
23+
},
24+
onSubmit: console.log.bind(console, "submit"),
25+
onError: console.log.bind(console, "errors")
2426
};
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
module.exports = {
2+
schema: {
3+
type: "array",
4+
title: "title",
5+
items: {
6+
type: "string",
7+
title: "item"
8+
}
9+
},
10+
onChange: console.log.bind(console)
11+
};

0 commit comments

Comments
 (0)