Skip to content

Commit

Permalink
Documentation for tags
Browse files Browse the repository at this point in the history
  • Loading branch information
davidlgj committed Jun 27, 2014
1 parent f16c8d0 commit 7867f4a
Show file tree
Hide file tree
Showing 2 changed files with 101 additions and 4 deletions.
39 changes: 38 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,12 @@ manually)

It depends on AngularJS (duh!), [tv4](https://github.com/geraintluff/tv4), and
if you like to use the date picker you also need jQuery and
[pickadate.js](http://amsul.ca/pickadate.js/)
[pickadate.js](http://amsul.ca/pickadate.js/). Also if you use the ```help```
type to inject HTML you'll want to use ngSanitize as well.

The minified files also includes all templates so they are all you need.


Addons
------
Currently there is only one addon, a date picker using
Expand All @@ -85,6 +87,41 @@ the excellent [pickadate.js](http://amsul.ca/pickadate.js/).
See the [docs](docs/datepicker.md) for usage.


Building
--------
The files in the ```dist``` plus dependencies are all you need to use Schema
Form, but if you like to build it yourself we use [gulp](http://gulpjs.com/).

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.

```bash
$ npm install
$ sudo npm install -g gulp
$ gulp
```

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.

You can also run ```gulp watch``` to have it rebuild on change.

Tests
-----
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/)

To run the tests first install all dependencies with npm (if you haven't done it
already) and install the karma cli to run the test.

```bash
$ npm install
$ sudo npm install -g karma-cli
$ karma start karma.conf.js
```

Contributing
------------

Expand Down
66 changes: 63 additions & 3 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,15 @@ Documentation
1. [onChange](#onchange)
1. [Validation Messages](#validation-messages)
1. [Inline feedback icons](#inline-feedback-icons)
1. [Specific options per type](#specific-options-per-type)
1. [Specific options and types](#specific-options-and-types)
1. [fieldset and section](#fieldset-and-section)
1. [conditional](#conditional)
1. [select and checkboxes](#select-and-checkboxes)
1. [actions](#actions)
1. [button](#button)
1. [radios and radiobuttons](#radios-and-radiobuttons)
1. [help](#help)
1. [tabs](#tabs)
1. [Post process function](#post-process-function)

Form types
Expand All @@ -40,6 +41,7 @@ Schema Form currently supports the following form field types out of the box:
| radios | radio buttons |
| radiobuttons | radio buttons with bootstrap buttons |
| help | insert arbitrary html |
| tab | tabs with content |

More field types can be added, for instance a "datepicker" type can be added by
including the [datepicker addon](datepicker.md)
Expand Down Expand Up @@ -226,8 +228,8 @@ Useful things in the decorators scope are



Specific options per type
-------------------------
Specific options and types
--------------------------

### fieldset and section

Expand Down Expand Up @@ -403,6 +405,64 @@ function FormCtrl($scope) {
}
```

### tabs
The ```tabs``` form type lets you split your form into tabs. It is similar to
```fieldset``` in that it just changes the presentation of the form. ```tabs```
takes a option, also called ```tabs```, that is a list of tab objects. Each tab
object consist of a *title* and a *items* list of form objects.

Ex.
```javascript
function FormCtrl($scope) {
$scope.schema = {
type: "object",
properties: {
name: {
title: "Name",
type: "string"
},
nick: {
title: "Nick",
type: "string"
}
alias: {
title: "Alias",
type: "string"
}
tag: {
title: "Tag",
type: "string"
}
}
};

$scope.form = [
"name",
{
type: "tabs",
tabs: [
{
title: "Tab 1",
items: [
"nick",
"alias"
]
},
{
title: "Tab 2",
items: [
"tag"
]
}
]
}
];
}
```




Post process function
---------------------

Expand Down

0 comments on commit 7867f4a

Please sign in to comment.