Skip to content

Commit 3cbcdac

Browse files
committed
Add idClass and upgrade webpack to v2
1 parent a30a7cb commit 3cbcdac

28 files changed

+656
-4442
lines changed

README.md

+2-4
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,16 @@ or
2323
```sh
2424
npm install angular-schema-form-bootstrap
2525
```
26-
And then include `angular-schema-form-bootstrap.min.js`. Note that angular-schema-form >= 1.0.0-alpha.1 is needed.
26+
And then include `angular-schema-form-bootstrap-bundled.min.js`. Note that angular-schema-form >= 1.0.0-alpha.1 is needed.
2727

28-
You **DO NOT** need to include angular-schema-form with this version, it is now embedded within the above file.
28+
You **DO NOT** need to include angular-schema-form with this version, it is now embedded within the above file. If you wish to include the files separately you can still use `angular-schema-form-bootstrap.min.js`
2929

3030
Future
3131
------
3232
Using the new builder opens up for a lot of optimization. Primarily we can get rid of a lot of small
3333
watches by using build helpers. For instance, slapping on a `sf-changed` directive *only* if the
3434
form definition has an `onChange` option.
3535

36-
We also intend to provide a version that can be added as just the decorator without including Angular Schema Form.
37-
3836
Developer Install
3937
-----------------
4038
```sh

dist/angular-schema-form-bootstrap-bundled.js

+274-4,086
Large diffs are not rendered by default.

dist/angular-schema-form-bootstrap.js

+274-219
Large diffs are not rendered by default.

examples/data/array-deep.json

+6
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,12 @@
5656
"form": [
5757
{
5858
"key": "transportCategory",
59+
"type": "tabarray",
60+
"add": "New",
61+
"style": {
62+
"add": "btn-success"
63+
},
64+
"title": "{{ 'Tab '+$index + ' ' + value.mode + ' ' || 'Tab' + $index }}",
5965
"items": [
6066
"transportCategory[].mode",
6167
{

examples/bootstrap-example.html examples/example.html

+2
Original file line numberDiff line numberDiff line change
@@ -241,10 +241,12 @@ <h3>Schema</h3>
241241

242242
$scope.tests = [
243243
{ name: "Simple", data: 'data/simple.json' },
244+
{ name: "Simple oneOf", data: 'data/simple-oneOf.json' },
244245
{ name: "Basic JSON Schema Type", data: 'data/types.json' },
245246
{ name: "Bootstrap Grid", data: 'data/grid.json' },
246247
{ name: "Complex Key Support", data: 'data/complex-keys.json' },
247248
{ name: "Array", data: 'data/array.json' },
249+
{ name: "Deep Array", data: 'data/array-deep.json' },
248250
{ name: "Tab Array", data: 'data/tabarray.json' },
249251
{ name: "TitleMap Examples", data: 'data/titlemaps.json' },
250252
{ name: "Kitchen Sink", data: 'data/sink.json' },

npm-debug.log

-48
This file was deleted.

package.json

+6-18
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
{
22
"name": "angular-schema-form-bootstrap",
3-
"version": "1.0.0-alpha.2",
3+
"version": "1.0.0-alpha.5",
44
"description": "Bootstrap 3 decorator for Angular Schema Form",
55
"main": "dist/bootstrap-decorator.js",
66
"scripts": {
7-
"dist": "npm run build && npm run minify",
87
"build": "webpack",
8+
"dist": "webpack --config webpack.config.dist.js",
99
"watch": "webpack --watch",
10-
"minify": "uglifyjs dist/angular-schema-form-bootstrap.js --comments --output=dist/angular-schema-form-bootstrap.min.js && uglifyjs dist/angular-schema-form-bootstrap-bundled.js --comments --output=dist/angular-schema-form-bootstrap-bundled.min.js",
11-
"test": "echo \"Error: no test specified\" && exit 1",
12-
"test-not-yet-done": "karma start --single-run --browsers PhantomJS karma.conf.js --log-level info"
10+
"test": "echo \"Error: test not currently available\" && exit 1",
11+
"test-me": "karma start --log-level debug"
1312
},
1413
"keywords": [
1514
"angular-schema-form-decorator"
@@ -24,7 +23,6 @@
2423
"angular": ">= 1.2",
2524
"angular-messages": "^1.5.0",
2625
"angular-sanitize": ">= 1.2",
27-
"angular-schema-form": "git://github.com/json-schema-form/angular-schema-form.git#feature/webpack-babel",
2826
"tv4": "~1.0.15"
2927
},
3028
"devDependencies": {
@@ -35,16 +33,6 @@
3533
"babel-preset-es2015": "^6.16.0",
3634
"chai": "^3.5.0",
3735
"coveralls": "^2.11.0",
38-
"gulp": "^3.9.0",
39-
"gulp-angular-templatecache": "^1.6.0",
40-
"gulp-concat": "^2.5.2",
41-
"gulp-jscs": "^3.0.2",
42-
"gulp-minify-html": "^1.0.2",
43-
"gulp-protractor": "^3.0.0",
44-
"gulp-rename": "^1.2.2",
45-
"gulp-uglify": "^1.2.0",
46-
"gulp-watch": "^4.2.4",
47-
"gulp-webserver": "^0.9.1",
4836
"html": "^1.0.0",
4937
"html-loader": "^0.4.4",
5038
"html-webpack-plugin": "^2.22.0",
@@ -64,7 +52,7 @@
6452
"sinon-chai": "^2.8.0",
6553
"streamqueue": "^0.1.3",
6654
"uglify-js": "^2.6.2",
67-
"webpack": "^1.13.1",
68-
"webpack-dev-server": "^1.14.1"
55+
"webpack": "^2.1.0-beta.27",
56+
"webpack-dev-server": "^2.1.0-beta.12"
6957
}
7058
}

src/bootstrap-decorator.js

+16-16
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
// angular-templatecache-loader
2-
let textareaTemplate = require('./bootstrap/textarea.html');
3-
let fieldsetTemplate = require('./bootstrap/fieldset.html');
4-
let arrayTemplate = require('./bootstrap/array.html');
5-
let tabarrayTemplate = require('./bootstrap/tabarray.html');
6-
let tabsTemplate = require('./bootstrap/tabs.html');
7-
let sectionTemplate = require('./bootstrap/section.html');
8-
let actionsTemplate = require('./bootstrap/actions.html');
9-
let selectTemplate = require('./bootstrap/select.html');
10-
let checkboxTemplate = require('./bootstrap/checkbox.html');
11-
let checkboxesTemplate = require('./bootstrap/checkboxes.html');
12-
let submitTemplate = require('./bootstrap/submit.html');
13-
let radiosTemplate = require('./bootstrap/radios.html');
14-
let radiosInlineTemplate = require('./bootstrap/radios-inline.html');
15-
let radiobuttonsTemplate = require('./bootstrap/radio-buttons.html');
16-
let helpTemplate = require('./bootstrap/help.html');
17-
let defaultTemplate = require('./bootstrap/default.html');
2+
import textareaTemplate from './bootstrap/textarea.html';
3+
import fieldsetTemplate from './bootstrap/fieldset.html';
4+
import arrayTemplate from './bootstrap/array.html';
5+
import tabarrayTemplate from './bootstrap/tabarray.html';
6+
import tabsTemplate from './bootstrap/tabs.html';
7+
import sectionTemplate from './bootstrap/section.html';
8+
import actionsTemplate from './bootstrap/actions.html';
9+
import selectTemplate from './bootstrap/select.html';
10+
import checkboxTemplate from './bootstrap/checkbox.html';
11+
import checkboxesTemplate from './bootstrap/checkboxes.html';
12+
import submitTemplate from './bootstrap/submit.html';
13+
import radiosTemplate from './bootstrap/radios.html';
14+
import radiosInlineTemplate from './bootstrap/radios-inline.html';
15+
import radiobuttonsTemplate from './bootstrap/radio-buttons.html';
16+
import helpTemplate from './bootstrap/help.html';
17+
import defaultTemplate from './bootstrap/default.html';
1818

1919
angular
2020
.module('schemaForm')

src/bootstrap/actions-trcl.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<div class="btn-group schema-form-actions {{::form.htmlClass}}" ng-transclude></div>
1+
<div class="btn-group schema-form-actions {{::form.htmlClass + ' ' + idClass}}" ng-transclude></div>

src/bootstrap/actions.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<div class="btn-group schema-form-actions {{::form.htmlClass}}">
1+
<div class="btn-group schema-form-actions {{::form.htmlClass + ' ' + idClass}}">
22
<input ng-repeat-start="item in form.items"
33
type="submit"
44
class="btn {{ item.style || 'btn-default' }} {{::form.fieldHtmlClass}}"

src/bootstrap/array.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<div class="schema-form-array {{::form.htmlClass}}"
1+
<div class="schema-form-array {{::form.htmlClass + ' ' + idClass}}"
22
sf-field-model="sf-new-array"
33
sf-new-array>
44
<label class="control-label" ng-show="showTitle()">{{ form.title }}</label>

src/bootstrap/checkbox.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<div class="checkbox schema-form-checkbox {{::form.htmlClass}}"
1+
<div class="checkbox schema-form-checkbox {{::form.htmlClass + ' ' + idClass}}"
22
ng-class="{'has-error': form.disableErrorState !== true && hasError(), 'has-success': form.disableSuccessState !== true && hasSuccess()}">
33
<label class="{{::form.labelHtmlClass}}">
44
<input type="checkbox"

src/bootstrap/checkboxes.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<div sf-field-model="sf-new-array"
22
sf-new-array
3-
class="form-group schema-form-checkboxes {{::form.htmlClass}}"
3+
class="form-group schema-form-checkboxes {{::form.htmlClass + ' ' + idClass}}"
44
ng-class="{'has-error': form.disableErrorState !== true && hasError(), 'has-success': form.disableSuccessState !== true && hasSuccess()}">
55
<label class="control-label {{::form.labelHtmlClass}}"
66
sf-field-model

src/bootstrap/default.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<div class="form-group {{::form.htmlClass + ' schema-form-' + form.type}}"
1+
<div class="form-group {{::form.htmlClass + ' schema-form-' + form.type + ' ' + idClass}}"
22
ng-class="{ 'has-error': form.disableErrorState !== true && hasError(), 'has-success': form.disableSuccessState !== true && hasSuccess(), 'has-feedback': form.feedback !== false }">
33
<label class="control-label {{::form.labelHtmlClass}}" ng-class="{'sr-only': !showTitle()}" for="{{::fieldId(true, false)}}">{{form.title}}</label>
44

src/bootstrap/fieldset.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<fieldset ng-disabled="form.readonly" class="schema-form-fieldset {{::form.htmlClass}}" sf-key-controller sf-parent-key="[{{form.key.join('][')}}]" sf-index="{{$index}}">
1+
<fieldset ng-disabled="form.readonly" class="schema-form-fieldset {{::form.htmlClass + ' ' + idClass}}" sf-key-controller sf-parent-key="[{{form.key.join('][')}}]" sf-index="{{$index}}">
22
<legend ng-class="{'sr-only': !showTitle() }">{{ form.title }}</legend>
33
<div class="help-block" ng-show="form.description" ng-bind-html="form.description"></div>
44
</fieldset>

src/bootstrap/help.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<div class="helpvalue schema-form-helpvalue {{::form.htmlClass}}" ng-bind-html="form.helpvalue"></div>
1+
<div class="helpvalue schema-form-helpvalue {{::form.htmlClass + ' ' + idClass}}" ng-bind-html="form.helpvalue"></div>

src/bootstrap/radio-buttons.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<div class="form-group schema-form-radiobuttons {{::form.htmlClass}}"
1+
<div class="form-group schema-form-radiobuttons {{::form.htmlClass + ' ' + idClass}}"
22
ng-class="{'has-error': form.disableErrorState !== true && hasError(), 'has-success': form.disableSuccessState !== true && hasSuccess()}">
33
<div>
44
<label class="control-label {{::form.labelHtmlClass}}" ng-show="showTitle()">{{form.title}}</label>

src/bootstrap/radios-inline.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<div class="form-group schema-form-radios-inline {{::form.htmlClass}}"
1+
<div class="form-group schema-form-radios-inline {{::form.htmlClass + ' ' + idClass}}"
22
ng-class="{'has-error': form.disableErrorState !== true && hasError(), 'has-success': form.disableSuccessState !== true && hasSuccess()}">
33
<label class="control-label {{::form.labelHtmlClass}}"
44
ng-show="showTitle()" sf-field-model

src/bootstrap/radios.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<div class="form-group schema-form-radios {{::form.htmlClass}}" ng-class="{'has-error': form.disableErrorState !== true && hasError(), 'has-success': form.disableSuccessState !== true && hasSuccess()}">
1+
<div class="form-group schema-form-radios {{::form.htmlClass + ' ' + idClass}}" ng-class="{'has-error': form.disableErrorState !== true && hasError(), 'has-success': form.disableSuccessState !== true && hasSuccess()}">
22
<label class="control-label {{::form.labelHtmlClass}}"
33
sf-field-model schema-validate="form"
44
ng-show="showTitle()">{{form.title}}</label>

src/bootstrap/section.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<div class="schema-form-section {{::form.htmlClass}}" sf-key-controller sf-parent-key="[{{form.key.join('][')}}]" sf-index="{{$index}}"></div>
1+
<div class="schema-form-section {{::form.htmlClass + ' ' + idClass}}" sf-key-controller sf-parent-key="[{{form.key.join('][')}}]" sf-index="{{$index}}"></div>

src/bootstrap/select.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<div class="form-group {{::form.htmlClass}} schema-form-select"
1+
<div class="form-group {{::form.htmlClass + ' ' + idClass}} schema-form-select"
22
ng-class="{'has-error': form.disableErrorState !== true && hasError(), 'has-success': form.disableSuccessState !== true && hasSuccess(), 'has-feedback': form.feedback !== false}">
33
<label class="control-label {{::form.labelHtmlClass}}" ng-show="showTitle()" for="{{::fieldId(true, false)}}">
44
{{form.title}}

src/bootstrap/submit.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<div class="form-group schema-form-submit {{::form.htmlClass}}">
1+
<div class="form-group schema-form-submit {{::form.htmlClass + ' ' + idClass}}">
22
<input type="submit"
33
class="btn {{ form.style || 'btn-primary' }} {{::form.fieldHtmlClass}}"
44
value="{{form.title}}"

src/bootstrap/tabarray.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
ng-model="modelArray" schema-validate="form"
33
sf-field-model="sf-new-array"
44
sf-new-array
5-
class="clearfix schema-form-tabarray schema-form-tabarray-{{form.tabType || 'left'}} {{::form.htmlClass}}">
5+
class="clearfix schema-form-tabarray schema-form-tabarray-{{form.tabType || 'left'}} {{::form.htmlClass + ' ' + idClass}}">
66
<div ng-if="!form.tabType || form.tabType !== 'right'"
77
ng-class="{'col-xs-3': !form.tabType || form.tabType === 'left'}">
88
<ol class="nav nav-tabs"

src/bootstrap/tabs.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<div ng-init="selected = { tab: 0 }" class="schema-form-tabs {{::form.htmlClass}}">
1+
<div ng-init="selected = { tab: 0 }" class="schema-form-tabs {{::form.htmlClass + ' ' + idClass}}">
22
<ul class="nav nav-tabs">
33
<li ng-repeat="tab in form.tabs"
44
ng-disabled="form.readonly"

src/bootstrap/textarea.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<div class="form-group has-feedback {{::form.htmlClass}} schema-form-textarea" ng-class="{'has-error': form.disableErrorState !== true && hasError(), 'has-success': form.disableSuccessState !== true && hasSuccess()}">
1+
<div class="form-group has-feedback {{::form.htmlClass + ' ' + idClass}} schema-form-textarea" ng-class="{'has-error': form.disableErrorState !== true && hasError(), 'has-success': form.disableSuccessState !== true && hasSuccess()}">
22
<label class="control-label {{::form.labelHtmlClass}}" ng-class="{'sr-only': !showTitle()}" for="{{::fieldId(true, false)}}">{{form.title}}</label>
33

44
<textarea ng-if="!form.fieldAddonLeft && !form.fieldAddonRight"

src/module-bundled.js

-2
This file was deleted.

webpack.config.dist.js

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
const config = require('./webpack.config.js');
2+
const path = require('path');
3+
4+
config.entry = {
5+
'angular-schema-form-bootstrap': [ path.join(__dirname, 'src', 'module') ],
6+
'angular-schema-form-bootstrap-bundled': [ 'angular-schema-form', path.join(__dirname, 'src', 'module') ],
7+
'angular-schema-form-bootstrap.min': [ path.join(__dirname, 'src', 'module') ],
8+
'angular-schema-form-bootstrap-bundled.min': [ 'angular-schema-form', path.join(__dirname, 'src', 'module') ],
9+
}
10+
11+
module.exports = config;

0 commit comments

Comments
 (0)