Skip to content

Commit 52a3011

Browse files
committed
Initial commit
0 parents  commit 52a3011

37 files changed

+1653
-0
lines changed

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
bower_components
2+
node_modules
3+

README.md

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
Angular Material Decorator
2+
==========================
3+
4+
For https://github.com/Textalk/angular-schema-form
5+
6+
7+
Very very very much work in progress.
8+
9+
To test clone repo and:
10+
```
11+
npm install
12+
bower install
13+
gulp minify
14+
```
15+
16+
Start favorite http server (http-server or puer for instance) and open
17+
`examples/material-example.html`
18+
19+
There is also a `gulp watch` task that minifys on change.
20+
21+
Known Issues
22+
------------
23+
* Almost nothing work
24+
* Only inputs and textare are implemented
25+
* No angular material "theme". Looks like an issue with us using $compile in the link function of
26+
our directives.

bower.json

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{
2+
"name": "angular-schema-form-material",
3+
"version": "1.0.0",
4+
"authors": [
5+
"David Jensen <[email protected]>"
6+
],
7+
"description": "Angular Material decorator for Angular Schema Form",
8+
"main": "material-decorator.min.js",
9+
"keywords": [
10+
"angular-schema-form-decorator"
11+
],
12+
"license": "MIT",
13+
"homepage": "schemaform.io",
14+
"ignore": [
15+
"**/.*",
16+
"node_modules",
17+
"bower_components",
18+
"test",
19+
"tests"
20+
],
21+
"dependencies": {
22+
"angular-schema-form": "~0.8.2",
23+
"angular": "1.4",
24+
"angular-material": "master",
25+
"angular-animate": "1.4",
26+
"angular-sanitize": "1.4"
27+
},
28+
"resolutions": {
29+
"angular": "^1.3.0 || >1.4.0-beta.0"
30+
},
31+
"devDependencies": {
32+
"angular-ui-ace": "~0.2.3"
33+
}
34+
}

examples/data/array.json

+72
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
{
2+
"schema": {
3+
"type": "object",
4+
"title": "Comment",
5+
"required": ["comments"],
6+
"properties": {
7+
"comments": {
8+
"type": "array",
9+
"maxItems": 2,
10+
"items": {
11+
"type": "object",
12+
"properties": {
13+
"name": {
14+
"title": "Name",
15+
"type": "string"
16+
},
17+
"email": {
18+
"title": "Email",
19+
"type": "string",
20+
"pattern": "^\\S+@\\S+$",
21+
"description": "Email will be used for evil."
22+
},
23+
"spam": {
24+
"title": "Spam",
25+
"type": "boolean",
26+
"default": true
27+
},
28+
"comment": {
29+
"title": "Comment",
30+
"type": "string",
31+
"maxLength": 20,
32+
"validationMessage": "Don't be greedy!"
33+
}
34+
},
35+
"required": ["name","comment"]
36+
}
37+
}
38+
}
39+
},
40+
"form": [
41+
{
42+
"type": "help",
43+
"helpvalue": "<h4>Array Example</h4><p>Try adding a couple of forms, reorder by drag'n'drop.</p>"
44+
},
45+
{
46+
"key": "comments",
47+
"add": "New",
48+
"style": {
49+
"add": "btn-success"
50+
},
51+
"items": [
52+
"comments[].name",
53+
"comments[].email",
54+
{
55+
"key": "comments[].spam",
56+
"type": "checkbox",
57+
"title": "Yes I want spam.",
58+
"condition": "model.comments[arrayIndex].email"
59+
},
60+
{
61+
"key": "comments[].comment",
62+
"type": "textarea"
63+
}
64+
]
65+
},
66+
{
67+
"type": "submit",
68+
"style": "btn-info",
69+
"title": "OK"
70+
}
71+
]
72+
}

examples/data/complex-keys.json

+62
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
{
2+
"schema": {
3+
"type": "object",
4+
"title": "Complex Key Support",
5+
"properties": {
6+
"a[\"b\"].c": {
7+
"type": "string"
8+
},
9+
"simple": {
10+
"type": "object",
11+
"properties": {
12+
"prøp": {
13+
"title": "UTF8 in both dot and bracket notation",
14+
"type": "string"
15+
}
16+
}
17+
},
18+
"array-key": {
19+
"type": "array",
20+
"items": {
21+
"type": "object",
22+
"properties": {
23+
"a'rr[\"l": {
24+
"title": "Control Characters",
25+
"type": "string"
26+
},
27+
"˙∆∂∞˚¬": {
28+
"type": "string"
29+
}
30+
},
31+
"required": [
32+
"a'rr[\"l",
33+
"˙∆∂∞˚¬"
34+
]
35+
}
36+
}
37+
}
38+
},
39+
"form": [
40+
{
41+
"type": "help",
42+
"helpvalue": "Complex keys are only supported with AngularJS version 1.3.x, see <a href=\"https://github.com/Textalk/angular-schema-form/blob/master/docs/knownlimitations.md\">known limitations</a> in the docs."
43+
},
44+
"['a[\"b\"].c']",
45+
{
46+
"key": "array-key",
47+
"items": [
48+
"['array-key'][]['a'rr[\"l']",
49+
{
50+
"key": "['array-key'][]['˙∆∂∞˚¬']",
51+
"title": "Unicode Characters"
52+
}
53+
]
54+
},
55+
{
56+
"key": "simple",
57+
"items": [
58+
"simple.prøp"
59+
]
60+
}
61+
]
62+
}
+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
{
2+
"schema": {
3+
"type": "object",
4+
"properties": {
5+
"switch": {
6+
"title": "Spam me, please",
7+
"type": "boolean"
8+
},
9+
"email": {
10+
"title": "Email",
11+
"type": "string",
12+
"pattern": "^\\S+@\\S+$",
13+
"description": "Email will be used for evil."
14+
}
15+
},
16+
"required": ["switch"]
17+
},
18+
"form": [
19+
{
20+
"type": "help",
21+
"helpvalue": "<p>Schema Form does not support oneOf (yet), but you can do a workaround and simulate certain scenarios with 'condition' and 'required' (and/or 'readonly') in the form.</p>"
22+
},
23+
"switch",
24+
{
25+
"key": "email",
26+
"condition": "model.switch",
27+
"required": true
28+
},
29+
{
30+
"key": "email",
31+
"condition": "!model.switch"
32+
},
33+
{
34+
"type": "submit",
35+
"style": "btn-info",
36+
"title": "OK"
37+
}
38+
]
39+
}

examples/data/grid.json

+57
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
{
2+
"schema": {
3+
"type": "object",
4+
"title": "Comment",
5+
"properties": {
6+
"name": {
7+
"title": "Name",
8+
"type": "string"
9+
},
10+
"email": {
11+
"title": "Email",
12+
"type": "string",
13+
"pattern": "^\\S+@\\S+$",
14+
"description": "Email will be used for evil."
15+
},
16+
"comment": {
17+
"title": "Comment",
18+
"type": "string",
19+
"maxLength": 20,
20+
"validationMessage": "Don't be greedy!"
21+
}
22+
},
23+
"required": ["name","email","comment"]
24+
},
25+
"form": [
26+
{
27+
"type": "help",
28+
"helpvalue": "<div class=\"alert alert-info\">Grid it up with bootstrap</div>"
29+
},
30+
{
31+
"type": "section",
32+
"htmlClass": "row",
33+
"items": [
34+
{
35+
"type": "section",
36+
"htmlClass": "col-xs-6",
37+
"items": ["name"]
38+
},
39+
{
40+
"type": "section",
41+
"htmlClass": "col-xs-6",
42+
"items": ["email"]
43+
}
44+
]
45+
},
46+
{
47+
"key": "comment",
48+
"type": "textarea",
49+
"placeholder": "Make a comment"
50+
},
51+
{
52+
"type": "submit",
53+
"style": "btn-info",
54+
"title": "OK"
55+
}
56+
]
57+
}

examples/data/simple-oneOf.json

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"schema": {
3+
"type": "object",
4+
"title": "Comment",
5+
"properties": {
6+
"name": {
7+
"oneOf": [
8+
{
9+
"type": "string",
10+
"enum": ["Bob"]
11+
},
12+
{
13+
"type": "string",
14+
"pattern": "^\\S+ \\S+$"
15+
}
16+
]
17+
}
18+
},
19+
"required": ["name"]
20+
},
21+
"form": [
22+
{
23+
"key": "name",
24+
"title": "Name"
25+
}
26+
27+
]
28+
}

examples/data/simple.json

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
{
2+
"schema": {
3+
"type": "object",
4+
"title": "Comment",
5+
"properties": {
6+
"name": {
7+
"title": "Name",
8+
"type": "string"
9+
},
10+
"email": {
11+
"title": "Email",
12+
"type": "string",
13+
"pattern": "^\\S+@\\S+$",
14+
"description": "Email will be used for evil."
15+
},
16+
"comment": {
17+
"title": "Comment",
18+
"type": "string",
19+
"maxLength": 20,
20+
"validationMessage": "Don't be greedy!"
21+
}
22+
},
23+
"required": ["name","email","comment"]
24+
},
25+
"form": [
26+
"name",
27+
"email",
28+
{
29+
"key": "comment",
30+
"type": "textarea",
31+
"placeholder": "Make a comment"
32+
},
33+
{
34+
"type": "submit",
35+
"style": "btn-info",
36+
"title": "OK"
37+
}
38+
]
39+
}

0 commit comments

Comments
 (0)