Skip to content

Commit c1cd75a

Browse files
committed
Latest updates, hard set Angular to 1.4.0-beta.6
Added chips and autocomplete in raw version, not added to decorator yet, still need to write a example for them.
1 parent feba86a commit c1cd75a

File tree

11 files changed

+95
-40
lines changed

11 files changed

+95
-40
lines changed

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
],
2121
"dependencies": {
2222
"angular-schema-form": "development",
23-
"angular": "1.4",
23+
"angular": "1.4.0-beta.6",
2424
"angular-material": "master",
2525
"angular-animate": "1.4",
2626
"angular-sanitize": "1.4"

examples/material-example.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<html>
33
<head>
44
<meta charset="utf-8">
5-
<title>Material Design Schema Form example</title>
5+
<title>Material Design Schema Form Example</title>
66
<link rel="stylesheet" href="../bower_components/angular-material/angular-material.css">
77
<style type="text/css">
88
.spinner {

src/array.html

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,25 +4,29 @@ <h3 ng-show="form.title && form.notitle !== true">{{ form.title }}</h3>
44
<ol class="list-group" ng-model="modelArray" ui-sortable>
55
<li class="list-group-item {{form.fieldHtmlClass}}"
66
ng-repeat="item in modelArray track by $index">
7-
<button ng-hide="form.readonly || form.remove === null"
7+
<md-button ng-hide="form.readonly || form.remove === null"
88
ng-click="deleteFromArray($index)"
99
style="position: relative; z-index: 20;"
1010
type="button" class="close pull-right">
1111
<span aria-hidden="true">&times;</span><span class="sr-only">Close</span>
12-
</button>
12+
</md-button>
1313
<sf-decorator ng-init="arrayIndex = $index" form="copyWithIndex($index)"></sf-decorator>
1414
</li>
1515
</ol>
1616
<div class="clearfix" style="padding: 15px;">
17-
<button ng-hide="form.readonly || form.add === null"
17+
<md-button ng-hide="form.readonly || form.add === null"
1818
ng-click="appendToArray()"
1919
type="button"
2020
class="btn {{ form.style.add || 'btn-default' }} pull-right">
2121
<i class="glyphicon glyphicon-plus"></i>
2222
{{ form.add || 'Add'}}
23-
</button>
23+
</md-button>
24+
</div>
25+
<div ng-messages="ngModel.$error">
26+
<!--
27+
This is a bit of a hack. sf-message does the work, but ng-messages and ng-message
28+
is needed for the styling
29+
-->
30+
<div sf-message ng-message></div>
2431
</div>
25-
<div class="help-block"
26-
ng-show="(hasError() && errorMessage(schemaError())) || form.description"
27-
ng-bind-html="(hasError() && errorMessage(schemaError())) || form.description"></div>
2832
</div>

src/autocomplete.html

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<div class="form-group {{form.htmlClass}} schema-form-select"
2+
ng-class="{'has-error': hasError(), 'has-success': hasSuccess(), 'has-feedback': form.feedback !== false}">
3+
<md-autocomplete flex
4+
md-selected-item="form.selectedItem"
5+
md-search-text="form.searchText"
6+
md-items="item in querySearch(form.searchText)"
7+
md-item-text="item.label"
8+
md-floating-label="{{form.title || form.key.slice(-1)[0]}}">
9+
<span md-highlight-text="ctrl.searchText">{{item.label}}</span>
10+
</md-autocomplete>
11+
<div ng-messages="ngModel.$error">
12+
<!--
13+
This is a bit of a hack. sf-message does the work, but ng-messages and ng-message
14+
is needed for the styling
15+
-->
16+
<div sf-message ng-message></div>
17+
</div>
18+
</div>

src/checkbox.html

Lines changed: 7 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
1-
<div class="checkbox schema-form-checkbox {{form.htmlClass}}">
2-
<md-checkbox sf-changed="form"
1+
<div class="checkbox schema-form-checkbox {{form.htmlClass}}"
2+
ng-class="{'has-error': hasError(), 'has-success': hasSuccess()}">
3+
<md-checkbox ng-model="$$value$$"
4+
ng-model-options="form.ngModelOptions"
5+
sf-changed="form"
36
ng-disabled="form.readonly"
47
schema-validate="form"
8+
class="{{form.fieldHtmlClass}}"
59
name="{{form.key.slice(-1)[0]}}"
6-
ng-model="$$value$$" aria-label="{{::form.title}}">
10+
aria-label="{{form.title || form.key.slice(-1)[0]}}">
711
<span ng-bind-html="form.title"></span>
812
</md-checkbox>
913
<div ng-messages="ngModel.$error">
@@ -14,19 +18,3 @@
1418
<div sf-message ng-message></div>
1519
</div>
1620
</div>
17-
<!--
18-
<div class="checkbox schema-form-checkbox {{form.htmlClass}}"
19-
ng-class="{'has-error': hasError(), 'has-success': hasSuccess()}">
20-
<md-checkbox ng-model="$$value$$"
21-
ng-model-options="form.ngModelOptions"
22-
sf-changed="form"
23-
ng-disabled="form.readonly"
24-
schema-validate="form"
25-
class="{{form.fieldHtmlClass}}"
26-
name="{{form.key.slice(-1)[0]}}"
27-
aria-label="{{form.title || form.key.slice(-1)[0]}}">
28-
<span ng-bind-html="form.title"></span>
29-
</md-checkbox>
30-
<div class="help-block md-caption" sf-message="form.description"></div>
31-
</div>
32-
-->

src/checkboxes.html

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
<div sf-array="form" ng-model="$$value$$"
22
class="form-group schema-form-checkboxes {{form.htmlClass}}"
33
ng-class="{'has-error': hasError(), 'has-success': hasSuccess()}">
4-
54
<label class="control-label" ng-show="showTitle()">{{form.title}}</label>
65
<div class="checkbox" ng-repeat="val in titleMapValues track by $index" >
76
<md-checkbox ng-model="titleMapValues[$index]"
@@ -21,5 +20,4 @@
2120
-->
2221
<div sf-message ng-message></div>
2322
</div>
24-
2523
</div>

src/chips.html

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<div class="form-group schema-form-chips {{form.htmlClass}}"
2+
ng-class="{'has-error': hasError(), 'has-success': hasSuccess(), 'has-feedback': form.feedback !== false}">
3+
<md-chips ng-model="$$value$$" readonly="form.readonly" flex
4+
placeholder="{{form.title || form.key.slice(-1)[0]}}">
5+
<md-chip-template>
6+
<!-- should include an optional template from form.template -->
7+
<strong ng-if="!form.template">{{$chip}}</strong>
8+
</md-chip-template>
9+
</md-chips>
10+
<div ng-messages="ngModel.$error">
11+
<!--
12+
This is a bit of a hack. sf-message does the work, but ng-messages and ng-message
13+
is needed for the styling
14+
-->
15+
<div sf-message ng-message></div>
16+
</div>
17+
</div>

src/radios-inline.html

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,11 @@
1414
<span ng-bind-html="item.name"></span>
1515
</md-radio-button>
1616
</md-radio-group>
17-
<div class="help-block md-caption" sf-message="form.description"></div>
17+
<div ng-messages="ngModel.$error">
18+
<!--
19+
This is a bit of a hack. sf-message does the work, but ng-messages and ng-message
20+
is needed for the styling
21+
-->
22+
<div sf-message ng-message></div>
23+
</div>
1824
</div>

src/radios.html

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,23 @@
11
<div class="form-group schema-form-radios {{form.htmlClass}}"
22
ng-class="{'has-error': hasError(), 'has-success': hasSuccess()}">
3-
<label class="control-label" ng-show="showTitle()">{{form.title}}</label>
3+
<label class="control-label" ng-show="showTitle()" aria-label="{{form.title}}">{{form.title}} {{form.titleMap | json}}</label>
44
<md-radio-group ng-model="$$value$$"
55
ng-model-options="form.ngModelOptions"
6-
class="{{form.fieldHtmlClass}}"
7-
ng-class="{ active: item.value === $$value$$ }"
86
sf-changed="form"
9-
schema-validate="form"
107
ng-disabled="form.readonly"
118
name="{{form.key.join('.')}}">
12-
<md-radio-button ng-repeat="item in form.titleMap" ng-value="item.value">
9+
<md-radio-button ng-repeat="item in form.titleMap"
10+
ng-value="item.value"
11+
class="{{form.fieldHtmlClass}}"
12+
ng-class="{ active: item.value === $$value$$ }">
1313
<span ng-bind-html="item.name"></span>
1414
</md-radio-button>
1515
</md-radio-group>
16-
<div class="help-block md-caption" sf-message="form.description"></div>
16+
<div ng-messages="ngModel.$error">
17+
<!--
18+
This is a bit of a hack. sf-message does the work, but ng-messages and ng-message
19+
is needed for the styling
20+
-->
21+
<div sf-message ng-message></div>
22+
</div>
1723
</div>

src/select.html

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,11 @@
1212
ng-if="!opt.group"
1313
ng-value="opt.value">{{opt.name}}</md-option>
1414
</md-select>
15-
<p class="help-block md-caption" sf-message="form.description"></p>
15+
<div ng-messages="ngModel.$error">
16+
<!--
17+
This is a bit of a hack. sf-message does the work, but ng-messages and ng-message
18+
is needed for the styling
19+
-->
20+
<div sf-message ng-message></div>
21+
</div>
1622
</div>

0 commit comments

Comments
 (0)