Skip to content

Commit 8e8cb1a

Browse files
committed
Merge branch 'feature/classy' into development
2 parents c9a91a5 + bba3446 commit 8e8cb1a

19 files changed

+71
-46
lines changed

docs/index.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,8 +315,10 @@ General options most field types can handle:
315315
feedback: false, // Inline feedback icons
316316
placeholder: "Input...", // placeholder on inputs and textarea
317317
ngModelOptions: { ... }, // Passed along to ng-model-options
318-
readonly: true // Same effect as readOnly in schema. Put on a fieldset or array
318+
readonly: true, // Same effect as readOnly in schema. Put on a fieldset or array
319319
// and their items will inherit it.
320+
htmlClass: "street foobar", // CSS Class(es) to be added to the container div
321+
fieldHtmlClass: "street" // CSS Class(es) to be added to field input (or similar)
320322
}
321323
```
322324
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<div class="btn-group" ng-transclude></div>
1+
<div class="btn-group schema-form-actions {{form.htmlClass}}" ng-transclude></div>

src/directives/decorators/bootstrap/actions.html

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
<div class="btn-group">
1+
<div class="btn-group schema-form-actions {{form.htmlClass}}">
22
<input ng-repeat-start="item in form.items"
33
type="submit"
4-
class="btn {{ item.style || 'btn-primary' }}"
4+
class="btn {{ item.style || 'btn-default' }} {{form.fieldHtmlClass}}"
55
value="{{item.title}}"
66
ng-if="item.type === 'submit'">
7-
<button ng-repeat-end class="btn {{ item.style || 'btn-default' }}"
7+
<button ng-repeat-end
8+
class="btn {{ item.style || 'btn-default' }} {{form.fieldHtmlClass}}"
89
type="button"
910
ng-disabled="form.readonly"
1011
ng-if="item.type !== 'submit'"

src/directives/decorators/bootstrap/array.html

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
<div sf-array="form" ng-model="$$value$$" ng-model-options="form.ngModelOptions">
1+
<div sf-array="form" class="schema-form-array {{form.htmlClass}}"
2+
ng-model="$$value$$" ng-model-options="form.ngModelOptions">
23
<h3 ng-show="form.title && form.notitle !== true">{{ form.title }}</h3>
34
<ol class="list-group" ng-model="modelArray" ui-sortable>
4-
<li class="list-group-item" ng-repeat="item in modelArray track by $index">
5+
<li class="list-group-item {{form.fieldHtmlClass}}"
6+
ng-repeat="item in modelArray track by $index">
57
<button ng-hide="form.readonly"
68
ng-click="deleteFromArray($index)"
79
style="position: relative; z-index: 20;"
@@ -12,7 +14,7 @@ <h3 ng-show="form.title && form.notitle !== true">{{ form.title }}</h3>
1214
</li>
1315
</ol>
1416
<div class="clearfix" style="padding: 15px;">
15-
<button ng-hide="form.readonly"
17+
<button ng-hide="form.readonly || form.add === null"
1618
ng-click="appendToArray()"
1719
type="button"
1820
class="btn {{ form.style.add || 'btn-default' }} pull-right">

src/directives/decorators/bootstrap/checkbox.html

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
1-
<div class="checkbox" ng-class="{'has-error': hasError(), 'has-success': hasSuccess()}">
1+
<div class="checkbox schema-form-checkbox {{form.htmlClass}}"
2+
ng-class="{'has-error': hasError(), 'has-success': hasSuccess()}">
23
<label>
34
<input type="checkbox"
45
sf-changed="form"
56
ng-disabled="form.readonly"
67
ng-model="$$value$$"
78
ng-model-options="form.ngModelOptions"
8-
schema-validate="form">
9+
schema-validate="form"
10+
class="{{form.fieldHtmlClass}}"
11+
name="{{form.key.slice(-1)[0]}}">
912
<span ng-bind-html="form.title"></span>
1013
</label>
1114

src/directives/decorators/bootstrap/checkboxes.html

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
1-
<div sf-array="form" ng-model="$$value$$" class="form-group" ng-class="{'has-error': hasError(), 'has-success': hasSuccess()}">
1+
<div sf-array="form" ng-model="$$value$$"
2+
class="form-group schema-form-checkboxes {{form.htmlClass}}"
3+
ng-class="{'has-error': hasError(), 'has-success': hasSuccess()}">
24
<label class="control-label" ng-show="showTitle()">{{form.title}}</label>
35
<div class="checkbox" ng-repeat="val in titleMapValues track by $index" >
46
<label>
57
<input type="checkbox"
68
ng-disabled="form.readonly"
79
sf-changed="form"
8-
ng-model="titleMapValues[$index]">
10+
class="{{form.fieldHtmlClass}}"
11+
ng-model="titleMapValues[$index]"
12+
name="{{form.key.slice(-1)[0]}}">
913
<span ng-bind-html="form.titleMap[$index].name"></span>
1014
</label>
1115

src/directives/decorators/bootstrap/default.html

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
1-
<div class="form-group" ng-class="{'has-error': hasError(), 'has-success': hasSuccess(), 'has-feedback': form.feedback !== false }">
1+
<div class="form-group schema-form-{{form.type}} {{form.htmlClass}}"
2+
ng-class="{'has-error': hasError(), 'has-success': hasSuccess(), 'has-feedback': form.feedback !== false }">
23
<label class="control-label" ng-show="showTitle()">{{form.title}}</label>
34

45
<input ng-show="form.key"
56
type="{{form.type}}"
67
step="any"
78
sf-changed="form"
89
placeholder="{{form.placeholder}}"
9-
class="form-control"
10+
class="form-control {{form.fieldHtmlClass}}"
1011
ng-model-options="form.ngModelOptions"
1112
ng-model="$$value$$"
1213
ng-disabled="form.readonly"
13-
schema-validate="form">
14+
schema-validate="form"
15+
name="{{form.key.slice(-1)[0]}}">
1416
<span ng-if="form.feedback !== false"
1517
class="form-control-feedback"
1618
ng-class="evalInScope(form.feedback) || {'glyphicon': true, 'glyphicon-ok': hasSuccess(), 'glyphicon-remove': hasError() }"></span>
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
<fieldset ng-disabled="form.readonly">
1+
<fieldset ng-disabled="form.readonly" class="schema-form-fieldset {{form.htmlClass}}">
22
<legend ng-show="form.title">{{ form.title }}</legend>
33
<div class="help-block" ng-show="form.description" ng-bind-html="form.description"></div>
44
<div ng-transclude></div>
5-
</fieldset>
5+
</fieldset>
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
<fieldset ng-disabled="form.readonly">
1+
<fieldset ng-disabled="form.readonly" class="schema-form-fieldset {{form.htmlClass}}">
22
<legend ng-show="form.title">{{ form.title }}</legend>
33
<div class="help-block" ng-show="form.description" ng-bind-html="form.description"></div>
44
<sf-decorator ng-repeat="item in form.items" form="item"></sf-decorator>
5-
</fieldset>
5+
</fieldset>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<div class="helpvalue" ng-bind-html="form.helpvalue"></div>
1+
<div class="helpvalue schema-form-helpvalue {{form.htmlClass}}" ng-bind-html="form.helpvalue"></div>

0 commit comments

Comments
 (0)