Skip to content

Commit 81af0ee

Browse files
committed
update builder
1 parent 4de129b commit 81af0ee

File tree

4 files changed

+70
-81
lines changed

4 files changed

+70
-81
lines changed

README.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
# Schema Form Builder
2-
3-
A simple form builder that generates a schema and form based on the [angular schema form](http://schemaform.io) package.
1+
# Json Schema Form Builder
42

3+
Quickly generate your your schema form using this GUI builder.
54

65
# Roadmap
76

87
- Complete support of all elements based on schema-form
9-
- Generate vanilla/bootstrap/material forms
8+
- Provide source definition for different platforms
9+
- 100% test coverage
1010

11-
Built By: [ralphowino.com](http://ralphowino.com)
11+
# Simply need a html form?
12+
To generate vanilla/bootstrap/material forms checkout ralphowino.github.com/form-builder

app/builder/controllers/builder-controller.es6

Lines changed: 61 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -5,78 +5,72 @@
55
constructor(Converter, growl, locker, $scope, $uibModal) {
66
let vm = this;
77

8-
vm.forms = locker.get('schema_forms', {}/* {
9-
'sample_form': {
10-
name: 'Sample Form',
11-
type: 'schema-form',
12-
fields: [
13-
{
14-
type: 'text',
15-
key: 'first_name',
16-
title: 'First name',
17-
open: false
18-
},
19-
{
20-
type: 'text',
21-
key: 'last_name',
22-
title: 'Last name',
23-
open: false
24-
},
25-
{
26-
type: 'email',
27-
key: 'email',
28-
title: 'Email',
29-
open: false
30-
},
31-
{
32-
type: 'date',
33-
key: 'dob',
34-
title: 'Date of Birth',
35-
open: false
36-
},
37-
{
38-
type: 'dropdown',
39-
key: 'marital-status',
40-
title: 'Marital Status',
41-
open: false
42-
},
43-
{
44-
type: 'date-time',
45-
key: 'check-in',
46-
title: 'Check In',
47-
open: false
48-
},
49-
{
50-
type: 'date-time',
51-
key: 'check-out',
52-
title: 'Check Out',
53-
open: false
54-
},
55-
{
56-
type: 'textarea',
57-
key: 'bio',
58-
title: 'Biography',
59-
open: false
60-
}
61-
]
62-
}
63-
}*/);
64-
console.log(vm.forms);
8+
vm.forms = locker.get('schema_forms', {
9+
'sample_form': {
10+
name: 'Sample Form',
11+
type: 'schema-form',
12+
fields: [
13+
{
14+
type: 'text',
15+
key: 'first_name',
16+
title: 'First name',
17+
open: false
18+
},
19+
{
20+
type: 'text',
21+
key: 'last_name',
22+
title: 'Last name',
23+
open: false
24+
},
25+
{
26+
type: 'email',
27+
key: 'email',
28+
title: 'Email',
29+
open: false,
30+
showAdvance: true,
31+
fieldAddonRight:'<i class="glyphicon glyphicon-envelope"></i>'
32+
},
33+
{
34+
type: 'date',
35+
key: 'dob',
36+
title: 'Date of Birth',
37+
open: false
38+
},
39+
{
40+
type: 'dropdown',
41+
key: 'marital-status',
42+
title: 'Marital Status',
43+
open: false
44+
},
45+
{
46+
type: 'date-time',
47+
key: 'check-in',
48+
title: 'Check In',
49+
open: false
50+
},
51+
{
52+
type: 'date-time',
53+
key: 'check-out',
54+
title: 'Check Out',
55+
open: false
56+
},
57+
{
58+
type: 'textarea',
59+
key: 'bio',
60+
title: 'Biography',
61+
open: false
62+
}
63+
]
64+
}
65+
});
66+
6567
vm.schema = {
6668
type: 'object',
6769
title: 'Comment',
6870
properties: {
6971
name: {
7072
type: 'string'
7173
},
72-
type: {
73-
type: 'string',
74-
title: 'Form Output',
75-
enum: [
76-
'schema-form',
77-
'bootstrap',
78-
]
79-
},
8074
fields: {
8175
type: 'array',
8276
title: 'Fields',
@@ -116,7 +110,7 @@
116110
key: {
117111
title: 'Key',
118112
type: 'string',
119-
//description: 'Unique identifier'
113+
description: 'Unique identifier'
120114
},
121115
title: {
122116
condition: 'model.notitle',
@@ -222,7 +216,6 @@
222216
}
223217
},
224218
required: [
225-
'type',
226219
'key'
227220
]
228221
}
@@ -243,14 +236,7 @@
243236
notitle: true,
244237
fieldHtmlClass: 'field-name',
245238
labelHtmlClass: 'field-name-label'
246-
},
247-
{
248-
key: 'type',
249-
htmlClass: 'col-sm-6',
250-
//notitle: true,
251-
fieldHtmlClass: 'output-type',
252-
labelHtmlClass: 'output-type-label'
253-
},
239+
}
254240
]
255241
},
256242
{

app/builder/factories/converter-factory.es6

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
'condition',
2222
'onChange',
2323
'notitle',
24-
'showAdvanced',
2524
'validationMessage',
2625
'onChange',
2726
'ngModelOptions',

bower.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,8 @@
2222
"jquery": "*"
2323
}
2424
}
25+
},
26+
"resolutions": {
27+
"angular": "~1.4.*"
2528
}
2629
}

0 commit comments

Comments
 (0)