@@ -638,6 +638,7 @@ return /******/ (function(modules) { // webpackBootstrap
638
638
/**
639
639
* Evaluate an expression, i.e. scope.$eval
640
640
* but do it in sfSchemas parent scope sf-schema directive is used
641
+ *
641
642
* @param {string } expression
642
643
* @param {Object } locals (optional)
643
644
* @return {Any } the result of the expression
@@ -654,6 +655,7 @@ return /******/ (function(modules) { // webpackBootstrap
654
655
/**
655
656
* Evaluate an expression, i.e. scope.$eval
656
657
* in this decorators scope
658
+ *
657
659
* @param {string } expression
658
660
* @param {Object } locals (optional)
659
661
* @return {Any } the result of the expression
@@ -673,7 +675,7 @@ return /******/ (function(modules) { // webpackBootstrap
673
675
* Use the Angular `{{ interpolation }}`
674
676
* braces to access properties on `locals`.
675
677
*
676
- * @param {string } content The string to interpolate.
678
+ * @param {string } expression The string to interpolate.
677
679
* @param {Object } locals (optional) Properties that may be accessed in the
678
680
* `expression` string.
679
681
* @return {Any } The result of the expression or `undefined`.
@@ -745,7 +747,7 @@ return /******/ (function(modules) { // webpackBootstrap
745
747
746
748
var evalExpr = 'evalExpr(form.condition,{ model: model, "arrayIndex": arrayIndex})' ;
747
749
if ( form . key ) {
748
- evalExpr = 'evalExpr(form.condition,{ model: model, "arrayIndex": arrayIndex, "modelValue": model' + sfPath . stringify ( form . key ) + '})' ;
750
+ evalExpr = 'evalExpr(form.condition, {' + ' model: model, "arrayIndex": arrayIndex, "modelValue": model' + sfPath . stringify ( form . key ) + '})' ;
749
751
}
750
752
751
753
_angular2 . default . forEach ( element . children ( ) , function ( child ) {
@@ -805,7 +807,8 @@ return /******/ (function(modules) { // webpackBootstrap
805
807
} ) ;
806
808
807
809
// Clean up the model when the corresponding form field is $destroy-ed.
808
- // Default behavior can be supplied as a globalOption, and behavior can be overridden in the form definition.
810
+ // Default behavior can be supplied as a globalOption, and behavior can be overridden
811
+ // in the form definition.
809
812
scope . $on ( '$destroy' , function ( ) {
810
813
// If the entire schema form is destroyed we don't touch the model
811
814
if ( ! scope . externalDestructionInProgress ) {
@@ -982,6 +985,7 @@ return /******/ (function(modules) { // webpackBootstrap
982
985
* DEPRECATED
983
986
* Same as createDirective, but takes an object where key is 'type' and value is 'templateUrl'
984
987
* Useful for batching.
988
+ *
985
989
* @param {Object } templates
986
990
*/
987
991
this . createDirectives = function ( templates ) {
@@ -992,6 +996,7 @@ return /******/ (function(modules) { // webpackBootstrap
992
996
993
997
/**
994
998
* Getter for decorator settings
999
+ *
995
1000
* @param {string } name (optional) defaults to defaultDecorator
996
1001
* @return {Object } rules and templates { rules: [],templates: {}}
997
1002
*/
@@ -1003,6 +1008,7 @@ return /******/ (function(modules) { // webpackBootstrap
1003
1008
/**
1004
1009
* DEPRECATED use defineAddOn() instead.
1005
1010
* Adds a mapping to an existing decorator.
1011
+ *
1006
1012
* @param {String } name Decorator name
1007
1013
* @param {String } type Form type for the mapping
1008
1014
* @param {String } url The template url
@@ -1021,6 +1027,7 @@ return /******/ (function(modules) { // webpackBootstrap
1021
1027
1022
1028
/**
1023
1029
* Adds an add-on to an existing decorator.
1030
+ *
1024
1031
* @param {String } name Decorator name
1025
1032
* @param {String } type Form type for the mapping
1026
1033
* @param {String } url The template url
@@ -1056,6 +1063,8 @@ return /******/ (function(modules) { // webpackBootstrap
1056
1063
1057
1064
function _interopRequireDefault ( obj ) { return obj && obj . __esModule ? obj : { default : obj } ; }
1058
1065
1066
+ ;
1067
+
1059
1068
/***/ } ,
1060
1069
/* 5 */
1061
1070
/***/ function ( module , exports , __webpack_require__ ) {
@@ -1067,7 +1076,6 @@ return /******/ (function(modules) { // webpackBootstrap
1067
1076
} ) ;
1068
1077
1069
1078
exports . default = function ( ) {
1070
-
1071
1079
var postProcessFn = function postProcessFn ( form ) {
1072
1080
return form ;
1073
1081
} ;
@@ -1194,7 +1202,7 @@ return /******/ (function(modules) { // webpackBootstrap
1194
1202
1195
1203
/*!
1196
1204
* json-schema-form
1197
- * @version 1.0.0-alpha.1
1205
+ * @version 1.0.0-alpha.2
1198
1206
* @link https://github.com/json-schema-form/json-schema-form-core
1199
1207
* @license MIT
1200
1208
* Copyright (c) 2016 JSON Schema Form
@@ -2086,7 +2094,6 @@ return /******/ (function(modules) { // webpackBootstrap
2086
2094
} ) ;
2087
2095
2088
2096
exports . default = function ( ) {
2089
-
2090
2097
var validator = { } ;
2091
2098
2092
2099
/**
@@ -2096,30 +2103,30 @@ return /******/ (function(modules) { // webpackBootstrap
2096
2103
*
2097
2104
* @param {Object } form A merged form definition, i.e. one with a schema.
2098
2105
* @param {Any } value the value to validate.
2099
- * @return a tv4js result object.
2106
+ * @return { Object } a tv4js result object.
2100
2107
*/
2101
2108
validator . validate = function ( form , value ) {
2102
2109
if ( ! form ) {
2103
2110
return { valid : true } ;
2104
- }
2105
- var schema = form . schema ;
2111
+ } ;
2106
2112
2113
+ var schema = form . schema ;
2107
2114
if ( ! schema ) {
2108
2115
return { valid : true } ;
2109
- }
2116
+ } ;
2110
2117
2111
2118
// Input of type text and textareas will give us a viewValue of ''
2112
2119
// when empty, this is a valid value in a schema and does not count as something
2113
2120
// that breaks validation of 'required'. But for our own sanity an empty field should
2114
2121
// not validate if it's required.
2115
2122
if ( value === '' ) {
2116
2123
value = undefined ;
2117
- }
2124
+ } ;
2118
2125
2119
2126
// Numbers fields will give a null value, which also means empty field
2120
2127
if ( form . type === 'number' && value === null ) {
2121
2128
value = undefined ;
2122
- }
2129
+ } ;
2123
2130
2124
2131
// Version 4 of JSON Schema has the required property not on the
2125
2132
// property itself but on the wrapping object. Since we like to test
@@ -2130,11 +2137,13 @@ return /******/ (function(modules) { // webpackBootstrap
2130
2137
2131
2138
if ( form . required ) {
2132
2139
wrap . required = [ propName ] ;
2133
- }
2140
+ } ;
2141
+
2134
2142
var valueWrap = { } ;
2135
2143
if ( _angular2 . default . isDefined ( value ) ) {
2136
2144
valueWrap [ propName ] = value ;
2137
- }
2145
+ } ;
2146
+
2138
2147
return _tv2 . default . validateResult ( valueWrap , wrap ) ;
2139
2148
} ;
2140
2149
@@ -2243,6 +2252,7 @@ return /******/ (function(modules) { // webpackBootstrap
2243
2252
* Interpolate and return proper error for an eror code.
2244
2253
* Validation message on form trumps global error messages.
2245
2254
* and if the message is a function instead of a string that function will be called instead.
2255
+ *
2246
2256
* @param {string } error the error code, i.e. tv4-xxx for tv4 errors, otherwise it's whats on
2247
2257
* ngModel.$error for custom errors.
2248
2258
* @param {Any } value the actual model value.
@@ -2311,7 +2321,6 @@ return /******/ (function(modules) { // webpackBootstrap
2311
2321
} ) ;
2312
2322
2313
2323
exports . default = function ( ) {
2314
-
2315
2324
// expose the methods in sfPathProvider
2316
2325
this . parse = _jsonSchemaFormCore . sfPath . parse ;
2317
2326
this . stringify = _jsonSchemaFormCore . sfPath . stringify ;
@@ -2364,15 +2373,15 @@ return /******/ (function(modules) { // webpackBootstrap
2364
2373
// most notably for errors.
2365
2374
// So we emit it up to the decorator directive so it can put it on scope.
2366
2375
scope . $emit ( 'schemaFormPropagateNgModelController' , ngModel ) ;
2367
- }
2376
+ } ;
2368
2377
2369
2378
// Watch for the form definition and then rewrite it.
2370
2379
// It's the (first) array part of the key, '[]' that needs a number
2371
2380
// corresponding to an index of the form.
2372
2381
var once = scope . $watch ( attrs . sfArray , function ( form ) {
2373
2382
if ( ! form ) {
2374
2383
return ;
2375
- }
2384
+ } ;
2376
2385
2377
2386
// An array model always needs a key so we know what part of the model
2378
2387
// to look at. This makes us a bit incompatible with JSON Form, on the
@@ -2732,6 +2741,7 @@ return /******/ (function(modules) { // webpackBootstrap
2732
2741
/**
2733
2742
* Evaluate an expression, i.e. scope.$eval
2734
2743
* in this decorators scope
2744
+ *
2735
2745
* @param {string } expression
2736
2746
* @param {Object } locals (optional)
2737
2747
* @return {Any } the result of the expression
@@ -2751,7 +2761,7 @@ return /******/ (function(modules) { // webpackBootstrap
2751
2761
* Use the Angular `{{ interpolation }}`
2752
2762
* braces to access properties on `locals`.
2753
2763
*
2754
- * @param {string } content The string to interpolate.
2764
+ * @param {string } expression The string to interpolate.
2755
2765
* @param {Object } locals (optional) Properties that may be accessed in the
2756
2766
* `expression` string.
2757
2767
* @return {Any } The result of the expression or `undefined`.
@@ -3138,8 +3148,13 @@ return /******/ (function(modules) { // webpackBootstrap
3138
3148
3139
3149
form . titleMap . forEach ( function ( item , index ) {
3140
3150
var arrIndex = arr . indexOf ( item . value ) ;
3141
- if ( arrIndex === - 1 && vals [ index ] ) arr . push ( item . value ) ;
3142
- if ( arrIndex !== - 1 && ! vals [ index ] ) arr . splice ( arrIndex , 1 ) ;
3151
+ if ( arrIndex === - 1 && vals [ index ] ) {
3152
+ arr . push ( item . value ) ;
3153
+ } ;
3154
+
3155
+ if ( arrIndex !== - 1 && ! vals [ index ] ) {
3156
+ arr . splice ( arrIndex , 1 ) ;
3157
+ } ;
3143
3158
} ) ;
3144
3159
// Time to validate the rebuilt array.
3145
3160
// validateField method is exported by schema-validate
@@ -3340,7 +3355,7 @@ return /******/ (function(modules) { // webpackBootstrap
3340
3355
} ) ;
3341
3356
} else {
3342
3357
internalRender ( schema , form , merged ) ;
3343
- }
3358
+ } ;
3344
3359
} ;
3345
3360
3346
3361
var internalRender = function internalRender ( schema , form , merged ) {
@@ -3353,7 +3368,7 @@ return /******/ (function(modules) { // webpackBootstrap
3353
3368
scope . externalDestructionInProgress = true ;
3354
3369
childScope . $destroy ( ) ;
3355
3370
scope . externalDestructionInProgress = false ;
3356
- }
3371
+ } ;
3357
3372
childScope = scope . $new ( ) ;
3358
3373
3359
3374
//make the form available to decorators
@@ -3519,7 +3534,7 @@ return /******/ (function(modules) { // webpackBootstrap
3519
3534
// Since we might have different tv4 errors we must clear all
3520
3535
// errors that start with tv4-
3521
3536
Object . keys ( ngModel . $error ) . filter ( function ( k ) {
3522
- return k . indexOf ( 'tv4-' ) === 0 ;
3537
+ return k . indexOf ( 'tv4-' ) === 0 || k . indexOf ( 'md-' ) === 0 ;
3523
3538
} ) . forEach ( function ( k ) {
3524
3539
ngModel . $setValidity ( k , true ) ;
3525
3540
} ) ;
@@ -4071,11 +4086,7 @@ return /******/ (function(modules) { // webpackBootstrap
4071
4086
/* 7 */
4072
4087
/***/ function ( module , exports ) {
4073
4088
4074
- angular . module ( 'schemaForm' ) . directive ( 'sfMaterialClass' , sfMaterialClassDirective ) ;
4075
-
4076
- sfMaterialClassDirective . $inject = [ '$compile' , '$timeout' ] ;
4077
-
4078
- function sfMaterialClassDirective ( $compile , $timeout ) {
4089
+ angular . module ( 'schemaForm' ) . directive ( 'sfMaterialClass' , function ( $compile , $timeout ) {
4079
4090
return {
4080
4091
restrict : 'A' ,
4081
4092
scope : false ,
@@ -4100,7 +4111,7 @@ return /******/ (function(modules) { // webpackBootstrap
4100
4111
} , 0 ) ;
4101
4112
}
4102
4113
} ;
4103
- }
4114
+ } ) ;
4104
4115
4105
4116
/***/ }
4106
4117
/******/ ] )
0 commit comments