Skip to content

Commit 8d7c18c

Browse files
committed
Merge branch 'release/v0.7.0'
2 parents edec694 + 481e430 commit 8d7c18c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+7257
-2642
lines changed

CHANGELOG

+24
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,27 @@
1+
v0.7.0
2+
------
3+
* Support for complex keys, at least when using Angular 1.3.
4+
See docs/knownlimitations.md for details. Thanks @mike-marcacci for that
5+
awesome PR.
6+
* New format for 'titleMap', it can now also take a list.
7+
* Checkboxes have proper two way binding.
8+
* Validate entire form with $scope.$broadcast('schemaFormValidate')
9+
* If there is no title in neither schema nor form it defaults to the property
10+
name from the schema.
11+
* 'sf-options' attribute for globals options, with an option for form defaults.
12+
* Added 'ng-model-options' so Angular 1.3 users can validate on blur.
13+
* All validation, even required is now using tv4js, change 'validationMessage'
14+
accordingly. This means arrays validate.
15+
* 'Checkbox' type implies a default of false if none is set.
16+
* Changed tactics when it comes to bower deps, it now only depends on what you
17+
cannot go without, i.e. tv4, angular, angular-sanitize and objectpath. You
18+
have to add bootstrap and other dependencies manually (a lot are optional).
19+
* Lots of small bugfixes.
20+
21+
Thanks to @mike-marcacci, @sashless, @cameronprattedwards,@ianbeeston,
22+
@torstenrudolf and all of you who made a lot of issues and PR:s this summer!
23+
24+
125
v0.6.0
226
------
327
* array and tabarray support, with help from @zackbloom (thanks!).

README.md

+71-56
Original file line numberDiff line numberDiff line change
@@ -5,33 +5,34 @@ Angular Schema Form
55
[![Coverage Status](https://coveralls.io/repos/Textalk/angular-schema-form/badge.png?branch=master)](https://coveralls.io/r/Textalk/angular-schema-form?branch=development)
66
[![Bower version](https://badge.fury.io/bo/angular-schema-form.svg)](http://badge.fury.io/bo/angular-schema-form)
77

8-
Generate forms from a JSON schema, with AngularJS!
8+
Generate forms from JSON schemas using AngularJS!
99

1010
### [Try out the example page](http://textalk.github.io/angular-schema-form/examples/bootstrap-example.html)
11-
...where you can edit the schema or the form definition and see what comes out!
12-
11+
Try editing the schema or form definition and see what comes out!
1312

1413
What is it?
1514
----------
1615

17-
Schema Form is a set of AngularJS directives (and a couple of services..) that can create a form directly from a json schema
18-
definition and also validate against that schema. The defaults may be fine for a lot cases, but you can also
19-
customize it, changing order and type of fields.
16+
Schema Form is a set of AngularJS directives (and a couple of services). It can do two things to make life easier:
17+
18+
1. Create a form directly from a JSON schema.
19+
2. Validate form fields against that same JSON schema.
20+
21+
Schema Form uses convention over configuration, so it comes packaged with some sensible defaults. But you can always customize it by changing the order and types of form fields.
2022

23+
JSON Form
24+
---------
25+
Schema Form is inspired by the nice [JSON Form](https://github.com/joshfire/jsonform) library and aims to be roughly compatible with it, especially its form definition. So what sets Schema Form apart from JSON Form?
2126

22-
Schema Form is inspired by the nice [JSON Form](https://github.com/joshfire/jsonform) library and aims to be roughly
23-
compatible with it, especially it's form defintion. What sets Schema Form apart from JSON Form is that Schema Form
24-
aims to be deeply integrated with AngularJS, i.e. to use the standard AngularJS way of handling forms. It also uses
25-
[tv4](https://github.com/geraintluff/tv4) for validation which means its compatible with version 4 of the json schema
26-
standard. Schema Form, as a default, generates bootstrap 3 friendly HTML.
27+
1. Schema Form integrates deeply with AngularJS and uses AngularJS conventions to handle forms.
28+
2. Schema Form uses [tv4](https://github.com/geraintluff/tv4) for validation, making it compatible with version 4 of the JSON schema standard.
29+
3. By default, Schema Form generates Bootstrap 3-friendly HTML.
2730

2831

2932
Basic Usage
3033
-----------
3134

32-
```html
33-
<form sf-schema="schema" sf-form="form" sf-model="data"></form>
34-
```
35+
First, expose your schema, form, and model to the $scope.
3536

3637
```javascript
3738
function FormController($scope) {
@@ -54,84 +55,99 @@ function FormController($scope) {
5455
}
5556
];
5657

57-
$scope.data = {};
58+
$scope.model = {};
5859
}
5960
```
6061

62+
Then load them into Schema Form using the `sfSchema`, `sfForm`, and `sfModel` directives.
63+
64+
```html
65+
<div ng-controller="FormController">
66+
<form sf-schema="schema" sf-form="form" sf-model="model"></form>
67+
</div>
68+
```
69+
70+
71+
6172
Documentation
6273
-------------
6374
Documentation covering defaults and form types [can be found here.](docs/index.md)
6475

6576

6677
Installation
6778
------------
68-
Simplest way is by using [bower](http://bower.io/) since it will also download
69-
any dependencies.
79+
80+
### Bower
81+
82+
It's simplest to install Schema Form using [Bower](http://bower.io/).
7083

7184
```bash
7285
bower install angular-schema-form
7386
```
7487

75-
(or just download the contents of the ```dist/``` folder and add dependencies
76-
manually)
88+
This will install the latest release and basic dependencies. See
89+
[dependecies section below](#dependencies).
7790

78-
It depends on [AngularJS](https://angularjs.org/) (duh!),
79-
[angular-sanitize](https://docs.angularjs.org/api/ngSanitize),
80-
[bootstrap 3](http://getbootstrap.com/),
81-
[tv4](https://github.com/geraintluff/tv4), and
82-
if you like to use the date picker you also need jQuery and
83-
[pickadate.js](http://amsul.ca/pickadate.js/). Also if you use the ```help```
84-
type to inject HTML you'll want to use ngSanitize as well.
91+
### Manual
8592

86-
If you like to have drag and drop reordering of arrays you also need
87-
[ui-sortable](https://github.com/angular-ui/ui-sortable) and its dependencies
88-
[jQueryUI](http://jqueryui.com/), see *ui-sortable* documentation for details of
89-
what parts of jQueryUI that is needed. You can safely ignore these if you don't
90-
need the reordering.
93+
You can also just download the contents of the `dist/` folder and add dependencies manually.
9194

92-
Tabbed arrays, form type ```tabarray```, defaults to tabs on the left side. For
93-
these to work you also need to include the css from
94-
[bootstrap-vertical-tabs](https://github.com/dbtek/bootstrap-vertical-tabs).
95-
It is not needed for tabs on top, the ```tabType: "top"``` option.
95+
### Dependencies
9696

97-
The minified files also includes all templates so they are all you need.
97+
Schema form has a lot of dependencies, most of which are optional. Therefor
9898

99-
Addons
100-
------
101-
Currently there is only one addon, a date picker using
102-
the excellent [pickadate.js](http://amsul.ca/pickadate.js/).
99+
Schema Form depends on:
100+
101+
1. [AngularJS](https://angularjs.org/) version 1.3.x is recomended. Version 1.2.x
102+
has some limitation. See [known limitations](docs/knownlimitations.md).
103+
2. [angular-sanitize](https://docs.angularjs.org/api/ngSanitize)
104+
3. [tv4](https://github.com/geraintluff/tv4)
105+
4. [objectpath](https://github.com/mike-marcacci/objectpath)
106+
5. [bootstrap 3](http://getbootstrap.com/)
107+
108+
If you install via bower you get all of the above except bootstrap since we
109+
don't want to push a certain version or flavor on you. Also make
110+
sure you got the angular version you actually want.
103111

104-
See the [docs](docs/datepicker.md) for usage.
112+
#### Additional dependecies
105113

114+
1. If you want to use the date picker, you'll also need [jQuery](https://github.com/jquery/jquery) and [pickadate.js](http://amsul.ca/pickadate.js/)
115+
2. If you'd like to use drag-and-drop reordering of arrays, you'll also need [ui-sortable](https://github.com/angular-ui/ui-sortable) and its [jQueryUI](http://jqueryui.com/) dependencies. See the *ui-sortable* documentation for details about which parts of jQueryUI are needed. You can safely ignore these if you don't need reordering.
116+
3. Schema Form provides tabbed arrays through the form type `tabarray`. Tab arrays default to tabs on the left side. For these to work, you'll need to include the CSS from [bootstrap-vertical-tabs](https://github.com/dbtek/bootstrap-vertical-tabs). However, you won't need Bootstrap Vertical Tabs for horizontal tabs (the `tabType: "top"` option).
117+
118+
The minified files include templates - no need to load additional HTML files.
119+
120+
Add-ons
121+
------
122+
There is currently only one add-on, a date picker using the excellent [pickadate.js](http://amsul.ca/pickadate.js/).
123+
124+
See the [add-on docs](docs/datepicker.md) for usage.
106125

107126
Building
108127
--------
109-
The files in the ```dist``` plus dependencies are all you need to use Schema
110-
Form, but if you like to build it yourself we use [gulp](http://gulpjs.com/).
128+
The files in the `dist/` folder, plus dependencies, are all you need to use Schema Form. But if you'd like to build it yourself, we use [gulp](http://gulpjs.com/).
111129

112-
First off you need to have nodejs installed. Then install all dev dependencies
113-
of the project with npm, install gulp and run the default task.
130+
First off, you need to have nodejs installed. Then install all dev dependencies of the project with npm, install gulp and run the default task.
114131

115132
```bash
116133
$ npm install
117134
$ sudo npm install -g gulp
118135
$ gulp
119136
```
120137

121-
The default task uses [gulp-angular-templatecache](https://github.com/miickel/gulp-angular-templatecache)
122-
to compile all html templates to js and then concatenates and minifies them with
123-
the rest of the sources.
138+
The default task uses [gulp-angular-templatecache](https://github.com/miickel/gulp-angular-templatecache) to compile all html templates to js and then concatenates and minifies them with the rest of the sources.
124139

125-
You can also run ```gulp watch``` to have it rebuild on change.
140+
You can also run `gulp watch` to have it rebuild on change.
126141

127142
Tests
128143
-----
129-
Unit tests are run with [karma](http://karma-runner.github.io) and written using
130-
[mocha](http://visionmedia.github.io/mocha/), [chai](http://chaijs.com/)
131-
and [sinon](http://sinonjs.org/)
144+
Unit tests are run with [karma](http://karma-runner.github.io) and written using [mocha](http://visionmedia.github.io/mocha/), [chai](http://chaijs.com/) and [sinon](http://sinonjs.org/)
145+
146+
To run the tests:
132147

133-
To run the tests first install all dependencies with npm (if you haven't done it
134-
already) and install the karma cli to run the test.
148+
1. Install all dependencies via NPM
149+
2. Install the Karma CLI
150+
3. Run the tests
135151

136152
```bash
137153
$ npm install
@@ -142,5 +158,4 @@ $ karma start karma.conf.js
142158
Contributing
143159
------------
144160

145-
All contributions are welcome! We're trying to use [git flow](http://danielkummer.github.io/git-flow-cheatsheet/)
146-
so please base any merge request on the **development** branch instead of **master**.
161+
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

+12-6
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,22 @@
55
"dist/bootstrap-decorator.min.js",
66
"dist/bootstrap-datepicker.min.js"
77
],
8-
"version": "0.6.0",
8+
"version": "0.7.0",
99
"authors": [
1010
"Textalk",
1111
"David Jensen <[email protected]>"
1212
],
1313
"moduleType": [
1414
"globals"
1515
],
16-
"keywords": ["angular","angularjs","form","json","json-schema","schema"],
16+
"keywords": [
17+
"angular",
18+
"angularjs",
19+
"form",
20+
"json",
21+
"json-schema",
22+
"schema"
23+
],
1724
"license": "MIT",
1825
"ignore": [
1926
"**/.*",
@@ -23,11 +30,10 @@
2330
"coverage"
2431
],
2532
"dependencies": {
26-
"angular": "~1.2.18",
33+
"angular": ">= 1.2",
2734
"tv4": "~1.0.15",
28-
"pickadate": "~3.5.2",
29-
"angular-sanitize": "~1.2.18",
30-
"bootstrap-vertical-tabs": "~1.1.0"
35+
"angular-sanitize": ">= 1.2",
36+
"objectpath": "~1.0.4"
3137
},
3238
"devDependencies": {
3339
"angular-ui-ace": "bower"

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.

0 commit comments

Comments
 (0)