-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from mozilla-services/fields-widgets
Fields & widgets
- Loading branch information
Showing
52 changed files
with
604 additions
and
135 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
module.exports = { | ||
errors: [ | ||
{stack: "error message 1"}, | ||
{stack: "error message 2"}, | ||
] | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
module.exports = { | ||
schema: { | ||
title: "Todo Tasks", | ||
description: "Tasks collection.", | ||
type: "object", | ||
additionalProperties: false, | ||
required: [ | ||
"title", "tasks" | ||
], | ||
properties: { | ||
title: { | ||
type: "string", | ||
title: "Tasks list title", | ||
}, | ||
tasks: { | ||
type: "array", | ||
title: "Tasks list", | ||
items: { | ||
type: "object", | ||
properties: { | ||
done: { | ||
type: "boolean", | ||
title: "Done?", | ||
description: "Is that task done already?" | ||
}, | ||
title: { | ||
type: "string", | ||
title: "Title", | ||
description: "The task title.", | ||
minLength: 1 | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
formData: { | ||
title: "My tasks", | ||
tasks: [ | ||
{title: "Enjoying JSONSchema", done: true}, | ||
{title: "Enjoying React", done: true}, | ||
{title: "Enjoying react-jsonschema-form", done: false}, | ||
] | ||
}, | ||
onSubmit: console.log.bind(console, "submit"), | ||
onError: console.log.bind(console, "errors") | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
module.exports = { | ||
schema: { | ||
title: "Todo Tasks", | ||
description: "Tasks collection.", | ||
type: "object", | ||
additionalProperties: false, | ||
required: [ | ||
"title", "tasks" | ||
], | ||
properties: { | ||
title: { | ||
type: "string", | ||
title: "Tasks list title", | ||
}, | ||
tasks: { | ||
type: "array", | ||
title: "Tasks list", | ||
items: { | ||
type: "object", | ||
properties: { | ||
done: { | ||
type: "boolean", | ||
title: "Done?", | ||
description: "Is that task done already?" | ||
}, | ||
title: { | ||
type: "string", | ||
title: "Title", | ||
description: "The task title.", | ||
minLength: 1 | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
onSubmit: console.log.bind(console, "submit"), | ||
onError: console.log.bind(console, "errors") | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
module.exports = { | ||
schema: { | ||
type: "array", | ||
title: "title", | ||
items: { | ||
type: "string", | ||
title: "item" | ||
} | ||
}, | ||
onChange: console.log.bind(console) | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
module.exports = { | ||
schema: { | ||
type: "array", | ||
title: "title", | ||
default: ["default1", "default2"], | ||
items: { | ||
type: "string", | ||
title: "item" | ||
} | ||
}, | ||
onChange: console.log.bind(console) | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
module.exports = { | ||
schema: { | ||
type: "array", | ||
title: "title", | ||
items: { | ||
type: "string", | ||
title: "item" | ||
} | ||
}, | ||
formData: ["item1", "item2"], | ||
onChange: console.log.bind(console) | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
module.exports = { | ||
schema: { | ||
type: "boolean", | ||
title: "My boolean", | ||
}, | ||
onChange: console.log.bind(console) | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
module.exports = { | ||
schema: { | ||
type: "boolean", | ||
title: "My boolean", | ||
default: true, | ||
}, | ||
onChange: console.log.bind(console) | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
module.exports = { | ||
schema: { | ||
type: "boolean", | ||
title: "My boolean", | ||
}, | ||
formData: true, | ||
onChange: console.log.bind(console) | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
module.exports = { | ||
schema: { | ||
type: "object", | ||
title: "object title", | ||
properties: { | ||
string: { | ||
type: "string", | ||
title: "string" | ||
}, | ||
bool: { | ||
type: "boolean", | ||
title: "bool" | ||
} | ||
} | ||
}, | ||
onChange: console.log.bind(console) | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
module.exports = { | ||
schema: { | ||
type: "object", | ||
title: "object title", | ||
default: { | ||
string: "a default string", | ||
bool: true | ||
}, | ||
properties: { | ||
string: { | ||
type: "string", | ||
title: "string" | ||
}, | ||
bool: { | ||
type: "boolean", | ||
title: "bool" | ||
} | ||
} | ||
}, | ||
onChange: console.log.bind(console) | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
module.exports = { | ||
schema: { | ||
type: "object", | ||
title: "object title", | ||
properties: { | ||
string: { | ||
type: "string", | ||
title: "string" | ||
}, | ||
bool: { | ||
type: "boolean", | ||
title: "bool" | ||
} | ||
} | ||
}, | ||
formData: { | ||
string: "an existing string", | ||
bool: true | ||
}, | ||
onChange: console.log.bind(console) | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
module.exports = { | ||
schema: { | ||
type: "array", | ||
title: "title", | ||
items: { | ||
type: "string", | ||
title: "item" | ||
} | ||
}, | ||
onChange: console.log.bind(console) | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
module.exports = { | ||
schema: { | ||
type: "boolean", | ||
title: "My boolean", | ||
}, | ||
onChange: console.log.bind(console) | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
module.exports = { | ||
schema: { | ||
type: "date-time", | ||
title: "date-time" | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
module.exports = { | ||
schema: { | ||
type: "number", | ||
title: "number" | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
module.exports = { | ||
schema: { | ||
type: "object", | ||
title: "object title", | ||
properties: { | ||
string: { | ||
type: "string", | ||
title: "string" | ||
}, | ||
bool: { | ||
type: "boolean", | ||
title: "bool" | ||
} | ||
} | ||
}, | ||
onChange: console.log.bind(console) | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
module.exports = { | ||
schema: { | ||
type: "string", | ||
title: "string" | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
module.exports = { | ||
schema: { | ||
type: "string", | ||
title: "string" | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
module.exports = { | ||
schema: { | ||
type: "string", | ||
title: "string", | ||
default: "a default string" | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
module.exports = { | ||
schema: { | ||
type: "string", | ||
title: "string", | ||
}, | ||
formData: "an existing string" | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
module.exports = { | ||
schema: { | ||
type: "non-existent", | ||
title: "blah" | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
module.exports = { | ||
type: "boolean", | ||
label: "foo", | ||
onChange: console.log.bind(console) | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
module.exports = { | ||
type: "string", | ||
label: "foo", | ||
defaultValue: "b", | ||
options: ["a", "b"], | ||
onChange: console.log.bind(console) | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
module.exports = { | ||
type: "string", | ||
label: "foo", | ||
options: ["foo", "bar", "baz"], | ||
onChange: console.log.bind(console) | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
module.exports = { | ||
type: "string", | ||
label: "foo", | ||
value: "plop", | ||
onChange: console.log.bind(console) | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
var React = require("react"); | ||
|
||
module.exports = { | ||
type: "string", | ||
label: "foo", | ||
required: true, | ||
children: React.createElement("div", {}, "content") | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.