Skip to content
This repository was archived by the owner on Apr 30, 2018. It is now read-only.

Commit 738e0c9

Browse files
committed
v7.3.0
2 parents ce1a3d9 + 8f7428e commit 738e0c9

37 files changed

+3295
-3250
lines changed

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ before_install:
1717
before_script:
1818
- npm prune
1919
script:
20+
- npm run eslint
2021
- npm run test
2122
- npm run check-coverage
2223
after_success:

dist/formly.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* angular-formly JavaScript Library v7.2.3
2+
* angular-formly JavaScript Library v7.3.0
33
*
44
* @license MIT (http://license.angular-formly.com)
55
*
@@ -153,7 +153,7 @@ return /******/ (function(modules) { // webpackBootstrap
153153

154154
ngModule.constant('formlyApiCheck', _providersFormlyApiCheck2['default']);
155155
ngModule.constant('formlyErrorAndWarningsUrlPrefix', _otherDocsBaseUrl2['default']);
156-
ngModule.constant('formlyVersion', ("7.2.3")); // <-- webpack variable
156+
ngModule.constant('formlyVersion', ("7.3.0")); // <-- webpack variable
157157

158158
ngModule.provider('formlyUsability', _providersFormlyUsability2['default']);
159159
ngModule.provider('formlyConfig', _providersFormlyConfig2['default']);
@@ -372,6 +372,8 @@ return /******/ (function(modules) { // webpackBootstrap
372372
fieldGroup: apiCheck.arrayOf(apiCheck.oneOfType([formlyFieldOptions, apiCheck.object])),
373373
className: apiCheck.string.optional,
374374
options: formOptionsApi.optional,
375+
templateOptions: apiCheck.object.optional,
376+
wrapper: specifyWrapperType.optional,
375377
hide: apiCheck.bool.optional,
376378
hideExpression: formlyExpression.optional,
377379
data: apiCheck.object.optional,
@@ -422,7 +424,7 @@ return /******/ (function(modules) { // webpackBootstrap
422424
Object.defineProperty(exports, "__esModule", {
423425
value: true
424426
});
425-
exports["default"] = "https://github.com/formly-js/angular-formly/blob/" + ("7.2.3") + "/other/ERRORS_AND_WARNINGS.md#";
427+
exports["default"] = "https://github.com/formly-js/angular-formly/blob/" + ("7.3.0") + "/other/ERRORS_AND_WARNINGS.md#";
426428
module.exports = exports["default"];
427429

428430
/***/ },
@@ -1210,8 +1212,8 @@ return /******/ (function(modules) { // webpackBootstrap
12101212
fields: '=?',
12111213
formState: '=?',
12121214
formOptions: '=?',
1213-
form: '=?' // TODO require form in a breaking release
1214-
},
1215+
form: '=?' },
1216+
// TODO require form in a breaking release
12151217
controller: FormlyFieldController,
12161218
link: fieldLink
12171219
};
@@ -1433,7 +1435,7 @@ return /******/ (function(modules) { // webpackBootstrap
14331435
if (scope.options.key) {
14341436
modelValue = 'model[\'' + scope.options.key + '\']';
14351437
}
1436-
setElementTemplate('\n <formly-form model="' + modelValue + '"\n fields="options.fieldGroup"\n options="options.options"\n form="options.form"\n class="' + scope.options.className + '"\n ' + extraAttributes + '\n is-field-group>\n </formly-form>\n ');
1438+
getTemplate('\n <formly-form model="' + modelValue + '"\n fields="options.fieldGroup"\n options="options.options"\n form="options.form"\n class="' + scope.options.className + '"\n ' + extraAttributes + '\n is-field-group>\n </formly-form>\n ').then(transcludeInWrappers(scope.options, scope.formOptions)).then(setElementTemplate);
14371439
}
14381440

14391441
function addAttributes() {

dist/formly.min.js

Lines changed: 8 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/formly.min.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

other/karma.conf.es6.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* eslint-env node */
2-
require('./set-env')(process.argv);
2+
require('argv-set-env')();
33
const path = require('path');
44

55
process.env.NODE_ENV = process.env.NODE_ENV || 'test';

other/set-env.js

Lines changed: 0 additions & 9 deletions
This file was deleted.

other/webpack.config.es6.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* eslint-env node */
2-
require('./set-env')(process.argv);
2+
require('argv-set-env')();
33
const packageJson = require('../package.json');
44

55
const here = require('path-here');

package.json

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "angular-formly",
3-
"version": "7.2.3",
3+
"version": "7.3.0",
44
"author": "Astrism <[email protected]>",
55
"contributors": [
66
"Astrism <[email protected]>",
@@ -27,20 +27,25 @@
2727
"build:dist": "webpack --progress --colors --set-env-NODE_ENV=development",
2828
"build:prod": "webpack --progress --colors --set-env-NODE_ENV=production",
2929
"build": "npm run build:dist & npm run build:prod",
30+
"eslint:test": "eslint -c other/test.eslintrc --ignore-pattern '**/*.+(test|mock).js' src/",
31+
"eslint:src": "eslint -c other/src.eslintrc --ignore-pattern '!**/*.+(test|mock).js' src/",
32+
"eslint": "npm run eslint:test -s && npm run eslint:src -s",
3033
"test": "karma start --single-run --set-env-COVERAGE=true --set-env-NODE_ENV=test",
3134
"test:watch": "karma start --set-env-COVERAGE=true --set-env-NODE_ENV=test",
3235
"test:debug": "karma start --browsers Chrome --set-env-NODE_ENV=test",
3336
"start": "npm run test:watch",
3437
"check-coverage": "istanbul check-coverage --statements 93 --branches 89 --functions 92 --lines 92",
3538
"report-coverage": "cat ./coverage/lcov.info | node_modules/.bin/codecov",
3639
"commit": "git-cz",
37-
"prepublish": "npm run build",
38-
"postpublish": "publish-latest --user-email [email protected] --user-name formly-bot",
39-
"semantic-release": "semantic-release pre && npm publish && semantic-release post"
40+
"publish-latest": "publish-latest --user-email [email protected] --user-name formly-bot",
41+
"semantic-release": "semantic-release pre && npm run build && npm publish && npm run publish-latest && semantic-release post"
4042
},
4143
"config": {
4244
"ghooks": {
43-
"commit-msg": "./node_modules/.bin/validate-commit-msg && npm t && npm run check-coverage"
45+
"commit-msg": "./node_modules/.bin/validate-commit-msg && npm run eslint && npm t && npm run check-coverage"
46+
},
47+
"commitizen": {
48+
"path": "node_modules/cz-conventional-changelog"
4449
}
4550
},
4651
"description": "AngularJS directive which takes JSON representing a form and renders to HTML",
@@ -52,28 +57,29 @@
5257
"angular": "1.4.7",
5358
"angular-mocks": "1.4.7",
5459
"api-check": "7.5.3",
60+
"argv-set-env": "1.0.0",
5561
"babel": "5.8.23",
5662
"babel-eslint": "4.1.3",
5763
"babel-loader": "5.3.2",
58-
"chai": "3.3.0",
64+
"chai": "3.4.0",
5965
"codecov.io": "0.1.6",
60-
"commitizen": "2.0.2",
66+
"commitizen": "2.3.0",
6167
"cracks": "3.1.1",
6268
"cz-conventional-changelog": "1.1.4",
6369
"deindent": "0.1.0",
64-
"eslint": "1.6.0",
65-
"eslint-config-kentcdodds": "4.0.1",
66-
"eslint-loader": "1.0.0",
70+
"eslint": "1.7.3",
71+
"eslint-config-kentcdodds": "5.0.0",
72+
"eslint-loader": "1.1.0",
6773
"eslint-plugin-mocha": "1.0.0",
6874
"ghooks": "0.3.2",
6975
"http-server": "0.8.5",
7076
"isparta": "3.1.0",
7177
"isparta-loader": "1.0.0",
72-
"istanbul": "0.3.22",
73-
"karma": "0.13.10",
78+
"istanbul": "0.4.0",
79+
"karma": "0.13.14",
7480
"karma-chai": "0.1.0",
75-
"karma-chrome-launcher": "0.2.0",
76-
"karma-coverage": "0.5.2",
81+
"karma-chrome-launcher": "0.2.1",
82+
"karma-coverage": "0.5.3",
7783
"karma-firefox-launcher": "0.1.6",
7884
"karma-mocha": "0.2.0",
7985
"karma-sinon": "1.0.4",
@@ -88,7 +94,7 @@
8894
"publish-latest": "1.1.2",
8995
"raw-loader": "0.5.1",
9096
"semantic-release": "4.3.5",
91-
"sinon": "1.17.1",
97+
"sinon": "1.17.2",
9298
"sinon-chai": "2.8.0",
9399
"uglify-loader": "1.2.0",
94100
"validate-commit-msg": "1.0.0",
@@ -100,9 +106,6 @@
100106
"angular": "*"
101107
}
102108
},
103-
"czConfig": {
104-
"path": "node_modules/cz-conventional-changelog"
105-
},
106109
"release": {
107110
"verfiyRelease": {
108111
"path": "cracks",

src/angular-fix/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
// some versions of angular don't export the angular module properly,
22
// so we get it from window in this case.
3-
let angular = require('angular');
3+
let angular = require('angular')
44

55
/* istanbul ignore next */
66
if (!angular.version) {
7-
angular = window.angular;
7+
angular = window.angular
88
}
9-
export default angular;
9+
export default angular
Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,82 +1,82 @@
1-
import angular from 'angular-fix';
2-
export default formlyCustomValidation;
1+
import angular from 'angular-fix'
2+
export default formlyCustomValidation
33

44
// @ngInject
55
function formlyCustomValidation(formlyUtil) {
66
return {
77
restrict: 'A',
88
require: 'ngModel',
99
link: function formlyCustomValidationLink(scope, el, attrs, ctrl) {
10-
const opts = scope.options;
11-
opts.validation.messages = opts.validation.messages || {};
10+
const opts = scope.options
11+
opts.validation.messages = opts.validation.messages || {}
1212
angular.forEach(opts.validation.messages, (message, key) => {
1313
opts.validation.messages[key] = () => {
14-
return formlyUtil.formlyEval(scope, message, ctrl.$modelValue, ctrl.$viewValue);
15-
};
16-
});
14+
return formlyUtil.formlyEval(scope, message, ctrl.$modelValue, ctrl.$viewValue)
15+
}
16+
})
1717

1818

19-
const useNewValidatorsApi = ctrl.hasOwnProperty('$validators') && !attrs.hasOwnProperty('useParsers');
20-
angular.forEach(opts.validators, angular.bind(null, addValidatorToPipeline, false));
21-
angular.forEach(opts.asyncValidators, angular.bind(null, addValidatorToPipeline, true));
19+
const useNewValidatorsApi = ctrl.hasOwnProperty('$validators') && !attrs.hasOwnProperty('useParsers')
20+
angular.forEach(opts.validators, angular.bind(null, addValidatorToPipeline, false))
21+
angular.forEach(opts.asyncValidators, angular.bind(null, addValidatorToPipeline, true))
2222

2323
function addValidatorToPipeline(isAsync, validator, name) {
24-
setupMessage(validator, name);
25-
validator = angular.isObject(validator) ? validator.expression : validator;
24+
setupMessage(validator, name)
25+
validator = angular.isObject(validator) ? validator.expression : validator
2626
if (useNewValidatorsApi) {
27-
setupWithValidators(validator, name, isAsync);
27+
setupWithValidators(validator, name, isAsync)
2828
} else {
29-
setupWithParsers(validator, name, isAsync);
29+
setupWithParsers(validator, name, isAsync)
3030
}
3131
}
3232

3333
function setupMessage(validator, name) {
34-
const message = validator.message;
34+
const message = validator.message
3535
if (message) {
3636
opts.validation.messages[name] = () => {
37-
return formlyUtil.formlyEval(scope, message, ctrl.$modelValue, ctrl.$viewValue);
38-
};
37+
return formlyUtil.formlyEval(scope, message, ctrl.$modelValue, ctrl.$viewValue)
38+
}
3939
}
4040
}
4141

4242
function setupWithValidators(validator, name, isAsync) {
43-
const validatorCollection = isAsync ? '$asyncValidators' : '$validators';
43+
const validatorCollection = isAsync ? '$asyncValidators' : '$validators'
4444

4545
ctrl[validatorCollection][name] = function evalValidity(modelValue, viewValue) {
46-
return formlyUtil.formlyEval(scope, validator, modelValue, viewValue);
47-
};
46+
return formlyUtil.formlyEval(scope, validator, modelValue, viewValue)
47+
}
4848
}
4949

5050
function setupWithParsers(validator, name, isAsync) {
51-
let inFlightValidator;
51+
let inFlightValidator
5252
ctrl.$parsers.unshift(function evalValidityOfParser(viewValue) {
53-
const isValid = formlyUtil.formlyEval(scope, validator, ctrl.$modelValue, viewValue);
53+
const isValid = formlyUtil.formlyEval(scope, validator, ctrl.$modelValue, viewValue)
5454
if (isAsync) {
55-
ctrl.$pending = ctrl.$pending || {};
56-
ctrl.$pending[name] = true;
57-
inFlightValidator = isValid;
55+
ctrl.$pending = ctrl.$pending || {}
56+
ctrl.$pending[name] = true
57+
inFlightValidator = isValid
5858
isValid.then(() => {
5959
if (inFlightValidator === isValid) {
60-
ctrl.$setValidity(name, true);
60+
ctrl.$setValidity(name, true)
6161
}
6262
}).catch(() => {
6363
if (inFlightValidator === isValid) {
64-
ctrl.$setValidity(name, false);
64+
ctrl.$setValidity(name, false)
6565
}
6666
}).finally(() => {
67-
const $pending = ctrl.$pending || {};
67+
const $pending = ctrl.$pending || {}
6868
if (Object.keys($pending).length === 1) {
69-
delete ctrl.$pending;
69+
delete ctrl.$pending
7070
} else {
71-
delete ctrl.$pending[name];
71+
delete ctrl.$pending[name]
7272
}
73-
});
73+
})
7474
} else {
75-
ctrl.$setValidity(name, isValid);
75+
ctrl.$setValidity(name, isValid)
7676
}
77-
return viewValue;
78-
});
77+
return viewValue
78+
})
7979
}
80-
}
81-
};
80+
},
81+
}
8282
}

0 commit comments

Comments
 (0)