Skip to content

Commit f78c5ce

Browse files
committed
Merge branch 'release/v0.7.1'
2 parents 8d7c18c + 7986e66 commit f78c5ce

15 files changed

+65
-15
lines changed

CHANGELOG

+7
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
v0.7.1
2+
------
3+
Thanks to @torstenrudolf, this release is basically his PR:s.
4+
* Bugfix: Array validation for Checkboxes
5+
* New radios type: 'radios-inline'
6+
* Class "control-label" added to labels
7+
18
v0.7.0
29
------
310
* Support for complex keys, at least when using Angular 1.3.

README.md

+3
Original file line numberDiff line numberDiff line change
@@ -158,4 +158,7 @@ $ karma start karma.conf.js
158158
Contributing
159159
------------
160160

161+
**Heads up!** Sometime soon we will go over and change the code style to follow
162+
whatever [jscs](https://github.com/mdevils/node-jscs) says with preset set to 'google'.
163+
161164
All contributions are welcome! We're trying to use [git flow](http://danielkummer.github.io/git-flow-cheatsheet/), so please base any merge request on the **development** branch instead of **master**.

bower.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"dist/bootstrap-decorator.min.js",
66
"dist/bootstrap-datepicker.min.js"
77
],
8-
"version": "0.7.0",
8+
"version": "0.7.1",
99
"authors": [
1010
"Textalk",
1111
"David Jensen <[email protected]>"

dist/bootstrap-datepicker.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/bootstrap-decorator.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/index.md

+4-3
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Documentation
44
1. [Basic Usage](#basic-usage)
55
1. [Handling Submit](#handling-submit)
66
1. [Global Options](#global-options)
7-
1. [Form types](#form-types)
7+
1. [Form types](#form-types)
88
1. [Default form types](#default-form-types)
99
1. [Form definitions](#form-definitions)
1010
1. [Overriding field types and order](#overriding-field-types-and-order)
@@ -190,6 +190,7 @@ Schema Form currently supports the following form field types out of the box:
190190
| submit | a submit button |
191191
| button | a button |
192192
| radios | radio buttons |
193+
| radios-inline | radio buttons in one line |
193194
| radiobuttons | radio buttons with bootstrap buttons |
194195
| help | insert arbitrary html |
195196
| tab | tabs with content |
@@ -312,7 +313,7 @@ General options most field types can handle:
312313

313314
### onChange
314315
The ```onChange``` option can be used with most fields and its value should be
315-
either an angular expression, as a string, or a function. If its an expression
316+
either an angular expression, as a string, or a function. If its an expression
316317
it will be evaluated in the parent scope of the ```sf-schema``` directive with
317318
the special locals ```modelValue``` and ```form```. If its a function that will
318319
be called with ```modelValue``` and ```form``` as first and second arguments.
@@ -876,7 +877,7 @@ It is not needed for tabs on top.
876877
The `title` option is a bit special in `tabarray`, it defines the title
877878
of the tab and is considered a angular expression. The expression is evaluated
878879
with two extra variables in context: **value** and **$index**, where **value**
879-
is the value in the array (i.e. that tab) and **$index** the index.
880+
is the value in the array (i.e. that tab) and **$index** the index.
880881
881882
Example with tabs on the top:
882883

examples/data/sink.json

+22
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,14 @@
101101
"Tube"
102102
]
103103
},
104+
"radio2": {
105+
"title": "My Second Radio",
106+
"type": "string",
107+
"enum": [
108+
"Transistor",
109+
"Tube"
110+
]
111+
},
104112
"radiobuttons": {
105113
"type": "string",
106114
"enum": [
@@ -182,6 +190,20 @@
182190
}
183191
]
184192
},
193+
{
194+
"key": "radio2",
195+
"type": "radios-inline",
196+
"titleMap": [
197+
{
198+
"value": "Transistor",
199+
"name": "Transistor <br> Not the tube kind."
200+
},
201+
{
202+
"value": "Tube",
203+
"name": "Tube <br> The tube kind."
204+
}
205+
]
206+
},
185207
{
186208
"key": "radiobuttons",
187209
"style": {

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "angular-schema-form",
3-
"version": "0.7.0",
3+
"version": "0.7.1",
44
"description": "Create forms from a JSON schema",
55
"scripts": {
66
"test": "rm -fr coverage && ./node_modules/karma/bin/karma start --single-run --browsers PhantomJS karma.conf.js && find coverage/ -name lcov.info -print0 | xargs -0 cat | ./node_modules/coveralls/bin/coveralls.js"

src/directives/decorators/bootstrap/bootstrap-decorator.js

+2
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ angular.module('schemaForm').config(['schemaFormDecoratorsProvider',function(dec
1818
submit: base+'submit.html',
1919
button: base+'submit.html',
2020
radios: base+'radios.html',
21+
'radios-inline': base+'radios-inline.html',
2122
radiobuttons: base+'radio-buttons.html',
2223
help: base+'help.html',
2324
'default': base+'default.html'
@@ -44,6 +45,7 @@ angular.module('schemaForm').config(['schemaFormDecoratorsProvider',function(dec
4445
datepicker: base+'datepicker.html',
4546
input: base+'default.html',
4647
radios: base+'radios.html',
48+
'radios-inline': base+'radios-inline.html',
4749
radiobuttons: base+'radio-buttons.html',
4850
});
4951

Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
<div sf-array="form" class="form-group" ng-class="{'has-error': hasError(), 'has-success': hasSuccess()}">
2-
<label ng-show="showTitle()">{{form.title}}</label>
1+
<div sf-array="form" ng-model="$$value$$" class="form-group" ng-class="{'has-error': hasError(), 'has-success': hasSuccess()}">
2+
<label class="control-label" ng-show="showTitle()">{{form.title}}</label>
33
<div class="checkbox" ng-repeat="val in titleMapValues track by $index" >
44
<label>
55
<input type="checkbox"
@@ -9,5 +9,7 @@
99
</label>
1010

1111
</div>
12-
<div class="help-block" ng-show="form.description" ng-bind-html="form.description"></div>
12+
<div class="help-block"
13+
ng-show="(hasError() && errorMessage(schemaError())) || form.description"
14+
ng-bind-html="(hasError() && errorMessage(schemaError())) || form.description"></div>
1315
</div>

src/directives/decorators/bootstrap/datepicker/datepicker.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<div class="form-group" ng-class="{'has-error': hasError()}">
2-
<label ng-show="showTitle()">{{form.title}}</label>
2+
<label class="control-label" ng-show="showTitle()">{{form.title}}</label>
33

44
<input ng-show="form.key"
55
style="background-color: white"

src/directives/decorators/bootstrap/radio-buttons.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<div class="form-group" ng-class="{'has-error': hasError(), 'has-success': hasSuccess()}">
22
<div>
3-
<label ng-show="showTitle()">{{form.title}}</label>
3+
<label class="control-label" ng-show="showTitle()">{{form.title}}</label>
44
</div>
55
<div class="btn-group">
66
<label class="btn {{ (item.value === $$value$$) ? form.style.selected || 'btn-primary' : form.style.unselected || 'btn-primary'; }}"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<div class="form-group" ng-class="{'has-error': hasError(), 'has-success': hasSuccess()}">
2+
<label class="control-label" ng-show="showTitle()">{{form.title}}</label>
3+
<div>
4+
<label class="radio-inline" ng-repeat="item in form.titleMap" >
5+
<input type="radio"
6+
sf-changed="form"
7+
ng-model="$$value$$"
8+
ng-value="item.value">
9+
<span ng-bind-html="item.name"></span>
10+
</label>
11+
</div>
12+
<div class="help-block" ng-show="(hasError() && errorMessage(schemaError())) || form.description" ng-bind-html="(hasError() && errorMessage(schemaError())) || form.description"></div>
13+
</div>

src/directives/decorators/bootstrap/radios.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<div class="form-group" ng-class="{'has-error': hasError(), 'has-success': hasSuccess()}">
2-
<label ng-show="showTitle()">{{form.title}}</label>
2+
<label class="control-label" ng-show="showTitle()">{{form.title}}</label>
33
<div class="radio" ng-repeat="item in form.titleMap" >
44
<label>
55
<input type="radio"
@@ -10,5 +10,5 @@
1010
<span ng-bind-html="item.name"></span>
1111
</label>
1212
</div>
13-
<div class="help-block" ng-show="form.description" ng-bind-html="form.description"></div>
13+
<div class="help-block" ng-show="(hasError() && errorMessage(schemaError())) || form.description" ng-bind-html="(hasError() && errorMessage(schemaError())) || form.description"></div>
1414
</div>

src/directives/decorators/bootstrap/select.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<div class="form-group" ng-class="{'has-error': hasError(), 'has-success': hasSuccess(), 'has-feedback': form.feedback !== false}">
2-
<label ng-show="showTitle()">
2+
<label class="control-label" ng-show="showTitle()">
33
{{form.title}}
44
</label>
55
<select ng-model="$$value$$"

0 commit comments

Comments
 (0)