From 32fcb8bcbb7f6fe7d186e4e5b6e95938c23da2a9 Mon Sep 17 00:00:00 2001 From: Kamil Kisiela Date: Tue, 15 Dec 2015 00:26:12 +0100 Subject: [PATCH 01/23] chore: add meteor support --- gulpfile.js | 12 ++++++++++++ package.js | 24 ++++++++++++++++++++++++ package.json | 5 ++++- 3 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 gulpfile.js create mode 100644 package.js diff --git a/gulpfile.js b/gulpfile.js new file mode 100644 index 00000000..a88f54cb --- /dev/null +++ b/gulpfile.js @@ -0,0 +1,12 @@ +const gulp = require('gulp') +const replace = require('gulp-replace') + +// bump npm package version into package.js +gulp.task('meteor', function() { + const pkg = require('./package.json') + const versionRegex = /(version\:\s*\')([^\']+)\'/gi + + return gulp.src('package.js') + .pipe(replace(versionRegex, '$1' + pkg.version + "'")) + .pipe(gulp.dest('./')) +}) diff --git a/package.js b/package.js new file mode 100644 index 00000000..1afa7abc --- /dev/null +++ b/package.js @@ -0,0 +1,24 @@ +/* global packageFix:true Package:false */ +// package metadata file for AtmosphereJS + +try { + packageFix = Package + + packageFix.describe({ + name: 'formly:angular-formly', + summary: 'angular-formly (official): forms for AngularJS', + version: '0.0.0-semantically-released.0', + git: 'https://github.com/formly-js/angular-formly.git', + }) + + packageFix.onUse((api) => { + api.versionsFrom(['METEOR@1.0']) + api.use('wieldo:api-check@7.5.5') + api.addFiles('dist/formly.js', 'client') + }) + +} catch (e) { + // little workaround... + // ghooks compiles this file and throws ReferenceError because + // Package is a global variable available only in Meteor environment +} diff --git a/package.json b/package.json index 01431251..e921d148 100644 --- a/package.json +++ b/package.json @@ -38,7 +38,8 @@ "report-coverage": "cat ./coverage/lcov.info | node_modules/.bin/codecov", "commit": "git-cz", "publish-latest": "publish-latest --user-email kent+formly-bot@doddsfamily.us --user-name formly-bot", - "semantic-release": "semantic-release pre && npm run build && npm publish && npm run publish-latest && semantic-release post" + "meteor": "gulp meteor", + "semantic-release": "semantic-release pre && npm run build && npm run meteor && npm publish && npm run publish-latest && semantic-release post" }, "config": { "ghooks": { @@ -72,6 +73,8 @@ "eslint-loader": "1.1.0", "eslint-plugin-mocha": "1.0.0", "ghooks": "1.0.0", + "gulp": "3.9.0", + "gulp-replace": "0.5.4", "http-server": "0.8.5", "isparta": "3.1.0", "isparta-loader": "1.0.0", From a5ea31648a1d91cf24566065f003a53ee760d435 Mon Sep 17 00:00:00 2001 From: Kamil Kisiela Date: Wed, 30 Dec 2015 23:06:40 +0100 Subject: [PATCH 02/23] chore: add meteor dependencies --- package.js | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/package.js b/package.js index 1afa7abc..e8510962 100644 --- a/package.js +++ b/package.js @@ -1,24 +1,23 @@ -/* global packageFix:true Package:false */ +/* global Package:false */ // package metadata file for AtmosphereJS try { - packageFix = Package - - packageFix.describe({ + Package.describe({ name: 'formly:angular-formly', summary: 'angular-formly (official): forms for AngularJS', version: '0.0.0-semantically-released.0', git: 'https://github.com/formly-js/angular-formly.git', }) - packageFix.onUse((api) => { + Package.onUse(function(api) { api.versionsFrom(['METEOR@1.0']) + // api-check api.use('wieldo:api-check@7.5.5') + api.imply('wieldo:api-check') + // angular + api.use('angular:angular@1.4.0') api.addFiles('dist/formly.js', 'client') }) - } catch (e) { - // little workaround... - // ghooks compiles this file and throws ReferenceError because - // Package is a global variable available only in Meteor environment + // } From 974d6a0ae0149ee541678dea02e36b152ee483f4 Mon Sep 17 00:00:00 2001 From: Jonathan Haines Date: Wed, 13 Jan 2016 15:55:23 +1100 Subject: [PATCH 03/23] test(formly-field): should run field expressions when form is initialised --- src/directives/formly-field.test.js | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/src/directives/formly-field.test.js b/src/directives/formly-field.test.js index 866a921e..538520d6 100644 --- a/src/directives/formly-field.test.js +++ b/src/directives/formly-field.test.js @@ -1933,6 +1933,31 @@ describe('formly-field', function() { $timeout.flush() expect($validateSpy).to.have.been.calledOnce }) + + it.skip(`should run field expressions when form is initialised`, () => { + scope.model = {email: ''} + scope.fields = [getNewField({ + key: 'email', + templateOptions: { + required: true, + }, + extras: {validateOnModelChange: true}, + }), + getNewField({ + key: 'firstName', + templateOptions: { + required: true, + }, + extras: {validateOnModelChange: true}, + hideExpression: 'form.email.$invalid', + })] + + compileAndDigest() + $timeout.flush() + scope.$digest() + expect(scope.fields[1].formControl).to.exist + expect(scope.fields[1].hide).to.equal(true) + }) }) }) From 8167abda547fe6ad26da01b343e782ad62f07d9c Mon Sep 17 00:00:00 2001 From: Karol Wypchlo Date: Sun, 10 Jan 2016 16:55:58 +0100 Subject: [PATCH 04/23] feat(manualModelWatcher): add alternatives to global model watcher - add manualModelWatcher option that accepts boolean or custom watcher function for more flexibilty - add watchAllExpressions option (boolean) that puts angular watcher on every field expression - add runFieldExpressions option to custom field watcher that runs field expressions on expression change --- src/directives/formly-field.js | 18 +- src/directives/formly-form.js | 76 +++++-- src/directives/formly-form.test.js | 339 +++++++++++++++++++++++++++++ src/providers/formlyApiCheck.js | 5 +- 4 files changed, 413 insertions(+), 25 deletions(-) diff --git a/src/directives/formly-field.js b/src/directives/formly-field.js index 28abdbac..4c50195f 100644 --- a/src/directives/formly-field.js +++ b/src/directives/formly-field.js @@ -35,7 +35,7 @@ function formlyField($http, $q, $compile, $templateCache, $interpolate, formlyCo // @ngInject function FormlyFieldController($scope, $timeout, $parse, $controller, formlyValidationMessages) { - /* eslint max-statements:[2, 32] */ + /* eslint max-statements:[2, 34] */ if ($scope.options.fieldGroup) { setupFieldGroup() return @@ -53,6 +53,7 @@ function formlyField($http, $q, $compile, $templateCache, $interpolate, formlyCo setDefaultValue() setInitialValue() runExpressions() + watchExpressions() addValidationMessages($scope.options) invokeControllers($scope, $scope.options, fieldType) @@ -72,6 +73,21 @@ function formlyField($http, $q, $compile, $templateCache, $interpolate, formlyCo }, 0, false) } + function watchExpressions() { + if ($scope.formOptions.watchAllExpressions) { + const field = $scope.options + const currentValue = valueGetterSetter() + angular.forEach(field.expressionProperties, function watchExpression(expression, prop) { + const setter = $parse(prop).assign + $scope.$watch(function expressionPropertyWatcher() { + return formlyUtil.formlyEval($scope, expression, currentValue, currentValue) + }, function expressionPropertyListener(value) { + setter(field, value) + }, true) + }) + } + } + function valueGetterSetter(newVal) { if (!$scope.model || !$scope.options.key) { return undefined diff --git a/src/directives/formly-form.js b/src/directives/formly-form.js index b2037e8a..1d91fca8 100644 --- a/src/directives/formly-form.js +++ b/src/directives/formly-form.js @@ -112,28 +112,35 @@ function formlyForm(formlyUsability, formlyWarn, $parse, formlyConfig, $interpol setupFields() // watch the model and evaluate watch expressions that depend on it. - $scope.$watch('model', onModelOrFormStateChange, true) + if (!$scope.options.manualModelWatcher) { + $scope.$watch('model', onModelOrFormStateChange, true) + } else if (angular.isFunction($scope.options.manualModelWatcher)) { + $scope.$watch($scope.options.manualModelWatcher, onModelOrFormStateChange, true) + } + if ($scope.options.formState) { $scope.$watch('options.formState', onModelOrFormStateChange, true) } function onModelOrFormStateChange() { - angular.forEach($scope.fields, function runFieldExpressionProperties(field, index) { - const model = field.model || $scope.model - const promise = field.runExpressions && field.runExpressions() - if (field.hideExpression) { // can't use hide with expressionProperties reliably - const val = model[field.key] - field.hide = evalCloseToFormlyExpression(field.hideExpression, val, field, index) - } - if (field.extras && field.extras.validateOnModelChange && field.formControl) { - const validate = field.formControl.$validate - if (promise) { - promise.then(validate) - } else { - validate() - } + angular.forEach($scope.fields, runFieldExpressionProperties) + } + + function runFieldExpressionProperties(field, index) { + const model = field.model || $scope.model + const promise = field.runExpressions && field.runExpressions() + if (field.hideExpression) { // can't use hide with expressionProperties reliably + const val = model[field.key] + field.hide = evalCloseToFormlyExpression(field.hideExpression, val, field, index) + } + if (field.extras && field.extras.validateOnModelChange && field.formControl) { + const validate = field.formControl.$validate + if (promise) { + promise.then(validate) + } else { + validate() } - }) + } } function setupFields() { @@ -158,6 +165,10 @@ function formlyForm(formlyUsability, formlyWarn, $parse, formlyConfig, $interpol setupModels() + if ($scope.options.watchAllExpressions) { + angular.forEach($scope.fields, setupHideExpressionWatcher) + } + angular.forEach($scope.fields, attachKey) // attaches a key based on the index if a key isn't specified angular.forEach($scope.fields, setupWatchers) // setup watchers for all fields } @@ -217,6 +228,8 @@ function formlyForm(formlyUsability, formlyWarn, $parse, formlyConfig, $interpol function setupModels() { // a set of field models that are already watched (the $scope.model will have its own watcher) const watchedModels = [$scope.model] + // we will not set up automatic model watchers if manual mode is set + const manualModelWatcher = $scope.options.manualModelWatcher if ($scope.options.formState) { // $scope.options.formState will have its own watcher @@ -226,13 +239,23 @@ function formlyForm(formlyUsability, formlyWarn, $parse, formlyConfig, $interpol angular.forEach($scope.fields, (field) => { const isNewModel = initModel(field) - if (field.model && isNewModel && watchedModels.indexOf(field.model) === -1) { + if (field.model && isNewModel && watchedModels.indexOf(field.model) === -1 && !manualModelWatcher) { $scope.$watch(() => field.model, onModelOrFormStateChange, true) watchedModels.push(field.model) } }) } + function setupHideExpressionWatcher(field, index) { + if (field.hideExpression) { // can't use hide with expressionProperties reliably + const model = field.model || $scope.model + $scope.$watch(function hideExpressionWatcher() { + const val = model[field.key] + return evalCloseToFormlyExpression(field.hideExpression, val, field, index) + }, (hide) => field.hide = hide, true) + } + } + function initModel(field) { let isNewModel = true @@ -240,7 +263,7 @@ function formlyForm(formlyUsability, formlyWarn, $parse, formlyConfig, $interpol const expression = field.model const index = $scope.fields.indexOf(field) - isNewModel = !refrencesCurrentlyWatchedModel(expression) + isNewModel = !referencesCurrentlyWatchedModel(expression) field.model = evalCloseToFormlyExpression(expression, undefined, field, index) if (!field.model) { @@ -254,7 +277,7 @@ function formlyForm(formlyUsability, formlyWarn, $parse, formlyConfig, $interpol return isNewModel } - function refrencesCurrentlyWatchedModel(expression) { + function referencesCurrentlyWatchedModel(expression) { return ['model', 'formState'].some(item => { return formlyUtil.startsWith(expression, `${item}.`) || formlyUtil.startsWith(expression, `${item}[`) }) @@ -275,7 +298,7 @@ function formlyForm(formlyUsability, formlyWarn, $parse, formlyConfig, $interpol watchers = [watchers] } angular.forEach(watchers, function setupWatcher(watcher) { - if (!angular.isDefined(watcher.listener)) { + if (!angular.isDefined(watcher.listener) && !watcher.runFieldExpressions) { throw formlyUsability.getFieldError( 'all-field-watchers-must-have-a-listener', 'All field watchers must have a listener', field @@ -306,13 +329,20 @@ function formlyForm(formlyUsability, formlyWarn, $parse, formlyConfig, $interpol function getWatchListener(watcher, field, index) { let watchListener = watcher.listener - if (angular.isFunction(watchListener)) { + if (angular.isFunction(watchListener) || watcher.runFieldExpressions) { // wrap the field's watch listener so we can call it with the field as the first arg // and the stop function as the last arg as a helper const originalListener = watchListener watchListener = function formlyWatchListener() { - const args = modifyArgs(watcher, index, ...arguments) - return originalListener(...args) + let value + if (originalListener) { + const args = modifyArgs(watcher, index, ...arguments) + value = originalListener(...args) + } + if (watcher.runFieldExpressions) { + runFieldExpressionProperties(field, index) + } + return value } watchListener.displayName = `Formly Watch Listener for field for ${field.key}` } diff --git a/src/directives/formly-form.test.js b/src/directives/formly-form.test.js index a3b160b1..ab4cfd3a 100644 --- a/src/directives/formly-form.test.js +++ b/src/directives/formly-form.test.js @@ -953,4 +953,343 @@ describe('formly-form', () => { expect(expression).to.have.been.called }) }) + + describe(`manualModelWatcher option`, () => { + beforeEach(() => { + scope.model = { + foo: 'myFoo', + bar: 123, + baz: {buzz: 'myBuzz'}, + } + + scope.fields = [ + {template: input, key: 'foo'}, + {template: input, key: 'bar', templateOptions: {type: 'number'}}, + ] + }) + + describe('declared as a boolean', () => { + beforeEach(() => { + scope.options = { + manualModelWatcher: true, + } + }) + + it(`should block a global model watcher`, () => { + const spy = sinon.spy() + + scope.fields[0].expressionProperties = { + 'templateOptions.label': spy, + } + + compileAndDigest() + $timeout.flush() + + spy.reset() + + scope.model.foo = 'bar' + + scope.$digest() + $timeout.verifyNoPendingTasks() + + expect(spy).to.not.have.been.called + }) + + it(`should watch manually selected model property`, () => { + const spy = sinon.spy() + + scope.fields[0].watcher = [{ + expression: 'model.foo', + runFieldExpressions: true, + }] + scope.fields[0].expressionProperties = { + 'templateOptions.label': spy, + } + + compileAndDigest() + $timeout.flush() + + spy.reset() + + scope.model.foo = 'bar' + + scope.$digest() + $timeout.flush() + + expect(spy).to.have.been.called + }) + + it(`should not watch model properties that do not have manual watcher defined`, () => { + const spy = sinon.spy() + + scope.fields[0].watcher = [{ + expression: 'model.foo', + runFieldExpressions: true, + }] + scope.fields[0].expressionProperties = { + 'templateOptions.label': spy, + } + + compileAndDigest() + $timeout.flush() + + spy.reset() + + scope.model.bar = 123 + + scope.$digest() + $timeout.verifyNoPendingTasks() + + expect(spy).to.not.have.been.called + }) + + it(`should run manual watchers defined as a function`, () => { + const spy = sinon.spy() + const stub = sinon.stub() + + scope.fields[0].watcher = [{ + expression: stub, + runFieldExpressions: true, + }] + scope.fields[0].expressionProperties = { + 'templateOptions.label': spy, + } + + compileAndDigest() + $timeout.flush() + + stub.reset() + spy.reset() + + // set random stub value so it triggers watcher function + stub.returns(Math.random()) + + scope.$digest() + $timeout.flush() + + expect(stub).to.have.been.called + expect(spy).to.have.been.called + }) + + it('should not trigger watches on other fields', () => { + const spy1 = sinon.spy() + const spy2 = sinon.spy() + + scope.fields[0].watcher = [{ + expression: 'model.foo', + runFieldExpressions: true, + }] + scope.fields[0].expressionProperties = { + 'templateOptions.label': spy1, + } + scope.fields[1].expressionProperties = { + 'templateOptions.label': spy2, + } + + compileAndDigest() + $timeout.flush() + + spy1.reset() + spy2.reset() + + scope.model.foo = 'asd' + + scope.$digest() + $timeout.flush() + + expect(spy1).to.have.been.called + expect(spy2).to.not.have.been.called + }) + + it('works with models that are declared as string (relative model)', () => { + const spy = sinon.spy() + const model = 'model.nested' + + scope.model = { + nested: { + foo: 'foo', + }, + } + scope.fields[0].model = model + scope.fields[0].watcher = [{ + expression: 'model.nested.foo', + runFieldExpressions: true, + }] + scope.fields[0].expressionProperties = { + 'templateOptions.label': spy, + } + + compileAndDigest() + $timeout.flush() + + spy.reset() + + scope.model.nested.foo = 'bar' + + scope.$digest() + $timeout.flush() + + expect(spy).to.have.been.called + }) + }) + + describe('declared as a function', () => { + beforeEach(() => { + scope.options = { + manualModelWatcher: () => scope.model.baz, + } + }) + + it('works as a form-wide watcher', () => { + const spy = sinon.spy() + + scope.options = { + manualModelWatcher: () => scope.model.baz, + } + + scope.fields[1].expressionProperties = { + 'templateOptions.label': spy, + } + + compileAndDigest() + $timeout.flush() + + spy.reset() + + scope.model.foo = 'random string' + + scope.$digest() + $timeout.verifyNoPendingTasks() + + expect(spy).to.not.have.been.called + + spy.reset() + + scope.model.baz.buzz = 'random buzz string' + + scope.$digest() + $timeout.flush() + + expect(spy).to.have.been.called + }) + + it('still fires manual field watchers', () => { + const spy = sinon.spy() + + scope.fields[0].watcher = [{ + expression: 'model.foo', + runFieldExpressions: true, + }] + scope.fields[0].expressionProperties = { + 'templateOptions.label': spy, + } + + compileAndDigest() + $timeout.flush() + + spy.reset() + + scope.model.foo = 'bar' + + scope.$digest() + $timeout.flush() + + expect(spy).to.have.been.called + }) + + }) + + describe('enabled with watchAllExpressions option', () => { + beforeEach(() => { + scope.options = { + manualModelWatcher: true, + watchAllExpressions: true, + } + }) + + it('watches and evaluates string template expressions', () => { + const field = scope.fields[0] + + field.expressionProperties = { + 'templateOptions.label': 'model.foo', + } + + compileAndDigest() + $timeout.flush() + + scope.model.foo = 'bar' + + scope.$digest() + + expect(field.templateOptions.label).to.equal(scope.model.foo) + }) + + it('watches and evaluates string template expressions with custom string model', () => { + const field = scope.fields[0] + + field.model = 'model.baz' + field.expressionProperties = { + 'templateOptions.label': 'model.buzz', + } + + compileAndDigest() + $timeout.flush() + + scope.model.baz.buzz = 'bar' + + scope.$digest() + + expect(field.templateOptions.label).to.equal(scope.model.baz.buzz) + }) + + it('watches and evaluates string template expressions with custom object model', () => { + const field = scope.fields[0] + + field.model = {customFoo: 'customBar'} + field.expressionProperties = { + 'templateOptions.label': 'model.customFoo', + } + + compileAndDigest() + $timeout.flush() + + field.model.customFoo = 'bar' + + scope.$digest() + + expect(field.templateOptions.label).to.equal(field.model.customFoo) + }) + + it('watches and evaluates hideExpression', () => { + const field = scope.fields[0] + + field.hideExpression = 'model.foo === "bar"' + + compileAndDigest() + $timeout.flush() + + scope.model.foo = 'bar' + + scope.$digest() + + expect(field.hide).to.equal(true) + }) + + it('watches and evaluates hideExpression with custom string model', () => { + const field = scope.fields[0] + + field.model = 'model.baz' + field.hideExpression = 'model.baz.buzz === "bar"' + + compileAndDigest() + $timeout.flush() + + scope.model.baz.buzz = 'bar' + + scope.$digest() + + expect(field.hide).to.equal(true) + }) + }) + }) }) diff --git a/src/providers/formlyApiCheck.js b/src/providers/formlyApiCheck.js index b8cef8c9..202235cd 100644 --- a/src/providers/formlyApiCheck.js +++ b/src/providers/formlyApiCheck.js @@ -116,7 +116,8 @@ const fieldOptionsApiShape = { watcher: apiCheck.typeOrArrayOf( apiCheck.shape({ expression: formlyExpression.optional, - listener: formlyExpression, + listener: formlyExpression.optional, + runFieldExpressions: apiCheck.bool.optional, }) ).optional, validators: validatorChecker.optional, @@ -164,6 +165,8 @@ const formOptionsApi = apiCheck.shape({ updateInitialValue: apiCheck.func.optional, removeChromeAutoComplete: apiCheck.bool.optional, templateManipulators: templateManipulators.optional, + manualModelWatcher: apiCheck.oneOfType([apiCheck.bool, apiCheck.func]).optional, + watchAllExpressions: apiCheck.bool.optional, wrapper: specifyWrapperType.optional, fieldTransform: apiCheck.oneOfType([ apiCheck.func, apiCheck.array, From e3fa13cb10a91ee0c87e23bdf22b15def7dd2a83 Mon Sep 17 00:00:00 2001 From: Kamil Kisiela Date: Tue, 19 Jan 2016 22:25:31 +0100 Subject: [PATCH 05/23] chore: set png files as binary Denote all files that are truly binary and should not be modified --- .gitattributes | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitattributes b/.gitattributes index fcadb2cf..d0c0c4c1 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1 +1,2 @@ * text eol=lf +*.png binary From 967e9ce47b8804c421e0c15ce1472b82802641f2 Mon Sep 17 00:00:00 2001 From: Kamil Kisiela Date: Tue, 19 Jan 2016 23:58:04 +0100 Subject: [PATCH 06/23] chore(tests): fix socket error in karma related with karma-runner/karma#1782 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index e921d148..4b4f94ba 100644 --- a/package.json +++ b/package.json @@ -79,7 +79,7 @@ "isparta": "3.1.0", "isparta-loader": "1.0.0", "istanbul": "0.4.0", - "karma": "0.13.14", + "karma": "0.13.19", "karma-chai": "0.1.0", "karma-chrome-launcher": "0.2.1", "karma-coverage": "0.5.3", From f8bc5479ce2dd66aafe2a513f68c2deb411d8d88 Mon Sep 17 00:00:00 2001 From: Benjamin Orozco Date: Tue, 19 Jan 2016 17:50:55 -0600 Subject: [PATCH 07/23] feat(formly-form): add 'watcher' to fieldGroup originally requested in: http://stackoverflow.com/questions/34850697/clearing-fieldgroups-fields-when-hidden/34857087?noredirect=1#comment57499232_34857087 --- src/directives/formly-form.js | 9 +++++++-- src/directives/formly-form.test.js | 25 +++++++++++++++++++++++++ src/providers/formlyApiCheck.js | 17 ++++++++++------- 3 files changed, 42 insertions(+), 9 deletions(-) diff --git a/src/directives/formly-form.js b/src/directives/formly-form.js index 1d91fca8..db0bf70a 100644 --- a/src/directives/formly-form.js +++ b/src/directives/formly-form.js @@ -290,7 +290,7 @@ function formlyForm(formlyUsability, formlyWarn, $parse, formlyConfig, $interpol } function setupWatchers(field, index) { - if (isFieldGroup(field) || !angular.isDefined(field.watcher)) { + if (!angular.isDefined(field.watcher)) { return } let watchers = field.watcher @@ -313,7 +313,12 @@ function formlyForm(formlyUsability, formlyWarn, $parse, formlyConfig, $interpol } function getWatchExpression(watcher, field, index) { - let watchExpression = watcher.expression || 'model[\'' + field.key.toString().split('.').join('\'][\'') + '\']' + let watchExpression + if (!angular.isUndefined(watcher.expression)) { + watchExpression = watcher.expression + } else if (field.key) { + watchExpression = 'model[\'' + field.key.toString().split('.').join('\'][\'') + '\']' + } if (angular.isFunction(watchExpression)) { // wrap the field's watch expression so we can call it with the field as the first arg // and the stop function as the last arg as a helper diff --git a/src/directives/formly-form.test.js b/src/directives/formly-form.test.js index ab4cfd3a..b22ba670 100644 --- a/src/directives/formly-form.test.js +++ b/src/directives/formly-form.test.js @@ -952,6 +952,31 @@ describe('formly-form', () => { expect(listener).to.have.been.called expect(expression).to.have.been.called }) + + it(`should setup any watchers specified on a fieldgroup`, () => { + scope.model = {} + + const listener = sinon.spy() + const expression = sinon.spy() + + scope.fields = [{ + watcher: [{ + listener: '', + expression: '', + }, { + listener, + expression, + }], + fieldGroup: [ + getNewField({}), + getNewField({}), + ], + }] + + expect(compileAndDigest).to.not.throw() + expect(listener).to.have.been.called + expect(expression).to.have.been.called + }) }) describe(`manualModelWatcher option`, () => { diff --git a/src/providers/formlyApiCheck.js b/src/providers/formlyApiCheck.js index 202235cd..46dcb942 100644 --- a/src/providers/formlyApiCheck.js +++ b/src/providers/formlyApiCheck.js @@ -77,6 +77,14 @@ const validatorChecker = apiCheck.objectOf(apiCheck.oneOfType([ }).strict, ])) +const watcherChecker = apiCheck.typeOrArrayOf( + apiCheck.shape({ + expression: formlyExpression.optional, + listener: formlyExpression.optional, + runFieldExpressions: apiCheck.bool.optional, + }) +) + const fieldOptionsApiShape = { $$hashKey: apiCheck.any.optional, type: apiCheck.shape.ifNot(['template', 'templateUrl'], apiCheck.string).optional, @@ -113,13 +121,7 @@ const fieldOptionsApiShape = { getterSetter: apiCheck.bool.optional, timezone: apiCheck.string.optional, }).optional, - watcher: apiCheck.typeOrArrayOf( - apiCheck.shape({ - expression: formlyExpression.optional, - listener: formlyExpression.optional, - runFieldExpressions: apiCheck.bool.optional, - }) - ).optional, + watcher: watcherChecker.optional, validators: validatorChecker.optional, asyncValidators: validatorChecker.optional, parsers: apiCheck.arrayOf(formlyExpression).optional, @@ -184,6 +186,7 @@ const fieldGroup = apiCheck.shape({ options: formOptionsApi.optional, templateOptions: apiCheck.object.optional, wrapper: specifyWrapperType.optional, + watcher: watcherChecker.optional, hide: apiCheck.bool.optional, hideExpression: formlyExpression.optional, data: apiCheck.object.optional, From 8042d2ac8ef3f78f473c7504af4456832e5ae221 Mon Sep 17 00:00:00 2001 From: Kamil Kisiela Date: Wed, 20 Jan 2016 01:44:09 +0100 Subject: [PATCH 08/23] feat(ngModelAttrsManipulator): step attribute Closes #592 --- src/run/formlyNgModelAttrsManipulator.js | 2 +- src/run/formlyNgModelAttrsManipulator.test.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/run/formlyNgModelAttrsManipulator.js b/src/run/formlyNgModelAttrsManipulator.js index c12b7cb1..e780b9ee 100644 --- a/src/run/formlyNgModelAttrsManipulator.js +++ b/src/run/formlyNgModelAttrsManipulator.js @@ -182,7 +182,7 @@ function addFormlyNgModelAttrsManipulator(formlyConfig, $interpolate) { const bothBooleanAndBound = ['required', 'disabled'] const bothAttributeAndBound = ['pattern', 'minlength'] const statementOnly = ['change', 'keydown', 'keyup', 'keypress', 'click', 'focus', 'blur'] - const attributeOnly = ['placeholder', 'min', 'max', 'tabindex', 'type'] + const attributeOnly = ['placeholder', 'min', 'max', 'step', 'tabindex', 'type'] if (formlyConfig.extras.ngModelAttrsManipulatorPreferUnbound) { bothAttributeAndBound.push('maxlength') } else { diff --git a/src/run/formlyNgModelAttrsManipulator.test.js b/src/run/formlyNgModelAttrsManipulator.test.js index e0bfed69..b4f0fc3b 100644 --- a/src/run/formlyNgModelAttrsManipulator.test.js +++ b/src/run/formlyNgModelAttrsManipulator.test.js @@ -258,7 +258,7 @@ describe('formlyNgModelAttrsManipulator', () => { describe(`attributeOnly`, () => { - ['placeholder', 'min', 'max', 'tabindex', 'type'].forEach(testAttribute) + ['placeholder', 'min', 'max', 'step', 'tabindex', 'type'].forEach(testAttribute) function testAttribute(name) { it(`should be placed as an attribute if it is present in the templateOptions`, () => { From 3bee9f52d0522a5e48fadd9f271cd1c9f5806408 Mon Sep 17 00:00:00 2001 From: Alex Booker Date: Fri, 5 Feb 2016 02:36:39 +0000 Subject: [PATCH 09/23] Update links to Angular convention specification --- CONTRIBUTING.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index f5eb466f..718ec963 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -33,7 +33,7 @@ with a link to a jsbin that demonstrates the issue with [issue.angular-formly.co [How to Write an Open Source JavaScript Library](https://egghead.io/series/how-to-write-an-open-source-javascript-library) series on egghead.io (by yours truly). See [this lesson](https://egghead.io/lessons/javascript-how-to-write-a-javascript-library-writing-conventional-commits-with-commitizen?series=how-to-write-an-open-source-javascript-library) -and [this repo](https://github.com/ajoslin/conventional-changelog/blob/master/conventions/angular.md) +and [this repo](https://github.com/ajoslin/conventional-changelog/blob/81860ab6529d45422a78251951b458289df9405c/conventions/angular.md) to learn more about the commit message conventions. [Watch video](https://www.youtube.com/watch?v=QOchwBm9W-g&list=PLV5CVI1eNcJi7lVVIuNyRhEuck1Z007BH&index=1) (slightly out of date) @@ -52,7 +52,7 @@ Please do the following: 2. run `npm start` (if you're on a windows machine, see [this issue](https://github.com/formly-js/angular-formly/issues/305)) 3. write tests & code in ES6 goodness :-) 4. run `git add src/` -5. run `npm run commit` and follow the prompt (this ensures that your commit message follows [our conventions](https://github.com/ajoslin/conventional-changelog/blob/master/conventions/angular.md)). +5. run `npm run commit` and follow the prompt (this ensures that your commit message follows [our conventions](https://github.com/ajoslin/conventional-changelog/blob/81860ab6529d45422a78251951b458289df9405c/conventions/angular.md)). 6. notice that there's a pre-commit hook that runs to ensure tests pass and coverage doesn't drop to prevent the build from breaking :-) 7. push your changes 8. create a PR with a link to the original issue From 200a24695f936d4fba0381dc192158f462b401ed Mon Sep 17 00:00:00 2001 From: Alex Booker Date: Fri, 5 Feb 2016 02:50:55 +0000 Subject: [PATCH 10/23] Update links to Angular convention specification --- CONTRIBUTING.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 718ec963..81e839c3 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -33,7 +33,7 @@ with a link to a jsbin that demonstrates the issue with [issue.angular-formly.co [How to Write an Open Source JavaScript Library](https://egghead.io/series/how-to-write-an-open-source-javascript-library) series on egghead.io (by yours truly). See [this lesson](https://egghead.io/lessons/javascript-how-to-write-a-javascript-library-writing-conventional-commits-with-commitizen?series=how-to-write-an-open-source-javascript-library) -and [this repo](https://github.com/ajoslin/conventional-changelog/blob/81860ab6529d45422a78251951b458289df9405c/conventions/angular.md) +and [this repo](https://github.com/stevemao/conventional-changelog-angular/blob/master/convention.md) to learn more about the commit message conventions. [Watch video](https://www.youtube.com/watch?v=QOchwBm9W-g&list=PLV5CVI1eNcJi7lVVIuNyRhEuck1Z007BH&index=1) (slightly out of date) @@ -52,7 +52,7 @@ Please do the following: 2. run `npm start` (if you're on a windows machine, see [this issue](https://github.com/formly-js/angular-formly/issues/305)) 3. write tests & code in ES6 goodness :-) 4. run `git add src/` -5. run `npm run commit` and follow the prompt (this ensures that your commit message follows [our conventions](https://github.com/ajoslin/conventional-changelog/blob/81860ab6529d45422a78251951b458289df9405c/conventions/angular.md)). +5. run `npm run commit` and follow the prompt (this ensures that your commit message follows [our conventions](https://github.com/stevemao/conventional-changelog-angular/blob/master/convention.md)). 6. notice that there's a pre-commit hook that runs to ensure tests pass and coverage doesn't drop to prevent the build from breaking :-) 7. push your changes 8. create a PR with a link to the original issue From d87392a05aa0b3e9dbbb37a6846a7331d9f6d86e Mon Sep 17 00:00:00 2001 From: Nikhil Shagrithaya Date: Wed, 3 Feb 2016 01:55:33 +0530 Subject: [PATCH 11/23] fix(formly-form): added originalModel and formOptions to getFormlyFieldLikeLocals function added originalModel and formOptions to getFormlyFieldLikeLocals function issue #616: https://github.com/formly-js/angular-formly/issues/616 --- src/directives/formly-form.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/directives/formly-form.js b/src/directives/formly-form.js index db0bf70a..ff2ff97c 100644 --- a/src/directives/formly-form.js +++ b/src/directives/formly-form.js @@ -369,6 +369,8 @@ function formlyForm(formlyUsability, formlyWarn, $parse, formlyConfig, $interpol options: field, index, formState: $scope.options.formState, + originalModel: $scope.model, + formOptions: $scope.options, formId: $scope.formId, } } From fcb91c8e95e40954a735135144da1d7b031e25c7 Mon Sep 17 00:00:00 2001 From: Nikhil Shagrithaya Date: Mon, 8 Feb 2016 01:39:29 +0530 Subject: [PATCH 12/23] test(formly-form): closes issue #616 added tests to hideExpression test suite --- src/directives/formly-form.test.js | 89 +++++++++++++++++++++++++----- 1 file changed, 74 insertions(+), 15 deletions(-) diff --git a/src/directives/formly-form.test.js b/src/directives/formly-form.test.js index b22ba670..ff857fa5 100644 --- a/src/directives/formly-form.test.js +++ b/src/directives/formly-form.test.js @@ -536,26 +536,85 @@ describe('formly-form', () => { beforeEach(() => { scope.model = {} scope.fieldModel = {} - - scope.fields = [ - {template: input, key: 'foo', model: scope.fieldModel}, - {template: input, key: 'bar', model: scope.fieldModel, hideExpression: () => !!scope.fieldModel.foo}, - ] }) + describe('behaviour when model changes', () => { + + describe('when a string is passed to hideExpression', () => { + beforeEach(() => { + scope.fields = [ + {template: input, key: 'foo', model: scope.fieldModel}, + {template: input, key: 'bar', model: scope.fieldModel, hideExpression: () => !!scope.fieldModel.foo}, + ] + }) - it('should be called and resolve to true when field model changes', () => { - compileAndDigest() - expect(scope.fields[1].hide).be.false - scope.fields[0].formControl.$setViewValue('value') - expect(scope.fields[1].hide).be.true + it('should be called and should resolve to true when field model changes', () => { + compileAndDigest() + expect(scope.fields[1].hide).be.false + scope.fields[0].formControl.$setViewValue('value') + expect(scope.fields[1].hide).be.true + }) + + it('should be called and should resolve to false when field model changes', () => { + scope.fieldModel.foo = 'value' + compileAndDigest() + expect(scope.fields[1].hide).be.true + scope.fields[0].formControl.$setViewValue('') + expect(scope.fields[1].hide).be.false + }) + }) + describe('when a function is passed to hideExpression', () => { + beforeEach(() => { + scope.fields = [ + {template: input, key: 'foo', model: scope.fieldModel}, + { + template: input, key: 'bar', + model: scope.fieldModel, + hideExpression: ($viewValue, $modelValue, scope) => { + return !!scope.fields[1].data.formScope.fieldModel.foo //since the scope passed to the function belongs to the field, + }, //we store the form's scope in data property to access it here. + data: { + formScope: scope, //the form's scope + }, + }, + ] + }) + + it('should be called and should resolve to true when field model changes', () => { + compileAndDigest() + expect(scope.fields[1].hide).be.false + scope.fields[0].formControl.$setViewValue('value') + expect(scope.fields[1].hide).be.true + }) + + it('should be called and should resolve to false when field model changes', () => { + scope.fieldModel.foo = 'value' + compileAndDigest() + expect(scope.fields[1].hide).be.true + scope.fields[0].formControl.$setViewValue('') + expect(scope.fields[1].hide).be.false + }) + }) }) - it('should be called and resolve to false when field model changes', () => { - scope.fieldModel.foo = 'value' + it('ensures that hideExpression has all the expressionProperties values', () => { + scope.options = {formState: {}} + scope.fields = [{ + template: input, + key: 'test', + hideExpression: ` + options === options.data.field && + index === 0 && + formState === options.data.formOptions.formState && + originalModel === options.data.originalModel && + formOptions === options.data.formOptions`, + data: { + originalModel: scope.model, + formOptions: scope.options, + }, + }] + scope.fields[0].data.field = scope.fields[0] compileAndDigest() - expect(scope.fields[1].hide).be.true - scope.fields[0].formControl.$setViewValue('') - expect(scope.fields[1].hide).be.false + expect(scope.fields[0].hide).be.true }) }) From 817262d331a33df7b3a35d2e53e930ce9611f93f Mon Sep 17 00:00:00 2001 From: "Kent C. Dodds" Date: Mon, 8 Feb 2016 11:01:33 -0800 Subject: [PATCH 13/23] docs(contrib): Add makeapullrequest.com links --- CONTRIBUTING.md | 2 ++ README.md | 2 ++ 2 files changed, 4 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 81e839c3..61473334 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -29,6 +29,8 @@ with a link to a jsbin that demonstrates the issue with [issue.angular-formly.co ## Pull Requests +**Working on your first Pull Request?** You can learn how from this *free* series [How to Contribute to an Open Source Project on GitHub](https://egghead.io/series/how-to-contribute-to-an-open-source-project-on-github) + ‼️‼️‼️ 👉**Please follow our commit message conventions** even if you're making a small change! This repository follows the [How to Write an Open Source JavaScript Library](https://egghead.io/series/how-to-write-an-open-source-javascript-library) series on egghead.io (by yours truly). See diff --git a/README.md b/README.md index 13ce77c9..b2d48ae0 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,8 @@ Links: [![egghead.io lessons](https://img.shields.io/badge/egghead-lessons-blue.svg?style=flat-square)](https://egghead.io/playlists/advanced-angular-forms-with-angular-formly) [![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/formly-js/angular-formly?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg?style=flat-square)](https://github.com/formly-js/angular-formly/releases) +[![PRs Welcome](https://img.shields.io/badge/prs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com) + angular-formly is an AngularJS module which has a directive to help customize and render JavaScript/JSON configured forms. The `formly-form` directive and the `formlyConfig` service are very powerful and bring unmatched maintainability to your From 3e6697217f765d4529ae774fdeaddb3e6a14a4a0 Mon Sep 17 00:00:00 2001 From: Nikhil Shagrithaya Date: Wed, 10 Feb 2016 01:17:04 +0530 Subject: [PATCH 14/23] test(formly-form): closes issue #616 --- src/directives/formly-form.test.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/directives/formly-form.test.js b/src/directives/formly-form.test.js index ff857fa5..1dcdbe85 100644 --- a/src/directives/formly-form.test.js +++ b/src/directives/formly-form.test.js @@ -570,10 +570,10 @@ describe('formly-form', () => { template: input, key: 'bar', model: scope.fieldModel, hideExpression: ($viewValue, $modelValue, scope) => { - return !!scope.fields[1].data.formScope.fieldModel.foo //since the scope passed to the function belongs to the field, - }, //we store the form's scope in data property to access it here. - data: { - formScope: scope, //the form's scope + return !!scope.fields[1].data.parentScope.fieldModel.foo //since the scope passed to the function belongs to the form, + }, //we store the outer(parent) scope in 'data' property to access + data: { //the template named 'foo' stored in the fields array + parentScope: scope, //the parent scope(one used to compile the form) }, }, ] From f16124c8922430227cda7358788cadd16dff2427 Mon Sep 17 00:00:00 2001 From: "Kent C. Dodds" Date: Wed, 17 Feb 2016 21:07:38 -0700 Subject: [PATCH 15/23] docs(templates): Add issue_template.md and pull_request_template.md --- .github/ISSUE_TEMPLATE.md | 28 ++++++++++++++++++++++++++++ .github/PULL_REQUEST_TEMPLATE.md | 30 ++++++++++++++++++++++++++++++ 2 files changed, 58 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE.md create mode 100644 .github/PULL_REQUEST_TEMPLATE.md diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md new file mode 100644 index 00000000..0d4aa6d6 --- /dev/null +++ b/.github/ISSUE_TEMPLATE.md @@ -0,0 +1,28 @@ + + diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 00000000..42cd724b --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,30 @@ + + +## What + + + +## Why + + + +## How + + + +For issue # + +Checklist: + +* [ ] Follows the commit message [conventions](https://github.com/stevemao/conventional-changelog-angular/blob/master/convention.md) +* [ ] Is [rebased with master](https://egghead.io/lessons/javascript-how-to-rebase-a-git-pull-request-branch?series=how-to-contribute-to-an-open-source-project-on-github) +* [ ] Is [only one (maybe two) commits](https://egghead.io/lessons/javascript-how-to-squash-multiple-git-commits) + From 262198f1c7e55dd52f29bb0de4c647a27d01f51e Mon Sep 17 00:00:00 2001 From: "Kent C. Dodds" Date: Wed, 17 Feb 2016 21:09:11 -0700 Subject: [PATCH 16/23] docs(issueTemplate): Update issue template links --- .github/ISSUE_TEMPLATE.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md index 0d4aa6d6..7a1f74fc 100644 --- a/.github/ISSUE_TEMPLATE.md +++ b/.github/ISSUE_TEMPLATE.md @@ -4,13 +4,13 @@ Thanks for your interest in angular-formly. If you're filing this issue to get help, please follow the -instructions at [help.angular-formly.com](http://help.angular-formly.com). +instructions at help.angular-formly.com The GitHub issues on this project are reserved for feature requests and bug reports. So if you file an issue looking for help, it will be closed and you'll be invited to follow the instructions -at [help.angular-formly.com](http://help.angular-formly.com). +at help.angular-formly.com. It's nothing personal. It's just hard to manage the project otherwise! From 96eaa4c2ac1ae4da6130fe988d6b44ff44920478 Mon Sep 17 00:00:00 2001 From: "Kent C. Dodds" Date: Wed, 17 Feb 2016 21:10:01 -0700 Subject: [PATCH 17/23] docs(issueTemplate): Fix link in issue template --- .github/ISSUE_TEMPLATE.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md index 7a1f74fc..8a0872fa 100644 --- a/.github/ISSUE_TEMPLATE.md +++ b/.github/ISSUE_TEMPLATE.md @@ -19,8 +19,7 @@ the project otherwise! If you'd like to report what you think is a bug or a feature request, please follow the instructions -at [issue.angular-formly.com](http://issue.angular-formly.com) -to file your issue. +at issue.angular-formly.com to file your issue. Thanks for your contribution! From eae422f9e449c7db69fde27e14ba9659e137c392 Mon Sep 17 00:00:00 2001 From: "Kent C. Dodds" Date: Wed, 17 Feb 2016 21:32:41 -0700 Subject: [PATCH 18/23] docs(readme): Add reference to #638 --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index b2d48ae0..1ad4b6d3 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,8 @@ ## [angular-formly](http://docs.angular-formly.com) +[THIS PROJECT NEEDS A MAINTAINER](https://github.com/formly-js/angular-formly/issues/638) + Status: [![npm version](https://img.shields.io/npm/v/angular-formly.svg?style=flat-square)](https://www.npmjs.org/package/angular-formly) [![npm downloads](https://img.shields.io/npm/dm/angular-formly.svg?style=flat-square)](http://npm-stat.com/charts.html?package=angular-formly&from=2015-01-01) From c03b2dc2f454ab1220523adeab66eb670686cb3c Mon Sep 17 00:00:00 2001 From: Dick Porter Date: Wed, 24 Feb 2016 13:10:20 +0000 Subject: [PATCH 19/23] fix(formly-form): validateOnModelChange now copes when field.formControl is an array Run $validate() on each formControl issue #523 --- src/directives/formly-field.test.js | 25 +++++++++++++++++++++++++ src/directives/formly-form.js | 18 ++++++++++++++---- 2 files changed, 39 insertions(+), 4 deletions(-) diff --git a/src/directives/formly-field.test.js b/src/directives/formly-field.test.js index 538520d6..51759b3e 100644 --- a/src/directives/formly-field.test.js +++ b/src/directives/formly-field.test.js @@ -1934,6 +1934,31 @@ describe('formly-field', function() { expect($validateSpy).to.have.been.calledOnce }) + it(`should cope when field.formControl has been upgraded to an array`, () => { + scope.model = { + multiNgModel: { + start: 'start', + stop: 'stop', + }, + } + const field = getNewField({ + key: 'multiNgModel', + template: multiNgModelField, + extras: { + validateOnModelChange: true, + }, + }) + scope.fields = [field] + compileAndDigest() + const $validateSpy0 = sinon.spy(field.formControl[0], '$validate') + const $validateSpy1 = sinon.spy(field.formControl[1], '$validate') + scope.model.foo = 'bar' + scope.$digest() + $timeout.flush() + expect($validateSpy0).to.have.been.calledOnce + expect($validateSpy1).to.have.been.calledOnce + }) + it.skip(`should run field expressions when form is initialised`, () => { scope.model = {email: ''} scope.fields = [getNewField({ diff --git a/src/directives/formly-form.js b/src/directives/formly-form.js index ff2ff97c..379dea36 100644 --- a/src/directives/formly-form.js +++ b/src/directives/formly-form.js @@ -126,6 +126,15 @@ function formlyForm(formlyUsability, formlyWarn, $parse, formlyConfig, $interpol angular.forEach($scope.fields, runFieldExpressionProperties) } + function validateFormControl(formControl, promise) { + const validate = formControl.$validate + if (promise) { + promise.then(validate) + } else { + validate() + } + } + function runFieldExpressionProperties(field, index) { const model = field.model || $scope.model const promise = field.runExpressions && field.runExpressions() @@ -134,11 +143,12 @@ function formlyForm(formlyUsability, formlyWarn, $parse, formlyConfig, $interpol field.hide = evalCloseToFormlyExpression(field.hideExpression, val, field, index) } if (field.extras && field.extras.validateOnModelChange && field.formControl) { - const validate = field.formControl.$validate - if (promise) { - promise.then(validate) + if (angular.isArray(field.formControl)) { + angular.forEach(field.formControl, function(formControl) { + validateFormControl(formControl, promise) + }) } else { - validate() + validateFormControl(field.formControl, promise) } } } From c899ee61eba157f573570fb9ce460bf8d9a9178b Mon Sep 17 00:00:00 2001 From: Karol Wypchlo Date: Thu, 18 Feb 2016 23:41:57 +0100 Subject: [PATCH 20/23] fix(expressions): change model reference in string hideExpression and watcher expression for nested models BREAKING CHANGE: reference to 'model' in string hideExpressions and watchers on fields with nested models now points to field.model just as in expressionProperties --- src/directives/formly-form.js | 9 ++++++++- src/directives/formly-form.test.js | 8 ++++++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/src/directives/formly-form.js b/src/directives/formly-form.js index ff2ff97c..4165ab6b 100644 --- a/src/directives/formly-form.js +++ b/src/directives/formly-form.js @@ -42,7 +42,7 @@ function formlyForm(formlyUsability, formlyWarn, $parse, formlyConfig, $interpol ${getHideDirective()}="!field.hide" class="formly-field" options="field" - model="field.model || model" + model="field.model" original-model="model" fields="fields" form="theFormlyForm" @@ -265,6 +265,8 @@ function formlyForm(formlyUsability, formlyWarn, $parse, formlyConfig, $interpol isNewModel = !referencesCurrentlyWatchedModel(expression) + // temporary assign $scope.model as field.model to evaluate the expression in correct context + field.model = $scope.model field.model = evalCloseToFormlyExpression(expression, undefined, field, index) if (!field.model) { throw formlyUsability.getFieldError( @@ -273,6 +275,8 @@ function formlyForm(formlyUsability, formlyWarn, $parse, formlyConfig, $interpol ' expression must have been initialized ahead of time.', field) } + } else if (!field.model) { + field.model = $scope.model } return isNewModel } @@ -328,6 +332,8 @@ function formlyForm(formlyUsability, formlyWarn, $parse, formlyConfig, $interpol return originalExpression(...args) } watchExpression.displayName = `Formly Watch Expression for field for ${field.key}` + } else if (field.model) { + watchExpression = $parse(watchExpression).bind(null, $scope, {model: field.model}) } return watchExpression } @@ -366,6 +372,7 @@ function formlyForm(formlyUsability, formlyWarn, $parse, formlyConfig, $interpol function getFormlyFieldLikeLocals(field, index) { // this makes it closer to what a regular formlyExpression would be return { + model: field.model, options: field, index, formState: $scope.options.formState, diff --git a/src/directives/formly-form.test.js b/src/directives/formly-form.test.js index 1dcdbe85..28914e95 100644 --- a/src/directives/formly-form.test.js +++ b/src/directives/formly-form.test.js @@ -597,17 +597,21 @@ describe('formly-form', () => { }) it('ensures that hideExpression has all the expressionProperties values', () => { + scope.model = {nested: {foo: 'bar', baz: []}} scope.options = {formState: {}} scope.fields = [{ template: input, key: 'test', + model: 'model.nested', hideExpression: ` + model === options.data.model && options === options.data.field && index === 0 && formState === options.data.formOptions.formState && originalModel === options.data.originalModel && formOptions === options.data.formOptions`, data: { + model: scope.model.nested, originalModel: scope.model, formOptions: scope.options, }, @@ -1196,7 +1200,7 @@ describe('formly-form', () => { } scope.fields[0].model = model scope.fields[0].watcher = [{ - expression: 'model.nested.foo', + expression: 'model.foo', runFieldExpressions: true, }] scope.fields[0].expressionProperties = { @@ -1363,7 +1367,7 @@ describe('formly-form', () => { const field = scope.fields[0] field.model = 'model.baz' - field.hideExpression = 'model.baz.buzz === "bar"' + field.hideExpression = 'model.buzz === "bar"' compileAndDigest() $timeout.flush() From 716f526edd34c4da31887e8efa06a11c44d4d226 Mon Sep 17 00:00:00 2001 From: Karol Wypchlo Date: Mon, 7 Mar 2016 15:29:33 +0100 Subject: [PATCH 21/23] fix(models): update field model reference for fields with nested string models --- src/directives/formly-form.js | 25 ++++++++++++++++--------- src/directives/formly-form.test.js | 18 ++++++++++++++++++ 2 files changed, 34 insertions(+), 9 deletions(-) diff --git a/src/directives/formly-form.js b/src/directives/formly-form.js index a9ab5b51..52895442 100644 --- a/src/directives/formly-form.js +++ b/src/directives/formly-form.js @@ -271,24 +271,31 @@ function formlyForm(formlyUsability, formlyWarn, $parse, formlyConfig, $interpol if (angular.isString(field.model)) { const expression = field.model - const index = $scope.fields.indexOf(field) isNewModel = !referencesCurrentlyWatchedModel(expression) - // temporary assign $scope.model as field.model to evaluate the expression in correct context + field.model = resolveStringModel(expression) + + $scope.$watch(() => resolveStringModel(expression), (model) => field.model = model) + } else if (!field.model) { field.model = $scope.model - field.model = evalCloseToFormlyExpression(expression, undefined, field, index) - if (!field.model) { + } + return isNewModel + + function resolveStringModel(expression) { + const index = $scope.fields.indexOf(field) + const model = evalCloseToFormlyExpression(expression, undefined, field, index, {model: $scope.model}) + + if (!model) { throw formlyUsability.getFieldError( 'field-model-must-be-initialized', 'Field model must be initialized. When specifying a model as a string for a field, the result of the' + ' expression must have been initialized ahead of time.', field) } - } else if (!field.model) { - field.model = $scope.model + + return model } - return isNewModel } function referencesCurrentlyWatchedModel(expression) { @@ -374,8 +381,8 @@ function formlyForm(formlyUsability, formlyWarn, $parse, formlyConfig, $interpol return [$scope.fields[index], ...originalArgs, watcher.stopWatching] } - function evalCloseToFormlyExpression(expression, val, field, index) { - const extraLocals = getFormlyFieldLikeLocals(field, index) + function evalCloseToFormlyExpression(expression, val, field, index, extraLocals = {}) { + extraLocals = angular.extend(getFormlyFieldLikeLocals(field, index), extraLocals) return formlyUtil.formlyEval($scope, expression, val, val, extraLocals) } diff --git a/src/directives/formly-form.test.js b/src/directives/formly-form.test.js index 28914e95..0eb6c2ab 100644 --- a/src/directives/formly-form.test.js +++ b/src/directives/formly-form.test.js @@ -495,6 +495,24 @@ describe('formly-form', () => { testFormStateAccessor('formState["nested"]') }) + it('should be updated when the reference to the outer model changes', () => { + scope.model.nested.foo = 'bar' + scope.fields[0].model = 'model.nested' + + compileAndDigest() + $timeout.flush() + + scope.model = { + nested: { + foo: 'baz', + }, + } + + scope.$digest() + + expect(scope.fields[0].model.foo).to.equal('baz') + }) + function testModelAccessor(accessor) { scope.fields[0].model = accessor From 01d37561385ee9850c70c7639a1cd51a1a27a09c Mon Sep 17 00:00:00 2001 From: Jonathan Haines Date: Wed, 9 Mar 2016 10:47:56 +1100 Subject: [PATCH 22/23] fix(build): create tag From c72f803a775dd53ed6c15820a8edd618602dd5ed Mon Sep 17 00:00:00 2001 From: Jonathan Haines Date: Wed, 9 Mar 2016 11:19:02 +1100 Subject: [PATCH 23/23] v8.0.2 --- dist/formly.js | 2772 ++++++++++++++++++++++++++++++++++++++++ dist/formly.min.js | 4 + dist/formly.min.js.map | 1 + package.json | 2 +- 4 files changed, 2778 insertions(+), 1 deletion(-) create mode 100644 dist/formly.js create mode 100644 dist/formly.min.js create mode 100644 dist/formly.min.js.map diff --git a/dist/formly.js b/dist/formly.js new file mode 100644 index 00000000..cb66d2a3 --- /dev/null +++ b/dist/formly.js @@ -0,0 +1,2772 @@ +/*! +* angular-formly JavaScript Library v0.0.0-semantically-released.0 +* +* @license MIT (http://license.angular-formly.com) +* +* built with ♥ by Astrism , Kent C. Dodds +* (ó ì_í)=óò=(ì_í ò) +*/ +(function webpackUniversalModuleDefinition(root, factory) { + if(typeof exports === 'object' && typeof module === 'object') + module.exports = factory(require("angular"), require("api-check")); + else if(typeof define === 'function' && define.amd) + define(["angular", "api-check"], factory); + else if(typeof exports === 'object') + exports["ngFormly"] = factory(require("angular"), require("api-check")); + else + root["ngFormly"] = factory(root["angular"], root["apiCheck"]); +})(this, function(__WEBPACK_EXTERNAL_MODULE_3__, __WEBPACK_EXTERNAL_MODULE_5__) { +return /******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; + +/******/ // The require function +/******/ function __webpack_require__(moduleId) { + +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) +/******/ return installedModules[moduleId].exports; + +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ exports: {}, +/******/ id: moduleId, +/******/ loaded: false +/******/ }; + +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); + +/******/ // Flag the module as loaded +/******/ module.loaded = true; + +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } + + +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; + +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; + +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = ""; + +/******/ // Load entry module and return exports +/******/ return __webpack_require__(0); +/******/ }) +/************************************************************************/ +/******/ ([ +/* 0 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, '__esModule', { + value: true + }); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + + var _indexCommon = __webpack_require__(1); + + var _indexCommon2 = _interopRequireDefault(_indexCommon); + + exports['default'] = _indexCommon2['default']; + module.exports = exports['default']; + +/***/ }, +/* 1 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, '__esModule', { + value: true + }); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + + var _angularFix = __webpack_require__(2); + + var _angularFix2 = _interopRequireDefault(_angularFix); + + var _providersFormlyApiCheck = __webpack_require__(4); + + var _providersFormlyApiCheck2 = _interopRequireDefault(_providersFormlyApiCheck); + + var _otherDocsBaseUrl = __webpack_require__(6); + + var _otherDocsBaseUrl2 = _interopRequireDefault(_otherDocsBaseUrl); + + var _providersFormlyUsability = __webpack_require__(7); + + var _providersFormlyUsability2 = _interopRequireDefault(_providersFormlyUsability); + + var _providersFormlyConfig = __webpack_require__(8); + + var _providersFormlyConfig2 = _interopRequireDefault(_providersFormlyConfig); + + var _providersFormlyValidationMessages = __webpack_require__(10); + + var _providersFormlyValidationMessages2 = _interopRequireDefault(_providersFormlyValidationMessages); + + var _servicesFormlyUtil = __webpack_require__(11); + + var _servicesFormlyUtil2 = _interopRequireDefault(_servicesFormlyUtil); + + var _servicesFormlyWarn = __webpack_require__(12); + + var _servicesFormlyWarn2 = _interopRequireDefault(_servicesFormlyWarn); + + var _directivesFormlyCustomValidation = __webpack_require__(13); + + var _directivesFormlyCustomValidation2 = _interopRequireDefault(_directivesFormlyCustomValidation); + + var _directivesFormlyField = __webpack_require__(14); + + var _directivesFormlyField2 = _interopRequireDefault(_directivesFormlyField); + + var _directivesFormlyFocus = __webpack_require__(15); + + var _directivesFormlyFocus2 = _interopRequireDefault(_directivesFormlyFocus); + + var _directivesFormlyForm = __webpack_require__(16); + + var _directivesFormlyForm2 = _interopRequireDefault(_directivesFormlyForm); + + var _runFormlyNgModelAttrsManipulator = __webpack_require__(17); + + var _runFormlyNgModelAttrsManipulator2 = _interopRequireDefault(_runFormlyNgModelAttrsManipulator); + + var _runFormlyCustomTags = __webpack_require__(18); + + var _runFormlyCustomTags2 = _interopRequireDefault(_runFormlyCustomTags); + + var ngModuleName = 'formly'; + + exports['default'] = ngModuleName; + + var ngModule = _angularFix2['default'].module(ngModuleName, []); + + ngModule.constant('formlyApiCheck', _providersFormlyApiCheck2['default']); + ngModule.constant('formlyErrorAndWarningsUrlPrefix', _otherDocsBaseUrl2['default']); + ngModule.constant('formlyVersion', ("0.0.0-semantically-released.0")); // <-- webpack variable + + ngModule.provider('formlyUsability', _providersFormlyUsability2['default']); + ngModule.provider('formlyConfig', _providersFormlyConfig2['default']); + + ngModule.factory('formlyValidationMessages', _providersFormlyValidationMessages2['default']); + ngModule.factory('formlyUtil', _servicesFormlyUtil2['default']); + ngModule.factory('formlyWarn', _servicesFormlyWarn2['default']); + + ngModule.directive('formlyCustomValidation', _directivesFormlyCustomValidation2['default']); + ngModule.directive('formlyField', _directivesFormlyField2['default']); + ngModule.directive('formlyFocus', _directivesFormlyFocus2['default']); + ngModule.directive('formlyForm', _directivesFormlyForm2['default']); + + ngModule.run(_runFormlyNgModelAttrsManipulator2['default']); + ngModule.run(_runFormlyCustomTags2['default']); + module.exports = exports['default']; + +/***/ }, +/* 2 */ +/***/ function(module, exports, __webpack_require__) { + + // some versions of angular don't export the angular module properly, + // so we get it from window in this case. + 'use strict'; + + Object.defineProperty(exports, '__esModule', { + value: true + }); + var angular = __webpack_require__(3); + + /* istanbul ignore next */ + if (!angular.version) { + angular = window.angular; + } + exports['default'] = angular; + module.exports = exports['default']; + +/***/ }, +/* 3 */ +/***/ function(module, exports) { + + module.exports = __WEBPACK_EXTERNAL_MODULE_3__; + +/***/ }, +/* 4 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, '__esModule', { + value: true + }); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + + var _angularFix = __webpack_require__(2); + + var _angularFix2 = _interopRequireDefault(_angularFix); + + var _apiCheck = __webpack_require__(5); + + var _apiCheck2 = _interopRequireDefault(_apiCheck); + + var apiCheck = (0, _apiCheck2['default'])({ + output: { + prefix: 'angular-formly:', + docsBaseUrl: __webpack_require__(6) + } + }); + + function shapeRequiredIfNot(otherProps, propChecker) { + if (!_angularFix2['default'].isArray(otherProps)) { + otherProps = [otherProps]; + } + var type = 'specified if these are not specified: `' + otherProps.join(', ') + '` (otherwise it\'s optional)'; + + function shapeRequiredIfNotDefinition(prop, propName, location, obj) { + var propExists = obj && obj.hasOwnProperty(propName); + var otherPropsExist = otherProps.some(function (otherProp) { + return obj && obj.hasOwnProperty(otherProp); + }); + if (!otherPropsExist && !propExists) { + return apiCheck.utils.getError(propName, location, type); + } else if (propExists) { + return propChecker(prop, propName, location, obj); + } + } + + shapeRequiredIfNotDefinition.type = type; + return apiCheck.utils.checkerHelpers.setupChecker(shapeRequiredIfNotDefinition); + } + + var formlyExpression = apiCheck.oneOfType([apiCheck.string, apiCheck.func]); + var specifyWrapperType = apiCheck.typeOrArrayOf(apiCheck.string).nullable; + + var apiCheckProperty = apiCheck.func; + + var apiCheckInstanceProperty = apiCheck.shape.onlyIf('apiCheck', apiCheck.func.withProperties({ + warn: apiCheck.func, + 'throw': apiCheck.func, + shape: apiCheck.func + })); + + var apiCheckFunctionProperty = apiCheck.shape.onlyIf('apiCheck', apiCheck.oneOf(['throw', 'warn'])); + + var formlyWrapperType = apiCheck.shape({ + name: shapeRequiredIfNot('types', apiCheck.string).optional, + template: apiCheck.shape.ifNot('templateUrl', apiCheck.string).optional, + templateUrl: apiCheck.shape.ifNot('template', apiCheck.string).optional, + types: apiCheck.typeOrArrayOf(apiCheck.string).optional, + overwriteOk: apiCheck.bool.optional, + apiCheck: apiCheckProperty.optional, + apiCheckInstance: apiCheckInstanceProperty.optional, + apiCheckFunction: apiCheckFunctionProperty.optional, + apiCheckOptions: apiCheck.object.optional + }).strict; + + var expressionProperties = apiCheck.objectOf(apiCheck.oneOfType([formlyExpression, apiCheck.shape({ + expression: formlyExpression, + message: formlyExpression.optional + }).strict])); + + var modelChecker = apiCheck.oneOfType([apiCheck.string, apiCheck.object]); + + var templateManipulators = apiCheck.shape({ + preWrapper: apiCheck.arrayOf(apiCheck.func).nullable.optional, + postWrapper: apiCheck.arrayOf(apiCheck.func).nullable.optional + }).strict.nullable; + + var validatorChecker = apiCheck.objectOf(apiCheck.oneOfType([formlyExpression, apiCheck.shape({ + expression: formlyExpression, + message: formlyExpression.optional + }).strict])); + + var watcherChecker = apiCheck.typeOrArrayOf(apiCheck.shape({ + expression: formlyExpression.optional, + listener: formlyExpression.optional, + runFieldExpressions: apiCheck.bool.optional + })); + + var fieldOptionsApiShape = { + $$hashKey: apiCheck.any.optional, + type: apiCheck.shape.ifNot(['template', 'templateUrl'], apiCheck.string).optional, + template: apiCheck.shape.ifNot(['type', 'templateUrl'], apiCheck.oneOfType([apiCheck.string, apiCheck.func])).optional, + templateUrl: apiCheck.shape.ifNot(['type', 'template'], apiCheck.oneOfType([apiCheck.string, apiCheck.func])).optional, + key: apiCheck.oneOfType([apiCheck.string, apiCheck.number]).optional, + model: modelChecker.optional, + originalModel: modelChecker.optional, + className: apiCheck.string.optional, + id: apiCheck.string.optional, + name: apiCheck.string.optional, + expressionProperties: expressionProperties.optional, + extras: apiCheck.shape({ + validateOnModelChange: apiCheck.bool.optional, + skipNgModelAttrsManipulator: apiCheck.oneOfType([apiCheck.string, apiCheck.bool]).optional + }).strict.optional, + data: apiCheck.object.optional, + templateOptions: apiCheck.object.optional, + wrapper: specifyWrapperType.optional, + modelOptions: apiCheck.shape({ + updateOn: apiCheck.string.optional, + debounce: apiCheck.oneOfType([apiCheck.objectOf(apiCheck.number), apiCheck.number]).optional, + allowInvalid: apiCheck.bool.optional, + getterSetter: apiCheck.bool.optional, + timezone: apiCheck.string.optional + }).optional, + watcher: watcherChecker.optional, + validators: validatorChecker.optional, + asyncValidators: validatorChecker.optional, + parsers: apiCheck.arrayOf(formlyExpression).optional, + formatters: apiCheck.arrayOf(formlyExpression).optional, + noFormControl: apiCheck.bool.optional, + hide: apiCheck.bool.optional, + hideExpression: formlyExpression.optional, + ngModelElAttrs: apiCheck.objectOf(apiCheck.string).optional, + ngModelAttrs: apiCheck.objectOf(apiCheck.shape({ + statement: apiCheck.shape.ifNot(['value', 'attribute', 'bound', 'boolean'], apiCheck.any).optional, + value: apiCheck.shape.ifNot('statement', apiCheck.any).optional, + attribute: apiCheck.shape.ifNot('statement', apiCheck.any).optional, + bound: apiCheck.shape.ifNot('statement', apiCheck.any).optional, + boolean: apiCheck.shape.ifNot('statement', apiCheck.any).optional + }).strict).optional, + elementAttributes: apiCheck.objectOf(apiCheck.string).optional, + optionsTypes: apiCheck.typeOrArrayOf(apiCheck.string).optional, + link: apiCheck.func.optional, + controller: apiCheck.oneOfType([apiCheck.string, apiCheck.func, apiCheck.array]).optional, + validation: apiCheck.shape({ + show: apiCheck.bool.nullable.optional, + messages: apiCheck.objectOf(formlyExpression).optional, + errorExistsAndShouldBeVisible: apiCheck.bool.optional + }).optional, + formControl: apiCheck.typeOrArrayOf(apiCheck.object).optional, + value: apiCheck.func.optional, + runExpressions: apiCheck.func.optional, + templateManipulators: templateManipulators.optional, + resetModel: apiCheck.func.optional, + updateInitialValue: apiCheck.func.optional, + initialValue: apiCheck.any.optional, + defaultValue: apiCheck.any.optional + }; + + var formlyFieldOptions = apiCheck.shape(fieldOptionsApiShape).strict; + + var formOptionsApi = apiCheck.shape({ + formState: apiCheck.object.optional, + resetModel: apiCheck.func.optional, + updateInitialValue: apiCheck.func.optional, + removeChromeAutoComplete: apiCheck.bool.optional, + templateManipulators: templateManipulators.optional, + manualModelWatcher: apiCheck.oneOfType([apiCheck.bool, apiCheck.func]).optional, + watchAllExpressions: apiCheck.bool.optional, + wrapper: specifyWrapperType.optional, + fieldTransform: apiCheck.oneOfType([apiCheck.func, apiCheck.array]).optional, + data: apiCheck.object.optional + }).strict; + + var fieldGroup = apiCheck.shape({ + $$hashKey: apiCheck.any.optional, + key: apiCheck.oneOfType([apiCheck.string, apiCheck.number]).optional, + // danger. Nested field groups wont get api-checked... + fieldGroup: apiCheck.arrayOf(apiCheck.oneOfType([formlyFieldOptions, apiCheck.object])), + className: apiCheck.string.optional, + options: formOptionsApi.optional, + templateOptions: apiCheck.object.optional, + wrapper: specifyWrapperType.optional, + watcher: watcherChecker.optional, + hide: apiCheck.bool.optional, + hideExpression: formlyExpression.optional, + data: apiCheck.object.optional, + model: modelChecker.optional, + form: apiCheck.object.optional, + elementAttributes: apiCheck.objectOf(apiCheck.string).optional + }).strict; + + var typeOptionsDefaultOptions = _angularFix2['default'].copy(fieldOptionsApiShape); + typeOptionsDefaultOptions.key = apiCheck.string.optional; + + var formlyTypeOptions = apiCheck.shape({ + name: apiCheck.string, + template: apiCheck.shape.ifNot('templateUrl', apiCheck.oneOfType([apiCheck.string, apiCheck.func])).optional, + templateUrl: apiCheck.shape.ifNot('template', apiCheck.oneOfType([apiCheck.string, apiCheck.func])).optional, + controller: apiCheck.oneOfType([apiCheck.func, apiCheck.string, apiCheck.array]).optional, + link: apiCheck.func.optional, + defaultOptions: apiCheck.oneOfType([apiCheck.func, apiCheck.shape(typeOptionsDefaultOptions)]).optional, + 'extends': apiCheck.string.optional, + wrapper: specifyWrapperType.optional, + data: apiCheck.object.optional, + apiCheck: apiCheckProperty.optional, + apiCheckInstance: apiCheckInstanceProperty.optional, + apiCheckFunction: apiCheckFunctionProperty.optional, + apiCheckOptions: apiCheck.object.optional, + overwriteOk: apiCheck.bool.optional + }).strict; + + _angularFix2['default'].extend(apiCheck, { + formlyTypeOptions: formlyTypeOptions, formlyFieldOptions: formlyFieldOptions, formlyExpression: formlyExpression, formlyWrapperType: formlyWrapperType, fieldGroup: fieldGroup, formOptionsApi: formOptionsApi + }); + + exports['default'] = apiCheck; + module.exports = exports['default']; + +/***/ }, +/* 5 */ +/***/ function(module, exports) { + + module.exports = __WEBPACK_EXTERNAL_MODULE_5__; + +/***/ }, +/* 6 */ +/***/ function(module, exports, __webpack_require__) { + + "use strict"; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports["default"] = "https://github.com/formly-js/angular-formly/blob/" + ("0.0.0-semantically-released.0") + "/other/ERRORS_AND_WARNINGS.md#"; + module.exports = exports["default"]; + +/***/ }, +/* 7 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, '__esModule', { + value: true + }); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + + var _angularFix = __webpack_require__(2); + + var _angularFix2 = _interopRequireDefault(_angularFix); + + exports['default'] = formlyUsability; + + // @ngInject + function formlyUsability(formlyApiCheck, formlyErrorAndWarningsUrlPrefix) { + var _this = this; + + _angularFix2['default'].extend(this, { + getFormlyError: getFormlyError, + getFieldError: getFieldError, + checkWrapper: checkWrapper, + checkWrapperTemplate: checkWrapperTemplate, + getErrorMessage: getErrorMessage, + $get: function $get() { + return _this; + } + }); + + function getFieldError(errorInfoSlug, message, field) { + if (arguments.length < 3) { + field = message; + message = errorInfoSlug; + errorInfoSlug = null; + } + return new Error(getErrorMessage(errorInfoSlug, message) + (' Field definition: ' + _angularFix2['default'].toJson(field))); + } + + function getFormlyError(errorInfoSlug, message) { + if (!message) { + message = errorInfoSlug; + errorInfoSlug = null; + } + return new Error(getErrorMessage(errorInfoSlug, message)); + } + + function getErrorMessage(errorInfoSlug, message) { + var url = ''; + if (errorInfoSlug !== null) { + url = '' + formlyErrorAndWarningsUrlPrefix + errorInfoSlug; + } + return 'Formly Error: ' + message + '. ' + url; + } + + function checkWrapper(wrapper) { + formlyApiCheck['throw'](formlyApiCheck.formlyWrapperType, wrapper, { + prefix: 'formlyConfig.setWrapper', + urlSuffix: 'setwrapper-validation-failed' + }); + } + + function checkWrapperTemplate(template, additionalInfo) { + var formlyTransclude = ''; + if (template.indexOf(formlyTransclude) === -1) { + throw getFormlyError('Template wrapper templates must use "' + formlyTransclude + '" somewhere in them. ' + ('This one does not have "" in it: ' + template) + '\n' + ('Additional information: ' + JSON.stringify(additionalInfo))); + } + } + } + formlyUsability.$inject = ["formlyApiCheck", "formlyErrorAndWarningsUrlPrefix"]; + module.exports = exports['default']; + +/***/ }, +/* 8 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, '__esModule', { + value: true + }); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + + function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) arr2[i] = arr[i]; return arr2; } else { return Array.from(arr); } } + + var _angularFix = __webpack_require__(2); + + var _angularFix2 = _interopRequireDefault(_angularFix); + + var _otherUtils = __webpack_require__(9); + + var _otherUtils2 = _interopRequireDefault(_otherUtils); + + exports['default'] = formlyConfig; + + // @ngInject + function formlyConfig(formlyUsabilityProvider, formlyErrorAndWarningsUrlPrefix, formlyApiCheck) { + var _this2 = this; + + var typeMap = {}; + var templateWrappersMap = {}; + var defaultWrapperName = 'default'; + var _this = this; + var getError = formlyUsabilityProvider.getFormlyError; + + _angularFix2['default'].extend(this, { + setType: setType, + getType: getType, + getTypeHeritage: getTypeHeritage, + setWrapper: setWrapper, + getWrapper: getWrapper, + getWrapperByType: getWrapperByType, + removeWrapperByName: removeWrapperByName, + removeWrappersForType: removeWrappersForType, + disableWarnings: false, + extras: { + disableNgModelAttrsManipulator: false, + fieldTransform: [], + ngModelAttrsManipulatorPreferUnbound: false, + removeChromeAutoComplete: false, + defaultHideDirective: 'ng-if', + getFieldId: null + }, + templateManipulators: { + preWrapper: [], + postWrapper: [] + }, + $get: function $get() { + return _this2; + } + }); + + function setType(options) { + if (_angularFix2['default'].isArray(options)) { + var _ret = (function () { + var allTypes = []; + _angularFix2['default'].forEach(options, function (item) { + allTypes.push(setType(item)); + }); + return { + v: allTypes + }; + })(); + + if (typeof _ret === 'object') return _ret.v; + } else if (_angularFix2['default'].isObject(options)) { + checkType(options); + if (options['extends']) { + extendTypeOptions(options); + } + typeMap[options.name] = options; + return typeMap[options.name]; + } else { + throw getError('You must provide an object or array for setType. You provided: ' + JSON.stringify(arguments)); + } + } + + function checkType(options) { + formlyApiCheck['throw'](formlyApiCheck.formlyTypeOptions, options, { + prefix: 'formlyConfig.setType', + url: 'settype-validation-failed' + }); + if (!options.overwriteOk) { + checkOverwrite(options.name, typeMap, options, 'types'); + } else { + options.overwriteOk = undefined; + } + } + + function extendTypeOptions(options) { + var extendsType = getType(options['extends'], true, options); + extendTypeControllerFunction(options, extendsType); + extendTypeLinkFunction(options, extendsType); + extendTypeDefaultOptions(options, extendsType); + _otherUtils2['default'].reverseDeepMerge(options, extendsType); + extendTemplate(options, extendsType); + } + + function extendTemplate(options, extendsType) { + if (options.template && extendsType.templateUrl) { + delete options.templateUrl; + } else if (options.templateUrl && extendsType.template) { + delete options.template; + } + } + + function extendTypeControllerFunction(options, extendsType) { + var extendsCtrl = extendsType.controller; + if (!_angularFix2['default'].isDefined(extendsCtrl)) { + return; + } + var optionsCtrl = options.controller; + if (_angularFix2['default'].isDefined(optionsCtrl)) { + options.controller = function ($scope, $controller) { + $controller(extendsCtrl, { $scope: $scope }); + $controller(optionsCtrl, { $scope: $scope }); + }; + options.controller.$inject = ['$scope', '$controller']; + } else { + options.controller = extendsCtrl; + } + } + + function extendTypeLinkFunction(options, extendsType) { + var extendsFn = extendsType.link; + if (!_angularFix2['default'].isDefined(extendsFn)) { + return; + } + var optionsFn = options.link; + if (_angularFix2['default'].isDefined(optionsFn)) { + options.link = function () { + extendsFn.apply(undefined, arguments); + optionsFn.apply(undefined, arguments); + }; + } else { + options.link = extendsFn; + } + } + + function extendTypeDefaultOptions(options, extendsType) { + var extendsDO = extendsType.defaultOptions; + if (!_angularFix2['default'].isDefined(extendsDO)) { + return; + } + var optionsDO = options.defaultOptions; + var optionsDOIsFn = _angularFix2['default'].isFunction(optionsDO); + var extendsDOIsFn = _angularFix2['default'].isFunction(extendsDO); + if (extendsDOIsFn) { + options.defaultOptions = function defaultOptions(opts, scope) { + var extendsDefaultOptions = extendsDO(opts, scope); + var mergedDefaultOptions = {}; + _otherUtils2['default'].reverseDeepMerge(mergedDefaultOptions, opts, extendsDefaultOptions); + var extenderOptionsDefaultOptions = optionsDO; + if (optionsDOIsFn) { + extenderOptionsDefaultOptions = extenderOptionsDefaultOptions(mergedDefaultOptions, scope); + } + _otherUtils2['default'].reverseDeepMerge(extendsDefaultOptions, extenderOptionsDefaultOptions); + return extendsDefaultOptions; + }; + } else if (optionsDOIsFn) { + options.defaultOptions = function defaultOptions(opts, scope) { + var newDefaultOptions = {}; + _otherUtils2['default'].reverseDeepMerge(newDefaultOptions, opts, extendsDO); + return optionsDO(newDefaultOptions, scope); + }; + } + } + + function getType(name, throwError, errorContext) { + if (!name) { + return undefined; + } + var type = typeMap[name]; + if (!type && throwError === true) { + throw getError('There is no type by the name of "' + name + '": ' + JSON.stringify(errorContext)); + } else { + return type; + } + } + + function getTypeHeritage(parent) { + var heritage = []; + var type = parent; + if (_angularFix2['default'].isString(type)) { + type = getType(parent); + } + parent = type['extends']; + while (parent) { + type = getType(parent); + heritage.push(type); + parent = type['extends']; + } + return heritage; + } + + function setWrapper(_x, _x2) { + var _again = true; + + _function: while (_again) { + var options = _x, + name = _x2; + _again = false; + + if (_angularFix2['default'].isArray(options)) { + return options.map(function (wrapperOptions) { + return setWrapper(wrapperOptions); + }); + } else if (_angularFix2['default'].isObject(options)) { + options.types = getOptionsTypes(options); + options.name = getOptionsName(options, name); + checkWrapperAPI(options); + templateWrappersMap[options.name] = options; + return options; + } else if (_angularFix2['default'].isString(options)) { + _x = { + template: options, + name: name + }; + _x2 = undefined; + _again = true; + continue _function; + } + } + } + + function getOptionsTypes(options) { + if (_angularFix2['default'].isString(options.types)) { + return [options.types]; + } + if (!_angularFix2['default'].isDefined(options.types)) { + return []; + } else { + return options.types; + } + } + + function getOptionsName(options, name) { + return options.name || name || options.types.join(' ') || defaultWrapperName; + } + + function checkWrapperAPI(options) { + formlyUsabilityProvider.checkWrapper(options); + if (options.template) { + formlyUsabilityProvider.checkWrapperTemplate(options.template, options); + } + if (!options.overwriteOk) { + checkOverwrite(options.name, templateWrappersMap, options, 'templateWrappers'); + } else { + delete options.overwriteOk; + } + checkWrapperTypes(options); + } + + function checkWrapperTypes(options) { + var shouldThrow = !_angularFix2['default'].isArray(options.types) || !options.types.every(_angularFix2['default'].isString); + if (shouldThrow) { + throw getError('Attempted to create a template wrapper with types that is not a string or an array of strings'); + } + } + + function checkOverwrite(property, object, newValue, objectName) { + if (object.hasOwnProperty(property)) { + warn('overwriting-types-or-wrappers', ['Attempting to overwrite ' + property + ' on ' + objectName + ' which is currently', JSON.stringify(object[property]) + ' with ' + JSON.stringify(newValue), 'To supress this warning, specify the property "overwriteOk: true"'].join(' ')); + } + } + + function getWrapper(name) { + return templateWrappersMap[name || defaultWrapperName]; + } + + function getWrapperByType(type) { + /* eslint prefer-const:0 */ + var wrappers = []; + for (var _name in templateWrappersMap) { + if (templateWrappersMap.hasOwnProperty(_name)) { + if (templateWrappersMap[_name].types && templateWrappersMap[_name].types.indexOf(type) !== -1) { + wrappers.push(templateWrappersMap[_name]); + } + } + } + return wrappers; + } + + function removeWrapperByName(name) { + var wrapper = templateWrappersMap[name]; + delete templateWrappersMap[name]; + return wrapper; + } + + function removeWrappersForType(type) { + var wrappers = getWrapperByType(type); + if (!wrappers) { + return undefined; + } + if (!_angularFix2['default'].isArray(wrappers)) { + return removeWrapperByName(wrappers.name); + } else { + wrappers.forEach(function (wrapper) { + return removeWrapperByName(wrapper.name); + }); + return wrappers; + } + } + + function warn() { + if (!_this.disableWarnings && console.warn) { + /* eslint no-console:0 */ + var args = Array.prototype.slice.call(arguments); + var warnInfoSlug = args.shift(); + args.unshift('Formly Warning:'); + args.push('' + formlyErrorAndWarningsUrlPrefix + warnInfoSlug); + console.warn.apply(console, _toConsumableArray(args)); + } + } + } + formlyConfig.$inject = ["formlyUsabilityProvider", "formlyErrorAndWarningsUrlPrefix", "formlyApiCheck"]; + module.exports = exports['default']; + +/***/ }, +/* 9 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, '__esModule', { + value: true + }); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + + var _angularFix = __webpack_require__(2); + + var _angularFix2 = _interopRequireDefault(_angularFix); + + exports['default'] = { + containsSelector: containsSelector, containsSpecialChar: containsSpecialChar, formlyEval: formlyEval, getFieldId: getFieldId, reverseDeepMerge: reverseDeepMerge, findByNodeName: findByNodeName, + arrayify: arrayify, extendFunction: extendFunction, extendArray: extendArray, startsWith: startsWith, contains: contains + }; + + function containsSelector(string) { + return containsSpecialChar(string, '.') || containsSpecialChar(string, '[') && containsSpecialChar(string, ']'); + } + + function containsSpecialChar(a, b) { + if (!a || !a.indexOf) { + return false; + } + return a.indexOf(b) !== -1; + } + + function formlyEval(scope, expression, $modelValue, $viewValue, extraLocals) { + if (_angularFix2['default'].isFunction(expression)) { + return expression($viewValue, $modelValue, scope, extraLocals); + } else { + return scope.$eval(expression, _angularFix2['default'].extend({ $viewValue: $viewValue, $modelValue: $modelValue }, extraLocals)); + } + } + + function getFieldId(formId, options, index) { + if (options.id) { + return options.id; + } + var type = options.type; + if (!type && options.template) { + type = 'template'; + } else if (!type && options.templateUrl) { + type = 'templateUrl'; + } + + return [formId, type, options.key, index].join('_'); + } + + function reverseDeepMerge(dest) { + _angularFix2['default'].forEach(arguments, function (src, index) { + if (!index) { + return; + } + _angularFix2['default'].forEach(src, function (val, prop) { + if (!_angularFix2['default'].isDefined(dest[prop])) { + dest[prop] = _angularFix2['default'].copy(val); + } else if (objAndSameType(dest[prop], val)) { + reverseDeepMerge(dest[prop], val); + } + }); + }); + return dest; + } + + function objAndSameType(obj1, obj2) { + return _angularFix2['default'].isObject(obj1) && _angularFix2['default'].isObject(obj2) && Object.getPrototypeOf(obj1) === Object.getPrototypeOf(obj2); + } + + // recurse down a node tree to find a node with matching nodeName, for custom tags jQuery.find doesn't work in IE8 + function findByNodeName(el, nodeName) { + if (!el.prop) { + // not a jQuery or jqLite object -> wrap it + el = _angularFix2['default'].element(el); + } + + if (el.prop('nodeName') === nodeName.toUpperCase()) { + return el; + } + + var c = el.children(); + for (var i = 0; c && i < c.length; i++) { + var node = findByNodeName(c[i], nodeName); + if (node) { + return node; + } + } + } + + function arrayify(obj) { + if (obj && !_angularFix2['default'].isArray(obj)) { + obj = [obj]; + } else if (!obj) { + obj = []; + } + return obj; + } + + function extendFunction() { + for (var _len = arguments.length, fns = Array(_len), _key = 0; _key < _len; _key++) { + fns[_key] = arguments[_key]; + } + + return function extendedFunction() { + var args = arguments; + fns.forEach(function (fn) { + return fn.apply(null, args); + }); + }; + } + + function extendArray(primary, secondary, property) { + if (property) { + primary = primary[property]; + secondary = secondary[property]; + } + if (secondary && primary) { + _angularFix2['default'].forEach(secondary, function (item) { + if (primary.indexOf(item) === -1) { + primary.push(item); + } + }); + return primary; + } else if (secondary) { + return secondary; + } else { + return primary; + } + } + + function startsWith(str, search) { + if (_angularFix2['default'].isString(str) && _angularFix2['default'].isString(search)) { + return str.length >= search.length && str.substring(0, search.length) === search; + } else { + return false; + } + } + + function contains(str, search) { + if (_angularFix2['default'].isString(str) && _angularFix2['default'].isString(search)) { + return str.length >= search.length && str.indexOf(search) !== -1; + } else { + return false; + } + } + module.exports = exports['default']; + +/***/ }, +/* 10 */ +/***/ function(module, exports) { + + 'use strict'; + + Object.defineProperty(exports, '__esModule', { + value: true + }); + exports['default'] = formlyValidationMessages; + + // @ngInject + function formlyValidationMessages() { + + var validationMessages = { + addTemplateOptionValueMessage: addTemplateOptionValueMessage, + addStringMessage: addStringMessage, + messages: {} + }; + + return validationMessages; + + function addTemplateOptionValueMessage(name, prop, prefix, suffix, alternate) { + validationMessages.messages[name] = templateOptionValue(prop, prefix, suffix, alternate); + } + + function addStringMessage(name, string) { + validationMessages.messages[name] = function () { + return string; + }; + } + + function templateOptionValue(prop, prefix, suffix, alternate) { + return function getValidationMessage(viewValue, modelValue, scope) { + if (typeof scope.options.templateOptions[prop] !== 'undefined') { + return prefix + ' ' + scope.options.templateOptions[prop] + ' ' + suffix; + } else { + return alternate; + } + }; + } + } + module.exports = exports['default']; + +/***/ }, +/* 11 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, '__esModule', { + value: true + }); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + + var _otherUtils = __webpack_require__(9); + + var _otherUtils2 = _interopRequireDefault(_otherUtils); + + exports['default'] = formlyUtil; + + // @ngInject + function formlyUtil() { + return _otherUtils2['default']; + } + module.exports = exports['default']; + +/***/ }, +/* 12 */ +/***/ function(module, exports) { + + 'use strict'; + + Object.defineProperty(exports, '__esModule', { + value: true + }); + + function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) arr2[i] = arr[i]; return arr2; } else { return Array.from(arr); } } + + exports['default'] = formlyWarn; + + // @ngInject + function formlyWarn(formlyConfig, formlyErrorAndWarningsUrlPrefix, $log) { + return function warn() { + if (!formlyConfig.disableWarnings) { + var args = Array.prototype.slice.call(arguments); + var warnInfoSlug = args.shift(); + args.unshift('Formly Warning:'); + args.push('' + formlyErrorAndWarningsUrlPrefix + warnInfoSlug); + $log.warn.apply($log, _toConsumableArray(args)); + } + }; + } + formlyWarn.$inject = ["formlyConfig", "formlyErrorAndWarningsUrlPrefix", "$log"]; + module.exports = exports['default']; + +/***/ }, +/* 13 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, '__esModule', { + value: true + }); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + + var _angularFix = __webpack_require__(2); + + var _angularFix2 = _interopRequireDefault(_angularFix); + + exports['default'] = formlyCustomValidation; + + // @ngInject + function formlyCustomValidation(formlyUtil) { + return { + restrict: 'A', + require: 'ngModel', + link: function formlyCustomValidationLink(scope, el, attrs, ctrl) { + var opts = scope.options; + opts.validation.messages = opts.validation.messages || {}; + _angularFix2['default'].forEach(opts.validation.messages, function (message, key) { + opts.validation.messages[key] = function () { + return formlyUtil.formlyEval(scope, message, ctrl.$modelValue, ctrl.$viewValue); + }; + }); + + var useNewValidatorsApi = ctrl.hasOwnProperty('$validators') && !attrs.hasOwnProperty('useParsers'); + _angularFix2['default'].forEach(opts.validators, _angularFix2['default'].bind(null, addValidatorToPipeline, false)); + _angularFix2['default'].forEach(opts.asyncValidators, _angularFix2['default'].bind(null, addValidatorToPipeline, true)); + + function addValidatorToPipeline(isAsync, validator, name) { + setupMessage(validator, name); + validator = _angularFix2['default'].isObject(validator) ? validator.expression : validator; + if (useNewValidatorsApi) { + setupWithValidators(validator, name, isAsync); + } else { + setupWithParsers(validator, name, isAsync); + } + } + + function setupMessage(validator, name) { + var message = validator.message; + if (message) { + opts.validation.messages[name] = function () { + return formlyUtil.formlyEval(scope, message, ctrl.$modelValue, ctrl.$viewValue); + }; + } + } + + function setupWithValidators(validator, name, isAsync) { + var validatorCollection = isAsync ? '$asyncValidators' : '$validators'; + + ctrl[validatorCollection][name] = function evalValidity(modelValue, viewValue) { + return formlyUtil.formlyEval(scope, validator, modelValue, viewValue); + }; + } + + function setupWithParsers(validator, name, isAsync) { + var inFlightValidator = undefined; + ctrl.$parsers.unshift(function evalValidityOfParser(viewValue) { + var isValid = formlyUtil.formlyEval(scope, validator, ctrl.$modelValue, viewValue); + if (isAsync) { + ctrl.$pending = ctrl.$pending || {}; + ctrl.$pending[name] = true; + inFlightValidator = isValid; + isValid.then(function () { + if (inFlightValidator === isValid) { + ctrl.$setValidity(name, true); + } + })['catch'](function () { + if (inFlightValidator === isValid) { + ctrl.$setValidity(name, false); + } + })['finally'](function () { + var $pending = ctrl.$pending || {}; + if (Object.keys($pending).length === 1) { + delete ctrl.$pending; + } else { + delete ctrl.$pending[name]; + } + }); + } else { + ctrl.$setValidity(name, isValid); + } + return viewValue; + }); + } + } + }; + } + formlyCustomValidation.$inject = ["formlyUtil"]; + module.exports = exports['default']; + +/***/ }, +/* 14 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, '__esModule', { + value: true + }); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + + function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) arr2[i] = arr[i]; return arr2; } else { return Array.from(arr); } } + + var _angularFix = __webpack_require__(2); + + var _angularFix2 = _interopRequireDefault(_angularFix); + + var _apiCheck = __webpack_require__(5); + + var _apiCheck2 = _interopRequireDefault(_apiCheck); + + exports['default'] = formlyField; + + /** + * @ngdoc directive + * @name formlyField + * @restrict AE + */ + // @ngInject + function formlyField($http, $q, $compile, $templateCache, $interpolate, formlyConfig, formlyApiCheck, formlyUtil, formlyUsability, formlyWarn) { + var arrayify = formlyUtil.arrayify; + + FormlyFieldController.$inject = ["$scope", "$timeout", "$parse", "$controller", "formlyValidationMessages"]; + return { + restrict: 'AE', + transclude: true, + require: '?^formlyForm', + scope: { + options: '=', + model: '=', + originalModel: '=?', + formId: '@', // TODO remove formId in a breaking release + index: '=?', + fields: '=?', + formState: '=?', + formOptions: '=?', + form: '=?' }, + // TODO require form in a breaking release + controller: FormlyFieldController, + link: fieldLink + }; + + // @ngInject + function FormlyFieldController($scope, $timeout, $parse, $controller, formlyValidationMessages) { + /* eslint max-statements:[2, 34] */ + if ($scope.options.fieldGroup) { + setupFieldGroup(); + return; + } + + var fieldType = getFieldType($scope.options); + simplifyLife($scope.options); + mergeFieldOptionsWithTypeDefaults($scope.options, fieldType); + extendOptionsWithDefaults($scope.options, $scope.index); + checkApi($scope.options); + // set field id to link labels and fields + + // initalization + setFieldIdAndName(); + setDefaultValue(); + setInitialValue(); + runExpressions(); + watchExpressions(); + addValidationMessages($scope.options); + invokeControllers($scope, $scope.options, fieldType); + + // function definitions + function runExpressions() { + // must run on next tick to make sure that the current value is correct. + return $timeout(function runExpressionsOnNextTick() { + var field = $scope.options; + var currentValue = valueGetterSetter(); + _angularFix2['default'].forEach(field.expressionProperties, function runExpression(expression, prop) { + var setter = $parse(prop).assign; + var promise = $q.when(formlyUtil.formlyEval($scope, expression, currentValue, currentValue)); + promise.then(function setFieldValue(value) { + setter(field, value); + }); + }); + }, 0, false); + } + + function watchExpressions() { + if ($scope.formOptions.watchAllExpressions) { + (function () { + var field = $scope.options; + var currentValue = valueGetterSetter(); + _angularFix2['default'].forEach(field.expressionProperties, function watchExpression(expression, prop) { + var setter = $parse(prop).assign; + $scope.$watch(function expressionPropertyWatcher() { + return formlyUtil.formlyEval($scope, expression, currentValue, currentValue); + }, function expressionPropertyListener(value) { + setter(field, value); + }, true); + }); + })(); + } + } + + function valueGetterSetter(newVal) { + if (!$scope.model || !$scope.options.key) { + return undefined; + } + if (_angularFix2['default'].isDefined(newVal)) { + parseSet($scope.options.key, $scope.model, newVal); + } + return parseGet($scope.options.key, $scope.model); + } + + function shouldNotUseParseKey(key) { + return _angularFix2['default'].isNumber(key) || !formlyUtil.containsSelector(key); + } + + function parseSet(key, model, newVal) { + // If either of these are null/undefined then just return undefined + if (!key || !model) { + return; + } + // If we are working with a number then $parse wont work, default back to the old way for now + if (shouldNotUseParseKey(key)) { + // TODO: Fix this so we can get several levels instead of just one with properties that are numeric + model[key] = newVal; + } else { + var setter = $parse($scope.options.key).assign; + if (setter) { + setter($scope.model, newVal); + } + } + } + + function parseGet(key, model) { + // If either of these are null/undefined then just return undefined + if (!key || !model) { + return undefined; + } + + // If we are working with a number then $parse wont work, default back to the old way for now + if (shouldNotUseParseKey(key)) { + // TODO: Fix this so we can get several levels instead of just one with properties that are numeric + return model[key]; + } else { + return $parse(key)(model); + } + } + + function simplifyLife(options) { + // add a few empty objects (if they don't already exist) so you don't have to undefined check everywhere + formlyUtil.reverseDeepMerge(options, { + originalModel: options.model, + extras: {}, + data: {}, + templateOptions: {}, + validation: {} + }); + // create $scope.to so template authors can reference to instead of $scope.options.templateOptions + $scope.to = $scope.options.templateOptions; + $scope.formOptions = $scope.formOptions || {}; + } + + function setFieldIdAndName() { + if (_angularFix2['default'].isFunction(formlyConfig.extras.getFieldId)) { + $scope.id = formlyConfig.extras.getFieldId($scope.options, $scope.model, $scope); + } else { + var formName = $scope.form && $scope.form.$name || $scope.formId; + $scope.id = formlyUtil.getFieldId(formName, $scope.options, $scope.index); + } + $scope.options.id = $scope.id; + $scope.name = $scope.options.name || $scope.options.id; + $scope.options.name = $scope.name; + } + + function setDefaultValue() { + if (_angularFix2['default'].isDefined($scope.options.defaultValue) && !_angularFix2['default'].isDefined(parseGet($scope.options.key, $scope.model))) { + parseSet($scope.options.key, $scope.model, $scope.options.defaultValue); + } + } + + function setInitialValue() { + $scope.options.initialValue = $scope.model && parseGet($scope.options.key, $scope.model); + } + + function mergeFieldOptionsWithTypeDefaults(options, type) { + if (type) { + mergeOptions(options, type.defaultOptions); + } + var properOrder = arrayify(options.optionsTypes).reverse(); // so the right things are overridden + _angularFix2['default'].forEach(properOrder, function (typeName) { + mergeOptions(options, formlyConfig.getType(typeName, true, options).defaultOptions); + }); + } + + function mergeOptions(options, extraOptions) { + if (extraOptions) { + if (_angularFix2['default'].isFunction(extraOptions)) { + extraOptions = extraOptions(options, $scope); + } + formlyUtil.reverseDeepMerge(options, extraOptions); + } + } + + function extendOptionsWithDefaults(options, index) { + var key = options.key || index || 0; + _angularFix2['default'].extend(options, { + // attach the key in case the formly-field directive is used directly + key: key, + value: options.value || valueGetterSetter, + runExpressions: runExpressions, + resetModel: resetModel, + updateInitialValue: updateInitialValue + }); + } + + function resetModel() { + parseSet($scope.options.key, $scope.model, $scope.options.initialValue); + if ($scope.options.formControl) { + if (_angularFix2['default'].isArray($scope.options.formControl)) { + _angularFix2['default'].forEach($scope.options.formControl, function (formControl) { + resetFormControl(formControl, true); + }); + } else { + resetFormControl($scope.options.formControl); + } + } + if ($scope.form) { + $scope.form.$setUntouched && $scope.form.$setUntouched(); + $scope.form.$setPristine(); + } + } + + function resetFormControl(formControl, isMultiNgModel) { + if (!isMultiNgModel) { + formControl.$setViewValue(parseGet($scope.options.key, $scope.model)); + } + + formControl.$render(); + formControl.$setUntouched && formControl.$setUntouched(); + formControl.$setPristine(); + + // To prevent breaking change requiring a digest to reset $viewModel + if (!$scope.$root.$$phase) { + $scope.$digest(); + } + } + + function updateInitialValue() { + $scope.options.initialValue = parseGet($scope.options.key, $scope.model); + } + + function addValidationMessages(options) { + options.validation.messages = options.validation.messages || {}; + _angularFix2['default'].forEach(formlyValidationMessages.messages, function createFunctionForMessage(expression, name) { + if (!options.validation.messages[name]) { + options.validation.messages[name] = function evaluateMessage(viewValue, modelValue, scope) { + return formlyUtil.formlyEval(scope, expression, modelValue, viewValue); + }; + } + }); + } + + function invokeControllers(scope) { + var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; + var type = arguments.length <= 2 || arguments[2] === undefined ? {} : arguments[2]; + + _angularFix2['default'].forEach([type.controller, options.controller], function (controller) { + if (controller) { + $controller(controller, { $scope: scope }); + } + }); + } + + function setupFieldGroup() { + $scope.options.options = $scope.options.options || {}; + $scope.options.options.formState = $scope.formState; + $scope.to = $scope.options.templateOptions; + } + } + + // link function + function fieldLink(scope, el, attrs, formlyFormCtrl) { + if (scope.options.fieldGroup) { + setFieldGroupTemplate(); + return; + } + + // watch the field model (if exists) if there is no parent formly-form directive (that would watch it instead) + if (!formlyFormCtrl && scope.options.model) { + scope.$watch('options.model', function () { + return scope.options.runExpressions(); + }, true); + } + + addAttributes(); + addClasses(); + + var type = getFieldType(scope.options); + var args = arguments; + var thusly = this; + var fieldCount = 0; + var fieldManipulators = getManipulators(scope.options, scope.formOptions); + getFieldTemplate(scope.options).then(runManipulators(fieldManipulators.preWrapper)).then(transcludeInWrappers(scope.options, scope.formOptions)).then(runManipulators(fieldManipulators.postWrapper)).then(setElementTemplate).then(watchFormControl).then(callLinkFunctions)['catch'](function (error) { + formlyWarn('there-was-a-problem-setting-the-template-for-this-field', 'There was a problem setting the template for this field ', scope.options, error); + }); + + function setFieldGroupTemplate() { + checkFieldGroupApi(scope.options); + el.addClass('formly-field-group'); + var extraAttributes = ''; + if (scope.options.elementAttributes) { + extraAttributes = Object.keys(scope.options.elementAttributes).map(function (key) { + return key + '="' + scope.options.elementAttributes[key] + '"'; + }).join(' '); + } + var modelValue = 'model'; + scope.options.form = scope.form; + if (scope.options.key) { + modelValue = 'model[\'' + scope.options.key + '\']'; + } + getTemplate('\n \n \n ').then(transcludeInWrappers(scope.options, scope.formOptions)).then(setElementTemplate); + } + + function addAttributes() { + if (scope.options.elementAttributes) { + el.attr(scope.options.elementAttributes); + } + } + + function addClasses() { + if (scope.options.className) { + el.addClass(scope.options.className); + } + if (scope.options.type) { + el.addClass('formly-field-' + scope.options.type); + } + } + + function setElementTemplate(templateString) { + el.html(asHtml(templateString)); + $compile(el.contents())(scope); + return templateString; + } + + function watchFormControl(templateString) { + var stopWatchingShowError = _angularFix2['default'].noop; + if (scope.options.noFormControl) { + return; + } + var templateEl = _angularFix2['default'].element('
' + templateString + '
'); + var ngModelNodes = templateEl[0].querySelectorAll('[ng-model],[data-ng-model]'); + + if (ngModelNodes.length) { + _angularFix2['default'].forEach(ngModelNodes, function (ngModelNode) { + fieldCount++; + watchFieldNameOrExistence(ngModelNode.getAttribute('name')); + }); + } + + function watchFieldNameOrExistence(name) { + var nameExpressionRegex = /\{\{(.*?)}}/; + var nameExpression = nameExpressionRegex.exec(name); + if (nameExpression) { + name = $interpolate(name)(scope); + } + watchFieldExistence(name); + } + + function watchFieldExistence(name) { + scope.$watch('form["' + name + '"]', function formControlChange(formControl) { + if (formControl) { + if (fieldCount > 1) { + if (!scope.options.formControl) { + scope.options.formControl = []; + } + scope.options.formControl.push(formControl); + } else { + scope.options.formControl = formControl; + } + scope.fc = scope.options.formControl; // shortcut for template authors + stopWatchingShowError(); + addShowMessagesWatcher(); + addParsers(); + addFormatters(); + } + }); + } + + function addShowMessagesWatcher() { + stopWatchingShowError = scope.$watch(function watchShowValidationChange() { + var customExpression = formlyConfig.extras.errorExistsAndShouldBeVisibleExpression; + var options = scope.options; + var formControls = arrayify(scope.fc); + if (!formControls.some(function (fc) { + return fc.$invalid; + })) { + return false; + } else if (typeof options.validation.show === 'boolean') { + return options.validation.show; + } else if (customExpression) { + return formControls.some(function (fc) { + return formlyUtil.formlyEval(scope, customExpression, fc.$modelValue, fc.$viewValue); + }); + } else { + return formControls.some(function (fc) { + var noTouchedButDirty = _angularFix2['default'].isUndefined(fc.$touched) && fc.$dirty; + return fc.$touched || noTouchedButDirty; + }); + } + }, function onShowValidationChange(show) { + scope.options.validation.errorExistsAndShouldBeVisible = show; + scope.showError = show; // shortcut for template authors + }); + } + + function addParsers() { + setParsersOrFormatters('parsers'); + } + + function addFormatters() { + setParsersOrFormatters('formatters'); + var ctrl = scope.fc; + var formWasPristine = scope.form.$pristine; + if (scope.options.formatters) { + (function () { + var value = ctrl.$modelValue; + ctrl.$formatters.forEach(function (formatter) { + value = formatter(value); + }); + + ctrl.$setViewValue(value); + ctrl.$render(); + ctrl.$setPristine(); + if (formWasPristine) { + scope.form.$setPristine(); + } + })(); + } + } + + function setParsersOrFormatters(which) { + var originalThingProp = 'originalParser'; + if (which === 'formatters') { + originalThingProp = 'originalFormatter'; + } + + // init with type's parsers + var things = getThingsFromType(type); + + // get optionsTypes things + things = formlyUtil.extendArray(things, getThingsFromOptionsTypes(scope.options.optionsTypes)); + + // get field's things + things = formlyUtil.extendArray(things, scope.options[which]); + + // convert things into formlyExpression things + _angularFix2['default'].forEach(things, function (thing, index) { + things[index] = getFormlyExpressionThing(thing); + }); + + var ngModelCtrls = scope.fc; + if (!_angularFix2['default'].isArray(ngModelCtrls)) { + ngModelCtrls = [ngModelCtrls]; + } + + _angularFix2['default'].forEach(ngModelCtrls, function (ngModelCtrl) { + var _ngModelCtrl; + + ngModelCtrl['$' + which] = (_ngModelCtrl = ngModelCtrl['$' + which]).concat.apply(_ngModelCtrl, _toConsumableArray(things)); + }); + + function getThingsFromType(theType) { + if (!theType) { + return []; + } + if (_angularFix2['default'].isString(theType)) { + theType = formlyConfig.getType(theType, true, scope.options); + } + var typeThings = []; + + // get things from parent + if (theType['extends']) { + typeThings = formlyUtil.extendArray(typeThings, getThingsFromType(theType['extends'])); + } + + // get own type's things + typeThings = formlyUtil.extendArray(typeThings, getDefaultOptionsProperty(theType, which, [])); + + // get things from optionsTypes + typeThings = formlyUtil.extendArray(typeThings, getThingsFromOptionsTypes(getDefaultOptionsOptionsTypes(theType))); + + return typeThings; + } + + function getThingsFromOptionsTypes() { + var optionsTypes = arguments.length <= 0 || arguments[0] === undefined ? [] : arguments[0]; + + var optionsTypesThings = []; + _angularFix2['default'].forEach(_angularFix2['default'].copy(arrayify(optionsTypes)).reverse(), function (optionsTypeName) { + optionsTypesThings = formlyUtil.extendArray(optionsTypesThings, getThingsFromType(optionsTypeName)); + }); + return optionsTypesThings; + } + + function getFormlyExpressionThing(thing) { + formlyExpressionParserOrFormatterFunction[originalThingProp] = thing; + return formlyExpressionParserOrFormatterFunction; + + function formlyExpressionParserOrFormatterFunction($viewValue) { + var $modelValue = scope.options.value(); + return formlyUtil.formlyEval(scope, thing, $modelValue, $viewValue); + } + } + } + } + + function callLinkFunctions() { + if (type && type.link) { + type.link.apply(thusly, args); + } + if (scope.options.link) { + scope.options.link.apply(thusly, args); + } + } + + function runManipulators(manipulators) { + return function runManipulatorsOnTemplate(templateToManipulate) { + var chain = $q.when(templateToManipulate); + _angularFix2['default'].forEach(manipulators, function (manipulator) { + chain = chain.then(function (template) { + return $q.when(manipulator(template, scope.options, scope)).then(function (newTemplate) { + return _angularFix2['default'].isString(newTemplate) ? newTemplate : asHtml(newTemplate); + }); + }); + }); + return chain; + }; + } + } + + // sort-of stateless util functions + function asHtml(el) { + var wrapper = _angularFix2['default'].element(''); + return wrapper.append(el).html(); + } + + function getFieldType(options) { + return options.type && formlyConfig.getType(options.type); + } + + function getManipulators(options, formOptions) { + var preWrapper = []; + var postWrapper = []; + addManipulators(options.templateManipulators); + addManipulators(formOptions.templateManipulators); + addManipulators(formlyConfig.templateManipulators); + return { preWrapper: preWrapper, postWrapper: postWrapper }; + + function addManipulators(manipulators) { + /* eslint-disable */ // it doesn't understand this :-( + + var _ref = manipulators || {}; + + var _ref$preWrapper = _ref.preWrapper; + var pre = _ref$preWrapper === undefined ? [] : _ref$preWrapper; + var _ref$postWrapper = _ref.postWrapper; + var post = _ref$postWrapper === undefined ? [] : _ref$postWrapper; + + preWrapper = preWrapper.concat(pre); + postWrapper = postWrapper.concat(post); + /* eslint-enable */ + } + } + + function getFieldTemplate(options) { + function fromOptionsOrType(key, fieldType) { + if (_angularFix2['default'].isDefined(options[key])) { + return options[key]; + } else if (fieldType && _angularFix2['default'].isDefined(fieldType[key])) { + return fieldType[key]; + } + } + + var type = formlyConfig.getType(options.type, true, options); + var template = fromOptionsOrType('template', type); + var templateUrl = fromOptionsOrType('templateUrl', type); + if (_angularFix2['default'].isUndefined(template) && !templateUrl) { + throw formlyUsability.getFieldError('type-type-has-no-template', 'Type \'' + options.type + '\' has no template. On element:', options); + } + + return getTemplate(templateUrl || template, _angularFix2['default'].isUndefined(template), options); + } + + function getTemplate(template, isUrl, options) { + var templatePromise = undefined; + if (_angularFix2['default'].isFunction(template)) { + templatePromise = $q.when(template(options)); + } else { + templatePromise = $q.when(template); + } + + if (!isUrl) { + return templatePromise; + } else { + var _ret3 = (function () { + var httpOptions = { cache: $templateCache }; + return { + v: templatePromise.then(function (url) { + return $http.get(url, httpOptions); + }).then(function (response) { + return response.data; + })['catch'](function handleErrorGettingATemplate(error) { + formlyWarn('problem-loading-template-for-templateurl', 'Problem loading template for ' + template, error); + }) + }; + })(); + + if (typeof _ret3 === 'object') return _ret3.v; + } + } + + function transcludeInWrappers(options, formOptions) { + var wrapper = getWrapperOption(options, formOptions); + + return function transcludeTemplate(template) { + if (!wrapper.length) { + return $q.when(template); + } + + wrapper.forEach(function (aWrapper) { + formlyUsability.checkWrapper(aWrapper, options); + runApiCheck(aWrapper, options); + }); + var promises = wrapper.map(function (w) { + return getTemplate(w.template || w.templateUrl, !w.template); + }); + return $q.all(promises).then(function (wrappersTemplates) { + wrappersTemplates.forEach(function (wrapperTemplate, index) { + formlyUsability.checkWrapperTemplate(wrapperTemplate, wrapper[index]); + }); + wrappersTemplates.reverse(); // wrapper 0 is wrapped in wrapper 1 and so on... + var totalWrapper = wrappersTemplates.shift(); + wrappersTemplates.forEach(function (wrapperTemplate) { + totalWrapper = doTransclusion(totalWrapper, wrapperTemplate); + }); + return doTransclusion(totalWrapper, template); + }); + }; + } + + function doTransclusion(wrapper, template) { + var superWrapper = _angularFix2['default'].element(''); // this allows people not have to have a single root in wrappers + superWrapper.append(wrapper); + var transcludeEl = superWrapper.find('formly-transclude'); + if (!transcludeEl.length) { + // try it using our custom find function + transcludeEl = formlyUtil.findByNodeName(superWrapper, 'formly-transclude'); + } + transcludeEl.replaceWith(template); + return superWrapper.html(); + } + + function getWrapperOption(options, formOptions) { + /* eslint complexity:[2, 6] */ + var wrapper = options.wrapper; + // explicit null means no wrapper + if (wrapper === null) { + return []; + } + + // nothing specified means use the default wrapper for the type + if (!wrapper) { + // get all wrappers that specify they apply to this type + wrapper = arrayify(formlyConfig.getWrapperByType(options.type)); + } else { + wrapper = arrayify(wrapper).map(formlyConfig.getWrapper); + } + + // get all wrappers for that the type specified that it uses. + var type = formlyConfig.getType(options.type, true, options); + if (type && type.wrapper) { + var typeWrappers = arrayify(type.wrapper).map(formlyConfig.getWrapper); + wrapper = wrapper.concat(typeWrappers); + } + + // add form wrappers + if (formOptions.wrapper) { + var formWrappers = arrayify(formOptions.wrapper).map(formlyConfig.getWrapper); + wrapper = wrapper.concat(formWrappers); + } + + // add the default wrapper last + var defaultWrapper = formlyConfig.getWrapper(); + if (defaultWrapper) { + wrapper.push(defaultWrapper); + } + return wrapper; + } + + function checkApi(options) { + formlyApiCheck['throw'](formlyApiCheck.formlyFieldOptions, options, { + prefix: 'formly-field directive', + url: 'formly-field-directive-validation-failed' + }); + // validate with the type + var type = options.type && formlyConfig.getType(options.type); + if (type) { + runApiCheck(type, options, true); + } + if (options.expressionProperties && options.expressionProperties.hide) { + formlyWarn('dont-use-expressionproperties.hide-use-hideexpression-instead', 'You have specified `hide` in `expressionProperties`. Use `hideExpression` instead', options); + } + } + + function checkFieldGroupApi(options) { + formlyApiCheck['throw'](formlyApiCheck.fieldGroup, options, { + prefix: 'formly-field directive', + url: 'formly-field-directive-validation-failed' + }); + } + + function runApiCheck(_ref2, options, forType) { + var apiCheck = _ref2.apiCheck; + var apiCheckInstance = _ref2.apiCheckInstance; + var apiCheckFunction = _ref2.apiCheckFunction; + var apiCheckOptions = _ref2.apiCheckOptions; + + runApiCheckForType(apiCheck, apiCheckInstance, apiCheckFunction, apiCheckOptions, options); + if (forType && options.type) { + _angularFix2['default'].forEach(formlyConfig.getTypeHeritage(options.type), function (type) { + runApiCheckForType(type.apiCheck, type.apiCheckInstance, type.apiCheckFunction, type.apiCheckOptions, options); + }); + } + } + + function runApiCheckForType(apiCheck, apiCheckInstance, apiCheckFunction, apiCheckOptions, options) { + /* eslint complexity:[2, 9] */ + if (!apiCheck) { + return; + } + var instance = apiCheckInstance || formlyConfig.extras.apiCheckInstance || formlyApiCheck; + if (instance.config.disabled || _apiCheck2['default'].globalConfig.disabled) { + return; + } + var fn = apiCheckFunction || 'warn'; + // this is the new API + var checkerObjects = apiCheck(instance); + _angularFix2['default'].forEach(checkerObjects, function (shape, name) { + var checker = instance.shape(shape); + var checkOptions = _angularFix2['default'].extend({ + prefix: 'formly-field type ' + options.type + ' for property ' + name, + url: formlyApiCheck.config.output.docsBaseUrl + 'formly-field-type-apicheck-failed' + }, apiCheckOptions); + instance[fn](checker, options[name], checkOptions); + }); + } + } + formlyField.$inject = ["$http", "$q", "$compile", "$templateCache", "$interpolate", "formlyConfig", "formlyApiCheck", "formlyUtil", "formlyUsability", "formlyWarn"]; + + // Stateless util functions + function getDefaultOptionsOptionsTypes(type) { + return getDefaultOptionsProperty(type, 'optionsTypes', []); + } + + function getDefaultOptionsProperty(type, prop, defaultValue) { + return type.defaultOptions && type.defaultOptions[prop] || defaultValue; + } + module.exports = exports['default']; + +/***/ }, +/* 15 */ +/***/ function(module, exports) { + + 'use strict'; + + Object.defineProperty(exports, '__esModule', { + value: true + }); + exports['default'] = formlyFocus; + + // @ngInject + function formlyFocus($timeout, $document) { + return { + restrict: 'A', + link: function formlyFocusLink(scope, element, attrs) { + var previousEl = null; + var el = element[0]; + var doc = $document[0]; + attrs.$observe('formlyFocus', function respondToFocusExpressionChange(value) { + /* eslint no-bitwise:0 */ // I know what I'm doing. I promise... + if (value === 'true') { + $timeout(function setElementFocus() { + previousEl = doc.activeElement; + el.focus(); + }, ~ ~attrs.focusWait); + } else if (value === 'false') { + if (doc.activeElement === el) { + el.blur(); + if (attrs.hasOwnProperty('refocus') && previousEl) { + previousEl.focus(); + } + } + } + }); + } + }; + } + formlyFocus.$inject = ["$timeout", "$document"]; + module.exports = exports['default']; + +/***/ }, +/* 16 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, '__esModule', { + value: true + }); + var _slice = Array.prototype.slice; + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + + function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) arr2[i] = arr[i]; return arr2; } else { return Array.from(arr); } } + + var _angularFix = __webpack_require__(2); + + var _angularFix2 = _interopRequireDefault(_angularFix); + + exports['default'] = formlyForm; + + /** + * @ngdoc directive + * @name formlyForm + * @restrict AE + */ + // @ngInject + function formlyForm(formlyUsability, formlyWarn, $parse, formlyConfig, $interpolate) { + var currentFormId = 1; + FormlyFormController.$inject = ["$scope", "formlyApiCheck", "formlyUtil"]; + return { + restrict: 'AE', + template: formlyFormGetTemplate, + replace: true, + transclude: true, + scope: { + fields: '=', + model: '=', + form: '=?', + options: '=?' + }, + controller: FormlyFormController, + link: formlyFormLink + }; + + function formlyFormGetTemplate(el, attrs) { + var rootEl = getRootEl(); + var fieldRootEl = getFieldRootEl(); + var formId = 'formly_' + currentFormId++; + var parentFormAttributes = ''; + if (attrs.hasOwnProperty('isFieldGroup') && el.parent().parent().hasClass('formly')) { + parentFormAttributes = copyAttributes(el.parent().parent()[0].attributes); + } + return '\n <' + rootEl + ' class="formly"\n name="' + getFormName() + '"\n role="form" ' + parentFormAttributes + '>\n <' + fieldRootEl + ' formly-field\n ng-repeat="field in fields ' + getTrackBy() + '"\n ' + getHideDirective() + '="!field.hide"\n class="formly-field"\n options="field"\n model="field.model"\n original-model="model"\n fields="fields"\n form="theFormlyForm"\n form-id="' + getFormName() + '"\n form-state="options.formState"\n form-options="options"\n index="$index">\n \n
\n \n '; + + function getRootEl() { + return attrs.rootEl || 'ng-form'; + } + + function getFieldRootEl() { + return attrs.fieldRootEl || 'div'; + } + + function getHideDirective() { + return attrs.hideDirective || formlyConfig.extras.defaultHideDirective || 'ng-if'; + } + + function getTrackBy() { + if (!attrs.trackBy) { + return ''; + } else { + return 'track by ' + attrs.trackBy; + } + } + + function getFormName() { + var formName = formId; + var bindName = attrs.bindName; + if (bindName) { + if (_angularFix2['default'].version.minor < 3) { + throw formlyUsability.getFormlyError('bind-name attribute on formly-form not allowed in < angular 1.3'); + } + // we can do a one-time binding here because we know we're in 1.3.x territory + formName = $interpolate.startSymbol() + '::\'formly_\' + ' + bindName + $interpolate.endSymbol(); + } + return formName; + } + + function getTranscludeClass() { + return attrs.transcludeClass || ''; + } + + function copyAttributes(attributes) { + var excluded = ['model', 'form', 'fields', 'options', 'name', 'role', 'class', 'data-model', 'data-form', 'data-fields', 'data-options', 'data-name']; + var arrayAttrs = []; + _angularFix2['default'].forEach(attributes, function (_ref) { + var nodeName = _ref.nodeName; + var value = _ref.value; + + if (nodeName !== 'undefined' && excluded.indexOf(nodeName) === -1) { + arrayAttrs.push(toKebabCase(nodeName) + '="' + value + '"'); + } + }); + return arrayAttrs.join(' '); + } + } + + // @ngInject + function FormlyFormController($scope, formlyApiCheck, formlyUtil) { + setupOptions(); + $scope.model = $scope.model || {}; + setupFields(); + + // watch the model and evaluate watch expressions that depend on it. + if (!$scope.options.manualModelWatcher) { + $scope.$watch('model', onModelOrFormStateChange, true); + } else if (_angularFix2['default'].isFunction($scope.options.manualModelWatcher)) { + $scope.$watch($scope.options.manualModelWatcher, onModelOrFormStateChange, true); + } + + if ($scope.options.formState) { + $scope.$watch('options.formState', onModelOrFormStateChange, true); + } + + function onModelOrFormStateChange() { + _angularFix2['default'].forEach($scope.fields, runFieldExpressionProperties); + } + + function validateFormControl(formControl, promise) { + var validate = formControl.$validate; + if (promise) { + promise.then(validate); + } else { + validate(); + } + } + + function runFieldExpressionProperties(field, index) { + var model = field.model || $scope.model; + var promise = field.runExpressions && field.runExpressions(); + if (field.hideExpression) { + // can't use hide with expressionProperties reliably + var val = model[field.key]; + field.hide = evalCloseToFormlyExpression(field.hideExpression, val, field, index); + } + if (field.extras && field.extras.validateOnModelChange && field.formControl) { + if (_angularFix2['default'].isArray(field.formControl)) { + _angularFix2['default'].forEach(field.formControl, function (formControl) { + validateFormControl(formControl, promise); + }); + } else { + validateFormControl(field.formControl, promise); + } + } + } + + function setupFields() { + $scope.fields = $scope.fields || []; + + checkDeprecatedOptions($scope.options); + + var fieldTransforms = $scope.options.fieldTransform || formlyConfig.extras.fieldTransform; + + if (!_angularFix2['default'].isArray(fieldTransforms)) { + fieldTransforms = [fieldTransforms]; + } + + _angularFix2['default'].forEach(fieldTransforms, function transformFields(fieldTransform) { + if (fieldTransform) { + $scope.fields = fieldTransform($scope.fields, $scope.model, $scope.options, $scope.form); + if (!$scope.fields) { + throw formlyUsability.getFormlyError('fieldTransform must return an array of fields'); + } + } + }); + + setupModels(); + + if ($scope.options.watchAllExpressions) { + _angularFix2['default'].forEach($scope.fields, setupHideExpressionWatcher); + } + + _angularFix2['default'].forEach($scope.fields, attachKey); // attaches a key based on the index if a key isn't specified + _angularFix2['default'].forEach($scope.fields, setupWatchers); // setup watchers for all fields + } + + function checkDeprecatedOptions(options) { + if (formlyConfig.extras.fieldTransform && _angularFix2['default'].isFunction(formlyConfig.extras.fieldTransform)) { + formlyWarn('fieldtransform-as-a-function-deprecated', 'fieldTransform as a function has been deprecated.', 'Attempted for formlyConfig.extras: ' + formlyConfig.extras.fieldTransform.name, formlyConfig.extras); + } else if (options.fieldTransform && _angularFix2['default'].isFunction(options.fieldTransform)) { + formlyWarn('fieldtransform-as-a-function-deprecated', 'fieldTransform as a function has been deprecated.', 'Attempted for form', options); + } + } + + function setupOptions() { + formlyApiCheck['throw']([formlyApiCheck.formOptionsApi.optional], [$scope.options], { prefix: 'formly-form options check' }); + $scope.options = $scope.options || {}; + $scope.options.formState = $scope.options.formState || {}; + + _angularFix2['default'].extend($scope.options, { + updateInitialValue: updateInitialValue, + resetModel: resetModel + }); + } + + function updateInitialValue() { + _angularFix2['default'].forEach($scope.fields, function (field) { + if (isFieldGroup(field) && field.options) { + field.options.updateInitialValue(); + } else { + field.updateInitialValue(); + } + }); + } + + function resetModel() { + _angularFix2['default'].forEach($scope.fields, function (field) { + if (isFieldGroup(field) && field.options) { + field.options.resetModel(); + } else if (field.resetModel) { + field.resetModel(); + } + }); + } + + function setupModels() { + // a set of field models that are already watched (the $scope.model will have its own watcher) + var watchedModels = [$scope.model]; + // we will not set up automatic model watchers if manual mode is set + var manualModelWatcher = $scope.options.manualModelWatcher; + + if ($scope.options.formState) { + // $scope.options.formState will have its own watcher + watchedModels.push($scope.options.formState); + } + + _angularFix2['default'].forEach($scope.fields, function (field) { + var isNewModel = initModel(field); + + if (field.model && isNewModel && watchedModels.indexOf(field.model) === -1 && !manualModelWatcher) { + $scope.$watch(function () { + return field.model; + }, onModelOrFormStateChange, true); + watchedModels.push(field.model); + } + }); + } + + function setupHideExpressionWatcher(field, index) { + if (field.hideExpression) { + (function () { + // can't use hide with expressionProperties reliably + var model = field.model || $scope.model; + $scope.$watch(function hideExpressionWatcher() { + var val = model[field.key]; + return evalCloseToFormlyExpression(field.hideExpression, val, field, index); + }, function (hide) { + return field.hide = hide; + }, true); + })(); + } + } + + function initModel(field) { + var isNewModel = true; + + if (_angularFix2['default'].isString(field.model)) { + (function () { + var expression = field.model; + + isNewModel = !referencesCurrentlyWatchedModel(expression); + + field.model = resolveStringModel(expression); + + $scope.$watch(function () { + return resolveStringModel(expression); + }, function (model) { + return field.model = model; + }); + })(); + } else if (!field.model) { + field.model = $scope.model; + } + return isNewModel; + + function resolveStringModel(expression) { + var index = $scope.fields.indexOf(field); + var model = evalCloseToFormlyExpression(expression, undefined, field, index, { model: $scope.model }); + + if (!model) { + throw formlyUsability.getFieldError('field-model-must-be-initialized', 'Field model must be initialized. When specifying a model as a string for a field, the result of the' + ' expression must have been initialized ahead of time.', field); + } + + return model; + } + } + + function referencesCurrentlyWatchedModel(expression) { + return ['model', 'formState'].some(function (item) { + return formlyUtil.startsWith(expression, item + '.') || formlyUtil.startsWith(expression, item + '['); + }); + } + + function attachKey(field, index) { + if (!isFieldGroup(field)) { + field.key = field.key || index || 0; + } + } + + function setupWatchers(field, index) { + if (!_angularFix2['default'].isDefined(field.watcher)) { + return; + } + var watchers = field.watcher; + if (!_angularFix2['default'].isArray(watchers)) { + watchers = [watchers]; + } + _angularFix2['default'].forEach(watchers, function setupWatcher(watcher) { + if (!_angularFix2['default'].isDefined(watcher.listener) && !watcher.runFieldExpressions) { + throw formlyUsability.getFieldError('all-field-watchers-must-have-a-listener', 'All field watchers must have a listener', field); + } + var watchExpression = getWatchExpression(watcher, field, index); + var watchListener = getWatchListener(watcher, field, index); + + var type = watcher.type || '$watch'; + watcher.stopWatching = $scope[type](watchExpression, watchListener, watcher.watchDeep); + }); + } + + function getWatchExpression(watcher, field, index) { + var watchExpression = undefined; + if (!_angularFix2['default'].isUndefined(watcher.expression)) { + watchExpression = watcher.expression; + } else if (field.key) { + watchExpression = 'model[\'' + field.key.toString().split('.').join('\'][\'') + '\']'; + } + if (_angularFix2['default'].isFunction(watchExpression)) { + (function () { + // wrap the field's watch expression so we can call it with the field as the first arg + // and the stop function as the last arg as a helper + var originalExpression = watchExpression; + watchExpression = function formlyWatchExpression() { + var args = modifyArgs.apply(undefined, [watcher, index].concat(_slice.call(arguments))); + return originalExpression.apply(undefined, _toConsumableArray(args)); + }; + watchExpression.displayName = 'Formly Watch Expression for field for ' + field.key; + })(); + } else if (field.model) { + watchExpression = $parse(watchExpression).bind(null, $scope, { model: field.model }); + } + return watchExpression; + } + + function getWatchListener(watcher, field, index) { + var watchListener = watcher.listener; + if (_angularFix2['default'].isFunction(watchListener) || watcher.runFieldExpressions) { + (function () { + // wrap the field's watch listener so we can call it with the field as the first arg + // and the stop function as the last arg as a helper + var originalListener = watchListener; + watchListener = function formlyWatchListener() { + var value = undefined; + if (originalListener) { + var args = modifyArgs.apply(undefined, [watcher, index].concat(_slice.call(arguments))); + value = originalListener.apply(undefined, _toConsumableArray(args)); + } + if (watcher.runFieldExpressions) { + runFieldExpressionProperties(field, index); + } + return value; + }; + watchListener.displayName = 'Formly Watch Listener for field for ' + field.key; + })(); + } + return watchListener; + } + + function modifyArgs(watcher, index) { + for (var _len = arguments.length, originalArgs = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) { + originalArgs[_key - 2] = arguments[_key]; + } + + return [$scope.fields[index]].concat(originalArgs, [watcher.stopWatching]); + } + + function evalCloseToFormlyExpression(expression, val, field, index) { + var extraLocals = arguments.length <= 4 || arguments[4] === undefined ? {} : arguments[4]; + + extraLocals = _angularFix2['default'].extend(getFormlyFieldLikeLocals(field, index), extraLocals); + return formlyUtil.formlyEval($scope, expression, val, val, extraLocals); + } + + function getFormlyFieldLikeLocals(field, index) { + // this makes it closer to what a regular formlyExpression would be + return { + model: field.model, + options: field, + index: index, + formState: $scope.options.formState, + originalModel: $scope.model, + formOptions: $scope.options, + formId: $scope.formId + }; + } + } + + function formlyFormLink(scope, el, attrs) { + setFormController(); + fixChromeAutocomplete(); + + function setFormController() { + var formId = attrs.name; + scope.formId = formId; + scope.theFormlyForm = scope[formId]; + if (attrs.form) { + var getter = $parse(attrs.form); + var setter = getter.assign; + var parentForm = getter(scope.$parent); + if (parentForm) { + scope.theFormlyForm = parentForm; + if (scope[formId]) { + scope.theFormlyForm.$removeControl(scope[formId]); + } + + // this next line is probably one of the more dangerous things that angular-formly does to improve the + // API for angular-formly forms. It ensures that the NgModelControllers inside of formly-form will be + // attached to the form that is passed to formly-form rather than the one that formly-form creates + // this is necessary because it's confusing to have a step between the form you pass in + // and the fields in that form. It also is because angular doesn't propagate properties like $submitted down + // to children forms :-( This line was added to solve this issue: + // https://github.com/formly-js/angular-formly/issues/287 + // luckily, this is how the formController has been accessed by the NgModelController since angular 1.0.0 + // so I expect it will remain this way for the life of angular 1.x + el.removeData('$formController'); + } else { + setter(scope.$parent, scope[formId]); + } + } + if (!scope.theFormlyForm && !formlyConfig.disableWarnings) { + /* eslint no-console:0 */ + formlyWarn('formly-form-has-no-formcontroller', 'Your formly-form does not have a `form` property. Many functions of the form (like validation) may not work', el, scope); + } + } + + /* + * chrome autocomplete lameness + * see https://code.google.com/p/chromium/issues/detail?id=468153#c14 + * ლ(ಠ益ಠლ) (╯°□°)╯︵ ┻━┻ (◞‸◟;) + */ + function fixChromeAutocomplete() { + var global = formlyConfig.extras.removeChromeAutoComplete === true; + var offInstance = scope.options && scope.options.removeChromeAutoComplete === false; + var onInstance = scope.options && scope.options.removeChromeAutoComplete === true; + if (global && !offInstance || onInstance) { + var input = document.createElement('input'); + input.setAttribute('autocomplete', 'address-level4'); + input.setAttribute('hidden', 'true'); + el[0].appendChild(input); + } + } + } + + // stateless util functions + function toKebabCase(string) { + if (string) { + return string.replace(/([A-Z])/g, function ($1) { + return '-' + $1.toLowerCase(); + }); + } else { + return ''; + } + } + + function isFieldGroup(field) { + return field && !!field.fieldGroup; + } + } + formlyForm.$inject = ["formlyUsability", "formlyWarn", "$parse", "formlyConfig", "$interpolate"]; + module.exports = exports['default']; + +/***/ }, +/* 17 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, '__esModule', { + value: true + }); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + + var _angularFix = __webpack_require__(2); + + var _angularFix2 = _interopRequireDefault(_angularFix); + + var _otherUtils = __webpack_require__(9); + + exports['default'] = addFormlyNgModelAttrsManipulator; + + // @ngInject + function addFormlyNgModelAttrsManipulator(formlyConfig, $interpolate) { + if (formlyConfig.extras.disableNgModelAttrsManipulator) { + return; + } + formlyConfig.templateManipulators.preWrapper.push(ngModelAttrsManipulator); + + function ngModelAttrsManipulator(template, options, scope) { + var node = document.createElement('div'); + var skip = options.extras && options.extras.skipNgModelAttrsManipulator; + if (skip === true) { + return template; + } + node.innerHTML = template; + + var modelNodes = getNgModelNodes(node, skip); + if (!modelNodes || !modelNodes.length) { + return template; + } + + addIfNotPresent(modelNodes, 'id', scope.id); + addIfNotPresent(modelNodes, 'name', scope.name || scope.id); + + addValidation(); + alterNgModelAttr(); + addModelOptions(); + addTemplateOptionsAttrs(); + addNgModelElAttrs(); + + return node.innerHTML; + + function addValidation() { + if (_angularFix2['default'].isDefined(options.validators) || _angularFix2['default'].isDefined(options.validation.messages)) { + addIfNotPresent(modelNodes, 'formly-custom-validation', ''); + } + } + + function alterNgModelAttr() { + if (isPropertyAccessor(options.key)) { + addRegardlessOfPresence(modelNodes, 'ng-model', 'model.' + options.key); + } + } + + function addModelOptions() { + if (_angularFix2['default'].isDefined(options.modelOptions)) { + addIfNotPresent(modelNodes, 'ng-model-options', 'options.modelOptions'); + if (options.modelOptions.getterSetter) { + addRegardlessOfPresence(modelNodes, 'ng-model', 'options.value'); + } + } + } + + function addTemplateOptionsAttrs() { + if (!options.templateOptions && !options.expressionProperties) { + // no need to run these if there are no templateOptions or expressionProperties + return; + } + var to = options.templateOptions || {}; + var ep = options.expressionProperties || {}; + + var ngModelAttributes = getBuiltInAttributes(); + + // extend with the user's specifications winning + _angularFix2['default'].extend(ngModelAttributes, options.ngModelAttrs); + + // Feel free to make this more simple :-) + _angularFix2['default'].forEach(ngModelAttributes, function (val, name) { + /* eslint complexity:[2, 14] */ + var attrVal = undefined, + attrName = undefined; + var ref = 'options.templateOptions[\'' + name + '\']'; + var toVal = to[name]; + var epVal = getEpValue(ep, name); + + var inTo = _angularFix2['default'].isDefined(toVal); + var inEp = _angularFix2['default'].isDefined(epVal); + if (val.value) { + // I realize this looks backwards, but it's right, trust me... + attrName = val.value; + attrVal = name; + } else if (val.statement && inTo) { + attrName = val.statement; + if (_angularFix2['default'].isString(to[name])) { + attrVal = '$eval(' + ref + ')'; + } else if (_angularFix2['default'].isFunction(to[name])) { + attrVal = ref + '(model[options.key], options, this, $event)'; + } else { + throw new Error('options.templateOptions.' + name + ' must be a string or function: ' + JSON.stringify(options)); + } + } else if (val.bound && inEp) { + attrName = val.bound; + attrVal = ref; + } else if ((val.attribute || val.boolean) && inEp) { + attrName = val.attribute || val.boolean; + attrVal = '' + $interpolate.startSymbol() + ref + $interpolate.endSymbol(); + } else if (val.attribute && inTo) { + attrName = val.attribute; + attrVal = toVal; + } else if (val.boolean) { + if (inTo && !inEp && toVal) { + attrName = val.boolean; + attrVal = true; + } else { + /* eslint no-empty:0 */ + // empty to illustrate that a boolean will not be added via val.bound + // if you want it added via val.bound, then put it in expressionProperties + } + } else if (val.bound && inTo) { + attrName = val.bound; + attrVal = ref; + } + + if (_angularFix2['default'].isDefined(attrName) && _angularFix2['default'].isDefined(attrVal)) { + addIfNotPresent(modelNodes, attrName, attrVal); + } + }); + } + + function addNgModelElAttrs() { + _angularFix2['default'].forEach(options.ngModelElAttrs, function (val, name) { + addRegardlessOfPresence(modelNodes, name, val); + }); + } + } + + // Utility functions + function getNgModelNodes(node, skip) { + var selectorNot = _angularFix2['default'].isString(skip) ? ':not(' + skip + ')' : ''; + var skipNot = ':not([formly-skip-ng-model-attrs-manipulator])'; + var query = '[ng-model]' + selectorNot + skipNot + ', [data-ng-model]' + selectorNot + skipNot; + try { + return node.querySelectorAll(query); + } catch (e) { + //this code is needed for IE8, as it does not support the CSS3 ':not' selector + //it should be removed when IE8 support is dropped + return getNgModelNodesFallback(node, skip); + } + } + + function getNgModelNodesFallback(node, skip) { + var allNgModelNodes = node.querySelectorAll('[ng-model], [data-ng-model]'); + var matchingNgModelNodes = []; + + //make sure this array is compatible with NodeList type by adding an 'item' function + matchingNgModelNodes.item = function (i) { + return this[i]; + }; + + for (var i = 0; i < allNgModelNodes.length; i++) { + var ngModelNode = allNgModelNodes[i]; + if (!ngModelNode.hasAttribute('formly-skip-ng-model-attrs-manipulator') && !(_angularFix2['default'].isString(skip) && nodeMatches(ngModelNode, skip))) { + matchingNgModelNodes.push(ngModelNode); + } + } + + return matchingNgModelNodes; + } + + function nodeMatches(node, selector) { + var div = document.createElement('div'); + div.innerHTML = node.outerHTML; + return div.querySelector(selector); + } + + function getBuiltInAttributes() { + var ngModelAttributes = { + focus: { + attribute: 'formly-focus' + } + }; + var boundOnly = []; + var bothBooleanAndBound = ['required', 'disabled']; + var bothAttributeAndBound = ['pattern', 'minlength']; + var statementOnly = ['change', 'keydown', 'keyup', 'keypress', 'click', 'focus', 'blur']; + var attributeOnly = ['placeholder', 'min', 'max', 'step', 'tabindex', 'type']; + if (formlyConfig.extras.ngModelAttrsManipulatorPreferUnbound) { + bothAttributeAndBound.push('maxlength'); + } else { + boundOnly.push('maxlength'); + } + + _angularFix2['default'].forEach(boundOnly, function (item) { + ngModelAttributes[item] = { bound: 'ng-' + item }; + }); + + _angularFix2['default'].forEach(bothBooleanAndBound, function (item) { + ngModelAttributes[item] = { boolean: item, bound: 'ng-' + item }; + }); + + _angularFix2['default'].forEach(bothAttributeAndBound, function (item) { + ngModelAttributes[item] = { attribute: item, bound: 'ng-' + item }; + }); + + _angularFix2['default'].forEach(statementOnly, function (item) { + var propName = 'on' + item.substr(0, 1).toUpperCase() + item.substr(1); + ngModelAttributes[propName] = { statement: 'ng-' + item }; + }); + + _angularFix2['default'].forEach(attributeOnly, function (item) { + ngModelAttributes[item] = { attribute: item }; + }); + return ngModelAttributes; + } + + function getEpValue(ep, name) { + return ep['templateOptions.' + name] || ep['templateOptions[\'' + name + '\']'] || ep['templateOptions["' + name + '"]']; + } + + function addIfNotPresent(nodes, attr, val) { + _angularFix2['default'].forEach(nodes, function (node) { + if (!node.getAttribute(attr)) { + node.setAttribute(attr, val); + } + }); + } + + function addRegardlessOfPresence(nodes, attr, val) { + _angularFix2['default'].forEach(nodes, function (node) { + node.setAttribute(attr, val); + }); + } + + function isPropertyAccessor(key) { + return (0, _otherUtils.contains)(key, '.') || (0, _otherUtils.contains)(key, '[') && (0, _otherUtils.contains)(key, ']'); + } + } + addFormlyNgModelAttrsManipulator.$inject = ["formlyConfig", "$interpolate"]; + module.exports = exports['default']; + +/***/ }, +/* 18 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, '__esModule', { + value: true + }); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + + var _angularFix = __webpack_require__(2); + + var _angularFix2 = _interopRequireDefault(_angularFix); + + exports['default'] = addCustomTags; + + // @ngInject + function addCustomTags($document) { + // IE8 check -> + // https://msdn.microsoft.com/en-us/library/cc196988(v=vs.85).aspx + if ($document && $document.documentMode < 9) { + (function () { + var document = $document.get(0); + // add the custom elements that we need for formly + var customElements = ['formly-field', 'formly-form']; + _angularFix2['default'].forEach(customElements, function (el) { + document.createElement(el); + }); + })(); + } + } + addCustomTags.$inject = ["$document"]; + module.exports = exports['default']; + +/***/ } +/******/ ]) +}); +; \ No newline at end of file diff --git a/dist/formly.min.js b/dist/formly.min.js new file mode 100644 index 00000000..b6576b03 --- /dev/null +++ b/dist/formly.min.js @@ -0,0 +1,4 @@ +/*! angular-formly v0.0.0-semantically-released.0 | MIT | built with ♥ by Astrism , Kent C. Dodds (ó ì_í)=óò=(ì_í ò) */ +!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("api-check"),require("angular")):"function"==typeof define&&define.amd?define(["api-check","angular"],t):"object"==typeof exports?exports.ngFormly=t(require("api-check"),require("angular")):e.ngFormly=t(e.apiCheck,e.angular)}(this,function(e,t){return function(e){function t(o){if(n[o])return n[o].exports;var r=n[o]={exports:{},id:o,loaded:!1};return e[o].call(r.exports,r,r.exports,t),r.loaded=!0,r.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var r=n(9),i=o(r);t["default"]=i["default"],e.exports=t["default"]},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=n(18);o.version||(o=window.angular),t["default"]=o,e.exports=t["default"]},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{"default":e}}function r(e){return i(e,".")||i(e,"[")&&i(e,"]")}function i(e,t){return e&&e.indexOf?-1!==e.indexOf(t):!1}function a(e,t,n,o,r){return v["default"].isFunction(t)?t(o,n,e,r):e.$eval(t,v["default"].extend({$viewValue:o,$modelValue:n},r))}function l(e,t,n){if(t.id)return t.id;var o=t.type;return!o&&t.template?o="template":!o&&t.templateUrl&&(o="templateUrl"),[e,o,t.key,n].join("_")}function f(e){return v["default"].forEach(arguments,function(t,n){n&&v["default"].forEach(t,function(t,n){v["default"].isDefined(e[n])?s(e[n],t)&&f(e[n],t):e[n]=v["default"].copy(t)})}),e}function s(e,t){return v["default"].isObject(e)&&v["default"].isObject(t)&&Object.getPrototypeOf(e)===Object.getPrototypeOf(t)}function u(e,t){if(e.prop||(e=v["default"].element(e)),e.prop("nodeName")===t.toUpperCase())return e;for(var n=e.children(),o=0;n&&on;n++)t[n]=arguments[n];return function(){var e=arguments;t.forEach(function(t){return t.apply(null,e)})}}function c(e,t,n){return n&&(e=e[n],t=t[n]),t&&e?(v["default"].forEach(t,function(t){-1===e.indexOf(t)&&e.push(t)}),e):t?t:e}function m(e,t){return v["default"].isString(e)&&v["default"].isString(t)?e.length>=t.length&&e.substring(0,t.length)===t:!1}function y(e,t){return v["default"].isString(e)&&v["default"].isString(t)?e.length>=t.length&&-1!==e.indexOf(t):!1}Object.defineProperty(t,"__esModule",{value:!0});var h=n(1),v=o(h);t["default"]={containsSelector:r,containsSpecialChar:i,formlyEval:a,getFieldId:l,reverseDeepMerge:f,findByNodeName:u,arrayify:p,extendFunction:d,extendArray:c,startsWith:m,contains:y},e.exports=t["default"]},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t["default"]="https://github.com/formly-js/angular-formly/blob/0.0.0-semantically-released.0/other/ERRORS_AND_WARNINGS.md#",e.exports=t["default"]},function(t,n){t.exports=e},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{"default":e}}function r(e){return{restrict:"A",require:"ngModel",link:function(t,n,o,r){function i(e,t,n){l(t,n),t=a["default"].isObject(t)?t.expression:t,p?f(t,n,e):s(t,n,e)}function l(n,o){var i=n.message;i&&(u.validation.messages[o]=function(){return e.formlyEval(t,i,r.$modelValue,r.$viewValue)})}function f(n,o,i){var a=i?"$asyncValidators":"$validators";r[a][o]=function(o,r){return e.formlyEval(t,n,o,r)}}function s(n,o,i){var a=void 0;r.$parsers.unshift(function(l){var f=e.formlyEval(t,n,r.$modelValue,l);return i?(r.$pending=r.$pending||{},r.$pending[o]=!0,a=f,f.then(function(){a===f&&r.$setValidity(o,!0)})["catch"](function(){a===f&&r.$setValidity(o,!1)})["finally"](function(){var e=r.$pending||{};1===Object.keys(e).length?delete r.$pending:delete r.$pending[o]})):r.$setValidity(o,f),l})}var u=t.options;u.validation.messages=u.validation.messages||{},a["default"].forEach(u.validation.messages,function(n,o){u.validation.messages[o]=function(){return e.formlyEval(t,n,r.$modelValue,r.$viewValue)}});var p=r.hasOwnProperty("$validators")&&!o.hasOwnProperty("useParsers");a["default"].forEach(u.validators,a["default"].bind(null,i,!1)),a["default"].forEach(u.asyncValidators,a["default"].bind(null,i,!0))}}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(1),a=o(i);t["default"]=r,r.$inject=["formlyUtil"],e.exports=t["default"]},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{"default":e}}function r(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t\n \n ").then(E(e.options,e.formOptions)).then(w)}function y(){e.options.elementAttributes&&o.attr(e.options.elementAttributes)}function h(){e.options.className&&o.addClass(e.options.className),e.options.type&&o.addClass("formly-field-"+e.options.type)}function w(t){return o.html(v(t)),n(o.contents())(e),t}function $(t){function n(t){var n=/\{\{(.*?)}}/,r=n.exec(t);r&&(t=i(t)(e)),o(t)}function o(t){e.$watch('form["'+t+'"]',function(t){t&&(_>1?(e.options.formControl||(e.options.formControl=[]),e.options.formControl.push(t)):e.options.formControl=t,e.fc=e.options.formControl,y(),u(),p(),c())})}function u(){y=e.$watch(function(){var t=f.extras.errorExistsAndShouldBeVisibleExpression,n=e.options,o=j(e.fc);return o.some(function(e){return e.$invalid})?"boolean"==typeof n.validation.show?n.validation.show:t?o.some(function(n){return d.formlyEval(e,t,n.$modelValue,n.$viewValue)}):o.some(function(e){var t=s["default"].isUndefined(e.$touched)&&e.$dirty;return e.$touched||t}):!1},function(t){e.options.validation.errorExistsAndShouldBeVisible=t,e.showError=t})}function p(){m("parsers")}function c(){m("formatters");var t=e.fc,n=e.form.$pristine;e.options.formatters&&!function(){var o=t.$modelValue;t.$formatters.forEach(function(e){o=e(o)}),t.$setViewValue(o),t.$render(),t.$setPristine(),n&&e.form.$setPristine()}()}function m(t){function n(r){if(!r)return[];s["default"].isString(r)&&(r=f.getType(r,!0,e.options));var i=[];return r["extends"]&&(i=d.extendArray(i,n(r["extends"]))),i=d.extendArray(i,l(r,t,[])),i=d.extendArray(i,o(a(r)))}function o(){var e=arguments.length<=0||void 0===arguments[0]?[]:arguments[0],t=[];return s["default"].forEach(s["default"].copy(j(e)).reverse(),function(e){t=d.extendArray(t,n(e))}),t}function i(t){function n(n){var o=e.options.value();return d.formlyEval(e,t,o,n)}return n[u]=t,n}var u="originalParser";"formatters"===t&&(u="originalFormatter");var p=n(C);p=d.extendArray(p,o(e.options.optionsTypes)),p=d.extendArray(p,e.options[t]),s["default"].forEach(p,function(e,t){p[t]=i(e)});var c=e.fc;s["default"].isArray(c)||(c=[c]),s["default"].forEach(c,function(e){var n;e["$"+t]=(n=e["$"+t]).concat.apply(n,r(p))})}var y=s["default"].noop;if(!e.options.noFormControl){var h=s["default"].element("
"+t+"
"),v=h[0].querySelectorAll("[ng-model],[data-ng-model]");v.length&&s["default"].forEach(v,function(e){_++,n(e.getAttribute("name"))})}}function A(){C&&C.link&&C.link.apply(F,T),e.options.link&&e.options.link.apply(F,T)}function M(n){return function(o){var r=t.when(o);return s["default"].forEach(n,function(n){r=r.then(function(o){return t.when(n(o,e.options,e)).then(function(e){return s["default"].isString(e)?e:v(e)})})}),r}}if(e.options.fieldGroup)return void c();!p&&e.options.model&&e.$watch("options.model",function(){return e.options.runExpressions()},!0),y(),h();var C=g(e.options),T=arguments,F=this,_=0,W=b(e.options,e.formOptions);O(e.options).then(M(W.preWrapper)).then(E(e.options,e.formOptions)).then(M(W.postWrapper)).then(w).then($).then(A)["catch"](function(t){m("there-was-a-problem-setting-the-template-for-this-field","There was a problem setting the template for this field ",e.options,t)})}function v(e){var t=s["default"].element("");return t.append(e).html()}function g(e){return e.type&&f.getType(e.type)}function b(e,t){function n(e){var t=e||{},n=t.preWrapper,i=void 0===n?[]:n,a=t.postWrapper,l=void 0===a?[]:a;o=o.concat(i),r=r.concat(l)}var o=[],r=[];return n(e.templateManipulators),n(t.templateManipulators),n(f.templateManipulators),{preWrapper:o,postWrapper:r}}function O(e){function t(t,n){return s["default"].isDefined(e[t])?e[t]:n&&s["default"].isDefined(n[t])?n[t]:void 0}var n=f.getType(e.type,!0,e),o=t("template",n),r=t("templateUrl",n);if(s["default"].isUndefined(o)&&!r)throw c.getFieldError("type-type-has-no-template","Type '"+e.type+"' has no template. On element:",e);return x(r||o,s["default"].isUndefined(o),e)}function x(n,r,i){var a=void 0;if(a=s["default"].isFunction(n)?t.when(n(i)):t.when(n),!r)return a;var l=function(){var t={cache:o};return{v:a.then(function(n){return e.get(n,t)}).then(function(e){return e.data})["catch"](function(e){m("problem-loading-template-for-templateurl","Problem loading template for "+n,e)})}}();return"object"==typeof l?l.v:void 0}function E(e,n){var o=$(e,n);return function(n){if(!o.length)return t.when(n);o.forEach(function(t){c.checkWrapper(t,e),M(t,e)});var r=o.map(function(e){return x(e.template||e.templateUrl,!e.template)});return t.all(r).then(function(e){e.forEach(function(e,t){c.checkWrapperTemplate(e,o[t])}),e.reverse();var t=e.shift();return e.forEach(function(e){t=w(t,e)}),w(t,n)})}}function w(e,t){var n=s["default"].element("");n.append(e);var o=n.find("formly-transclude");return o.length||(o=d.findByNodeName(n,"formly-transclude")),o.replaceWith(t),n.html()}function $(e,t){var n=e.wrapper;if(null===n)return[];n=n?j(n).map(f.getWrapper):j(f.getWrapperByType(e.type));var o=f.getType(e.type,!0,e);if(o&&o.wrapper){var r=j(o.wrapper).map(f.getWrapper);n=n.concat(r)}if(t.wrapper){var i=j(t.wrapper).map(f.getWrapper);n=n.concat(i)}var a=f.getWrapper();return a&&n.push(a),n}function A(e){u["throw"](u.formlyFieldOptions,e,{prefix:"formly-field directive",url:"formly-field-directive-validation-failed"});var t=e.type&&f.getType(e.type);t&&M(t,e,!0),e.expressionProperties&&e.expressionProperties.hide&&m("dont-use-expressionproperties.hide-use-hideexpression-instead","You have specified `hide` in `expressionProperties`. Use `hideExpression` instead",e)}function k(e){u["throw"](u.fieldGroup,e,{prefix:"formly-field directive",url:"formly-field-directive-validation-failed"})}function M(e,t,n){var o=e.apiCheck,r=e.apiCheckInstance,i=e.apiCheckFunction,a=e.apiCheckOptions;C(o,r,i,a,t),n&&t.type&&s["default"].forEach(f.getTypeHeritage(t.type),function(e){C(e.apiCheck,e.apiCheckInstance,e.apiCheckFunction,e.apiCheckOptions,t)})}function C(e,t,n,o,r){if(e){var i=t||f.extras.apiCheckInstance||u;if(!i.config.disabled&&!p["default"].globalConfig.disabled){var a=n||"warn",l=e(i);s["default"].forEach(l,function(e,t){var n=i.shape(e),l=s["default"].extend({prefix:"formly-field type "+r.type+" for property "+t,url:u.config.output.docsBaseUrl+"formly-field-type-apicheck-failed"},o);i[a](n,r[t],l)})}}}var j=d.arrayify;return y.$inject=["$scope","$timeout","$parse","$controller","formlyValidationMessages"],{restrict:"AE",transclude:!0,require:"?^formlyForm",scope:{options:"=",model:"=",originalModel:"=?",formId:"@",index:"=?",fields:"=?",formState:"=?",formOptions:"=?",form:"=?"},controller:y,link:h}}function a(e){return l(e,"optionsTypes",[])}function l(e,t,n){return e.defaultOptions&&e.defaultOptions[t]||n}Object.defineProperty(t,"__esModule",{value:!0});var f=n(1),s=o(f),u=n(4),p=o(u);t["default"]=i,i.$inject=["$http","$q","$compile","$templateCache","$interpolate","formlyConfig","formlyApiCheck","formlyUtil","formlyUsability","formlyWarn"],e.exports=t["default"]},function(e,t){"use strict";function n(e,t){return{restrict:"A",link:function(n,o,r){var i=null,a=o[0],l=t[0];r.$observe("formlyFocus",function(t){"true"===t?e(function(){i=l.activeElement,a.focus()},~~r.focusWait):"false"===t&&l.activeElement===a&&(a.blur(),r.hasOwnProperty("refocus")&&i&&i.focus())})}}}Object.defineProperty(t,"__esModule",{value:!0}),t["default"]=n,n.$inject=["$timeout","$document"],e.exports=t["default"]},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{"default":e}}function r(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t\n <"+h+' formly-field\n ng-repeat="field in fields '+s()+'"\n '+l()+'="!field.hide"\n class="formly-field"\n options="field"\n model="field.model"\n original-model="model"\n fields="fields"\n form="theFormlyForm"\n form-id="'+u()+'"\n form-state="options.formState"\n form-options="options"\n index="$index">\n \n
\n \n "}function s(i,l,s){function u(){f["default"].forEach(i.fields,c)}function p(e,t){var n=e.$validate;t?t.then(n):n()}function c(e,t){var n=e.model||i.model,o=e.runExpressions&&e.runExpressions();if(e.hideExpression){var r=n[e.key];e.hide=C(e.hideExpression,r,e,t)}e.extras&&e.extras.validateOnModelChange&&e.formControl&&(f["default"].isArray(e.formControl)?f["default"].forEach(e.formControl,function(e){p(e,o)}):p(e.formControl,o))}function m(){i.fields=i.fields||[],y(i.options);var t=i.options.fieldTransform||o.extras.fieldTransform;f["default"].isArray(t)||(t=[t]),f["default"].forEach(t,function(t){if(t&&(i.fields=t(i.fields,i.model,i.options,i.form),!i.fields))throw e.getFormlyError("fieldTransform must return an array of fields")}),b(),i.options.watchAllExpressions&&f["default"].forEach(i.fields,O),f["default"].forEach(i.fields,w),f["default"].forEach(i.fields,$)}function y(e){o.extras.fieldTransform&&f["default"].isFunction(o.extras.fieldTransform)?t("fieldtransform-as-a-function-deprecated","fieldTransform as a function has been deprecated.","Attempted for formlyConfig.extras: "+o.extras.fieldTransform.name,o.extras):e.fieldTransform&&f["default"].isFunction(e.fieldTransform)&&t("fieldtransform-as-a-function-deprecated","fieldTransform as a function has been deprecated.","Attempted for form",e)}function h(){l["throw"]([l.formOptionsApi.optional],[i.options],{prefix:"formly-form options check"}),i.options=i.options||{},i.options.formState=i.options.formState||{},f["default"].extend(i.options,{updateInitialValue:v,resetModel:g})}function v(){f["default"].forEach(i.fields,function(e){d(e)&&e.options?e.options.updateInitialValue():e.updateInitialValue()})}function g(){f["default"].forEach(i.fields,function(e){d(e)&&e.options?e.options.resetModel():e.resetModel&&e.resetModel()})}function b(){var e=[i.model],t=i.options.manualModelWatcher;i.options.formState&&e.push(i.options.formState),f["default"].forEach(i.fields,function(n){var o=x(n);n.model&&o&&-1===e.indexOf(n.model)&&!t&&(i.$watch(function(){return n.model},u,!0),e.push(n.model))})}function O(e,t){e.hideExpression&&!function(){var n=e.model||i.model;i.$watch(function(){var o=n[e.key];return C(e.hideExpression,o,e,t)},function(t){return e.hide=t},!0)}()}function x(t){function n(n){var o=i.fields.indexOf(t),r=C(n,void 0,t,o,{model:i.model});if(!r)throw e.getFieldError("field-model-must-be-initialized","Field model must be initialized. When specifying a model as a string for a field, the result of the expression must have been initialized ahead of time.",t);return r}var o=!0;return f["default"].isString(t.model)?!function(){var e=t.model;o=!E(e),t.model=n(e),i.$watch(function(){return n(e)},function(e){return t.model=e})}():t.model||(t.model=i.model),o}function E(e){return["model","formState"].some(function(t){return s.startsWith(e,t+".")||s.startsWith(e,t+"[")})}function w(e,t){d(e)||(e.key=e.key||t||0)}function $(t,n){if(f["default"].isDefined(t.watcher)){var o=t.watcher;f["default"].isArray(o)||(o=[o]),f["default"].forEach(o,function(o){if(!f["default"].isDefined(o.listener)&&!o.runFieldExpressions)throw e.getFieldError("all-field-watchers-must-have-a-listener","All field watchers must have a listener",t);var r=A(o,t,n),a=k(o,t,n),l=o.type||"$watch";o.stopWatching=i[l](r,a,o.watchDeep)})}}function A(e,t,o){var l=void 0;return f["default"].isUndefined(e.expression)?t.key&&(l="model['"+t.key.toString().split(".").join("']['")+"']"):l=e.expression,f["default"].isFunction(l)?!function(){var n=l;l=function(){var t=M.apply(void 0,[e,o].concat(a.call(arguments)));return n.apply(void 0,r(t))},l.displayName="Formly Watch Expression for field for "+t.key}():t.model&&(l=n(l).bind(null,i,{model:t.model})),l}function k(e,t,n){var o=e.listener;return(f["default"].isFunction(o)||e.runFieldExpressions)&&!function(){var i=o;o=function(){var o=void 0;if(i){var l=M.apply(void 0,[e,n].concat(a.call(arguments)));o=i.apply(void 0,r(l))}return e.runFieldExpressions&&c(t,n),o},o.displayName="Formly Watch Listener for field for "+t.key}(),o}function M(e,t){for(var n=arguments.length,o=Array(n>2?n-2:0),r=2;n>r;r++)o[r-2]=arguments[r];return[i.fields[t]].concat(o,[e.stopWatching])}function C(e,t,n,o){var r=arguments.length<=4||void 0===arguments[4]?{}:arguments[4];return r=f["default"].extend(j(n,o),r),s.formlyEval(i,e,t,t,r)}function j(e,t){return{model:e.model,options:e,index:t,formState:i.options.formState,originalModel:i.model,formOptions:i.options,formId:i.formId}}h(),i.model=i.model||{},m(),i.options.manualModelWatcher?f["default"].isFunction(i.options.manualModelWatcher)&&i.$watch(i.options.manualModelWatcher,u,!0):i.$watch("model",u,!0),i.options.formState&&i.$watch("options.formState",u,!0)}function u(e,r,i){function a(){var a=i.name;if(e.formId=a,e.theFormlyForm=e[a],i.form){var l=n(i.form),f=l.assign,s=l(e.$parent);s?(e.theFormlyForm=s,e[a]&&e.theFormlyForm.$removeControl(e[a]),r.removeData("$formController")):f(e.$parent,e[a])}e.theFormlyForm||o.disableWarnings||t("formly-form-has-no-formcontroller","Your formly-form does not have a `form` property. Many functions of the form (like validation) may not work",r,e)}function l(){var t=o.extras.removeChromeAutoComplete===!0,n=e.options&&e.options.removeChromeAutoComplete===!1,i=e.options&&e.options.removeChromeAutoComplete===!0;if(t&&!n||i){var a=document.createElement("input");a.setAttribute("autocomplete","address-level4"),a.setAttribute("hidden","true"),r[0].appendChild(a)}}a(),l()}function p(e){return e?e.replace(/([A-Z])/g,function(e){return"-"+e.toLowerCase()}):""}function d(e){return e&&!!e.fieldGroup}var c=1;return s.$inject=["$scope","formlyApiCheck","formlyUtil"],{restrict:"AE",template:l,replace:!0,transclude:!0,scope:{fields:"=",model:"=",form:"=?",options:"=?"},controller:s,link:u}}Object.defineProperty(t,"__esModule",{value:!0});var a=Array.prototype.slice,l=n(1),f=o(l);t["default"]=i,i.$inject=["formlyUsability","formlyWarn","$parse","formlyConfig","$interpolate"],e.exports=t["default"]},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var r=n(1),i=o(r),a=n(10),l=o(a),f=n(3),s=o(f),u=n(12),p=o(u),d=n(11),c=o(d),m=n(13),y=o(m),h=n(16),v=o(h),g=n(17),b=o(g),O=n(5),x=o(O),E=n(6),w=o(E),$=n(7),A=o($),k=n(8),M=o(k),C=n(15),j=o(C),T=n(14),F=o(T),_="formly";t["default"]=_;var W=i["default"].module(_,[]);W.constant("formlyApiCheck",l["default"]),W.constant("formlyErrorAndWarningsUrlPrefix",s["default"]),W.constant("formlyVersion","0.0.0-semantically-released.0"),W.provider("formlyUsability",p["default"]),W.provider("formlyConfig",c["default"]),W.factory("formlyValidationMessages",y["default"]),W.factory("formlyUtil",v["default"]),W.factory("formlyWarn",b["default"]),W.directive("formlyCustomValidation",x["default"]),W.directive("formlyField",w["default"]),W.directive("formlyFocus",A["default"]),W.directive("formlyForm",M["default"]),W.run(j["default"]),W.run(F["default"]),e.exports=t["default"]},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{"default":e}}function r(e,t){function n(n,r,i,a){var l=a&&a.hasOwnProperty(r),f=e.some(function(e){return a&&a.hasOwnProperty(e)});return f||l?l?t(n,r,i,a):void 0:s.utils.getError(r,i,o)}a["default"].isArray(e)||(e=[e]);var o="specified if these are not specified: `"+e.join(", ")+"` (otherwise it's optional)";return n.type=o,s.utils.checkerHelpers.setupChecker(n)}Object.defineProperty(t,"__esModule",{value:!0});var i=n(1),a=o(i),l=n(4),f=o(l),s=f["default"]({output:{prefix:"angular-formly:",docsBaseUrl:n(3)}}),u=s.oneOfType([s.string,s.func]),p=s.typeOrArrayOf(s.string).nullable,d=s.func,c=s.shape.onlyIf("apiCheck",s.func.withProperties({warn:s.func,"throw":s.func,shape:s.func})),m=s.shape.onlyIf("apiCheck",s.oneOf(["throw","warn"])),y=s.shape({name:r("types",s.string).optional,template:s.shape.ifNot("templateUrl",s.string).optional,templateUrl:s.shape.ifNot("template",s.string).optional,types:s.typeOrArrayOf(s.string).optional,overwriteOk:s.bool.optional,apiCheck:d.optional,apiCheckInstance:c.optional,apiCheckFunction:m.optional,apiCheckOptions:s.object.optional}).strict,h=s.objectOf(s.oneOfType([u,s.shape({expression:u,message:u.optional}).strict])),v=s.oneOfType([s.string,s.object]),g=s.shape({preWrapper:s.arrayOf(s.func).nullable.optional,postWrapper:s.arrayOf(s.func).nullable.optional}).strict.nullable,b=s.objectOf(s.oneOfType([u,s.shape({expression:u,message:u.optional}).strict])),O=s.typeOrArrayOf(s.shape({expression:u.optional,listener:u.optional,runFieldExpressions:s.bool.optional})),x={$$hashKey:s.any.optional,type:s.shape.ifNot(["template","templateUrl"],s.string).optional,template:s.shape.ifNot(["type","templateUrl"],s.oneOfType([s.string,s.func])).optional,templateUrl:s.shape.ifNot(["type","template"],s.oneOfType([s.string,s.func])).optional,key:s.oneOfType([s.string,s.number]).optional,model:v.optional,originalModel:v.optional,className:s.string.optional,id:s.string.optional,name:s.string.optional,expressionProperties:h.optional,extras:s.shape({validateOnModelChange:s.bool.optional,skipNgModelAttrsManipulator:s.oneOfType([s.string,s.bool]).optional}).strict.optional,data:s.object.optional,templateOptions:s.object.optional,wrapper:p.optional,modelOptions:s.shape({updateOn:s.string.optional,debounce:s.oneOfType([s.objectOf(s.number),s.number]).optional,allowInvalid:s.bool.optional,getterSetter:s.bool.optional,timezone:s.string.optional}).optional,watcher:O.optional,validators:b.optional,asyncValidators:b.optional,parsers:s.arrayOf(u).optional,formatters:s.arrayOf(u).optional,noFormControl:s.bool.optional,hide:s.bool.optional,hideExpression:u.optional,ngModelElAttrs:s.objectOf(s.string).optional,ngModelAttrs:s.objectOf(s.shape({statement:s.shape.ifNot(["value","attribute","bound","boolean"],s.any).optional,value:s.shape.ifNot("statement",s.any).optional,attribute:s.shape.ifNot("statement",s.any).optional,bound:s.shape.ifNot("statement",s.any).optional,"boolean":s.shape.ifNot("statement",s.any).optional}).strict).optional,elementAttributes:s.objectOf(s.string).optional,optionsTypes:s.typeOrArrayOf(s.string).optional,link:s.func.optional,controller:s.oneOfType([s.string,s.func,s.array]).optional,validation:s.shape({show:s.bool.nullable.optional,messages:s.objectOf(u).optional,errorExistsAndShouldBeVisible:s.bool.optional}).optional,formControl:s.typeOrArrayOf(s.object).optional,value:s.func.optional,runExpressions:s.func.optional,templateManipulators:g.optional,resetModel:s.func.optional,updateInitialValue:s.func.optional,initialValue:s.any.optional,defaultValue:s.any.optional},E=s.shape(x).strict,w=s.shape({formState:s.object.optional,resetModel:s.func.optional,updateInitialValue:s.func.optional,removeChromeAutoComplete:s.bool.optional,templateManipulators:g.optional,manualModelWatcher:s.oneOfType([s.bool,s.func]).optional,watchAllExpressions:s.bool.optional,wrapper:p.optional,fieldTransform:s.oneOfType([s.func,s.array]).optional,data:s.object.optional}).strict,$=s.shape({$$hashKey:s.any.optional,key:s.oneOfType([s.string,s.number]).optional,fieldGroup:s.arrayOf(s.oneOfType([E,s.object])),className:s.string.optional,options:w.optional,templateOptions:s.object.optional,wrapper:p.optional,watcher:O.optional,hide:s.bool.optional,hideExpression:u.optional,data:s.object.optional,model:v.optional,form:s.object.optional,elementAttributes:s.objectOf(s.string).optional}).strict,A=a["default"].copy(x);A.key=s.string.optional;var k=s.shape({name:s.string,template:s.shape.ifNot("templateUrl",s.oneOfType([s.string,s.func])).optional,templateUrl:s.shape.ifNot("template",s.oneOfType([s.string,s.func])).optional,controller:s.oneOfType([s.func,s.string,s.array]).optional,link:s.func.optional,defaultOptions:s.oneOfType([s.func,s.shape(A)]).optional,"extends":s.string.optional,wrapper:p.optional,data:s.object.optional,apiCheck:d.optional,apiCheckInstance:c.optional,apiCheckFunction:m.optional,apiCheckOptions:s.object.optional,overwriteOk:s.bool.optional}).strict;a["default"].extend(s,{formlyTypeOptions:k,formlyFieldOptions:E,formlyExpression:u,formlyWrapperType:y,fieldGroup:$,formOptionsApi:w}),t["default"]=s,e.exports=t["default"]},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{"default":e}}function r(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t" in it: '+e+"\nAdditional information: "+JSON.stringify(t))}var f=this;a["default"].extend(this,{getFormlyError:o,getFieldError:n,checkWrapper:i,checkWrapperTemplate:l,getErrorMessage:r,$get:function(){return f}})}Object.defineProperty(t,"__esModule",{value:!0});var i=n(1),a=o(i);t["default"]=r,r.$inject=["formlyApiCheck","formlyErrorAndWarningsUrlPrefix"],e.exports=t["default"]},function(e,t){"use strict";function n(){function e(e,t,r,i,a){o.messages[e]=n(t,r,i,a)}function t(e,t){o.messages[e]=function(){return t}}function n(e,t,n,o){return function(r,i,a){return"undefined"!=typeof a.options.templateOptions[e]?t+" "+a.options.templateOptions[e]+" "+n:o}}var o={addTemplateOptionValueMessage:e,addStringMessage:t,messages:{}};return o}Object.defineProperty(t,"__esModule",{value:!0}),t["default"]=n,e.exports=t["default"]},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{"default":e}}function r(e){e&&e.documentMode<9&&!function(){var t=e.get(0),n=["formly-field","formly-form"];a["default"].forEach(n,function(e){t.createElement(e)})}()}Object.defineProperty(t,"__esModule",{value:!0});var i=n(1),a=o(i);t["default"]=r,r.$inject=["$document"],e.exports=t["default"]},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{"default":e}}function r(e,t){function n(e,n,r){function i(){(a["default"].isDefined(n.validators)||a["default"].isDefined(n.validation.messages))&&u(g,"formly-custom-validation","")}function l(){d(n.key)&&p(g,"ng-model","model."+n.key)}function c(){a["default"].isDefined(n.modelOptions)&&(u(g,"ng-model-options","options.modelOptions"),n.modelOptions.getterSetter&&p(g,"ng-model","options.value"))}function m(){if(n.templateOptions||n.expressionProperties){var e=n.templateOptions||{},o=n.expressionProperties||{},r=f();a["default"].extend(r,n.ngModelAttrs),a["default"].forEach(r,function(r,i){var l=void 0,f=void 0,p="options.templateOptions['"+i+"']",d=e[i],c=s(o,i),m=a["default"].isDefined(d),y=a["default"].isDefined(c);if(r.value)f=r.value,l=i;else if(r.statement&&m)if(f=r.statement,a["default"].isString(e[i]))l="$eval("+p+")";else{if(!a["default"].isFunction(e[i]))throw new Error("options.templateOptions."+i+" must be a string or function: "+JSON.stringify(n));l=p+"(model[options.key], options, this, $event)"}else r.bound&&y?(f=r.bound,l=p):(r.attribute||r["boolean"])&&y?(f=r.attribute||r["boolean"],l=""+t.startSymbol()+p+t.endSymbol()):r.attribute&&m?(f=r.attribute,l=d):r["boolean"]?m&&!y&&d&&(f=r["boolean"],l=!0):r.bound&&m&&(f=r.bound,l=p);a["default"].isDefined(f)&&a["default"].isDefined(l)&&u(g,f,l)})}}function y(){a["default"].forEach(n.ngModelElAttrs,function(e,t){p(g,t,e)})}var h=document.createElement("div"),v=n.extras&&n.extras.skipNgModelAttrsManipulator;if(v===!0)return e;h.innerHTML=e;var g=o(h,v);return g&&g.length?(u(g,"id",r.id),u(g,"name",r.name||r.id),i(),l(),c(),m(),y(),h.innerHTML):e}function o(e,t){var n=a["default"].isString(t)?":not("+t+")":"",o=":not([formly-skip-ng-model-attrs-manipulator])",i="[ng-model]"+n+o+", [data-ng-model]"+n+o;try{return e.querySelectorAll(i)}catch(l){return r(e,t)}}function r(e,t){var n=e.querySelectorAll("[ng-model], [data-ng-model]"),o=[];o.item=function(e){return this[e]};for(var r=0;r, Kent C. Dodds (ó ì_í)=óò=(ì_í ò) */\n(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"api-check\"), require(\"angular\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"api-check\", \"angular\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"ngFormly\"] = factory(require(\"api-check\"), require(\"angular\"));\n\telse\n\t\troot[\"ngFormly\"] = factory(root[\"apiCheck\"], root[\"angular\"]);\n})(this, function(__WEBPACK_EXTERNAL_MODULE_4__, __WEBPACK_EXTERNAL_MODULE_18__) {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId])\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\texports: {},\n/******/ \t\t\tid: moduleId,\n/******/ \t\t\tloaded: false\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.loaded = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(0);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, '__esModule', {\n\t value: true\n\t});\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\t\n\tvar _indexCommon = __webpack_require__(9);\n\t\n\tvar _indexCommon2 = _interopRequireDefault(_indexCommon);\n\t\n\texports['default'] = _indexCommon2['default'];\n\tmodule.exports = exports['default'];\n\n/***/ },\n/* 1 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t// some versions of angular don't export the angular module properly,\n\t// so we get it from window in this case.\n\t'use strict';\n\t\n\tObject.defineProperty(exports, '__esModule', {\n\t value: true\n\t});\n\tvar angular = __webpack_require__(18);\n\t\n\t/* istanbul ignore next */\n\tif (!angular.version) {\n\t angular = window.angular;\n\t}\n\texports['default'] = angular;\n\tmodule.exports = exports['default'];\n\n/***/ },\n/* 2 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, '__esModule', {\n\t value: true\n\t});\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\t\n\tvar _angularFix = __webpack_require__(1);\n\t\n\tvar _angularFix2 = _interopRequireDefault(_angularFix);\n\t\n\texports['default'] = {\n\t containsSelector: containsSelector, containsSpecialChar: containsSpecialChar, formlyEval: formlyEval, getFieldId: getFieldId, reverseDeepMerge: reverseDeepMerge, findByNodeName: findByNodeName,\n\t arrayify: arrayify, extendFunction: extendFunction, extendArray: extendArray, startsWith: startsWith, contains: contains\n\t};\n\t\n\tfunction containsSelector(string) {\n\t return containsSpecialChar(string, '.') || containsSpecialChar(string, '[') && containsSpecialChar(string, ']');\n\t}\n\t\n\tfunction containsSpecialChar(a, b) {\n\t if (!a || !a.indexOf) {\n\t return false;\n\t }\n\t return a.indexOf(b) !== -1;\n\t}\n\t\n\tfunction formlyEval(scope, expression, $modelValue, $viewValue, extraLocals) {\n\t if (_angularFix2['default'].isFunction(expression)) {\n\t return expression($viewValue, $modelValue, scope, extraLocals);\n\t } else {\n\t return scope.$eval(expression, _angularFix2['default'].extend({ $viewValue: $viewValue, $modelValue: $modelValue }, extraLocals));\n\t }\n\t}\n\t\n\tfunction getFieldId(formId, options, index) {\n\t if (options.id) {\n\t return options.id;\n\t }\n\t var type = options.type;\n\t if (!type && options.template) {\n\t type = 'template';\n\t } else if (!type && options.templateUrl) {\n\t type = 'templateUrl';\n\t }\n\t\n\t return [formId, type, options.key, index].join('_');\n\t}\n\t\n\tfunction reverseDeepMerge(dest) {\n\t _angularFix2['default'].forEach(arguments, function (src, index) {\n\t if (!index) {\n\t return;\n\t }\n\t _angularFix2['default'].forEach(src, function (val, prop) {\n\t if (!_angularFix2['default'].isDefined(dest[prop])) {\n\t dest[prop] = _angularFix2['default'].copy(val);\n\t } else if (objAndSameType(dest[prop], val)) {\n\t reverseDeepMerge(dest[prop], val);\n\t }\n\t });\n\t });\n\t return dest;\n\t}\n\t\n\tfunction objAndSameType(obj1, obj2) {\n\t return _angularFix2['default'].isObject(obj1) && _angularFix2['default'].isObject(obj2) && Object.getPrototypeOf(obj1) === Object.getPrototypeOf(obj2);\n\t}\n\t\n\t// recurse down a node tree to find a node with matching nodeName, for custom tags jQuery.find doesn't work in IE8\n\tfunction findByNodeName(el, nodeName) {\n\t if (!el.prop) {\n\t // not a jQuery or jqLite object -> wrap it\n\t el = _angularFix2['default'].element(el);\n\t }\n\t\n\t if (el.prop('nodeName') === nodeName.toUpperCase()) {\n\t return el;\n\t }\n\t\n\t var c = el.children();\n\t for (var i = 0; c && i < c.length; i++) {\n\t var node = findByNodeName(c[i], nodeName);\n\t if (node) {\n\t return node;\n\t }\n\t }\n\t}\n\t\n\tfunction arrayify(obj) {\n\t if (obj && !_angularFix2['default'].isArray(obj)) {\n\t obj = [obj];\n\t } else if (!obj) {\n\t obj = [];\n\t }\n\t return obj;\n\t}\n\t\n\tfunction extendFunction() {\n\t for (var _len = arguments.length, fns = Array(_len), _key = 0; _key < _len; _key++) {\n\t fns[_key] = arguments[_key];\n\t }\n\t\n\t return function extendedFunction() {\n\t var args = arguments;\n\t fns.forEach(function (fn) {\n\t return fn.apply(null, args);\n\t });\n\t };\n\t}\n\t\n\tfunction extendArray(primary, secondary, property) {\n\t if (property) {\n\t primary = primary[property];\n\t secondary = secondary[property];\n\t }\n\t if (secondary && primary) {\n\t _angularFix2['default'].forEach(secondary, function (item) {\n\t if (primary.indexOf(item) === -1) {\n\t primary.push(item);\n\t }\n\t });\n\t return primary;\n\t } else if (secondary) {\n\t return secondary;\n\t } else {\n\t return primary;\n\t }\n\t}\n\t\n\tfunction startsWith(str, search) {\n\t if (_angularFix2['default'].isString(str) && _angularFix2['default'].isString(search)) {\n\t return str.length >= search.length && str.substring(0, search.length) === search;\n\t } else {\n\t return false;\n\t }\n\t}\n\t\n\tfunction contains(str, search) {\n\t if (_angularFix2['default'].isString(str) && _angularFix2['default'].isString(search)) {\n\t return str.length >= search.length && str.indexOf(search) !== -1;\n\t } else {\n\t return false;\n\t }\n\t}\n\tmodule.exports = exports['default'];\n\n/***/ },\n/* 3 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t\"use strict\";\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\texports[\"default\"] = \"https://github.com/formly-js/angular-formly/blob/\" + (\"0.0.0-semantically-released.0\") + \"/other/ERRORS_AND_WARNINGS.md#\";\n\tmodule.exports = exports[\"default\"];\n\n/***/ },\n/* 4 */\n/***/ function(module, exports) {\n\n\tmodule.exports = __WEBPACK_EXTERNAL_MODULE_4__;\n\n/***/ },\n/* 5 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, '__esModule', {\n\t value: true\n\t});\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\t\n\tvar _angularFix = __webpack_require__(1);\n\t\n\tvar _angularFix2 = _interopRequireDefault(_angularFix);\n\t\n\texports['default'] = formlyCustomValidation;\n\t\n\t// @ngInject\n\tfunction formlyCustomValidation(formlyUtil) {\n\t return {\n\t restrict: 'A',\n\t require: 'ngModel',\n\t link: function formlyCustomValidationLink(scope, el, attrs, ctrl) {\n\t var opts = scope.options;\n\t opts.validation.messages = opts.validation.messages || {};\n\t _angularFix2['default'].forEach(opts.validation.messages, function (message, key) {\n\t opts.validation.messages[key] = function () {\n\t return formlyUtil.formlyEval(scope, message, ctrl.$modelValue, ctrl.$viewValue);\n\t };\n\t });\n\t\n\t var useNewValidatorsApi = ctrl.hasOwnProperty('$validators') && !attrs.hasOwnProperty('useParsers');\n\t _angularFix2['default'].forEach(opts.validators, _angularFix2['default'].bind(null, addValidatorToPipeline, false));\n\t _angularFix2['default'].forEach(opts.asyncValidators, _angularFix2['default'].bind(null, addValidatorToPipeline, true));\n\t\n\t function addValidatorToPipeline(isAsync, validator, name) {\n\t setupMessage(validator, name);\n\t validator = _angularFix2['default'].isObject(validator) ? validator.expression : validator;\n\t if (useNewValidatorsApi) {\n\t setupWithValidators(validator, name, isAsync);\n\t } else {\n\t setupWithParsers(validator, name, isAsync);\n\t }\n\t }\n\t\n\t function setupMessage(validator, name) {\n\t var message = validator.message;\n\t if (message) {\n\t opts.validation.messages[name] = function () {\n\t return formlyUtil.formlyEval(scope, message, ctrl.$modelValue, ctrl.$viewValue);\n\t };\n\t }\n\t }\n\t\n\t function setupWithValidators(validator, name, isAsync) {\n\t var validatorCollection = isAsync ? '$asyncValidators' : '$validators';\n\t\n\t ctrl[validatorCollection][name] = function evalValidity(modelValue, viewValue) {\n\t return formlyUtil.formlyEval(scope, validator, modelValue, viewValue);\n\t };\n\t }\n\t\n\t function setupWithParsers(validator, name, isAsync) {\n\t var inFlightValidator = undefined;\n\t ctrl.$parsers.unshift(function evalValidityOfParser(viewValue) {\n\t var isValid = formlyUtil.formlyEval(scope, validator, ctrl.$modelValue, viewValue);\n\t if (isAsync) {\n\t ctrl.$pending = ctrl.$pending || {};\n\t ctrl.$pending[name] = true;\n\t inFlightValidator = isValid;\n\t isValid.then(function () {\n\t if (inFlightValidator === isValid) {\n\t ctrl.$setValidity(name, true);\n\t }\n\t })['catch'](function () {\n\t if (inFlightValidator === isValid) {\n\t ctrl.$setValidity(name, false);\n\t }\n\t })['finally'](function () {\n\t var $pending = ctrl.$pending || {};\n\t if (Object.keys($pending).length === 1) {\n\t delete ctrl.$pending;\n\t } else {\n\t delete ctrl.$pending[name];\n\t }\n\t });\n\t } else {\n\t ctrl.$setValidity(name, isValid);\n\t }\n\t return viewValue;\n\t });\n\t }\n\t }\n\t };\n\t}\n\tformlyCustomValidation.$inject = [\"formlyUtil\"];\n\tmodule.exports = exports['default'];\n\n/***/ },\n/* 6 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, '__esModule', {\n\t value: true\n\t});\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\t\n\tfunction _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) arr2[i] = arr[i]; return arr2; } else { return Array.from(arr); } }\n\t\n\tvar _angularFix = __webpack_require__(1);\n\t\n\tvar _angularFix2 = _interopRequireDefault(_angularFix);\n\t\n\tvar _apiCheck = __webpack_require__(4);\n\t\n\tvar _apiCheck2 = _interopRequireDefault(_apiCheck);\n\t\n\texports['default'] = formlyField;\n\t\n\t/**\n\t * @ngdoc directive\n\t * @name formlyField\n\t * @restrict AE\n\t */\n\t// @ngInject\n\tfunction formlyField($http, $q, $compile, $templateCache, $interpolate, formlyConfig, formlyApiCheck, formlyUtil, formlyUsability, formlyWarn) {\n\t var arrayify = formlyUtil.arrayify;\n\t\n\t FormlyFieldController.$inject = [\"$scope\", \"$timeout\", \"$parse\", \"$controller\", \"formlyValidationMessages\"];\n\t return {\n\t restrict: 'AE',\n\t transclude: true,\n\t require: '?^formlyForm',\n\t scope: {\n\t options: '=',\n\t model: '=',\n\t originalModel: '=?',\n\t formId: '@', // TODO remove formId in a breaking release\n\t index: '=?',\n\t fields: '=?',\n\t formState: '=?',\n\t formOptions: '=?',\n\t form: '=?' },\n\t // TODO require form in a breaking release\n\t controller: FormlyFieldController,\n\t link: fieldLink\n\t };\n\t\n\t // @ngInject\n\t function FormlyFieldController($scope, $timeout, $parse, $controller, formlyValidationMessages) {\n\t /* eslint max-statements:[2, 34] */\n\t if ($scope.options.fieldGroup) {\n\t setupFieldGroup();\n\t return;\n\t }\n\t\n\t var fieldType = getFieldType($scope.options);\n\t simplifyLife($scope.options);\n\t mergeFieldOptionsWithTypeDefaults($scope.options, fieldType);\n\t extendOptionsWithDefaults($scope.options, $scope.index);\n\t checkApi($scope.options);\n\t // set field id to link labels and fields\n\t\n\t // initalization\n\t setFieldIdAndName();\n\t setDefaultValue();\n\t setInitialValue();\n\t runExpressions();\n\t watchExpressions();\n\t addValidationMessages($scope.options);\n\t invokeControllers($scope, $scope.options, fieldType);\n\t\n\t // function definitions\n\t function runExpressions() {\n\t // must run on next tick to make sure that the current value is correct.\n\t return $timeout(function runExpressionsOnNextTick() {\n\t var field = $scope.options;\n\t var currentValue = valueGetterSetter();\n\t _angularFix2['default'].forEach(field.expressionProperties, function runExpression(expression, prop) {\n\t var setter = $parse(prop).assign;\n\t var promise = $q.when(formlyUtil.formlyEval($scope, expression, currentValue, currentValue));\n\t promise.then(function setFieldValue(value) {\n\t setter(field, value);\n\t });\n\t });\n\t }, 0, false);\n\t }\n\t\n\t function watchExpressions() {\n\t if ($scope.formOptions.watchAllExpressions) {\n\t (function () {\n\t var field = $scope.options;\n\t var currentValue = valueGetterSetter();\n\t _angularFix2['default'].forEach(field.expressionProperties, function watchExpression(expression, prop) {\n\t var setter = $parse(prop).assign;\n\t $scope.$watch(function expressionPropertyWatcher() {\n\t return formlyUtil.formlyEval($scope, expression, currentValue, currentValue);\n\t }, function expressionPropertyListener(value) {\n\t setter(field, value);\n\t }, true);\n\t });\n\t })();\n\t }\n\t }\n\t\n\t function valueGetterSetter(newVal) {\n\t if (!$scope.model || !$scope.options.key) {\n\t return undefined;\n\t }\n\t if (_angularFix2['default'].isDefined(newVal)) {\n\t parseSet($scope.options.key, $scope.model, newVal);\n\t }\n\t return parseGet($scope.options.key, $scope.model);\n\t }\n\t\n\t function shouldNotUseParseKey(key) {\n\t return _angularFix2['default'].isNumber(key) || !formlyUtil.containsSelector(key);\n\t }\n\t\n\t function parseSet(key, model, newVal) {\n\t // If either of these are null/undefined then just return undefined\n\t if (!key || !model) {\n\t return;\n\t }\n\t // If we are working with a number then $parse wont work, default back to the old way for now\n\t if (shouldNotUseParseKey(key)) {\n\t // TODO: Fix this so we can get several levels instead of just one with properties that are numeric\n\t model[key] = newVal;\n\t } else {\n\t var setter = $parse($scope.options.key).assign;\n\t if (setter) {\n\t setter($scope.model, newVal);\n\t }\n\t }\n\t }\n\t\n\t function parseGet(key, model) {\n\t // If either of these are null/undefined then just return undefined\n\t if (!key || !model) {\n\t return undefined;\n\t }\n\t\n\t // If we are working with a number then $parse wont work, default back to the old way for now\n\t if (shouldNotUseParseKey(key)) {\n\t // TODO: Fix this so we can get several levels instead of just one with properties that are numeric\n\t return model[key];\n\t } else {\n\t return $parse(key)(model);\n\t }\n\t }\n\t\n\t function simplifyLife(options) {\n\t // add a few empty objects (if they don't already exist) so you don't have to undefined check everywhere\n\t formlyUtil.reverseDeepMerge(options, {\n\t originalModel: options.model,\n\t extras: {},\n\t data: {},\n\t templateOptions: {},\n\t validation: {}\n\t });\n\t // create $scope.to so template authors can reference to instead of $scope.options.templateOptions\n\t $scope.to = $scope.options.templateOptions;\n\t $scope.formOptions = $scope.formOptions || {};\n\t }\n\t\n\t function setFieldIdAndName() {\n\t if (_angularFix2['default'].isFunction(formlyConfig.extras.getFieldId)) {\n\t $scope.id = formlyConfig.extras.getFieldId($scope.options, $scope.model, $scope);\n\t } else {\n\t var formName = $scope.form && $scope.form.$name || $scope.formId;\n\t $scope.id = formlyUtil.getFieldId(formName, $scope.options, $scope.index);\n\t }\n\t $scope.options.id = $scope.id;\n\t $scope.name = $scope.options.name || $scope.options.id;\n\t $scope.options.name = $scope.name;\n\t }\n\t\n\t function setDefaultValue() {\n\t if (_angularFix2['default'].isDefined($scope.options.defaultValue) && !_angularFix2['default'].isDefined(parseGet($scope.options.key, $scope.model))) {\n\t parseSet($scope.options.key, $scope.model, $scope.options.defaultValue);\n\t }\n\t }\n\t\n\t function setInitialValue() {\n\t $scope.options.initialValue = $scope.model && parseGet($scope.options.key, $scope.model);\n\t }\n\t\n\t function mergeFieldOptionsWithTypeDefaults(options, type) {\n\t if (type) {\n\t mergeOptions(options, type.defaultOptions);\n\t }\n\t var properOrder = arrayify(options.optionsTypes).reverse(); // so the right things are overridden\n\t _angularFix2['default'].forEach(properOrder, function (typeName) {\n\t mergeOptions(options, formlyConfig.getType(typeName, true, options).defaultOptions);\n\t });\n\t }\n\t\n\t function mergeOptions(options, extraOptions) {\n\t if (extraOptions) {\n\t if (_angularFix2['default'].isFunction(extraOptions)) {\n\t extraOptions = extraOptions(options, $scope);\n\t }\n\t formlyUtil.reverseDeepMerge(options, extraOptions);\n\t }\n\t }\n\t\n\t function extendOptionsWithDefaults(options, index) {\n\t var key = options.key || index || 0;\n\t _angularFix2['default'].extend(options, {\n\t // attach the key in case the formly-field directive is used directly\n\t key: key,\n\t value: options.value || valueGetterSetter,\n\t runExpressions: runExpressions,\n\t resetModel: resetModel,\n\t updateInitialValue: updateInitialValue\n\t });\n\t }\n\t\n\t function resetModel() {\n\t parseSet($scope.options.key, $scope.model, $scope.options.initialValue);\n\t if ($scope.options.formControl) {\n\t if (_angularFix2['default'].isArray($scope.options.formControl)) {\n\t _angularFix2['default'].forEach($scope.options.formControl, function (formControl) {\n\t resetFormControl(formControl, true);\n\t });\n\t } else {\n\t resetFormControl($scope.options.formControl);\n\t }\n\t }\n\t if ($scope.form) {\n\t $scope.form.$setUntouched && $scope.form.$setUntouched();\n\t $scope.form.$setPristine();\n\t }\n\t }\n\t\n\t function resetFormControl(formControl, isMultiNgModel) {\n\t if (!isMultiNgModel) {\n\t formControl.$setViewValue(parseGet($scope.options.key, $scope.model));\n\t }\n\t\n\t formControl.$render();\n\t formControl.$setUntouched && formControl.$setUntouched();\n\t formControl.$setPristine();\n\t\n\t // To prevent breaking change requiring a digest to reset $viewModel\n\t if (!$scope.$root.$$phase) {\n\t $scope.$digest();\n\t }\n\t }\n\t\n\t function updateInitialValue() {\n\t $scope.options.initialValue = parseGet($scope.options.key, $scope.model);\n\t }\n\t\n\t function addValidationMessages(options) {\n\t options.validation.messages = options.validation.messages || {};\n\t _angularFix2['default'].forEach(formlyValidationMessages.messages, function createFunctionForMessage(expression, name) {\n\t if (!options.validation.messages[name]) {\n\t options.validation.messages[name] = function evaluateMessage(viewValue, modelValue, scope) {\n\t return formlyUtil.formlyEval(scope, expression, modelValue, viewValue);\n\t };\n\t }\n\t });\n\t }\n\t\n\t function invokeControllers(scope) {\n\t var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];\n\t var type = arguments.length <= 2 || arguments[2] === undefined ? {} : arguments[2];\n\t\n\t _angularFix2['default'].forEach([type.controller, options.controller], function (controller) {\n\t if (controller) {\n\t $controller(controller, { $scope: scope });\n\t }\n\t });\n\t }\n\t\n\t function setupFieldGroup() {\n\t $scope.options.options = $scope.options.options || {};\n\t $scope.options.options.formState = $scope.formState;\n\t $scope.to = $scope.options.templateOptions;\n\t }\n\t }\n\t\n\t // link function\n\t function fieldLink(scope, el, attrs, formlyFormCtrl) {\n\t if (scope.options.fieldGroup) {\n\t setFieldGroupTemplate();\n\t return;\n\t }\n\t\n\t // watch the field model (if exists) if there is no parent formly-form directive (that would watch it instead)\n\t if (!formlyFormCtrl && scope.options.model) {\n\t scope.$watch('options.model', function () {\n\t return scope.options.runExpressions();\n\t }, true);\n\t }\n\t\n\t addAttributes();\n\t addClasses();\n\t\n\t var type = getFieldType(scope.options);\n\t var args = arguments;\n\t var thusly = this;\n\t var fieldCount = 0;\n\t var fieldManipulators = getManipulators(scope.options, scope.formOptions);\n\t getFieldTemplate(scope.options).then(runManipulators(fieldManipulators.preWrapper)).then(transcludeInWrappers(scope.options, scope.formOptions)).then(runManipulators(fieldManipulators.postWrapper)).then(setElementTemplate).then(watchFormControl).then(callLinkFunctions)['catch'](function (error) {\n\t formlyWarn('there-was-a-problem-setting-the-template-for-this-field', 'There was a problem setting the template for this field ', scope.options, error);\n\t });\n\t\n\t function setFieldGroupTemplate() {\n\t checkFieldGroupApi(scope.options);\n\t el.addClass('formly-field-group');\n\t var extraAttributes = '';\n\t if (scope.options.elementAttributes) {\n\t extraAttributes = Object.keys(scope.options.elementAttributes).map(function (key) {\n\t return key + '=\"' + scope.options.elementAttributes[key] + '\"';\n\t }).join(' ');\n\t }\n\t var modelValue = 'model';\n\t scope.options.form = scope.form;\n\t if (scope.options.key) {\n\t modelValue = 'model[\\'' + scope.options.key + '\\']';\n\t }\n\t getTemplate('\\n \\n \\n ').then(transcludeInWrappers(scope.options, scope.formOptions)).then(setElementTemplate);\n\t }\n\t\n\t function addAttributes() {\n\t if (scope.options.elementAttributes) {\n\t el.attr(scope.options.elementAttributes);\n\t }\n\t }\n\t\n\t function addClasses() {\n\t if (scope.options.className) {\n\t el.addClass(scope.options.className);\n\t }\n\t if (scope.options.type) {\n\t el.addClass('formly-field-' + scope.options.type);\n\t }\n\t }\n\t\n\t function setElementTemplate(templateString) {\n\t el.html(asHtml(templateString));\n\t $compile(el.contents())(scope);\n\t return templateString;\n\t }\n\t\n\t function watchFormControl(templateString) {\n\t var stopWatchingShowError = _angularFix2['default'].noop;\n\t if (scope.options.noFormControl) {\n\t return;\n\t }\n\t var templateEl = _angularFix2['default'].element('
' + templateString + '
');\n\t var ngModelNodes = templateEl[0].querySelectorAll('[ng-model],[data-ng-model]');\n\t\n\t if (ngModelNodes.length) {\n\t _angularFix2['default'].forEach(ngModelNodes, function (ngModelNode) {\n\t fieldCount++;\n\t watchFieldNameOrExistence(ngModelNode.getAttribute('name'));\n\t });\n\t }\n\t\n\t function watchFieldNameOrExistence(name) {\n\t var nameExpressionRegex = /\\{\\{(.*?)}}/;\n\t var nameExpression = nameExpressionRegex.exec(name);\n\t if (nameExpression) {\n\t name = $interpolate(name)(scope);\n\t }\n\t watchFieldExistence(name);\n\t }\n\t\n\t function watchFieldExistence(name) {\n\t scope.$watch('form[\"' + name + '\"]', function formControlChange(formControl) {\n\t if (formControl) {\n\t if (fieldCount > 1) {\n\t if (!scope.options.formControl) {\n\t scope.options.formControl = [];\n\t }\n\t scope.options.formControl.push(formControl);\n\t } else {\n\t scope.options.formControl = formControl;\n\t }\n\t scope.fc = scope.options.formControl; // shortcut for template authors\n\t stopWatchingShowError();\n\t addShowMessagesWatcher();\n\t addParsers();\n\t addFormatters();\n\t }\n\t });\n\t }\n\t\n\t function addShowMessagesWatcher() {\n\t stopWatchingShowError = scope.$watch(function watchShowValidationChange() {\n\t var customExpression = formlyConfig.extras.errorExistsAndShouldBeVisibleExpression;\n\t var options = scope.options;\n\t var formControls = arrayify(scope.fc);\n\t if (!formControls.some(function (fc) {\n\t return fc.$invalid;\n\t })) {\n\t return false;\n\t } else if (typeof options.validation.show === 'boolean') {\n\t return options.validation.show;\n\t } else if (customExpression) {\n\t return formControls.some(function (fc) {\n\t return formlyUtil.formlyEval(scope, customExpression, fc.$modelValue, fc.$viewValue);\n\t });\n\t } else {\n\t return formControls.some(function (fc) {\n\t var noTouchedButDirty = _angularFix2['default'].isUndefined(fc.$touched) && fc.$dirty;\n\t return fc.$touched || noTouchedButDirty;\n\t });\n\t }\n\t }, function onShowValidationChange(show) {\n\t scope.options.validation.errorExistsAndShouldBeVisible = show;\n\t scope.showError = show; // shortcut for template authors\n\t });\n\t }\n\t\n\t function addParsers() {\n\t setParsersOrFormatters('parsers');\n\t }\n\t\n\t function addFormatters() {\n\t setParsersOrFormatters('formatters');\n\t var ctrl = scope.fc;\n\t var formWasPristine = scope.form.$pristine;\n\t if (scope.options.formatters) {\n\t (function () {\n\t var value = ctrl.$modelValue;\n\t ctrl.$formatters.forEach(function (formatter) {\n\t value = formatter(value);\n\t });\n\t\n\t ctrl.$setViewValue(value);\n\t ctrl.$render();\n\t ctrl.$setPristine();\n\t if (formWasPristine) {\n\t scope.form.$setPristine();\n\t }\n\t })();\n\t }\n\t }\n\t\n\t function setParsersOrFormatters(which) {\n\t var originalThingProp = 'originalParser';\n\t if (which === 'formatters') {\n\t originalThingProp = 'originalFormatter';\n\t }\n\t\n\t // init with type's parsers\n\t var things = getThingsFromType(type);\n\t\n\t // get optionsTypes things\n\t things = formlyUtil.extendArray(things, getThingsFromOptionsTypes(scope.options.optionsTypes));\n\t\n\t // get field's things\n\t things = formlyUtil.extendArray(things, scope.options[which]);\n\t\n\t // convert things into formlyExpression things\n\t _angularFix2['default'].forEach(things, function (thing, index) {\n\t things[index] = getFormlyExpressionThing(thing);\n\t });\n\t\n\t var ngModelCtrls = scope.fc;\n\t if (!_angularFix2['default'].isArray(ngModelCtrls)) {\n\t ngModelCtrls = [ngModelCtrls];\n\t }\n\t\n\t _angularFix2['default'].forEach(ngModelCtrls, function (ngModelCtrl) {\n\t var _ngModelCtrl;\n\t\n\t ngModelCtrl['$' + which] = (_ngModelCtrl = ngModelCtrl['$' + which]).concat.apply(_ngModelCtrl, _toConsumableArray(things));\n\t });\n\t\n\t function getThingsFromType(theType) {\n\t if (!theType) {\n\t return [];\n\t }\n\t if (_angularFix2['default'].isString(theType)) {\n\t theType = formlyConfig.getType(theType, true, scope.options);\n\t }\n\t var typeThings = [];\n\t\n\t // get things from parent\n\t if (theType['extends']) {\n\t typeThings = formlyUtil.extendArray(typeThings, getThingsFromType(theType['extends']));\n\t }\n\t\n\t // get own type's things\n\t typeThings = formlyUtil.extendArray(typeThings, getDefaultOptionsProperty(theType, which, []));\n\t\n\t // get things from optionsTypes\n\t typeThings = formlyUtil.extendArray(typeThings, getThingsFromOptionsTypes(getDefaultOptionsOptionsTypes(theType)));\n\t\n\t return typeThings;\n\t }\n\t\n\t function getThingsFromOptionsTypes() {\n\t var optionsTypes = arguments.length <= 0 || arguments[0] === undefined ? [] : arguments[0];\n\t\n\t var optionsTypesThings = [];\n\t _angularFix2['default'].forEach(_angularFix2['default'].copy(arrayify(optionsTypes)).reverse(), function (optionsTypeName) {\n\t optionsTypesThings = formlyUtil.extendArray(optionsTypesThings, getThingsFromType(optionsTypeName));\n\t });\n\t return optionsTypesThings;\n\t }\n\t\n\t function getFormlyExpressionThing(thing) {\n\t formlyExpressionParserOrFormatterFunction[originalThingProp] = thing;\n\t return formlyExpressionParserOrFormatterFunction;\n\t\n\t function formlyExpressionParserOrFormatterFunction($viewValue) {\n\t var $modelValue = scope.options.value();\n\t return formlyUtil.formlyEval(scope, thing, $modelValue, $viewValue);\n\t }\n\t }\n\t }\n\t }\n\t\n\t function callLinkFunctions() {\n\t if (type && type.link) {\n\t type.link.apply(thusly, args);\n\t }\n\t if (scope.options.link) {\n\t scope.options.link.apply(thusly, args);\n\t }\n\t }\n\t\n\t function runManipulators(manipulators) {\n\t return function runManipulatorsOnTemplate(templateToManipulate) {\n\t var chain = $q.when(templateToManipulate);\n\t _angularFix2['default'].forEach(manipulators, function (manipulator) {\n\t chain = chain.then(function (template) {\n\t return $q.when(manipulator(template, scope.options, scope)).then(function (newTemplate) {\n\t return _angularFix2['default'].isString(newTemplate) ? newTemplate : asHtml(newTemplate);\n\t });\n\t });\n\t });\n\t return chain;\n\t };\n\t }\n\t }\n\t\n\t // sort-of stateless util functions\n\t function asHtml(el) {\n\t var wrapper = _angularFix2['default'].element('');\n\t return wrapper.append(el).html();\n\t }\n\t\n\t function getFieldType(options) {\n\t return options.type && formlyConfig.getType(options.type);\n\t }\n\t\n\t function getManipulators(options, formOptions) {\n\t var preWrapper = [];\n\t var postWrapper = [];\n\t addManipulators(options.templateManipulators);\n\t addManipulators(formOptions.templateManipulators);\n\t addManipulators(formlyConfig.templateManipulators);\n\t return { preWrapper: preWrapper, postWrapper: postWrapper };\n\t\n\t function addManipulators(manipulators) {\n\t /* eslint-disable */ // it doesn't understand this :-(\n\t\n\t var _ref = manipulators || {};\n\t\n\t var _ref$preWrapper = _ref.preWrapper;\n\t var pre = _ref$preWrapper === undefined ? [] : _ref$preWrapper;\n\t var _ref$postWrapper = _ref.postWrapper;\n\t var post = _ref$postWrapper === undefined ? [] : _ref$postWrapper;\n\t\n\t preWrapper = preWrapper.concat(pre);\n\t postWrapper = postWrapper.concat(post);\n\t /* eslint-enable */\n\t }\n\t }\n\t\n\t function getFieldTemplate(options) {\n\t function fromOptionsOrType(key, fieldType) {\n\t if (_angularFix2['default'].isDefined(options[key])) {\n\t return options[key];\n\t } else if (fieldType && _angularFix2['default'].isDefined(fieldType[key])) {\n\t return fieldType[key];\n\t }\n\t }\n\t\n\t var type = formlyConfig.getType(options.type, true, options);\n\t var template = fromOptionsOrType('template', type);\n\t var templateUrl = fromOptionsOrType('templateUrl', type);\n\t if (_angularFix2['default'].isUndefined(template) && !templateUrl) {\n\t throw formlyUsability.getFieldError('type-type-has-no-template', 'Type \\'' + options.type + '\\' has no template. On element:', options);\n\t }\n\t\n\t return getTemplate(templateUrl || template, _angularFix2['default'].isUndefined(template), options);\n\t }\n\t\n\t function getTemplate(template, isUrl, options) {\n\t var templatePromise = undefined;\n\t if (_angularFix2['default'].isFunction(template)) {\n\t templatePromise = $q.when(template(options));\n\t } else {\n\t templatePromise = $q.when(template);\n\t }\n\t\n\t if (!isUrl) {\n\t return templatePromise;\n\t } else {\n\t var _ret3 = (function () {\n\t var httpOptions = { cache: $templateCache };\n\t return {\n\t v: templatePromise.then(function (url) {\n\t return $http.get(url, httpOptions);\n\t }).then(function (response) {\n\t return response.data;\n\t })['catch'](function handleErrorGettingATemplate(error) {\n\t formlyWarn('problem-loading-template-for-templateurl', 'Problem loading template for ' + template, error);\n\t })\n\t };\n\t })();\n\t\n\t if (typeof _ret3 === 'object') return _ret3.v;\n\t }\n\t }\n\t\n\t function transcludeInWrappers(options, formOptions) {\n\t var wrapper = getWrapperOption(options, formOptions);\n\t\n\t return function transcludeTemplate(template) {\n\t if (!wrapper.length) {\n\t return $q.when(template);\n\t }\n\t\n\t wrapper.forEach(function (aWrapper) {\n\t formlyUsability.checkWrapper(aWrapper, options);\n\t runApiCheck(aWrapper, options);\n\t });\n\t var promises = wrapper.map(function (w) {\n\t return getTemplate(w.template || w.templateUrl, !w.template);\n\t });\n\t return $q.all(promises).then(function (wrappersTemplates) {\n\t wrappersTemplates.forEach(function (wrapperTemplate, index) {\n\t formlyUsability.checkWrapperTemplate(wrapperTemplate, wrapper[index]);\n\t });\n\t wrappersTemplates.reverse(); // wrapper 0 is wrapped in wrapper 1 and so on...\n\t var totalWrapper = wrappersTemplates.shift();\n\t wrappersTemplates.forEach(function (wrapperTemplate) {\n\t totalWrapper = doTransclusion(totalWrapper, wrapperTemplate);\n\t });\n\t return doTransclusion(totalWrapper, template);\n\t });\n\t };\n\t }\n\t\n\t function doTransclusion(wrapper, template) {\n\t var superWrapper = _angularFix2['default'].element(''); // this allows people not have to have a single root in wrappers\n\t superWrapper.append(wrapper);\n\t var transcludeEl = superWrapper.find('formly-transclude');\n\t if (!transcludeEl.length) {\n\t // try it using our custom find function\n\t transcludeEl = formlyUtil.findByNodeName(superWrapper, 'formly-transclude');\n\t }\n\t transcludeEl.replaceWith(template);\n\t return superWrapper.html();\n\t }\n\t\n\t function getWrapperOption(options, formOptions) {\n\t /* eslint complexity:[2, 6] */\n\t var wrapper = options.wrapper;\n\t // explicit null means no wrapper\n\t if (wrapper === null) {\n\t return [];\n\t }\n\t\n\t // nothing specified means use the default wrapper for the type\n\t if (!wrapper) {\n\t // get all wrappers that specify they apply to this type\n\t wrapper = arrayify(formlyConfig.getWrapperByType(options.type));\n\t } else {\n\t wrapper = arrayify(wrapper).map(formlyConfig.getWrapper);\n\t }\n\t\n\t // get all wrappers for that the type specified that it uses.\n\t var type = formlyConfig.getType(options.type, true, options);\n\t if (type && type.wrapper) {\n\t var typeWrappers = arrayify(type.wrapper).map(formlyConfig.getWrapper);\n\t wrapper = wrapper.concat(typeWrappers);\n\t }\n\t\n\t // add form wrappers\n\t if (formOptions.wrapper) {\n\t var formWrappers = arrayify(formOptions.wrapper).map(formlyConfig.getWrapper);\n\t wrapper = wrapper.concat(formWrappers);\n\t }\n\t\n\t // add the default wrapper last\n\t var defaultWrapper = formlyConfig.getWrapper();\n\t if (defaultWrapper) {\n\t wrapper.push(defaultWrapper);\n\t }\n\t return wrapper;\n\t }\n\t\n\t function checkApi(options) {\n\t formlyApiCheck['throw'](formlyApiCheck.formlyFieldOptions, options, {\n\t prefix: 'formly-field directive',\n\t url: 'formly-field-directive-validation-failed'\n\t });\n\t // validate with the type\n\t var type = options.type && formlyConfig.getType(options.type);\n\t if (type) {\n\t runApiCheck(type, options, true);\n\t }\n\t if (options.expressionProperties && options.expressionProperties.hide) {\n\t formlyWarn('dont-use-expressionproperties.hide-use-hideexpression-instead', 'You have specified `hide` in `expressionProperties`. Use `hideExpression` instead', options);\n\t }\n\t }\n\t\n\t function checkFieldGroupApi(options) {\n\t formlyApiCheck['throw'](formlyApiCheck.fieldGroup, options, {\n\t prefix: 'formly-field directive',\n\t url: 'formly-field-directive-validation-failed'\n\t });\n\t }\n\t\n\t function runApiCheck(_ref2, options, forType) {\n\t var apiCheck = _ref2.apiCheck;\n\t var apiCheckInstance = _ref2.apiCheckInstance;\n\t var apiCheckFunction = _ref2.apiCheckFunction;\n\t var apiCheckOptions = _ref2.apiCheckOptions;\n\t\n\t runApiCheckForType(apiCheck, apiCheckInstance, apiCheckFunction, apiCheckOptions, options);\n\t if (forType && options.type) {\n\t _angularFix2['default'].forEach(formlyConfig.getTypeHeritage(options.type), function (type) {\n\t runApiCheckForType(type.apiCheck, type.apiCheckInstance, type.apiCheckFunction, type.apiCheckOptions, options);\n\t });\n\t }\n\t }\n\t\n\t function runApiCheckForType(apiCheck, apiCheckInstance, apiCheckFunction, apiCheckOptions, options) {\n\t /* eslint complexity:[2, 9] */\n\t if (!apiCheck) {\n\t return;\n\t }\n\t var instance = apiCheckInstance || formlyConfig.extras.apiCheckInstance || formlyApiCheck;\n\t if (instance.config.disabled || _apiCheck2['default'].globalConfig.disabled) {\n\t return;\n\t }\n\t var fn = apiCheckFunction || 'warn';\n\t // this is the new API\n\t var checkerObjects = apiCheck(instance);\n\t _angularFix2['default'].forEach(checkerObjects, function (shape, name) {\n\t var checker = instance.shape(shape);\n\t var checkOptions = _angularFix2['default'].extend({\n\t prefix: 'formly-field type ' + options.type + ' for property ' + name,\n\t url: formlyApiCheck.config.output.docsBaseUrl + 'formly-field-type-apicheck-failed'\n\t }, apiCheckOptions);\n\t instance[fn](checker, options[name], checkOptions);\n\t });\n\t }\n\t}\n\tformlyField.$inject = [\"$http\", \"$q\", \"$compile\", \"$templateCache\", \"$interpolate\", \"formlyConfig\", \"formlyApiCheck\", \"formlyUtil\", \"formlyUsability\", \"formlyWarn\"];\n\t\n\t// Stateless util functions\n\tfunction getDefaultOptionsOptionsTypes(type) {\n\t return getDefaultOptionsProperty(type, 'optionsTypes', []);\n\t}\n\t\n\tfunction getDefaultOptionsProperty(type, prop, defaultValue) {\n\t return type.defaultOptions && type.defaultOptions[prop] || defaultValue;\n\t}\n\tmodule.exports = exports['default'];\n\n/***/ },\n/* 7 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, '__esModule', {\n\t value: true\n\t});\n\texports['default'] = formlyFocus;\n\t\n\t// @ngInject\n\tfunction formlyFocus($timeout, $document) {\n\t return {\n\t restrict: 'A',\n\t link: function formlyFocusLink(scope, element, attrs) {\n\t var previousEl = null;\n\t var el = element[0];\n\t var doc = $document[0];\n\t attrs.$observe('formlyFocus', function respondToFocusExpressionChange(value) {\n\t /* eslint no-bitwise:0 */ // I know what I'm doing. I promise...\n\t if (value === 'true') {\n\t $timeout(function setElementFocus() {\n\t previousEl = doc.activeElement;\n\t el.focus();\n\t }, ~ ~attrs.focusWait);\n\t } else if (value === 'false') {\n\t if (doc.activeElement === el) {\n\t el.blur();\n\t if (attrs.hasOwnProperty('refocus') && previousEl) {\n\t previousEl.focus();\n\t }\n\t }\n\t }\n\t });\n\t }\n\t };\n\t}\n\tformlyFocus.$inject = [\"$timeout\", \"$document\"];\n\tmodule.exports = exports['default'];\n\n/***/ },\n/* 8 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, '__esModule', {\n\t value: true\n\t});\n\tvar _slice = Array.prototype.slice;\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\t\n\tfunction _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) arr2[i] = arr[i]; return arr2; } else { return Array.from(arr); } }\n\t\n\tvar _angularFix = __webpack_require__(1);\n\t\n\tvar _angularFix2 = _interopRequireDefault(_angularFix);\n\t\n\texports['default'] = formlyForm;\n\t\n\t/**\n\t * @ngdoc directive\n\t * @name formlyForm\n\t * @restrict AE\n\t */\n\t// @ngInject\n\tfunction formlyForm(formlyUsability, formlyWarn, $parse, formlyConfig, $interpolate) {\n\t var currentFormId = 1;\n\t FormlyFormController.$inject = [\"$scope\", \"formlyApiCheck\", \"formlyUtil\"];\n\t return {\n\t restrict: 'AE',\n\t template: formlyFormGetTemplate,\n\t replace: true,\n\t transclude: true,\n\t scope: {\n\t fields: '=',\n\t model: '=',\n\t form: '=?',\n\t options: '=?'\n\t },\n\t controller: FormlyFormController,\n\t link: formlyFormLink\n\t };\n\t\n\t function formlyFormGetTemplate(el, attrs) {\n\t var rootEl = getRootEl();\n\t var fieldRootEl = getFieldRootEl();\n\t var formId = 'formly_' + currentFormId++;\n\t var parentFormAttributes = '';\n\t if (attrs.hasOwnProperty('isFieldGroup') && el.parent().parent().hasClass('formly')) {\n\t parentFormAttributes = copyAttributes(el.parent().parent()[0].attributes);\n\t }\n\t return '\\n <' + rootEl + ' class=\"formly\"\\n name=\"' + getFormName() + '\"\\n role=\"form\" ' + parentFormAttributes + '>\\n <' + fieldRootEl + ' formly-field\\n ng-repeat=\"field in fields ' + getTrackBy() + '\"\\n ' + getHideDirective() + '=\"!field.hide\"\\n class=\"formly-field\"\\n options=\"field\"\\n model=\"field.model\"\\n original-model=\"model\"\\n fields=\"fields\"\\n form=\"theFormlyForm\"\\n form-id=\"' + getFormName() + '\"\\n form-state=\"options.formState\"\\n form-options=\"options\"\\n index=\"$index\">\\n \\n
\\n \\n ';\n\t\n\t function getRootEl() {\n\t return attrs.rootEl || 'ng-form';\n\t }\n\t\n\t function getFieldRootEl() {\n\t return attrs.fieldRootEl || 'div';\n\t }\n\t\n\t function getHideDirective() {\n\t return attrs.hideDirective || formlyConfig.extras.defaultHideDirective || 'ng-if';\n\t }\n\t\n\t function getTrackBy() {\n\t if (!attrs.trackBy) {\n\t return '';\n\t } else {\n\t return 'track by ' + attrs.trackBy;\n\t }\n\t }\n\t\n\t function getFormName() {\n\t var formName = formId;\n\t var bindName = attrs.bindName;\n\t if (bindName) {\n\t if (_angularFix2['default'].version.minor < 3) {\n\t throw formlyUsability.getFormlyError('bind-name attribute on formly-form not allowed in < angular 1.3');\n\t }\n\t // we can do a one-time binding here because we know we're in 1.3.x territory\n\t formName = $interpolate.startSymbol() + '::\\'formly_\\' + ' + bindName + $interpolate.endSymbol();\n\t }\n\t return formName;\n\t }\n\t\n\t function getTranscludeClass() {\n\t return attrs.transcludeClass || '';\n\t }\n\t\n\t function copyAttributes(attributes) {\n\t var excluded = ['model', 'form', 'fields', 'options', 'name', 'role', 'class', 'data-model', 'data-form', 'data-fields', 'data-options', 'data-name'];\n\t var arrayAttrs = [];\n\t _angularFix2['default'].forEach(attributes, function (_ref) {\n\t var nodeName = _ref.nodeName;\n\t var value = _ref.value;\n\t\n\t if (nodeName !== 'undefined' && excluded.indexOf(nodeName) === -1) {\n\t arrayAttrs.push(toKebabCase(nodeName) + '=\"' + value + '\"');\n\t }\n\t });\n\t return arrayAttrs.join(' ');\n\t }\n\t }\n\t\n\t // @ngInject\n\t function FormlyFormController($scope, formlyApiCheck, formlyUtil) {\n\t setupOptions();\n\t $scope.model = $scope.model || {};\n\t setupFields();\n\t\n\t // watch the model and evaluate watch expressions that depend on it.\n\t if (!$scope.options.manualModelWatcher) {\n\t $scope.$watch('model', onModelOrFormStateChange, true);\n\t } else if (_angularFix2['default'].isFunction($scope.options.manualModelWatcher)) {\n\t $scope.$watch($scope.options.manualModelWatcher, onModelOrFormStateChange, true);\n\t }\n\t\n\t if ($scope.options.formState) {\n\t $scope.$watch('options.formState', onModelOrFormStateChange, true);\n\t }\n\t\n\t function onModelOrFormStateChange() {\n\t _angularFix2['default'].forEach($scope.fields, runFieldExpressionProperties);\n\t }\n\t\n\t function validateFormControl(formControl, promise) {\n\t var validate = formControl.$validate;\n\t if (promise) {\n\t promise.then(validate);\n\t } else {\n\t validate();\n\t }\n\t }\n\t\n\t function runFieldExpressionProperties(field, index) {\n\t var model = field.model || $scope.model;\n\t var promise = field.runExpressions && field.runExpressions();\n\t if (field.hideExpression) {\n\t // can't use hide with expressionProperties reliably\n\t var val = model[field.key];\n\t field.hide = evalCloseToFormlyExpression(field.hideExpression, val, field, index);\n\t }\n\t if (field.extras && field.extras.validateOnModelChange && field.formControl) {\n\t if (_angularFix2['default'].isArray(field.formControl)) {\n\t _angularFix2['default'].forEach(field.formControl, function (formControl) {\n\t validateFormControl(formControl, promise);\n\t });\n\t } else {\n\t validateFormControl(field.formControl, promise);\n\t }\n\t }\n\t }\n\t\n\t function setupFields() {\n\t $scope.fields = $scope.fields || [];\n\t\n\t checkDeprecatedOptions($scope.options);\n\t\n\t var fieldTransforms = $scope.options.fieldTransform || formlyConfig.extras.fieldTransform;\n\t\n\t if (!_angularFix2['default'].isArray(fieldTransforms)) {\n\t fieldTransforms = [fieldTransforms];\n\t }\n\t\n\t _angularFix2['default'].forEach(fieldTransforms, function transformFields(fieldTransform) {\n\t if (fieldTransform) {\n\t $scope.fields = fieldTransform($scope.fields, $scope.model, $scope.options, $scope.form);\n\t if (!$scope.fields) {\n\t throw formlyUsability.getFormlyError('fieldTransform must return an array of fields');\n\t }\n\t }\n\t });\n\t\n\t setupModels();\n\t\n\t if ($scope.options.watchAllExpressions) {\n\t _angularFix2['default'].forEach($scope.fields, setupHideExpressionWatcher);\n\t }\n\t\n\t _angularFix2['default'].forEach($scope.fields, attachKey); // attaches a key based on the index if a key isn't specified\n\t _angularFix2['default'].forEach($scope.fields, setupWatchers); // setup watchers for all fields\n\t }\n\t\n\t function checkDeprecatedOptions(options) {\n\t if (formlyConfig.extras.fieldTransform && _angularFix2['default'].isFunction(formlyConfig.extras.fieldTransform)) {\n\t formlyWarn('fieldtransform-as-a-function-deprecated', 'fieldTransform as a function has been deprecated.', 'Attempted for formlyConfig.extras: ' + formlyConfig.extras.fieldTransform.name, formlyConfig.extras);\n\t } else if (options.fieldTransform && _angularFix2['default'].isFunction(options.fieldTransform)) {\n\t formlyWarn('fieldtransform-as-a-function-deprecated', 'fieldTransform as a function has been deprecated.', 'Attempted for form', options);\n\t }\n\t }\n\t\n\t function setupOptions() {\n\t formlyApiCheck['throw']([formlyApiCheck.formOptionsApi.optional], [$scope.options], { prefix: 'formly-form options check' });\n\t $scope.options = $scope.options || {};\n\t $scope.options.formState = $scope.options.formState || {};\n\t\n\t _angularFix2['default'].extend($scope.options, {\n\t updateInitialValue: updateInitialValue,\n\t resetModel: resetModel\n\t });\n\t }\n\t\n\t function updateInitialValue() {\n\t _angularFix2['default'].forEach($scope.fields, function (field) {\n\t if (isFieldGroup(field) && field.options) {\n\t field.options.updateInitialValue();\n\t } else {\n\t field.updateInitialValue();\n\t }\n\t });\n\t }\n\t\n\t function resetModel() {\n\t _angularFix2['default'].forEach($scope.fields, function (field) {\n\t if (isFieldGroup(field) && field.options) {\n\t field.options.resetModel();\n\t } else if (field.resetModel) {\n\t field.resetModel();\n\t }\n\t });\n\t }\n\t\n\t function setupModels() {\n\t // a set of field models that are already watched (the $scope.model will have its own watcher)\n\t var watchedModels = [$scope.model];\n\t // we will not set up automatic model watchers if manual mode is set\n\t var manualModelWatcher = $scope.options.manualModelWatcher;\n\t\n\t if ($scope.options.formState) {\n\t // $scope.options.formState will have its own watcher\n\t watchedModels.push($scope.options.formState);\n\t }\n\t\n\t _angularFix2['default'].forEach($scope.fields, function (field) {\n\t var isNewModel = initModel(field);\n\t\n\t if (field.model && isNewModel && watchedModels.indexOf(field.model) === -1 && !manualModelWatcher) {\n\t $scope.$watch(function () {\n\t return field.model;\n\t }, onModelOrFormStateChange, true);\n\t watchedModels.push(field.model);\n\t }\n\t });\n\t }\n\t\n\t function setupHideExpressionWatcher(field, index) {\n\t if (field.hideExpression) {\n\t (function () {\n\t // can't use hide with expressionProperties reliably\n\t var model = field.model || $scope.model;\n\t $scope.$watch(function hideExpressionWatcher() {\n\t var val = model[field.key];\n\t return evalCloseToFormlyExpression(field.hideExpression, val, field, index);\n\t }, function (hide) {\n\t return field.hide = hide;\n\t }, true);\n\t })();\n\t }\n\t }\n\t\n\t function initModel(field) {\n\t var isNewModel = true;\n\t\n\t if (_angularFix2['default'].isString(field.model)) {\n\t (function () {\n\t var expression = field.model;\n\t\n\t isNewModel = !referencesCurrentlyWatchedModel(expression);\n\t\n\t field.model = resolveStringModel(expression);\n\t\n\t $scope.$watch(function () {\n\t return resolveStringModel(expression);\n\t }, function (model) {\n\t return field.model = model;\n\t });\n\t })();\n\t } else if (!field.model) {\n\t field.model = $scope.model;\n\t }\n\t return isNewModel;\n\t\n\t function resolveStringModel(expression) {\n\t var index = $scope.fields.indexOf(field);\n\t var model = evalCloseToFormlyExpression(expression, undefined, field, index, { model: $scope.model });\n\t\n\t if (!model) {\n\t throw formlyUsability.getFieldError('field-model-must-be-initialized', 'Field model must be initialized. When specifying a model as a string for a field, the result of the' + ' expression must have been initialized ahead of time.', field);\n\t }\n\t\n\t return model;\n\t }\n\t }\n\t\n\t function referencesCurrentlyWatchedModel(expression) {\n\t return ['model', 'formState'].some(function (item) {\n\t return formlyUtil.startsWith(expression, item + '.') || formlyUtil.startsWith(expression, item + '[');\n\t });\n\t }\n\t\n\t function attachKey(field, index) {\n\t if (!isFieldGroup(field)) {\n\t field.key = field.key || index || 0;\n\t }\n\t }\n\t\n\t function setupWatchers(field, index) {\n\t if (!_angularFix2['default'].isDefined(field.watcher)) {\n\t return;\n\t }\n\t var watchers = field.watcher;\n\t if (!_angularFix2['default'].isArray(watchers)) {\n\t watchers = [watchers];\n\t }\n\t _angularFix2['default'].forEach(watchers, function setupWatcher(watcher) {\n\t if (!_angularFix2['default'].isDefined(watcher.listener) && !watcher.runFieldExpressions) {\n\t throw formlyUsability.getFieldError('all-field-watchers-must-have-a-listener', 'All field watchers must have a listener', field);\n\t }\n\t var watchExpression = getWatchExpression(watcher, field, index);\n\t var watchListener = getWatchListener(watcher, field, index);\n\t\n\t var type = watcher.type || '$watch';\n\t watcher.stopWatching = $scope[type](watchExpression, watchListener, watcher.watchDeep);\n\t });\n\t }\n\t\n\t function getWatchExpression(watcher, field, index) {\n\t var watchExpression = undefined;\n\t if (!_angularFix2['default'].isUndefined(watcher.expression)) {\n\t watchExpression = watcher.expression;\n\t } else if (field.key) {\n\t watchExpression = 'model[\\'' + field.key.toString().split('.').join('\\'][\\'') + '\\']';\n\t }\n\t if (_angularFix2['default'].isFunction(watchExpression)) {\n\t (function () {\n\t // wrap the field's watch expression so we can call it with the field as the first arg\n\t // and the stop function as the last arg as a helper\n\t var originalExpression = watchExpression;\n\t watchExpression = function formlyWatchExpression() {\n\t var args = modifyArgs.apply(undefined, [watcher, index].concat(_slice.call(arguments)));\n\t return originalExpression.apply(undefined, _toConsumableArray(args));\n\t };\n\t watchExpression.displayName = 'Formly Watch Expression for field for ' + field.key;\n\t })();\n\t } else if (field.model) {\n\t watchExpression = $parse(watchExpression).bind(null, $scope, { model: field.model });\n\t }\n\t return watchExpression;\n\t }\n\t\n\t function getWatchListener(watcher, field, index) {\n\t var watchListener = watcher.listener;\n\t if (_angularFix2['default'].isFunction(watchListener) || watcher.runFieldExpressions) {\n\t (function () {\n\t // wrap the field's watch listener so we can call it with the field as the first arg\n\t // and the stop function as the last arg as a helper\n\t var originalListener = watchListener;\n\t watchListener = function formlyWatchListener() {\n\t var value = undefined;\n\t if (originalListener) {\n\t var args = modifyArgs.apply(undefined, [watcher, index].concat(_slice.call(arguments)));\n\t value = originalListener.apply(undefined, _toConsumableArray(args));\n\t }\n\t if (watcher.runFieldExpressions) {\n\t runFieldExpressionProperties(field, index);\n\t }\n\t return value;\n\t };\n\t watchListener.displayName = 'Formly Watch Listener for field for ' + field.key;\n\t })();\n\t }\n\t return watchListener;\n\t }\n\t\n\t function modifyArgs(watcher, index) {\n\t for (var _len = arguments.length, originalArgs = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {\n\t originalArgs[_key - 2] = arguments[_key];\n\t }\n\t\n\t return [$scope.fields[index]].concat(originalArgs, [watcher.stopWatching]);\n\t }\n\t\n\t function evalCloseToFormlyExpression(expression, val, field, index) {\n\t var extraLocals = arguments.length <= 4 || arguments[4] === undefined ? {} : arguments[4];\n\t\n\t extraLocals = _angularFix2['default'].extend(getFormlyFieldLikeLocals(field, index), extraLocals);\n\t return formlyUtil.formlyEval($scope, expression, val, val, extraLocals);\n\t }\n\t\n\t function getFormlyFieldLikeLocals(field, index) {\n\t // this makes it closer to what a regular formlyExpression would be\n\t return {\n\t model: field.model,\n\t options: field,\n\t index: index,\n\t formState: $scope.options.formState,\n\t originalModel: $scope.model,\n\t formOptions: $scope.options,\n\t formId: $scope.formId\n\t };\n\t }\n\t }\n\t\n\t function formlyFormLink(scope, el, attrs) {\n\t setFormController();\n\t fixChromeAutocomplete();\n\t\n\t function setFormController() {\n\t var formId = attrs.name;\n\t scope.formId = formId;\n\t scope.theFormlyForm = scope[formId];\n\t if (attrs.form) {\n\t var getter = $parse(attrs.form);\n\t var setter = getter.assign;\n\t var parentForm = getter(scope.$parent);\n\t if (parentForm) {\n\t scope.theFormlyForm = parentForm;\n\t if (scope[formId]) {\n\t scope.theFormlyForm.$removeControl(scope[formId]);\n\t }\n\t\n\t // this next line is probably one of the more dangerous things that angular-formly does to improve the\n\t // API for angular-formly forms. It ensures that the NgModelControllers inside of formly-form will be\n\t // attached to the form that is passed to formly-form rather than the one that formly-form creates\n\t // this is necessary because it's confusing to have a step between the form you pass in\n\t // and the fields in that form. It also is because angular doesn't propagate properties like $submitted down\n\t // to children forms :-( This line was added to solve this issue:\n\t // https://github.com/formly-js/angular-formly/issues/287\n\t // luckily, this is how the formController has been accessed by the NgModelController since angular 1.0.0\n\t // so I expect it will remain this way for the life of angular 1.x\n\t el.removeData('$formController');\n\t } else {\n\t setter(scope.$parent, scope[formId]);\n\t }\n\t }\n\t if (!scope.theFormlyForm && !formlyConfig.disableWarnings) {\n\t /* eslint no-console:0 */\n\t formlyWarn('formly-form-has-no-formcontroller', 'Your formly-form does not have a `form` property. Many functions of the form (like validation) may not work', el, scope);\n\t }\n\t }\n\t\n\t /*\n\t * chrome autocomplete lameness\n\t * see https://code.google.com/p/chromium/issues/detail?id=468153#c14\n\t * ლ(ಠ益ಠლ) (╯°□°)╯︵ ┻━┻ (◞‸◟;)\n\t */\n\t function fixChromeAutocomplete() {\n\t var global = formlyConfig.extras.removeChromeAutoComplete === true;\n\t var offInstance = scope.options && scope.options.removeChromeAutoComplete === false;\n\t var onInstance = scope.options && scope.options.removeChromeAutoComplete === true;\n\t if (global && !offInstance || onInstance) {\n\t var input = document.createElement('input');\n\t input.setAttribute('autocomplete', 'address-level4');\n\t input.setAttribute('hidden', 'true');\n\t el[0].appendChild(input);\n\t }\n\t }\n\t }\n\t\n\t // stateless util functions\n\t function toKebabCase(string) {\n\t if (string) {\n\t return string.replace(/([A-Z])/g, function ($1) {\n\t return '-' + $1.toLowerCase();\n\t });\n\t } else {\n\t return '';\n\t }\n\t }\n\t\n\t function isFieldGroup(field) {\n\t return field && !!field.fieldGroup;\n\t }\n\t}\n\tformlyForm.$inject = [\"formlyUsability\", \"formlyWarn\", \"$parse\", \"formlyConfig\", \"$interpolate\"];\n\tmodule.exports = exports['default'];\n\n/***/ },\n/* 9 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, '__esModule', {\n\t value: true\n\t});\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\t\n\tvar _angularFix = __webpack_require__(1);\n\t\n\tvar _angularFix2 = _interopRequireDefault(_angularFix);\n\t\n\tvar _providersFormlyApiCheck = __webpack_require__(10);\n\t\n\tvar _providersFormlyApiCheck2 = _interopRequireDefault(_providersFormlyApiCheck);\n\t\n\tvar _otherDocsBaseUrl = __webpack_require__(3);\n\t\n\tvar _otherDocsBaseUrl2 = _interopRequireDefault(_otherDocsBaseUrl);\n\t\n\tvar _providersFormlyUsability = __webpack_require__(12);\n\t\n\tvar _providersFormlyUsability2 = _interopRequireDefault(_providersFormlyUsability);\n\t\n\tvar _providersFormlyConfig = __webpack_require__(11);\n\t\n\tvar _providersFormlyConfig2 = _interopRequireDefault(_providersFormlyConfig);\n\t\n\tvar _providersFormlyValidationMessages = __webpack_require__(13);\n\t\n\tvar _providersFormlyValidationMessages2 = _interopRequireDefault(_providersFormlyValidationMessages);\n\t\n\tvar _servicesFormlyUtil = __webpack_require__(16);\n\t\n\tvar _servicesFormlyUtil2 = _interopRequireDefault(_servicesFormlyUtil);\n\t\n\tvar _servicesFormlyWarn = __webpack_require__(17);\n\t\n\tvar _servicesFormlyWarn2 = _interopRequireDefault(_servicesFormlyWarn);\n\t\n\tvar _directivesFormlyCustomValidation = __webpack_require__(5);\n\t\n\tvar _directivesFormlyCustomValidation2 = _interopRequireDefault(_directivesFormlyCustomValidation);\n\t\n\tvar _directivesFormlyField = __webpack_require__(6);\n\t\n\tvar _directivesFormlyField2 = _interopRequireDefault(_directivesFormlyField);\n\t\n\tvar _directivesFormlyFocus = __webpack_require__(7);\n\t\n\tvar _directivesFormlyFocus2 = _interopRequireDefault(_directivesFormlyFocus);\n\t\n\tvar _directivesFormlyForm = __webpack_require__(8);\n\t\n\tvar _directivesFormlyForm2 = _interopRequireDefault(_directivesFormlyForm);\n\t\n\tvar _runFormlyNgModelAttrsManipulator = __webpack_require__(15);\n\t\n\tvar _runFormlyNgModelAttrsManipulator2 = _interopRequireDefault(_runFormlyNgModelAttrsManipulator);\n\t\n\tvar _runFormlyCustomTags = __webpack_require__(14);\n\t\n\tvar _runFormlyCustomTags2 = _interopRequireDefault(_runFormlyCustomTags);\n\t\n\tvar ngModuleName = 'formly';\n\t\n\texports['default'] = ngModuleName;\n\t\n\tvar ngModule = _angularFix2['default'].module(ngModuleName, []);\n\t\n\tngModule.constant('formlyApiCheck', _providersFormlyApiCheck2['default']);\n\tngModule.constant('formlyErrorAndWarningsUrlPrefix', _otherDocsBaseUrl2['default']);\n\tngModule.constant('formlyVersion', (\"0.0.0-semantically-released.0\")); // <-- webpack variable\n\t\n\tngModule.provider('formlyUsability', _providersFormlyUsability2['default']);\n\tngModule.provider('formlyConfig', _providersFormlyConfig2['default']);\n\t\n\tngModule.factory('formlyValidationMessages', _providersFormlyValidationMessages2['default']);\n\tngModule.factory('formlyUtil', _servicesFormlyUtil2['default']);\n\tngModule.factory('formlyWarn', _servicesFormlyWarn2['default']);\n\t\n\tngModule.directive('formlyCustomValidation', _directivesFormlyCustomValidation2['default']);\n\tngModule.directive('formlyField', _directivesFormlyField2['default']);\n\tngModule.directive('formlyFocus', _directivesFormlyFocus2['default']);\n\tngModule.directive('formlyForm', _directivesFormlyForm2['default']);\n\t\n\tngModule.run(_runFormlyNgModelAttrsManipulator2['default']);\n\tngModule.run(_runFormlyCustomTags2['default']);\n\tmodule.exports = exports['default'];\n\n/***/ },\n/* 10 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, '__esModule', {\n\t value: true\n\t});\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\t\n\tvar _angularFix = __webpack_require__(1);\n\t\n\tvar _angularFix2 = _interopRequireDefault(_angularFix);\n\t\n\tvar _apiCheck = __webpack_require__(4);\n\t\n\tvar _apiCheck2 = _interopRequireDefault(_apiCheck);\n\t\n\tvar apiCheck = (0, _apiCheck2['default'])({\n\t output: {\n\t prefix: 'angular-formly:',\n\t docsBaseUrl: __webpack_require__(3)\n\t }\n\t});\n\t\n\tfunction shapeRequiredIfNot(otherProps, propChecker) {\n\t if (!_angularFix2['default'].isArray(otherProps)) {\n\t otherProps = [otherProps];\n\t }\n\t var type = 'specified if these are not specified: `' + otherProps.join(', ') + '` (otherwise it\\'s optional)';\n\t\n\t function shapeRequiredIfNotDefinition(prop, propName, location, obj) {\n\t var propExists = obj && obj.hasOwnProperty(propName);\n\t var otherPropsExist = otherProps.some(function (otherProp) {\n\t return obj && obj.hasOwnProperty(otherProp);\n\t });\n\t if (!otherPropsExist && !propExists) {\n\t return apiCheck.utils.getError(propName, location, type);\n\t } else if (propExists) {\n\t return propChecker(prop, propName, location, obj);\n\t }\n\t }\n\t\n\t shapeRequiredIfNotDefinition.type = type;\n\t return apiCheck.utils.checkerHelpers.setupChecker(shapeRequiredIfNotDefinition);\n\t}\n\t\n\tvar formlyExpression = apiCheck.oneOfType([apiCheck.string, apiCheck.func]);\n\tvar specifyWrapperType = apiCheck.typeOrArrayOf(apiCheck.string).nullable;\n\t\n\tvar apiCheckProperty = apiCheck.func;\n\t\n\tvar apiCheckInstanceProperty = apiCheck.shape.onlyIf('apiCheck', apiCheck.func.withProperties({\n\t warn: apiCheck.func,\n\t 'throw': apiCheck.func,\n\t shape: apiCheck.func\n\t}));\n\t\n\tvar apiCheckFunctionProperty = apiCheck.shape.onlyIf('apiCheck', apiCheck.oneOf(['throw', 'warn']));\n\t\n\tvar formlyWrapperType = apiCheck.shape({\n\t name: shapeRequiredIfNot('types', apiCheck.string).optional,\n\t template: apiCheck.shape.ifNot('templateUrl', apiCheck.string).optional,\n\t templateUrl: apiCheck.shape.ifNot('template', apiCheck.string).optional,\n\t types: apiCheck.typeOrArrayOf(apiCheck.string).optional,\n\t overwriteOk: apiCheck.bool.optional,\n\t apiCheck: apiCheckProperty.optional,\n\t apiCheckInstance: apiCheckInstanceProperty.optional,\n\t apiCheckFunction: apiCheckFunctionProperty.optional,\n\t apiCheckOptions: apiCheck.object.optional\n\t}).strict;\n\t\n\tvar expressionProperties = apiCheck.objectOf(apiCheck.oneOfType([formlyExpression, apiCheck.shape({\n\t expression: formlyExpression,\n\t message: formlyExpression.optional\n\t}).strict]));\n\t\n\tvar modelChecker = apiCheck.oneOfType([apiCheck.string, apiCheck.object]);\n\t\n\tvar templateManipulators = apiCheck.shape({\n\t preWrapper: apiCheck.arrayOf(apiCheck.func).nullable.optional,\n\t postWrapper: apiCheck.arrayOf(apiCheck.func).nullable.optional\n\t}).strict.nullable;\n\t\n\tvar validatorChecker = apiCheck.objectOf(apiCheck.oneOfType([formlyExpression, apiCheck.shape({\n\t expression: formlyExpression,\n\t message: formlyExpression.optional\n\t}).strict]));\n\t\n\tvar watcherChecker = apiCheck.typeOrArrayOf(apiCheck.shape({\n\t expression: formlyExpression.optional,\n\t listener: formlyExpression.optional,\n\t runFieldExpressions: apiCheck.bool.optional\n\t}));\n\t\n\tvar fieldOptionsApiShape = {\n\t $$hashKey: apiCheck.any.optional,\n\t type: apiCheck.shape.ifNot(['template', 'templateUrl'], apiCheck.string).optional,\n\t template: apiCheck.shape.ifNot(['type', 'templateUrl'], apiCheck.oneOfType([apiCheck.string, apiCheck.func])).optional,\n\t templateUrl: apiCheck.shape.ifNot(['type', 'template'], apiCheck.oneOfType([apiCheck.string, apiCheck.func])).optional,\n\t key: apiCheck.oneOfType([apiCheck.string, apiCheck.number]).optional,\n\t model: modelChecker.optional,\n\t originalModel: modelChecker.optional,\n\t className: apiCheck.string.optional,\n\t id: apiCheck.string.optional,\n\t name: apiCheck.string.optional,\n\t expressionProperties: expressionProperties.optional,\n\t extras: apiCheck.shape({\n\t validateOnModelChange: apiCheck.bool.optional,\n\t skipNgModelAttrsManipulator: apiCheck.oneOfType([apiCheck.string, apiCheck.bool]).optional\n\t }).strict.optional,\n\t data: apiCheck.object.optional,\n\t templateOptions: apiCheck.object.optional,\n\t wrapper: specifyWrapperType.optional,\n\t modelOptions: apiCheck.shape({\n\t updateOn: apiCheck.string.optional,\n\t debounce: apiCheck.oneOfType([apiCheck.objectOf(apiCheck.number), apiCheck.number]).optional,\n\t allowInvalid: apiCheck.bool.optional,\n\t getterSetter: apiCheck.bool.optional,\n\t timezone: apiCheck.string.optional\n\t }).optional,\n\t watcher: watcherChecker.optional,\n\t validators: validatorChecker.optional,\n\t asyncValidators: validatorChecker.optional,\n\t parsers: apiCheck.arrayOf(formlyExpression).optional,\n\t formatters: apiCheck.arrayOf(formlyExpression).optional,\n\t noFormControl: apiCheck.bool.optional,\n\t hide: apiCheck.bool.optional,\n\t hideExpression: formlyExpression.optional,\n\t ngModelElAttrs: apiCheck.objectOf(apiCheck.string).optional,\n\t ngModelAttrs: apiCheck.objectOf(apiCheck.shape({\n\t statement: apiCheck.shape.ifNot(['value', 'attribute', 'bound', 'boolean'], apiCheck.any).optional,\n\t value: apiCheck.shape.ifNot('statement', apiCheck.any).optional,\n\t attribute: apiCheck.shape.ifNot('statement', apiCheck.any).optional,\n\t bound: apiCheck.shape.ifNot('statement', apiCheck.any).optional,\n\t boolean: apiCheck.shape.ifNot('statement', apiCheck.any).optional\n\t }).strict).optional,\n\t elementAttributes: apiCheck.objectOf(apiCheck.string).optional,\n\t optionsTypes: apiCheck.typeOrArrayOf(apiCheck.string).optional,\n\t link: apiCheck.func.optional,\n\t controller: apiCheck.oneOfType([apiCheck.string, apiCheck.func, apiCheck.array]).optional,\n\t validation: apiCheck.shape({\n\t show: apiCheck.bool.nullable.optional,\n\t messages: apiCheck.objectOf(formlyExpression).optional,\n\t errorExistsAndShouldBeVisible: apiCheck.bool.optional\n\t }).optional,\n\t formControl: apiCheck.typeOrArrayOf(apiCheck.object).optional,\n\t value: apiCheck.func.optional,\n\t runExpressions: apiCheck.func.optional,\n\t templateManipulators: templateManipulators.optional,\n\t resetModel: apiCheck.func.optional,\n\t updateInitialValue: apiCheck.func.optional,\n\t initialValue: apiCheck.any.optional,\n\t defaultValue: apiCheck.any.optional\n\t};\n\t\n\tvar formlyFieldOptions = apiCheck.shape(fieldOptionsApiShape).strict;\n\t\n\tvar formOptionsApi = apiCheck.shape({\n\t formState: apiCheck.object.optional,\n\t resetModel: apiCheck.func.optional,\n\t updateInitialValue: apiCheck.func.optional,\n\t removeChromeAutoComplete: apiCheck.bool.optional,\n\t templateManipulators: templateManipulators.optional,\n\t manualModelWatcher: apiCheck.oneOfType([apiCheck.bool, apiCheck.func]).optional,\n\t watchAllExpressions: apiCheck.bool.optional,\n\t wrapper: specifyWrapperType.optional,\n\t fieldTransform: apiCheck.oneOfType([apiCheck.func, apiCheck.array]).optional,\n\t data: apiCheck.object.optional\n\t}).strict;\n\t\n\tvar fieldGroup = apiCheck.shape({\n\t $$hashKey: apiCheck.any.optional,\n\t key: apiCheck.oneOfType([apiCheck.string, apiCheck.number]).optional,\n\t // danger. Nested field groups wont get api-checked...\n\t fieldGroup: apiCheck.arrayOf(apiCheck.oneOfType([formlyFieldOptions, apiCheck.object])),\n\t className: apiCheck.string.optional,\n\t options: formOptionsApi.optional,\n\t templateOptions: apiCheck.object.optional,\n\t wrapper: specifyWrapperType.optional,\n\t watcher: watcherChecker.optional,\n\t hide: apiCheck.bool.optional,\n\t hideExpression: formlyExpression.optional,\n\t data: apiCheck.object.optional,\n\t model: modelChecker.optional,\n\t form: apiCheck.object.optional,\n\t elementAttributes: apiCheck.objectOf(apiCheck.string).optional\n\t}).strict;\n\t\n\tvar typeOptionsDefaultOptions = _angularFix2['default'].copy(fieldOptionsApiShape);\n\ttypeOptionsDefaultOptions.key = apiCheck.string.optional;\n\t\n\tvar formlyTypeOptions = apiCheck.shape({\n\t name: apiCheck.string,\n\t template: apiCheck.shape.ifNot('templateUrl', apiCheck.oneOfType([apiCheck.string, apiCheck.func])).optional,\n\t templateUrl: apiCheck.shape.ifNot('template', apiCheck.oneOfType([apiCheck.string, apiCheck.func])).optional,\n\t controller: apiCheck.oneOfType([apiCheck.func, apiCheck.string, apiCheck.array]).optional,\n\t link: apiCheck.func.optional,\n\t defaultOptions: apiCheck.oneOfType([apiCheck.func, apiCheck.shape(typeOptionsDefaultOptions)]).optional,\n\t 'extends': apiCheck.string.optional,\n\t wrapper: specifyWrapperType.optional,\n\t data: apiCheck.object.optional,\n\t apiCheck: apiCheckProperty.optional,\n\t apiCheckInstance: apiCheckInstanceProperty.optional,\n\t apiCheckFunction: apiCheckFunctionProperty.optional,\n\t apiCheckOptions: apiCheck.object.optional,\n\t overwriteOk: apiCheck.bool.optional\n\t}).strict;\n\t\n\t_angularFix2['default'].extend(apiCheck, {\n\t formlyTypeOptions: formlyTypeOptions, formlyFieldOptions: formlyFieldOptions, formlyExpression: formlyExpression, formlyWrapperType: formlyWrapperType, fieldGroup: fieldGroup, formOptionsApi: formOptionsApi\n\t});\n\t\n\texports['default'] = apiCheck;\n\tmodule.exports = exports['default'];\n\n/***/ },\n/* 11 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, '__esModule', {\n\t value: true\n\t});\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\t\n\tfunction _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) arr2[i] = arr[i]; return arr2; } else { return Array.from(arr); } }\n\t\n\tvar _angularFix = __webpack_require__(1);\n\t\n\tvar _angularFix2 = _interopRequireDefault(_angularFix);\n\t\n\tvar _otherUtils = __webpack_require__(2);\n\t\n\tvar _otherUtils2 = _interopRequireDefault(_otherUtils);\n\t\n\texports['default'] = formlyConfig;\n\t\n\t// @ngInject\n\tfunction formlyConfig(formlyUsabilityProvider, formlyErrorAndWarningsUrlPrefix, formlyApiCheck) {\n\t var _this2 = this;\n\t\n\t var typeMap = {};\n\t var templateWrappersMap = {};\n\t var defaultWrapperName = 'default';\n\t var _this = this;\n\t var getError = formlyUsabilityProvider.getFormlyError;\n\t\n\t _angularFix2['default'].extend(this, {\n\t setType: setType,\n\t getType: getType,\n\t getTypeHeritage: getTypeHeritage,\n\t setWrapper: setWrapper,\n\t getWrapper: getWrapper,\n\t getWrapperByType: getWrapperByType,\n\t removeWrapperByName: removeWrapperByName,\n\t removeWrappersForType: removeWrappersForType,\n\t disableWarnings: false,\n\t extras: {\n\t disableNgModelAttrsManipulator: false,\n\t fieldTransform: [],\n\t ngModelAttrsManipulatorPreferUnbound: false,\n\t removeChromeAutoComplete: false,\n\t defaultHideDirective: 'ng-if',\n\t getFieldId: null\n\t },\n\t templateManipulators: {\n\t preWrapper: [],\n\t postWrapper: []\n\t },\n\t $get: function $get() {\n\t return _this2;\n\t }\n\t });\n\t\n\t function setType(options) {\n\t if (_angularFix2['default'].isArray(options)) {\n\t var _ret = (function () {\n\t var allTypes = [];\n\t _angularFix2['default'].forEach(options, function (item) {\n\t allTypes.push(setType(item));\n\t });\n\t return {\n\t v: allTypes\n\t };\n\t })();\n\t\n\t if (typeof _ret === 'object') return _ret.v;\n\t } else if (_angularFix2['default'].isObject(options)) {\n\t checkType(options);\n\t if (options['extends']) {\n\t extendTypeOptions(options);\n\t }\n\t typeMap[options.name] = options;\n\t return typeMap[options.name];\n\t } else {\n\t throw getError('You must provide an object or array for setType. You provided: ' + JSON.stringify(arguments));\n\t }\n\t }\n\t\n\t function checkType(options) {\n\t formlyApiCheck['throw'](formlyApiCheck.formlyTypeOptions, options, {\n\t prefix: 'formlyConfig.setType',\n\t url: 'settype-validation-failed'\n\t });\n\t if (!options.overwriteOk) {\n\t checkOverwrite(options.name, typeMap, options, 'types');\n\t } else {\n\t options.overwriteOk = undefined;\n\t }\n\t }\n\t\n\t function extendTypeOptions(options) {\n\t var extendsType = getType(options['extends'], true, options);\n\t extendTypeControllerFunction(options, extendsType);\n\t extendTypeLinkFunction(options, extendsType);\n\t extendTypeDefaultOptions(options, extendsType);\n\t _otherUtils2['default'].reverseDeepMerge(options, extendsType);\n\t extendTemplate(options, extendsType);\n\t }\n\t\n\t function extendTemplate(options, extendsType) {\n\t if (options.template && extendsType.templateUrl) {\n\t delete options.templateUrl;\n\t } else if (options.templateUrl && extendsType.template) {\n\t delete options.template;\n\t }\n\t }\n\t\n\t function extendTypeControllerFunction(options, extendsType) {\n\t var extendsCtrl = extendsType.controller;\n\t if (!_angularFix2['default'].isDefined(extendsCtrl)) {\n\t return;\n\t }\n\t var optionsCtrl = options.controller;\n\t if (_angularFix2['default'].isDefined(optionsCtrl)) {\n\t options.controller = function ($scope, $controller) {\n\t $controller(extendsCtrl, { $scope: $scope });\n\t $controller(optionsCtrl, { $scope: $scope });\n\t };\n\t options.controller.$inject = ['$scope', '$controller'];\n\t } else {\n\t options.controller = extendsCtrl;\n\t }\n\t }\n\t\n\t function extendTypeLinkFunction(options, extendsType) {\n\t var extendsFn = extendsType.link;\n\t if (!_angularFix2['default'].isDefined(extendsFn)) {\n\t return;\n\t }\n\t var optionsFn = options.link;\n\t if (_angularFix2['default'].isDefined(optionsFn)) {\n\t options.link = function () {\n\t extendsFn.apply(undefined, arguments);\n\t optionsFn.apply(undefined, arguments);\n\t };\n\t } else {\n\t options.link = extendsFn;\n\t }\n\t }\n\t\n\t function extendTypeDefaultOptions(options, extendsType) {\n\t var extendsDO = extendsType.defaultOptions;\n\t if (!_angularFix2['default'].isDefined(extendsDO)) {\n\t return;\n\t }\n\t var optionsDO = options.defaultOptions;\n\t var optionsDOIsFn = _angularFix2['default'].isFunction(optionsDO);\n\t var extendsDOIsFn = _angularFix2['default'].isFunction(extendsDO);\n\t if (extendsDOIsFn) {\n\t options.defaultOptions = function defaultOptions(opts, scope) {\n\t var extendsDefaultOptions = extendsDO(opts, scope);\n\t var mergedDefaultOptions = {};\n\t _otherUtils2['default'].reverseDeepMerge(mergedDefaultOptions, opts, extendsDefaultOptions);\n\t var extenderOptionsDefaultOptions = optionsDO;\n\t if (optionsDOIsFn) {\n\t extenderOptionsDefaultOptions = extenderOptionsDefaultOptions(mergedDefaultOptions, scope);\n\t }\n\t _otherUtils2['default'].reverseDeepMerge(extendsDefaultOptions, extenderOptionsDefaultOptions);\n\t return extendsDefaultOptions;\n\t };\n\t } else if (optionsDOIsFn) {\n\t options.defaultOptions = function defaultOptions(opts, scope) {\n\t var newDefaultOptions = {};\n\t _otherUtils2['default'].reverseDeepMerge(newDefaultOptions, opts, extendsDO);\n\t return optionsDO(newDefaultOptions, scope);\n\t };\n\t }\n\t }\n\t\n\t function getType(name, throwError, errorContext) {\n\t if (!name) {\n\t return undefined;\n\t }\n\t var type = typeMap[name];\n\t if (!type && throwError === true) {\n\t throw getError('There is no type by the name of \"' + name + '\": ' + JSON.stringify(errorContext));\n\t } else {\n\t return type;\n\t }\n\t }\n\t\n\t function getTypeHeritage(parent) {\n\t var heritage = [];\n\t var type = parent;\n\t if (_angularFix2['default'].isString(type)) {\n\t type = getType(parent);\n\t }\n\t parent = type['extends'];\n\t while (parent) {\n\t type = getType(parent);\n\t heritage.push(type);\n\t parent = type['extends'];\n\t }\n\t return heritage;\n\t }\n\t\n\t function setWrapper(_x, _x2) {\n\t var _again = true;\n\t\n\t _function: while (_again) {\n\t var options = _x,\n\t name = _x2;\n\t _again = false;\n\t\n\t if (_angularFix2['default'].isArray(options)) {\n\t return options.map(function (wrapperOptions) {\n\t return setWrapper(wrapperOptions);\n\t });\n\t } else if (_angularFix2['default'].isObject(options)) {\n\t options.types = getOptionsTypes(options);\n\t options.name = getOptionsName(options, name);\n\t checkWrapperAPI(options);\n\t templateWrappersMap[options.name] = options;\n\t return options;\n\t } else if (_angularFix2['default'].isString(options)) {\n\t _x = {\n\t template: options,\n\t name: name\n\t };\n\t _x2 = undefined;\n\t _again = true;\n\t continue _function;\n\t }\n\t }\n\t }\n\t\n\t function getOptionsTypes(options) {\n\t if (_angularFix2['default'].isString(options.types)) {\n\t return [options.types];\n\t }\n\t if (!_angularFix2['default'].isDefined(options.types)) {\n\t return [];\n\t } else {\n\t return options.types;\n\t }\n\t }\n\t\n\t function getOptionsName(options, name) {\n\t return options.name || name || options.types.join(' ') || defaultWrapperName;\n\t }\n\t\n\t function checkWrapperAPI(options) {\n\t formlyUsabilityProvider.checkWrapper(options);\n\t if (options.template) {\n\t formlyUsabilityProvider.checkWrapperTemplate(options.template, options);\n\t }\n\t if (!options.overwriteOk) {\n\t checkOverwrite(options.name, templateWrappersMap, options, 'templateWrappers');\n\t } else {\n\t delete options.overwriteOk;\n\t }\n\t checkWrapperTypes(options);\n\t }\n\t\n\t function checkWrapperTypes(options) {\n\t var shouldThrow = !_angularFix2['default'].isArray(options.types) || !options.types.every(_angularFix2['default'].isString);\n\t if (shouldThrow) {\n\t throw getError('Attempted to create a template wrapper with types that is not a string or an array of strings');\n\t }\n\t }\n\t\n\t function checkOverwrite(property, object, newValue, objectName) {\n\t if (object.hasOwnProperty(property)) {\n\t warn('overwriting-types-or-wrappers', ['Attempting to overwrite ' + property + ' on ' + objectName + ' which is currently', JSON.stringify(object[property]) + ' with ' + JSON.stringify(newValue), 'To supress this warning, specify the property \"overwriteOk: true\"'].join(' '));\n\t }\n\t }\n\t\n\t function getWrapper(name) {\n\t return templateWrappersMap[name || defaultWrapperName];\n\t }\n\t\n\t function getWrapperByType(type) {\n\t /* eslint prefer-const:0 */\n\t var wrappers = [];\n\t for (var _name in templateWrappersMap) {\n\t if (templateWrappersMap.hasOwnProperty(_name)) {\n\t if (templateWrappersMap[_name].types && templateWrappersMap[_name].types.indexOf(type) !== -1) {\n\t wrappers.push(templateWrappersMap[_name]);\n\t }\n\t }\n\t }\n\t return wrappers;\n\t }\n\t\n\t function removeWrapperByName(name) {\n\t var wrapper = templateWrappersMap[name];\n\t delete templateWrappersMap[name];\n\t return wrapper;\n\t }\n\t\n\t function removeWrappersForType(type) {\n\t var wrappers = getWrapperByType(type);\n\t if (!wrappers) {\n\t return undefined;\n\t }\n\t if (!_angularFix2['default'].isArray(wrappers)) {\n\t return removeWrapperByName(wrappers.name);\n\t } else {\n\t wrappers.forEach(function (wrapper) {\n\t return removeWrapperByName(wrapper.name);\n\t });\n\t return wrappers;\n\t }\n\t }\n\t\n\t function warn() {\n\t if (!_this.disableWarnings && console.warn) {\n\t /* eslint no-console:0 */\n\t var args = Array.prototype.slice.call(arguments);\n\t var warnInfoSlug = args.shift();\n\t args.unshift('Formly Warning:');\n\t args.push('' + formlyErrorAndWarningsUrlPrefix + warnInfoSlug);\n\t console.warn.apply(console, _toConsumableArray(args));\n\t }\n\t }\n\t}\n\tformlyConfig.$inject = [\"formlyUsabilityProvider\", \"formlyErrorAndWarningsUrlPrefix\", \"formlyApiCheck\"];\n\tmodule.exports = exports['default'];\n\n/***/ },\n/* 12 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, '__esModule', {\n\t value: true\n\t});\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\t\n\tvar _angularFix = __webpack_require__(1);\n\t\n\tvar _angularFix2 = _interopRequireDefault(_angularFix);\n\t\n\texports['default'] = formlyUsability;\n\t\n\t// @ngInject\n\tfunction formlyUsability(formlyApiCheck, formlyErrorAndWarningsUrlPrefix) {\n\t var _this = this;\n\t\n\t _angularFix2['default'].extend(this, {\n\t getFormlyError: getFormlyError,\n\t getFieldError: getFieldError,\n\t checkWrapper: checkWrapper,\n\t checkWrapperTemplate: checkWrapperTemplate,\n\t getErrorMessage: getErrorMessage,\n\t $get: function $get() {\n\t return _this;\n\t }\n\t });\n\t\n\t function getFieldError(errorInfoSlug, message, field) {\n\t if (arguments.length < 3) {\n\t field = message;\n\t message = errorInfoSlug;\n\t errorInfoSlug = null;\n\t }\n\t return new Error(getErrorMessage(errorInfoSlug, message) + (' Field definition: ' + _angularFix2['default'].toJson(field)));\n\t }\n\t\n\t function getFormlyError(errorInfoSlug, message) {\n\t if (!message) {\n\t message = errorInfoSlug;\n\t errorInfoSlug = null;\n\t }\n\t return new Error(getErrorMessage(errorInfoSlug, message));\n\t }\n\t\n\t function getErrorMessage(errorInfoSlug, message) {\n\t var url = '';\n\t if (errorInfoSlug !== null) {\n\t url = '' + formlyErrorAndWarningsUrlPrefix + errorInfoSlug;\n\t }\n\t return 'Formly Error: ' + message + '. ' + url;\n\t }\n\t\n\t function checkWrapper(wrapper) {\n\t formlyApiCheck['throw'](formlyApiCheck.formlyWrapperType, wrapper, {\n\t prefix: 'formlyConfig.setWrapper',\n\t urlSuffix: 'setwrapper-validation-failed'\n\t });\n\t }\n\t\n\t function checkWrapperTemplate(template, additionalInfo) {\n\t var formlyTransclude = '';\n\t if (template.indexOf(formlyTransclude) === -1) {\n\t throw getFormlyError('Template wrapper templates must use \"' + formlyTransclude + '\" somewhere in them. ' + ('This one does not have \"\" in it: ' + template) + '\\n' + ('Additional information: ' + JSON.stringify(additionalInfo)));\n\t }\n\t }\n\t}\n\tformlyUsability.$inject = [\"formlyApiCheck\", \"formlyErrorAndWarningsUrlPrefix\"];\n\tmodule.exports = exports['default'];\n\n/***/ },\n/* 13 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, '__esModule', {\n\t value: true\n\t});\n\texports['default'] = formlyValidationMessages;\n\t\n\t// @ngInject\n\tfunction formlyValidationMessages() {\n\t\n\t var validationMessages = {\n\t addTemplateOptionValueMessage: addTemplateOptionValueMessage,\n\t addStringMessage: addStringMessage,\n\t messages: {}\n\t };\n\t\n\t return validationMessages;\n\t\n\t function addTemplateOptionValueMessage(name, prop, prefix, suffix, alternate) {\n\t validationMessages.messages[name] = templateOptionValue(prop, prefix, suffix, alternate);\n\t }\n\t\n\t function addStringMessage(name, string) {\n\t validationMessages.messages[name] = function () {\n\t return string;\n\t };\n\t }\n\t\n\t function templateOptionValue(prop, prefix, suffix, alternate) {\n\t return function getValidationMessage(viewValue, modelValue, scope) {\n\t if (typeof scope.options.templateOptions[prop] !== 'undefined') {\n\t return prefix + ' ' + scope.options.templateOptions[prop] + ' ' + suffix;\n\t } else {\n\t return alternate;\n\t }\n\t };\n\t }\n\t}\n\tmodule.exports = exports['default'];\n\n/***/ },\n/* 14 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, '__esModule', {\n\t value: true\n\t});\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\t\n\tvar _angularFix = __webpack_require__(1);\n\t\n\tvar _angularFix2 = _interopRequireDefault(_angularFix);\n\t\n\texports['default'] = addCustomTags;\n\t\n\t// @ngInject\n\tfunction addCustomTags($document) {\n\t // IE8 check ->\n\t // https://msdn.microsoft.com/en-us/library/cc196988(v=vs.85).aspx\n\t if ($document && $document.documentMode < 9) {\n\t (function () {\n\t var document = $document.get(0);\n\t // add the custom elements that we need for formly\n\t var customElements = ['formly-field', 'formly-form'];\n\t _angularFix2['default'].forEach(customElements, function (el) {\n\t document.createElement(el);\n\t });\n\t })();\n\t }\n\t}\n\taddCustomTags.$inject = [\"$document\"];\n\tmodule.exports = exports['default'];\n\n/***/ },\n/* 15 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, '__esModule', {\n\t value: true\n\t});\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\t\n\tvar _angularFix = __webpack_require__(1);\n\t\n\tvar _angularFix2 = _interopRequireDefault(_angularFix);\n\t\n\tvar _otherUtils = __webpack_require__(2);\n\t\n\texports['default'] = addFormlyNgModelAttrsManipulator;\n\t\n\t// @ngInject\n\tfunction addFormlyNgModelAttrsManipulator(formlyConfig, $interpolate) {\n\t if (formlyConfig.extras.disableNgModelAttrsManipulator) {\n\t return;\n\t }\n\t formlyConfig.templateManipulators.preWrapper.push(ngModelAttrsManipulator);\n\t\n\t function ngModelAttrsManipulator(template, options, scope) {\n\t var node = document.createElement('div');\n\t var skip = options.extras && options.extras.skipNgModelAttrsManipulator;\n\t if (skip === true) {\n\t return template;\n\t }\n\t node.innerHTML = template;\n\t\n\t var modelNodes = getNgModelNodes(node, skip);\n\t if (!modelNodes || !modelNodes.length) {\n\t return template;\n\t }\n\t\n\t addIfNotPresent(modelNodes, 'id', scope.id);\n\t addIfNotPresent(modelNodes, 'name', scope.name || scope.id);\n\t\n\t addValidation();\n\t alterNgModelAttr();\n\t addModelOptions();\n\t addTemplateOptionsAttrs();\n\t addNgModelElAttrs();\n\t\n\t return node.innerHTML;\n\t\n\t function addValidation() {\n\t if (_angularFix2['default'].isDefined(options.validators) || _angularFix2['default'].isDefined(options.validation.messages)) {\n\t addIfNotPresent(modelNodes, 'formly-custom-validation', '');\n\t }\n\t }\n\t\n\t function alterNgModelAttr() {\n\t if (isPropertyAccessor(options.key)) {\n\t addRegardlessOfPresence(modelNodes, 'ng-model', 'model.' + options.key);\n\t }\n\t }\n\t\n\t function addModelOptions() {\n\t if (_angularFix2['default'].isDefined(options.modelOptions)) {\n\t addIfNotPresent(modelNodes, 'ng-model-options', 'options.modelOptions');\n\t if (options.modelOptions.getterSetter) {\n\t addRegardlessOfPresence(modelNodes, 'ng-model', 'options.value');\n\t }\n\t }\n\t }\n\t\n\t function addTemplateOptionsAttrs() {\n\t if (!options.templateOptions && !options.expressionProperties) {\n\t // no need to run these if there are no templateOptions or expressionProperties\n\t return;\n\t }\n\t var to = options.templateOptions || {};\n\t var ep = options.expressionProperties || {};\n\t\n\t var ngModelAttributes = getBuiltInAttributes();\n\t\n\t // extend with the user's specifications winning\n\t _angularFix2['default'].extend(ngModelAttributes, options.ngModelAttrs);\n\t\n\t // Feel free to make this more simple :-)\n\t _angularFix2['default'].forEach(ngModelAttributes, function (val, name) {\n\t /* eslint complexity:[2, 14] */\n\t var attrVal = undefined,\n\t attrName = undefined;\n\t var ref = 'options.templateOptions[\\'' + name + '\\']';\n\t var toVal = to[name];\n\t var epVal = getEpValue(ep, name);\n\t\n\t var inTo = _angularFix2['default'].isDefined(toVal);\n\t var inEp = _angularFix2['default'].isDefined(epVal);\n\t if (val.value) {\n\t // I realize this looks backwards, but it's right, trust me...\n\t attrName = val.value;\n\t attrVal = name;\n\t } else if (val.statement && inTo) {\n\t attrName = val.statement;\n\t if (_angularFix2['default'].isString(to[name])) {\n\t attrVal = '$eval(' + ref + ')';\n\t } else if (_angularFix2['default'].isFunction(to[name])) {\n\t attrVal = ref + '(model[options.key], options, this, $event)';\n\t } else {\n\t throw new Error('options.templateOptions.' + name + ' must be a string or function: ' + JSON.stringify(options));\n\t }\n\t } else if (val.bound && inEp) {\n\t attrName = val.bound;\n\t attrVal = ref;\n\t } else if ((val.attribute || val.boolean) && inEp) {\n\t attrName = val.attribute || val.boolean;\n\t attrVal = '' + $interpolate.startSymbol() + ref + $interpolate.endSymbol();\n\t } else if (val.attribute && inTo) {\n\t attrName = val.attribute;\n\t attrVal = toVal;\n\t } else if (val.boolean) {\n\t if (inTo && !inEp && toVal) {\n\t attrName = val.boolean;\n\t attrVal = true;\n\t } else {\n\t /* eslint no-empty:0 */\n\t // empty to illustrate that a boolean will not be added via val.bound\n\t // if you want it added via val.bound, then put it in expressionProperties\n\t }\n\t } else if (val.bound && inTo) {\n\t attrName = val.bound;\n\t attrVal = ref;\n\t }\n\t\n\t if (_angularFix2['default'].isDefined(attrName) && _angularFix2['default'].isDefined(attrVal)) {\n\t addIfNotPresent(modelNodes, attrName, attrVal);\n\t }\n\t });\n\t }\n\t\n\t function addNgModelElAttrs() {\n\t _angularFix2['default'].forEach(options.ngModelElAttrs, function (val, name) {\n\t addRegardlessOfPresence(modelNodes, name, val);\n\t });\n\t }\n\t }\n\t\n\t // Utility functions\n\t function getNgModelNodes(node, skip) {\n\t var selectorNot = _angularFix2['default'].isString(skip) ? ':not(' + skip + ')' : '';\n\t var skipNot = ':not([formly-skip-ng-model-attrs-manipulator])';\n\t var query = '[ng-model]' + selectorNot + skipNot + ', [data-ng-model]' + selectorNot + skipNot;\n\t try {\n\t return node.querySelectorAll(query);\n\t } catch (e) {\n\t //this code is needed for IE8, as it does not support the CSS3 ':not' selector\n\t //it should be removed when IE8 support is dropped\n\t return getNgModelNodesFallback(node, skip);\n\t }\n\t }\n\t\n\t function getNgModelNodesFallback(node, skip) {\n\t var allNgModelNodes = node.querySelectorAll('[ng-model], [data-ng-model]');\n\t var matchingNgModelNodes = [];\n\t\n\t //make sure this array is compatible with NodeList type by adding an 'item' function\n\t matchingNgModelNodes.item = function (i) {\n\t return this[i];\n\t };\n\t\n\t for (var i = 0; i < allNgModelNodes.length; i++) {\n\t var ngModelNode = allNgModelNodes[i];\n\t if (!ngModelNode.hasAttribute('formly-skip-ng-model-attrs-manipulator') && !(_angularFix2['default'].isString(skip) && nodeMatches(ngModelNode, skip))) {\n\t matchingNgModelNodes.push(ngModelNode);\n\t }\n\t }\n\t\n\t return matchingNgModelNodes;\n\t }\n\t\n\t function nodeMatches(node, selector) {\n\t var div = document.createElement('div');\n\t div.innerHTML = node.outerHTML;\n\t return div.querySelector(selector);\n\t }\n\t\n\t function getBuiltInAttributes() {\n\t var ngModelAttributes = {\n\t focus: {\n\t attribute: 'formly-focus'\n\t }\n\t };\n\t var boundOnly = [];\n\t var bothBooleanAndBound = ['required', 'disabled'];\n\t var bothAttributeAndBound = ['pattern', 'minlength'];\n\t var statementOnly = ['change', 'keydown', 'keyup', 'keypress', 'click', 'focus', 'blur'];\n\t var attributeOnly = ['placeholder', 'min', 'max', 'step', 'tabindex', 'type'];\n\t if (formlyConfig.extras.ngModelAttrsManipulatorPreferUnbound) {\n\t bothAttributeAndBound.push('maxlength');\n\t } else {\n\t boundOnly.push('maxlength');\n\t }\n\t\n\t _angularFix2['default'].forEach(boundOnly, function (item) {\n\t ngModelAttributes[item] = { bound: 'ng-' + item };\n\t });\n\t\n\t _angularFix2['default'].forEach(bothBooleanAndBound, function (item) {\n\t ngModelAttributes[item] = { boolean: item, bound: 'ng-' + item };\n\t });\n\t\n\t _angularFix2['default'].forEach(bothAttributeAndBound, function (item) {\n\t ngModelAttributes[item] = { attribute: item, bound: 'ng-' + item };\n\t });\n\t\n\t _angularFix2['default'].forEach(statementOnly, function (item) {\n\t var propName = 'on' + item.substr(0, 1).toUpperCase() + item.substr(1);\n\t ngModelAttributes[propName] = { statement: 'ng-' + item };\n\t });\n\t\n\t _angularFix2['default'].forEach(attributeOnly, function (item) {\n\t ngModelAttributes[item] = { attribute: item };\n\t });\n\t return ngModelAttributes;\n\t }\n\t\n\t function getEpValue(ep, name) {\n\t return ep['templateOptions.' + name] || ep['templateOptions[\\'' + name + '\\']'] || ep['templateOptions[\"' + name + '\"]'];\n\t }\n\t\n\t function addIfNotPresent(nodes, attr, val) {\n\t _angularFix2['default'].forEach(nodes, function (node) {\n\t if (!node.getAttribute(attr)) {\n\t node.setAttribute(attr, val);\n\t }\n\t });\n\t }\n\t\n\t function addRegardlessOfPresence(nodes, attr, val) {\n\t _angularFix2['default'].forEach(nodes, function (node) {\n\t node.setAttribute(attr, val);\n\t });\n\t }\n\t\n\t function isPropertyAccessor(key) {\n\t return (0, _otherUtils.contains)(key, '.') || (0, _otherUtils.contains)(key, '[') && (0, _otherUtils.contains)(key, ']');\n\t }\n\t}\n\taddFormlyNgModelAttrsManipulator.$inject = [\"formlyConfig\", \"$interpolate\"];\n\tmodule.exports = exports['default'];\n\n/***/ },\n/* 16 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, '__esModule', {\n\t value: true\n\t});\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\t\n\tvar _otherUtils = __webpack_require__(2);\n\t\n\tvar _otherUtils2 = _interopRequireDefault(_otherUtils);\n\t\n\texports['default'] = formlyUtil;\n\t\n\t// @ngInject\n\tfunction formlyUtil() {\n\t return _otherUtils2['default'];\n\t}\n\tmodule.exports = exports['default'];\n\n/***/ },\n/* 17 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, '__esModule', {\n\t value: true\n\t});\n\t\n\tfunction _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) arr2[i] = arr[i]; return arr2; } else { return Array.from(arr); } }\n\t\n\texports['default'] = formlyWarn;\n\t\n\t// @ngInject\n\tfunction formlyWarn(formlyConfig, formlyErrorAndWarningsUrlPrefix, $log) {\n\t return function warn() {\n\t if (!formlyConfig.disableWarnings) {\n\t var args = Array.prototype.slice.call(arguments);\n\t var warnInfoSlug = args.shift();\n\t args.unshift('Formly Warning:');\n\t args.push('' + formlyErrorAndWarningsUrlPrefix + warnInfoSlug);\n\t $log.warn.apply($log, _toConsumableArray(args));\n\t }\n\t };\n\t}\n\tformlyWarn.$inject = [\"formlyConfig\", \"formlyErrorAndWarningsUrlPrefix\", \"$log\"];\n\tmodule.exports = exports['default'];\n\n/***/ },\n/* 18 */\n/***/ function(module, exports) {\n\n\tmodule.exports = __WEBPACK_EXTERNAL_MODULE_18__;\n\n/***/ }\n/******/ ])\n});\n;\n\n\n/** WEBPACK FOOTER **\n ** dist/formly.min.js\n **/"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\texports: {},\n \t\t\tid: moduleId,\n \t\t\tloaded: false\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.loaded = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(0);\n\n\n\n/** WEBPACK FOOTER **\n ** webpack/bootstrap 96ba1b0aea9ff184f6e5\n **/","'use strict';\n\nObject.defineProperty(exports, '__esModule', {\n value: true\n});\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\nvar _indexCommon = require('./index.common');\n\nvar _indexCommon2 = _interopRequireDefault(_indexCommon);\n\nexports['default'] = _indexCommon2['default'];\nmodule.exports = exports['default'];\n\n\n/** WEBPACK FOOTER **\n ** ./index.js\n **/","import index from './index.common'\nexport default index\n\n\n\n/** WEBPACK FOOTER **\n ** C:/Projects/personal/angular-formly/~/eslint-loader?configFile=./other/src.eslintrc!C:/Projects/personal/angular-formly/src/index.js\n **/","// some versions of angular don't export the angular module properly,\n// so we get it from window in this case.\n'use strict';\n\nObject.defineProperty(exports, '__esModule', {\n value: true\n});\nvar angular = require('angular');\n\n/* istanbul ignore next */\nif (!angular.version) {\n angular = window.angular;\n}\nexports['default'] = angular;\nmodule.exports = exports['default'];\n\n\n/** WEBPACK FOOTER **\n ** ./angular-fix/index.js\n **/","// some versions of angular don't export the angular module properly,\n// so we get it from window in this case.\nlet angular = require('angular')\n\n/* istanbul ignore next */\nif (!angular.version) {\n angular = window.angular\n}\nexport default angular\n\n\n\n/** WEBPACK FOOTER **\n ** C:/Projects/personal/angular-formly/~/eslint-loader?configFile=./other/src.eslintrc!C:/Projects/personal/angular-formly/src/angular-fix/index.js\n **/","'use strict';\n\nObject.defineProperty(exports, '__esModule', {\n value: true\n});\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\nvar _angularFix = require('angular-fix');\n\nvar _angularFix2 = _interopRequireDefault(_angularFix);\n\nexports['default'] = {\n containsSelector: containsSelector, containsSpecialChar: containsSpecialChar, formlyEval: formlyEval, getFieldId: getFieldId, reverseDeepMerge: reverseDeepMerge, findByNodeName: findByNodeName,\n arrayify: arrayify, extendFunction: extendFunction, extendArray: extendArray, startsWith: startsWith, contains: contains\n};\n\nfunction containsSelector(string) {\n return containsSpecialChar(string, '.') || containsSpecialChar(string, '[') && containsSpecialChar(string, ']');\n}\n\nfunction containsSpecialChar(a, b) {\n if (!a || !a.indexOf) {\n return false;\n }\n return a.indexOf(b) !== -1;\n}\n\nfunction formlyEval(scope, expression, $modelValue, $viewValue, extraLocals) {\n if (_angularFix2['default'].isFunction(expression)) {\n return expression($viewValue, $modelValue, scope, extraLocals);\n } else {\n return scope.$eval(expression, _angularFix2['default'].extend({ $viewValue: $viewValue, $modelValue: $modelValue }, extraLocals));\n }\n}\n\nfunction getFieldId(formId, options, index) {\n if (options.id) {\n return options.id;\n }\n var type = options.type;\n if (!type && options.template) {\n type = 'template';\n } else if (!type && options.templateUrl) {\n type = 'templateUrl';\n }\n\n return [formId, type, options.key, index].join('_');\n}\n\nfunction reverseDeepMerge(dest) {\n _angularFix2['default'].forEach(arguments, function (src, index) {\n if (!index) {\n return;\n }\n _angularFix2['default'].forEach(src, function (val, prop) {\n if (!_angularFix2['default'].isDefined(dest[prop])) {\n dest[prop] = _angularFix2['default'].copy(val);\n } else if (objAndSameType(dest[prop], val)) {\n reverseDeepMerge(dest[prop], val);\n }\n });\n });\n return dest;\n}\n\nfunction objAndSameType(obj1, obj2) {\n return _angularFix2['default'].isObject(obj1) && _angularFix2['default'].isObject(obj2) && Object.getPrototypeOf(obj1) === Object.getPrototypeOf(obj2);\n}\n\n// recurse down a node tree to find a node with matching nodeName, for custom tags jQuery.find doesn't work in IE8\nfunction findByNodeName(el, nodeName) {\n if (!el.prop) {\n // not a jQuery or jqLite object -> wrap it\n el = _angularFix2['default'].element(el);\n }\n\n if (el.prop('nodeName') === nodeName.toUpperCase()) {\n return el;\n }\n\n var c = el.children();\n for (var i = 0; c && i < c.length; i++) {\n var node = findByNodeName(c[i], nodeName);\n if (node) {\n return node;\n }\n }\n}\n\nfunction arrayify(obj) {\n if (obj && !_angularFix2['default'].isArray(obj)) {\n obj = [obj];\n } else if (!obj) {\n obj = [];\n }\n return obj;\n}\n\nfunction extendFunction() {\n for (var _len = arguments.length, fns = Array(_len), _key = 0; _key < _len; _key++) {\n fns[_key] = arguments[_key];\n }\n\n return function extendedFunction() {\n var args = arguments;\n fns.forEach(function (fn) {\n return fn.apply(null, args);\n });\n };\n}\n\nfunction extendArray(primary, secondary, property) {\n if (property) {\n primary = primary[property];\n secondary = secondary[property];\n }\n if (secondary && primary) {\n _angularFix2['default'].forEach(secondary, function (item) {\n if (primary.indexOf(item) === -1) {\n primary.push(item);\n }\n });\n return primary;\n } else if (secondary) {\n return secondary;\n } else {\n return primary;\n }\n}\n\nfunction startsWith(str, search) {\n if (_angularFix2['default'].isString(str) && _angularFix2['default'].isString(search)) {\n return str.length >= search.length && str.substring(0, search.length) === search;\n } else {\n return false;\n }\n}\n\nfunction contains(str, search) {\n if (_angularFix2['default'].isString(str) && _angularFix2['default'].isString(search)) {\n return str.length >= search.length && str.indexOf(search) !== -1;\n } else {\n return false;\n }\n}\nmodule.exports = exports['default'];\n\n\n/** WEBPACK FOOTER **\n ** ./other/utils.js\n **/","import angular from 'angular-fix'\n\nexport default {\n containsSelector, containsSpecialChar, formlyEval, getFieldId, reverseDeepMerge, findByNodeName,\n arrayify, extendFunction, extendArray, startsWith, contains,\n}\n\nfunction containsSelector(string) {\n return containsSpecialChar(string, '.') || (containsSpecialChar(string, '[') && containsSpecialChar(string, ']'))\n}\n\nfunction containsSpecialChar(a, b) {\n if (!a || !a.indexOf) {\n return false\n }\n return a.indexOf(b) !== -1\n}\n\n\nfunction formlyEval(scope, expression, $modelValue, $viewValue, extraLocals) {\n if (angular.isFunction(expression)) {\n return expression($viewValue, $modelValue, scope, extraLocals)\n } else {\n return scope.$eval(expression, angular.extend({$viewValue, $modelValue}, extraLocals))\n }\n}\n\nfunction getFieldId(formId, options, index) {\n if (options.id) {\n return options.id\n }\n let type = options.type\n if (!type && options.template) {\n type = 'template'\n } else if (!type && options.templateUrl) {\n type = 'templateUrl'\n }\n\n return [formId, type, options.key, index].join('_')\n}\n\n\nfunction reverseDeepMerge(dest) {\n angular.forEach(arguments, (src, index) => {\n if (!index) {\n return\n }\n angular.forEach(src, (val, prop) => {\n if (!angular.isDefined(dest[prop])) {\n dest[prop] = angular.copy(val)\n } else if (objAndSameType(dest[prop], val)) {\n reverseDeepMerge(dest[prop], val)\n }\n })\n })\n return dest\n}\n\nfunction objAndSameType(obj1, obj2) {\n return angular.isObject(obj1) && angular.isObject(obj2) &&\n Object.getPrototypeOf(obj1) === Object.getPrototypeOf(obj2)\n}\n\n// recurse down a node tree to find a node with matching nodeName, for custom tags jQuery.find doesn't work in IE8\nfunction findByNodeName(el, nodeName) {\n if (!el.prop) { // not a jQuery or jqLite object -> wrap it\n el = angular.element(el)\n }\n\n if (el.prop('nodeName') === nodeName.toUpperCase()) {\n return el\n }\n\n const c = el.children()\n for (let i = 0; c && i < c.length; i++) {\n const node = findByNodeName(c[i], nodeName)\n if (node) {\n return node\n }\n }\n}\n\n\nfunction arrayify(obj) {\n if (obj && !angular.isArray(obj)) {\n obj = [obj]\n } else if (!obj) {\n obj = []\n }\n return obj\n}\n\n\nfunction extendFunction(...fns) {\n return function extendedFunction() {\n const args = arguments\n fns.forEach(fn => fn.apply(null, args))\n }\n}\n\nfunction extendArray(primary, secondary, property) {\n if (property) {\n primary = primary[property]\n secondary = secondary[property]\n }\n if (secondary && primary) {\n angular.forEach(secondary, function(item) {\n if (primary.indexOf(item) === -1) {\n primary.push(item)\n }\n })\n return primary\n } else if (secondary) {\n return secondary\n } else {\n return primary\n }\n}\n\nfunction startsWith(str, search) {\n if (angular.isString(str) && angular.isString(search)) {\n return str.length >= search.length && str.substring(0, search.length) === search\n } else {\n return false\n }\n}\n\nfunction contains(str, search) {\n if (angular.isString(str) && angular.isString(search)) {\n return str.length >= search.length && str.indexOf(search) !== -1\n } else {\n return false\n }\n}\n\n\n\n/** WEBPACK FOOTER **\n ** C:/Projects/personal/angular-formly/~/eslint-loader?configFile=./other/src.eslintrc!C:/Projects/personal/angular-formly/src/other/utils.js\n **/","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports[\"default\"] = \"https://github.com/formly-js/angular-formly/blob/\" + VERSION + \"/other/ERRORS_AND_WARNINGS.md#\";\nmodule.exports = exports[\"default\"];\n\n\n/** WEBPACK FOOTER **\n ** ./other/docsBaseUrl.js\n **/","module.exports = __WEBPACK_EXTERNAL_MODULE_4__;\n\n\n/*****************\n ** WEBPACK FOOTER\n ** external {\"root\":\"apiCheck\",\"amd\":\"api-check\",\"commonjs2\":\"api-check\",\"commonjs\":\"api-check\"}\n ** module id = 4\n ** module chunks = 0\n **/","'use strict';\n\nObject.defineProperty(exports, '__esModule', {\n value: true\n});\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\nvar _angularFix = require('angular-fix');\n\nvar _angularFix2 = _interopRequireDefault(_angularFix);\n\nexports['default'] = formlyCustomValidation;\n\n// @ngInject\nfunction formlyCustomValidation(formlyUtil) {\n return {\n restrict: 'A',\n require: 'ngModel',\n link: function formlyCustomValidationLink(scope, el, attrs, ctrl) {\n var opts = scope.options;\n opts.validation.messages = opts.validation.messages || {};\n _angularFix2['default'].forEach(opts.validation.messages, function (message, key) {\n opts.validation.messages[key] = function () {\n return formlyUtil.formlyEval(scope, message, ctrl.$modelValue, ctrl.$viewValue);\n };\n });\n\n var useNewValidatorsApi = ctrl.hasOwnProperty('$validators') && !attrs.hasOwnProperty('useParsers');\n _angularFix2['default'].forEach(opts.validators, _angularFix2['default'].bind(null, addValidatorToPipeline, false));\n _angularFix2['default'].forEach(opts.asyncValidators, _angularFix2['default'].bind(null, addValidatorToPipeline, true));\n\n function addValidatorToPipeline(isAsync, validator, name) {\n setupMessage(validator, name);\n validator = _angularFix2['default'].isObject(validator) ? validator.expression : validator;\n if (useNewValidatorsApi) {\n setupWithValidators(validator, name, isAsync);\n } else {\n setupWithParsers(validator, name, isAsync);\n }\n }\n\n function setupMessage(validator, name) {\n var message = validator.message;\n if (message) {\n opts.validation.messages[name] = function () {\n return formlyUtil.formlyEval(scope, message, ctrl.$modelValue, ctrl.$viewValue);\n };\n }\n }\n\n function setupWithValidators(validator, name, isAsync) {\n var validatorCollection = isAsync ? '$asyncValidators' : '$validators';\n\n ctrl[validatorCollection][name] = function evalValidity(modelValue, viewValue) {\n return formlyUtil.formlyEval(scope, validator, modelValue, viewValue);\n };\n }\n\n function setupWithParsers(validator, name, isAsync) {\n var inFlightValidator = undefined;\n ctrl.$parsers.unshift(function evalValidityOfParser(viewValue) {\n var isValid = formlyUtil.formlyEval(scope, validator, ctrl.$modelValue, viewValue);\n if (isAsync) {\n ctrl.$pending = ctrl.$pending || {};\n ctrl.$pending[name] = true;\n inFlightValidator = isValid;\n isValid.then(function () {\n if (inFlightValidator === isValid) {\n ctrl.$setValidity(name, true);\n }\n })['catch'](function () {\n if (inFlightValidator === isValid) {\n ctrl.$setValidity(name, false);\n }\n })['finally'](function () {\n var $pending = ctrl.$pending || {};\n if (Object.keys($pending).length === 1) {\n delete ctrl.$pending;\n } else {\n delete ctrl.$pending[name];\n }\n });\n } else {\n ctrl.$setValidity(name, isValid);\n }\n return viewValue;\n });\n }\n }\n };\n}\nmodule.exports = exports['default'];\n\n\n/** WEBPACK FOOTER **\n ** ./directives/formly-custom-validation.js\n **/","import angular from 'angular-fix'\nexport default formlyCustomValidation\n\n// @ngInject\nfunction formlyCustomValidation(formlyUtil) {\n return {\n restrict: 'A',\n require: 'ngModel',\n link: function formlyCustomValidationLink(scope, el, attrs, ctrl) {\n const opts = scope.options\n opts.validation.messages = opts.validation.messages || {}\n angular.forEach(opts.validation.messages, (message, key) => {\n opts.validation.messages[key] = () => {\n return formlyUtil.formlyEval(scope, message, ctrl.$modelValue, ctrl.$viewValue)\n }\n })\n\n\n const useNewValidatorsApi = ctrl.hasOwnProperty('$validators') && !attrs.hasOwnProperty('useParsers')\n angular.forEach(opts.validators, angular.bind(null, addValidatorToPipeline, false))\n angular.forEach(opts.asyncValidators, angular.bind(null, addValidatorToPipeline, true))\n\n function addValidatorToPipeline(isAsync, validator, name) {\n setupMessage(validator, name)\n validator = angular.isObject(validator) ? validator.expression : validator\n if (useNewValidatorsApi) {\n setupWithValidators(validator, name, isAsync)\n } else {\n setupWithParsers(validator, name, isAsync)\n }\n }\n\n function setupMessage(validator, name) {\n const message = validator.message\n if (message) {\n opts.validation.messages[name] = () => {\n return formlyUtil.formlyEval(scope, message, ctrl.$modelValue, ctrl.$viewValue)\n }\n }\n }\n\n function setupWithValidators(validator, name, isAsync) {\n const validatorCollection = isAsync ? '$asyncValidators' : '$validators'\n\n ctrl[validatorCollection][name] = function evalValidity(modelValue, viewValue) {\n return formlyUtil.formlyEval(scope, validator, modelValue, viewValue)\n }\n }\n\n function setupWithParsers(validator, name, isAsync) {\n let inFlightValidator\n ctrl.$parsers.unshift(function evalValidityOfParser(viewValue) {\n const isValid = formlyUtil.formlyEval(scope, validator, ctrl.$modelValue, viewValue)\n if (isAsync) {\n ctrl.$pending = ctrl.$pending || {}\n ctrl.$pending[name] = true\n inFlightValidator = isValid\n isValid.then(() => {\n if (inFlightValidator === isValid) {\n ctrl.$setValidity(name, true)\n }\n }).catch(() => {\n if (inFlightValidator === isValid) {\n ctrl.$setValidity(name, false)\n }\n }).finally(() => {\n const $pending = ctrl.$pending || {}\n if (Object.keys($pending).length === 1) {\n delete ctrl.$pending\n } else {\n delete ctrl.$pending[name]\n }\n })\n } else {\n ctrl.$setValidity(name, isValid)\n }\n return viewValue\n })\n }\n },\n }\n}\n\n\n\n/** WEBPACK FOOTER **\n ** C:/Projects/personal/angular-formly/~/eslint-loader?configFile=./other/src.eslintrc!C:/Projects/personal/angular-formly/src/directives/formly-custom-validation.js\n **/","'use strict';\n\nObject.defineProperty(exports, '__esModule', {\n value: true\n});\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\nfunction _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) arr2[i] = arr[i]; return arr2; } else { return Array.from(arr); } }\n\nvar _angularFix = require('angular-fix');\n\nvar _angularFix2 = _interopRequireDefault(_angularFix);\n\nvar _apiCheck = require('api-check');\n\nvar _apiCheck2 = _interopRequireDefault(_apiCheck);\n\nexports['default'] = formlyField;\n\n/**\n * @ngdoc directive\n * @name formlyField\n * @restrict AE\n */\n// @ngInject\nfunction formlyField($http, $q, $compile, $templateCache, $interpolate, formlyConfig, formlyApiCheck, formlyUtil, formlyUsability, formlyWarn) {\n var arrayify = formlyUtil.arrayify;\n\n return {\n restrict: 'AE',\n transclude: true,\n require: '?^formlyForm',\n scope: {\n options: '=',\n model: '=',\n originalModel: '=?',\n formId: '@', // TODO remove formId in a breaking release\n index: '=?',\n fields: '=?',\n formState: '=?',\n formOptions: '=?',\n form: '=?' },\n // TODO require form in a breaking release\n controller: FormlyFieldController,\n link: fieldLink\n };\n\n // @ngInject\n function FormlyFieldController($scope, $timeout, $parse, $controller, formlyValidationMessages) {\n /* eslint max-statements:[2, 34] */\n if ($scope.options.fieldGroup) {\n setupFieldGroup();\n return;\n }\n\n var fieldType = getFieldType($scope.options);\n simplifyLife($scope.options);\n mergeFieldOptionsWithTypeDefaults($scope.options, fieldType);\n extendOptionsWithDefaults($scope.options, $scope.index);\n checkApi($scope.options);\n // set field id to link labels and fields\n\n // initalization\n setFieldIdAndName();\n setDefaultValue();\n setInitialValue();\n runExpressions();\n watchExpressions();\n addValidationMessages($scope.options);\n invokeControllers($scope, $scope.options, fieldType);\n\n // function definitions\n function runExpressions() {\n // must run on next tick to make sure that the current value is correct.\n return $timeout(function runExpressionsOnNextTick() {\n var field = $scope.options;\n var currentValue = valueGetterSetter();\n _angularFix2['default'].forEach(field.expressionProperties, function runExpression(expression, prop) {\n var setter = $parse(prop).assign;\n var promise = $q.when(formlyUtil.formlyEval($scope, expression, currentValue, currentValue));\n promise.then(function setFieldValue(value) {\n setter(field, value);\n });\n });\n }, 0, false);\n }\n\n function watchExpressions() {\n if ($scope.formOptions.watchAllExpressions) {\n (function () {\n var field = $scope.options;\n var currentValue = valueGetterSetter();\n _angularFix2['default'].forEach(field.expressionProperties, function watchExpression(expression, prop) {\n var setter = $parse(prop).assign;\n $scope.$watch(function expressionPropertyWatcher() {\n return formlyUtil.formlyEval($scope, expression, currentValue, currentValue);\n }, function expressionPropertyListener(value) {\n setter(field, value);\n }, true);\n });\n })();\n }\n }\n\n function valueGetterSetter(newVal) {\n if (!$scope.model || !$scope.options.key) {\n return undefined;\n }\n if (_angularFix2['default'].isDefined(newVal)) {\n parseSet($scope.options.key, $scope.model, newVal);\n }\n return parseGet($scope.options.key, $scope.model);\n }\n\n function shouldNotUseParseKey(key) {\n return _angularFix2['default'].isNumber(key) || !formlyUtil.containsSelector(key);\n }\n\n function parseSet(key, model, newVal) {\n // If either of these are null/undefined then just return undefined\n if (!key || !model) {\n return;\n }\n // If we are working with a number then $parse wont work, default back to the old way for now\n if (shouldNotUseParseKey(key)) {\n // TODO: Fix this so we can get several levels instead of just one with properties that are numeric\n model[key] = newVal;\n } else {\n var setter = $parse($scope.options.key).assign;\n if (setter) {\n setter($scope.model, newVal);\n }\n }\n }\n\n function parseGet(key, model) {\n // If either of these are null/undefined then just return undefined\n if (!key || !model) {\n return undefined;\n }\n\n // If we are working with a number then $parse wont work, default back to the old way for now\n if (shouldNotUseParseKey(key)) {\n // TODO: Fix this so we can get several levels instead of just one with properties that are numeric\n return model[key];\n } else {\n return $parse(key)(model);\n }\n }\n\n function simplifyLife(options) {\n // add a few empty objects (if they don't already exist) so you don't have to undefined check everywhere\n formlyUtil.reverseDeepMerge(options, {\n originalModel: options.model,\n extras: {},\n data: {},\n templateOptions: {},\n validation: {}\n });\n // create $scope.to so template authors can reference to instead of $scope.options.templateOptions\n $scope.to = $scope.options.templateOptions;\n $scope.formOptions = $scope.formOptions || {};\n }\n\n function setFieldIdAndName() {\n if (_angularFix2['default'].isFunction(formlyConfig.extras.getFieldId)) {\n $scope.id = formlyConfig.extras.getFieldId($scope.options, $scope.model, $scope);\n } else {\n var formName = $scope.form && $scope.form.$name || $scope.formId;\n $scope.id = formlyUtil.getFieldId(formName, $scope.options, $scope.index);\n }\n $scope.options.id = $scope.id;\n $scope.name = $scope.options.name || $scope.options.id;\n $scope.options.name = $scope.name;\n }\n\n function setDefaultValue() {\n if (_angularFix2['default'].isDefined($scope.options.defaultValue) && !_angularFix2['default'].isDefined(parseGet($scope.options.key, $scope.model))) {\n parseSet($scope.options.key, $scope.model, $scope.options.defaultValue);\n }\n }\n\n function setInitialValue() {\n $scope.options.initialValue = $scope.model && parseGet($scope.options.key, $scope.model);\n }\n\n function mergeFieldOptionsWithTypeDefaults(options, type) {\n if (type) {\n mergeOptions(options, type.defaultOptions);\n }\n var properOrder = arrayify(options.optionsTypes).reverse(); // so the right things are overridden\n _angularFix2['default'].forEach(properOrder, function (typeName) {\n mergeOptions(options, formlyConfig.getType(typeName, true, options).defaultOptions);\n });\n }\n\n function mergeOptions(options, extraOptions) {\n if (extraOptions) {\n if (_angularFix2['default'].isFunction(extraOptions)) {\n extraOptions = extraOptions(options, $scope);\n }\n formlyUtil.reverseDeepMerge(options, extraOptions);\n }\n }\n\n function extendOptionsWithDefaults(options, index) {\n var key = options.key || index || 0;\n _angularFix2['default'].extend(options, {\n // attach the key in case the formly-field directive is used directly\n key: key,\n value: options.value || valueGetterSetter,\n runExpressions: runExpressions,\n resetModel: resetModel,\n updateInitialValue: updateInitialValue\n });\n }\n\n function resetModel() {\n parseSet($scope.options.key, $scope.model, $scope.options.initialValue);\n if ($scope.options.formControl) {\n if (_angularFix2['default'].isArray($scope.options.formControl)) {\n _angularFix2['default'].forEach($scope.options.formControl, function (formControl) {\n resetFormControl(formControl, true);\n });\n } else {\n resetFormControl($scope.options.formControl);\n }\n }\n if ($scope.form) {\n $scope.form.$setUntouched && $scope.form.$setUntouched();\n $scope.form.$setPristine();\n }\n }\n\n function resetFormControl(formControl, isMultiNgModel) {\n if (!isMultiNgModel) {\n formControl.$setViewValue(parseGet($scope.options.key, $scope.model));\n }\n\n formControl.$render();\n formControl.$setUntouched && formControl.$setUntouched();\n formControl.$setPristine();\n\n // To prevent breaking change requiring a digest to reset $viewModel\n if (!$scope.$root.$$phase) {\n $scope.$digest();\n }\n }\n\n function updateInitialValue() {\n $scope.options.initialValue = parseGet($scope.options.key, $scope.model);\n }\n\n function addValidationMessages(options) {\n options.validation.messages = options.validation.messages || {};\n _angularFix2['default'].forEach(formlyValidationMessages.messages, function createFunctionForMessage(expression, name) {\n if (!options.validation.messages[name]) {\n options.validation.messages[name] = function evaluateMessage(viewValue, modelValue, scope) {\n return formlyUtil.formlyEval(scope, expression, modelValue, viewValue);\n };\n }\n });\n }\n\n function invokeControllers(scope) {\n var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];\n var type = arguments.length <= 2 || arguments[2] === undefined ? {} : arguments[2];\n\n _angularFix2['default'].forEach([type.controller, options.controller], function (controller) {\n if (controller) {\n $controller(controller, { $scope: scope });\n }\n });\n }\n\n function setupFieldGroup() {\n $scope.options.options = $scope.options.options || {};\n $scope.options.options.formState = $scope.formState;\n $scope.to = $scope.options.templateOptions;\n }\n }\n\n // link function\n function fieldLink(scope, el, attrs, formlyFormCtrl) {\n if (scope.options.fieldGroup) {\n setFieldGroupTemplate();\n return;\n }\n\n // watch the field model (if exists) if there is no parent formly-form directive (that would watch it instead)\n if (!formlyFormCtrl && scope.options.model) {\n scope.$watch('options.model', function () {\n return scope.options.runExpressions();\n }, true);\n }\n\n addAttributes();\n addClasses();\n\n var type = getFieldType(scope.options);\n var args = arguments;\n var thusly = this;\n var fieldCount = 0;\n var fieldManipulators = getManipulators(scope.options, scope.formOptions);\n getFieldTemplate(scope.options).then(runManipulators(fieldManipulators.preWrapper)).then(transcludeInWrappers(scope.options, scope.formOptions)).then(runManipulators(fieldManipulators.postWrapper)).then(setElementTemplate).then(watchFormControl).then(callLinkFunctions)['catch'](function (error) {\n formlyWarn('there-was-a-problem-setting-the-template-for-this-field', 'There was a problem setting the template for this field ', scope.options, error);\n });\n\n function setFieldGroupTemplate() {\n checkFieldGroupApi(scope.options);\n el.addClass('formly-field-group');\n var extraAttributes = '';\n if (scope.options.elementAttributes) {\n extraAttributes = Object.keys(scope.options.elementAttributes).map(function (key) {\n return key + '=\"' + scope.options.elementAttributes[key] + '\"';\n }).join(' ');\n }\n var modelValue = 'model';\n scope.options.form = scope.form;\n if (scope.options.key) {\n modelValue = 'model[\\'' + scope.options.key + '\\']';\n }\n getTemplate('\\n \\n \\n ').then(transcludeInWrappers(scope.options, scope.formOptions)).then(setElementTemplate);\n }\n\n function addAttributes() {\n if (scope.options.elementAttributes) {\n el.attr(scope.options.elementAttributes);\n }\n }\n\n function addClasses() {\n if (scope.options.className) {\n el.addClass(scope.options.className);\n }\n if (scope.options.type) {\n el.addClass('formly-field-' + scope.options.type);\n }\n }\n\n function setElementTemplate(templateString) {\n el.html(asHtml(templateString));\n $compile(el.contents())(scope);\n return templateString;\n }\n\n function watchFormControl(templateString) {\n var stopWatchingShowError = _angularFix2['default'].noop;\n if (scope.options.noFormControl) {\n return;\n }\n var templateEl = _angularFix2['default'].element('
' + templateString + '
');\n var ngModelNodes = templateEl[0].querySelectorAll('[ng-model],[data-ng-model]');\n\n if (ngModelNodes.length) {\n _angularFix2['default'].forEach(ngModelNodes, function (ngModelNode) {\n fieldCount++;\n watchFieldNameOrExistence(ngModelNode.getAttribute('name'));\n });\n }\n\n function watchFieldNameOrExistence(name) {\n var nameExpressionRegex = /\\{\\{(.*?)}}/;\n var nameExpression = nameExpressionRegex.exec(name);\n if (nameExpression) {\n name = $interpolate(name)(scope);\n }\n watchFieldExistence(name);\n }\n\n function watchFieldExistence(name) {\n scope.$watch('form[\"' + name + '\"]', function formControlChange(formControl) {\n if (formControl) {\n if (fieldCount > 1) {\n if (!scope.options.formControl) {\n scope.options.formControl = [];\n }\n scope.options.formControl.push(formControl);\n } else {\n scope.options.formControl = formControl;\n }\n scope.fc = scope.options.formControl; // shortcut for template authors\n stopWatchingShowError();\n addShowMessagesWatcher();\n addParsers();\n addFormatters();\n }\n });\n }\n\n function addShowMessagesWatcher() {\n stopWatchingShowError = scope.$watch(function watchShowValidationChange() {\n var customExpression = formlyConfig.extras.errorExistsAndShouldBeVisibleExpression;\n var options = scope.options;\n var formControls = arrayify(scope.fc);\n if (!formControls.some(function (fc) {\n return fc.$invalid;\n })) {\n return false;\n } else if (typeof options.validation.show === 'boolean') {\n return options.validation.show;\n } else if (customExpression) {\n return formControls.some(function (fc) {\n return formlyUtil.formlyEval(scope, customExpression, fc.$modelValue, fc.$viewValue);\n });\n } else {\n return formControls.some(function (fc) {\n var noTouchedButDirty = _angularFix2['default'].isUndefined(fc.$touched) && fc.$dirty;\n return fc.$touched || noTouchedButDirty;\n });\n }\n }, function onShowValidationChange(show) {\n scope.options.validation.errorExistsAndShouldBeVisible = show;\n scope.showError = show; // shortcut for template authors\n });\n }\n\n function addParsers() {\n setParsersOrFormatters('parsers');\n }\n\n function addFormatters() {\n setParsersOrFormatters('formatters');\n var ctrl = scope.fc;\n var formWasPristine = scope.form.$pristine;\n if (scope.options.formatters) {\n (function () {\n var value = ctrl.$modelValue;\n ctrl.$formatters.forEach(function (formatter) {\n value = formatter(value);\n });\n\n ctrl.$setViewValue(value);\n ctrl.$render();\n ctrl.$setPristine();\n if (formWasPristine) {\n scope.form.$setPristine();\n }\n })();\n }\n }\n\n function setParsersOrFormatters(which) {\n var originalThingProp = 'originalParser';\n if (which === 'formatters') {\n originalThingProp = 'originalFormatter';\n }\n\n // init with type's parsers\n var things = getThingsFromType(type);\n\n // get optionsTypes things\n things = formlyUtil.extendArray(things, getThingsFromOptionsTypes(scope.options.optionsTypes));\n\n // get field's things\n things = formlyUtil.extendArray(things, scope.options[which]);\n\n // convert things into formlyExpression things\n _angularFix2['default'].forEach(things, function (thing, index) {\n things[index] = getFormlyExpressionThing(thing);\n });\n\n var ngModelCtrls = scope.fc;\n if (!_angularFix2['default'].isArray(ngModelCtrls)) {\n ngModelCtrls = [ngModelCtrls];\n }\n\n _angularFix2['default'].forEach(ngModelCtrls, function (ngModelCtrl) {\n var _ngModelCtrl;\n\n ngModelCtrl['$' + which] = (_ngModelCtrl = ngModelCtrl['$' + which]).concat.apply(_ngModelCtrl, _toConsumableArray(things));\n });\n\n function getThingsFromType(theType) {\n if (!theType) {\n return [];\n }\n if (_angularFix2['default'].isString(theType)) {\n theType = formlyConfig.getType(theType, true, scope.options);\n }\n var typeThings = [];\n\n // get things from parent\n if (theType['extends']) {\n typeThings = formlyUtil.extendArray(typeThings, getThingsFromType(theType['extends']));\n }\n\n // get own type's things\n typeThings = formlyUtil.extendArray(typeThings, getDefaultOptionsProperty(theType, which, []));\n\n // get things from optionsTypes\n typeThings = formlyUtil.extendArray(typeThings, getThingsFromOptionsTypes(getDefaultOptionsOptionsTypes(theType)));\n\n return typeThings;\n }\n\n function getThingsFromOptionsTypes() {\n var optionsTypes = arguments.length <= 0 || arguments[0] === undefined ? [] : arguments[0];\n\n var optionsTypesThings = [];\n _angularFix2['default'].forEach(_angularFix2['default'].copy(arrayify(optionsTypes)).reverse(), function (optionsTypeName) {\n optionsTypesThings = formlyUtil.extendArray(optionsTypesThings, getThingsFromType(optionsTypeName));\n });\n return optionsTypesThings;\n }\n\n function getFormlyExpressionThing(thing) {\n formlyExpressionParserOrFormatterFunction[originalThingProp] = thing;\n return formlyExpressionParserOrFormatterFunction;\n\n function formlyExpressionParserOrFormatterFunction($viewValue) {\n var $modelValue = scope.options.value();\n return formlyUtil.formlyEval(scope, thing, $modelValue, $viewValue);\n }\n }\n }\n }\n\n function callLinkFunctions() {\n if (type && type.link) {\n type.link.apply(thusly, args);\n }\n if (scope.options.link) {\n scope.options.link.apply(thusly, args);\n }\n }\n\n function runManipulators(manipulators) {\n return function runManipulatorsOnTemplate(templateToManipulate) {\n var chain = $q.when(templateToManipulate);\n _angularFix2['default'].forEach(manipulators, function (manipulator) {\n chain = chain.then(function (template) {\n return $q.when(manipulator(template, scope.options, scope)).then(function (newTemplate) {\n return _angularFix2['default'].isString(newTemplate) ? newTemplate : asHtml(newTemplate);\n });\n });\n });\n return chain;\n };\n }\n }\n\n // sort-of stateless util functions\n function asHtml(el) {\n var wrapper = _angularFix2['default'].element('');\n return wrapper.append(el).html();\n }\n\n function getFieldType(options) {\n return options.type && formlyConfig.getType(options.type);\n }\n\n function getManipulators(options, formOptions) {\n var preWrapper = [];\n var postWrapper = [];\n addManipulators(options.templateManipulators);\n addManipulators(formOptions.templateManipulators);\n addManipulators(formlyConfig.templateManipulators);\n return { preWrapper: preWrapper, postWrapper: postWrapper };\n\n function addManipulators(manipulators) {\n /* eslint-disable */ // it doesn't understand this :-(\n\n var _ref = manipulators || {};\n\n var _ref$preWrapper = _ref.preWrapper;\n var pre = _ref$preWrapper === undefined ? [] : _ref$preWrapper;\n var _ref$postWrapper = _ref.postWrapper;\n var post = _ref$postWrapper === undefined ? [] : _ref$postWrapper;\n\n preWrapper = preWrapper.concat(pre);\n postWrapper = postWrapper.concat(post);\n /* eslint-enable */\n }\n }\n\n function getFieldTemplate(options) {\n function fromOptionsOrType(key, fieldType) {\n if (_angularFix2['default'].isDefined(options[key])) {\n return options[key];\n } else if (fieldType && _angularFix2['default'].isDefined(fieldType[key])) {\n return fieldType[key];\n }\n }\n\n var type = formlyConfig.getType(options.type, true, options);\n var template = fromOptionsOrType('template', type);\n var templateUrl = fromOptionsOrType('templateUrl', type);\n if (_angularFix2['default'].isUndefined(template) && !templateUrl) {\n throw formlyUsability.getFieldError('type-type-has-no-template', 'Type \\'' + options.type + '\\' has no template. On element:', options);\n }\n\n return getTemplate(templateUrl || template, _angularFix2['default'].isUndefined(template), options);\n }\n\n function getTemplate(template, isUrl, options) {\n var templatePromise = undefined;\n if (_angularFix2['default'].isFunction(template)) {\n templatePromise = $q.when(template(options));\n } else {\n templatePromise = $q.when(template);\n }\n\n if (!isUrl) {\n return templatePromise;\n } else {\n var _ret3 = (function () {\n var httpOptions = { cache: $templateCache };\n return {\n v: templatePromise.then(function (url) {\n return $http.get(url, httpOptions);\n }).then(function (response) {\n return response.data;\n })['catch'](function handleErrorGettingATemplate(error) {\n formlyWarn('problem-loading-template-for-templateurl', 'Problem loading template for ' + template, error);\n })\n };\n })();\n\n if (typeof _ret3 === 'object') return _ret3.v;\n }\n }\n\n function transcludeInWrappers(options, formOptions) {\n var wrapper = getWrapperOption(options, formOptions);\n\n return function transcludeTemplate(template) {\n if (!wrapper.length) {\n return $q.when(template);\n }\n\n wrapper.forEach(function (aWrapper) {\n formlyUsability.checkWrapper(aWrapper, options);\n runApiCheck(aWrapper, options);\n });\n var promises = wrapper.map(function (w) {\n return getTemplate(w.template || w.templateUrl, !w.template);\n });\n return $q.all(promises).then(function (wrappersTemplates) {\n wrappersTemplates.forEach(function (wrapperTemplate, index) {\n formlyUsability.checkWrapperTemplate(wrapperTemplate, wrapper[index]);\n });\n wrappersTemplates.reverse(); // wrapper 0 is wrapped in wrapper 1 and so on...\n var totalWrapper = wrappersTemplates.shift();\n wrappersTemplates.forEach(function (wrapperTemplate) {\n totalWrapper = doTransclusion(totalWrapper, wrapperTemplate);\n });\n return doTransclusion(totalWrapper, template);\n });\n };\n }\n\n function doTransclusion(wrapper, template) {\n var superWrapper = _angularFix2['default'].element(''); // this allows people not have to have a single root in wrappers\n superWrapper.append(wrapper);\n var transcludeEl = superWrapper.find('formly-transclude');\n if (!transcludeEl.length) {\n // try it using our custom find function\n transcludeEl = formlyUtil.findByNodeName(superWrapper, 'formly-transclude');\n }\n transcludeEl.replaceWith(template);\n return superWrapper.html();\n }\n\n function getWrapperOption(options, formOptions) {\n /* eslint complexity:[2, 6] */\n var wrapper = options.wrapper;\n // explicit null means no wrapper\n if (wrapper === null) {\n return [];\n }\n\n // nothing specified means use the default wrapper for the type\n if (!wrapper) {\n // get all wrappers that specify they apply to this type\n wrapper = arrayify(formlyConfig.getWrapperByType(options.type));\n } else {\n wrapper = arrayify(wrapper).map(formlyConfig.getWrapper);\n }\n\n // get all wrappers for that the type specified that it uses.\n var type = formlyConfig.getType(options.type, true, options);\n if (type && type.wrapper) {\n var typeWrappers = arrayify(type.wrapper).map(formlyConfig.getWrapper);\n wrapper = wrapper.concat(typeWrappers);\n }\n\n // add form wrappers\n if (formOptions.wrapper) {\n var formWrappers = arrayify(formOptions.wrapper).map(formlyConfig.getWrapper);\n wrapper = wrapper.concat(formWrappers);\n }\n\n // add the default wrapper last\n var defaultWrapper = formlyConfig.getWrapper();\n if (defaultWrapper) {\n wrapper.push(defaultWrapper);\n }\n return wrapper;\n }\n\n function checkApi(options) {\n formlyApiCheck['throw'](formlyApiCheck.formlyFieldOptions, options, {\n prefix: 'formly-field directive',\n url: 'formly-field-directive-validation-failed'\n });\n // validate with the type\n var type = options.type && formlyConfig.getType(options.type);\n if (type) {\n runApiCheck(type, options, true);\n }\n if (options.expressionProperties && options.expressionProperties.hide) {\n formlyWarn('dont-use-expressionproperties.hide-use-hideexpression-instead', 'You have specified `hide` in `expressionProperties`. Use `hideExpression` instead', options);\n }\n }\n\n function checkFieldGroupApi(options) {\n formlyApiCheck['throw'](formlyApiCheck.fieldGroup, options, {\n prefix: 'formly-field directive',\n url: 'formly-field-directive-validation-failed'\n });\n }\n\n function runApiCheck(_ref2, options, forType) {\n var apiCheck = _ref2.apiCheck;\n var apiCheckInstance = _ref2.apiCheckInstance;\n var apiCheckFunction = _ref2.apiCheckFunction;\n var apiCheckOptions = _ref2.apiCheckOptions;\n\n runApiCheckForType(apiCheck, apiCheckInstance, apiCheckFunction, apiCheckOptions, options);\n if (forType && options.type) {\n _angularFix2['default'].forEach(formlyConfig.getTypeHeritage(options.type), function (type) {\n runApiCheckForType(type.apiCheck, type.apiCheckInstance, type.apiCheckFunction, type.apiCheckOptions, options);\n });\n }\n }\n\n function runApiCheckForType(apiCheck, apiCheckInstance, apiCheckFunction, apiCheckOptions, options) {\n /* eslint complexity:[2, 9] */\n if (!apiCheck) {\n return;\n }\n var instance = apiCheckInstance || formlyConfig.extras.apiCheckInstance || formlyApiCheck;\n if (instance.config.disabled || _apiCheck2['default'].globalConfig.disabled) {\n return;\n }\n var fn = apiCheckFunction || 'warn';\n // this is the new API\n var checkerObjects = apiCheck(instance);\n _angularFix2['default'].forEach(checkerObjects, function (shape, name) {\n var checker = instance.shape(shape);\n var checkOptions = _angularFix2['default'].extend({\n prefix: 'formly-field type ' + options.type + ' for property ' + name,\n url: formlyApiCheck.config.output.docsBaseUrl + 'formly-field-type-apicheck-failed'\n }, apiCheckOptions);\n instance[fn](checker, options[name], checkOptions);\n });\n }\n}\n\n// Stateless util functions\nfunction getDefaultOptionsOptionsTypes(type) {\n return getDefaultOptionsProperty(type, 'optionsTypes', []);\n}\n\nfunction getDefaultOptionsProperty(type, prop, defaultValue) {\n return type.defaultOptions && type.defaultOptions[prop] || defaultValue;\n}\nmodule.exports = exports['default'];\n\n\n/** WEBPACK FOOTER **\n ** ./directives/formly-field.js\n **/","import angular from 'angular-fix'\nimport apiCheckFactory from 'api-check'\n\nexport default formlyField\n\n/**\n * @ngdoc directive\n * @name formlyField\n * @restrict AE\n */\n// @ngInject\nfunction formlyField($http, $q, $compile, $templateCache, $interpolate, formlyConfig,\n formlyApiCheck, formlyUtil, formlyUsability, formlyWarn) {\n const {arrayify} = formlyUtil\n\n return {\n restrict: 'AE',\n transclude: true,\n require: '?^formlyForm',\n scope: {\n options: '=',\n model: '=',\n originalModel: '=?',\n formId: '@', // TODO remove formId in a breaking release\n index: '=?',\n fields: '=?',\n formState: '=?',\n formOptions: '=?',\n form: '=?', // TODO require form in a breaking release\n },\n controller: FormlyFieldController,\n link: fieldLink,\n }\n\n\n // @ngInject\n function FormlyFieldController($scope, $timeout, $parse, $controller, formlyValidationMessages) {\n /* eslint max-statements:[2, 34] */\n if ($scope.options.fieldGroup) {\n setupFieldGroup()\n return\n }\n\n const fieldType = getFieldType($scope.options)\n simplifyLife($scope.options)\n mergeFieldOptionsWithTypeDefaults($scope.options, fieldType)\n extendOptionsWithDefaults($scope.options, $scope.index)\n checkApi($scope.options)\n // set field id to link labels and fields\n\n // initalization\n setFieldIdAndName()\n setDefaultValue()\n setInitialValue()\n runExpressions()\n watchExpressions()\n addValidationMessages($scope.options)\n invokeControllers($scope, $scope.options, fieldType)\n\n // function definitions\n function runExpressions() {\n // must run on next tick to make sure that the current value is correct.\n return $timeout(function runExpressionsOnNextTick() {\n const field = $scope.options\n const currentValue = valueGetterSetter()\n angular.forEach(field.expressionProperties, function runExpression(expression, prop) {\n const setter = $parse(prop).assign\n const promise = $q.when(formlyUtil.formlyEval($scope, expression, currentValue, currentValue))\n promise.then(function setFieldValue(value) {\n setter(field, value)\n })\n })\n }, 0, false)\n }\n\n function watchExpressions() {\n if ($scope.formOptions.watchAllExpressions) {\n const field = $scope.options\n const currentValue = valueGetterSetter()\n angular.forEach(field.expressionProperties, function watchExpression(expression, prop) {\n const setter = $parse(prop).assign\n $scope.$watch(function expressionPropertyWatcher() {\n return formlyUtil.formlyEval($scope, expression, currentValue, currentValue)\n }, function expressionPropertyListener(value) {\n setter(field, value)\n }, true)\n })\n }\n }\n\n function valueGetterSetter(newVal) {\n if (!$scope.model || !$scope.options.key) {\n return undefined\n }\n if (angular.isDefined(newVal)) {\n parseSet($scope.options.key, $scope.model, newVal)\n }\n return parseGet($scope.options.key, $scope.model)\n }\n\n function shouldNotUseParseKey(key) {\n return angular.isNumber(key) || !formlyUtil.containsSelector(key)\n }\n\n function parseSet(key, model, newVal) {\n // If either of these are null/undefined then just return undefined\n if (!key || !model) {\n return\n }\n // If we are working with a number then $parse wont work, default back to the old way for now\n if (shouldNotUseParseKey(key)) {\n // TODO: Fix this so we can get several levels instead of just one with properties that are numeric\n model[key] = newVal\n } else {\n const setter = $parse($scope.options.key).assign\n if (setter) {\n setter($scope.model, newVal)\n }\n }\n }\n\n function parseGet(key, model) {\n // If either of these are null/undefined then just return undefined\n if (!key || !model) {\n return undefined\n }\n\n // If we are working with a number then $parse wont work, default back to the old way for now\n if (shouldNotUseParseKey(key)) {\n // TODO: Fix this so we can get several levels instead of just one with properties that are numeric\n return model[key]\n } else {\n return $parse(key)(model)\n }\n }\n\n function simplifyLife(options) {\n // add a few empty objects (if they don't already exist) so you don't have to undefined check everywhere\n formlyUtil.reverseDeepMerge(options, {\n originalModel: options.model,\n extras: {},\n data: {},\n templateOptions: {},\n validation: {},\n })\n // create $scope.to so template authors can reference to instead of $scope.options.templateOptions\n $scope.to = $scope.options.templateOptions\n $scope.formOptions = $scope.formOptions || {}\n }\n\n function setFieldIdAndName() {\n if (angular.isFunction(formlyConfig.extras.getFieldId)) {\n $scope.id = formlyConfig.extras.getFieldId($scope.options, $scope.model, $scope)\n } else {\n const formName = ($scope.form && $scope.form.$name) || $scope.formId\n $scope.id = formlyUtil.getFieldId(formName, $scope.options, $scope.index)\n }\n $scope.options.id = $scope.id\n $scope.name = $scope.options.name || $scope.options.id\n $scope.options.name = $scope.name\n }\n\n function setDefaultValue() {\n if (angular.isDefined($scope.options.defaultValue) &&\n !angular.isDefined(parseGet($scope.options.key, $scope.model))) {\n parseSet($scope.options.key, $scope.model, $scope.options.defaultValue)\n }\n }\n\n function setInitialValue() {\n $scope.options.initialValue = $scope.model && parseGet($scope.options.key, $scope.model)\n }\n\n function mergeFieldOptionsWithTypeDefaults(options, type) {\n if (type) {\n mergeOptions(options, type.defaultOptions)\n }\n const properOrder = arrayify(options.optionsTypes).reverse() // so the right things are overridden\n angular.forEach(properOrder, typeName => {\n mergeOptions(options, formlyConfig.getType(typeName, true, options).defaultOptions)\n })\n }\n\n function mergeOptions(options, extraOptions) {\n if (extraOptions) {\n if (angular.isFunction(extraOptions)) {\n extraOptions = extraOptions(options, $scope)\n }\n formlyUtil.reverseDeepMerge(options, extraOptions)\n }\n }\n\n function extendOptionsWithDefaults(options, index) {\n const key = options.key || index || 0\n angular.extend(options, {\n // attach the key in case the formly-field directive is used directly\n key,\n value: options.value || valueGetterSetter,\n runExpressions,\n resetModel,\n updateInitialValue,\n })\n }\n\n function resetModel() {\n parseSet($scope.options.key, $scope.model, $scope.options.initialValue)\n if ($scope.options.formControl) {\n if (angular.isArray($scope.options.formControl)) {\n angular.forEach($scope.options.formControl, function(formControl) {\n resetFormControl(formControl, true)\n })\n } else {\n resetFormControl($scope.options.formControl)\n }\n }\n if ($scope.form) {\n $scope.form.$setUntouched && $scope.form.$setUntouched()\n $scope.form.$setPristine()\n }\n }\n\n function resetFormControl(formControl, isMultiNgModel) {\n if (!isMultiNgModel) {\n formControl.$setViewValue(parseGet($scope.options.key, $scope.model))\n }\n\n formControl.$render()\n formControl.$setUntouched && formControl.$setUntouched()\n formControl.$setPristine()\n\n // To prevent breaking change requiring a digest to reset $viewModel\n if (!$scope.$root.$$phase) {\n $scope.$digest()\n }\n }\n\n function updateInitialValue() {\n $scope.options.initialValue = parseGet($scope.options.key, $scope.model)\n }\n\n function addValidationMessages(options) {\n options.validation.messages = options.validation.messages || {}\n angular.forEach(formlyValidationMessages.messages, function createFunctionForMessage(expression, name) {\n if (!options.validation.messages[name]) {\n options.validation.messages[name] = function evaluateMessage(viewValue, modelValue, scope) {\n return formlyUtil.formlyEval(scope, expression, modelValue, viewValue)\n }\n }\n })\n }\n\n function invokeControllers(scope, options = {}, type = {}) {\n angular.forEach([type.controller, options.controller], controller => {\n if (controller) {\n $controller(controller, {$scope: scope})\n }\n })\n }\n\n function setupFieldGroup() {\n $scope.options.options = $scope.options.options || {}\n $scope.options.options.formState = $scope.formState\n $scope.to = $scope.options.templateOptions\n }\n }\n\n\n // link function\n function fieldLink(scope, el, attrs, formlyFormCtrl) {\n if (scope.options.fieldGroup) {\n setFieldGroupTemplate()\n return\n }\n\n // watch the field model (if exists) if there is no parent formly-form directive (that would watch it instead)\n if (!formlyFormCtrl && scope.options.model) {\n scope.$watch('options.model', () => scope.options.runExpressions(), true)\n }\n\n addAttributes()\n addClasses()\n\n const type = getFieldType(scope.options)\n const args = arguments\n const thusly = this\n let fieldCount = 0\n const fieldManipulators = getManipulators(scope.options, scope.formOptions)\n getFieldTemplate(scope.options)\n .then(runManipulators(fieldManipulators.preWrapper))\n .then(transcludeInWrappers(scope.options, scope.formOptions))\n .then(runManipulators(fieldManipulators.postWrapper))\n .then(setElementTemplate)\n .then(watchFormControl)\n .then(callLinkFunctions)\n .catch(error => {\n formlyWarn(\n 'there-was-a-problem-setting-the-template-for-this-field',\n 'There was a problem setting the template for this field ',\n scope.options,\n error\n )\n })\n\n function setFieldGroupTemplate() {\n checkFieldGroupApi(scope.options)\n el.addClass('formly-field-group')\n let extraAttributes = ''\n if (scope.options.elementAttributes) {\n extraAttributes = Object.keys(scope.options.elementAttributes).map(key => {\n return `${key}=\"${scope.options.elementAttributes[key]}\"`\n }).join(' ')\n }\n let modelValue = 'model'\n scope.options.form = scope.form\n if (scope.options.key) {\n modelValue = `model['${scope.options.key}']`\n }\n getTemplate(`\n \n \n `)\n .then(transcludeInWrappers(scope.options, scope.formOptions))\n .then(setElementTemplate)\n }\n\n function addAttributes() {\n if (scope.options.elementAttributes) {\n el.attr(scope.options.elementAttributes)\n }\n }\n\n function addClasses() {\n if (scope.options.className) {\n el.addClass(scope.options.className)\n }\n if (scope.options.type) {\n el.addClass(`formly-field-${scope.options.type}`)\n }\n }\n\n function setElementTemplate(templateString) {\n el.html(asHtml(templateString))\n $compile(el.contents())(scope)\n return templateString\n }\n\n function watchFormControl(templateString) {\n let stopWatchingShowError = angular.noop\n if (scope.options.noFormControl) {\n return\n }\n const templateEl = angular.element(`
${templateString}
`)\n const ngModelNodes = templateEl[0].querySelectorAll('[ng-model],[data-ng-model]')\n\n\n if (ngModelNodes.length) {\n angular.forEach(ngModelNodes, function(ngModelNode) {\n fieldCount++\n watchFieldNameOrExistence(ngModelNode.getAttribute('name'))\n })\n }\n\n function watchFieldNameOrExistence(name) {\n const nameExpressionRegex = /\\{\\{(.*?)}}/\n const nameExpression = nameExpressionRegex.exec(name)\n if (nameExpression) {\n name = $interpolate(name)(scope)\n }\n watchFieldExistence(name)\n }\n\n function watchFieldExistence(name) {\n scope.$watch(`form[\"${name}\"]`, function formControlChange(formControl) {\n if (formControl) {\n if (fieldCount > 1) {\n if (!scope.options.formControl) {\n scope.options.formControl = []\n }\n scope.options.formControl.push(formControl)\n } else {\n scope.options.formControl = formControl\n }\n scope.fc = scope.options.formControl // shortcut for template authors\n stopWatchingShowError()\n addShowMessagesWatcher()\n addParsers()\n addFormatters()\n }\n })\n }\n\n function addShowMessagesWatcher() {\n stopWatchingShowError = scope.$watch(function watchShowValidationChange() {\n const customExpression = formlyConfig.extras.errorExistsAndShouldBeVisibleExpression\n const options = scope.options\n const formControls = arrayify(scope.fc)\n if (!formControls.some(fc => fc.$invalid)) {\n return false\n } else if (typeof options.validation.show === 'boolean') {\n return options.validation.show\n } else if (customExpression) {\n return formControls.some(fc =>\n formlyUtil.formlyEval(scope, customExpression, fc.$modelValue, fc.$viewValue))\n } else {\n return formControls.some(fc => {\n const noTouchedButDirty = (angular.isUndefined(fc.$touched) && fc.$dirty)\n return (fc.$touched || noTouchedButDirty)\n })\n }\n }, function onShowValidationChange(show) {\n scope.options.validation.errorExistsAndShouldBeVisible = show\n scope.showError = show // shortcut for template authors\n })\n }\n\n function addParsers() {\n setParsersOrFormatters('parsers')\n }\n\n function addFormatters() {\n setParsersOrFormatters('formatters')\n const ctrl = scope.fc\n const formWasPristine = scope.form.$pristine\n if (scope.options.formatters) {\n let value = ctrl.$modelValue\n ctrl.$formatters.forEach((formatter) => {\n value = formatter(value)\n })\n\n ctrl.$setViewValue(value)\n ctrl.$render()\n ctrl.$setPristine()\n if (formWasPristine) {\n scope.form.$setPristine()\n }\n }\n }\n\n function setParsersOrFormatters(which) {\n let originalThingProp = 'originalParser'\n if (which === 'formatters') {\n originalThingProp = 'originalFormatter'\n }\n\n // init with type's parsers\n let things = getThingsFromType(type)\n\n // get optionsTypes things\n things = formlyUtil.extendArray(things, getThingsFromOptionsTypes(scope.options.optionsTypes))\n\n // get field's things\n things = formlyUtil.extendArray(things, scope.options[which])\n\n // convert things into formlyExpression things\n angular.forEach(things, (thing, index) => {\n things[index] = getFormlyExpressionThing(thing)\n })\n\n let ngModelCtrls = scope.fc\n if (!angular.isArray(ngModelCtrls)) {\n ngModelCtrls = [ngModelCtrls]\n }\n\n angular.forEach(ngModelCtrls, ngModelCtrl => {\n ngModelCtrl['$' + which] = ngModelCtrl['$' + which].concat(...things)\n })\n\n function getThingsFromType(theType) {\n if (!theType) {\n return []\n }\n if (angular.isString(theType)) {\n theType = formlyConfig.getType(theType, true, scope.options)\n }\n let typeThings = []\n\n // get things from parent\n if (theType.extends) {\n typeThings = formlyUtil.extendArray(typeThings, getThingsFromType(theType.extends))\n }\n\n // get own type's things\n typeThings = formlyUtil.extendArray(typeThings, getDefaultOptionsProperty(theType, which, []))\n\n // get things from optionsTypes\n typeThings = formlyUtil.extendArray(\n typeThings,\n getThingsFromOptionsTypes(getDefaultOptionsOptionsTypes(theType))\n )\n\n return typeThings\n }\n\n function getThingsFromOptionsTypes(optionsTypes = []) {\n let optionsTypesThings = []\n angular.forEach(angular.copy(arrayify(optionsTypes)).reverse(), optionsTypeName => {\n optionsTypesThings = formlyUtil.extendArray(optionsTypesThings, getThingsFromType(optionsTypeName))\n })\n return optionsTypesThings\n }\n\n function getFormlyExpressionThing(thing) {\n formlyExpressionParserOrFormatterFunction[originalThingProp] = thing\n return formlyExpressionParserOrFormatterFunction\n\n function formlyExpressionParserOrFormatterFunction($viewValue) {\n const $modelValue = scope.options.value()\n return formlyUtil.formlyEval(scope, thing, $modelValue, $viewValue)\n }\n }\n\n }\n }\n\n function callLinkFunctions() {\n if (type && type.link) {\n type.link.apply(thusly, args)\n }\n if (scope.options.link) {\n scope.options.link.apply(thusly, args)\n }\n }\n\n\n function runManipulators(manipulators) {\n return function runManipulatorsOnTemplate(templateToManipulate) {\n let chain = $q.when(templateToManipulate)\n angular.forEach(manipulators, manipulator => {\n chain = chain.then(template => {\n return $q.when(manipulator(template, scope.options, scope)).then(newTemplate => {\n return angular.isString(newTemplate) ? newTemplate : asHtml(newTemplate)\n })\n })\n })\n return chain\n }\n }\n }\n\n // sort-of stateless util functions\n function asHtml(el) {\n const wrapper = angular.element('')\n return wrapper.append(el).html()\n }\n\n function getFieldType(options) {\n return options.type && formlyConfig.getType(options.type)\n }\n\n function getManipulators(options, formOptions) {\n let preWrapper = []\n let postWrapper = []\n addManipulators(options.templateManipulators)\n addManipulators(formOptions.templateManipulators)\n addManipulators(formlyConfig.templateManipulators)\n return {preWrapper, postWrapper}\n\n function addManipulators(manipulators) {\n /* eslint-disable */ // it doesn't understand this :-(\n const {preWrapper:pre = [], postWrapper:post = []} = (manipulators || {});\n preWrapper = preWrapper.concat(pre);\n postWrapper = postWrapper.concat(post);\n /* eslint-enable */\n }\n }\n\n function getFieldTemplate(options) {\n function fromOptionsOrType(key, fieldType) {\n if (angular.isDefined(options[key])) {\n return options[key]\n } else if (fieldType && angular.isDefined(fieldType[key])) {\n return fieldType[key]\n }\n }\n\n const type = formlyConfig.getType(options.type, true, options)\n const template = fromOptionsOrType('template', type)\n const templateUrl = fromOptionsOrType('templateUrl', type)\n if (angular.isUndefined(template) && !templateUrl) {\n throw formlyUsability.getFieldError(\n 'type-type-has-no-template',\n `Type '${options.type}' has no template. On element:`, options\n )\n }\n\n return getTemplate(templateUrl || template, angular.isUndefined(template), options)\n }\n\n\n function getTemplate(template, isUrl, options) {\n let templatePromise\n if (angular.isFunction(template)) {\n templatePromise = $q.when(template(options))\n } else {\n templatePromise = $q.when(template)\n }\n\n if (!isUrl) {\n return templatePromise\n } else {\n const httpOptions = {cache: $templateCache}\n return templatePromise\n .then((url) => $http.get(url, httpOptions))\n .then((response) => response.data)\n .catch(function handleErrorGettingATemplate(error) {\n formlyWarn(\n 'problem-loading-template-for-templateurl',\n 'Problem loading template for ' + template,\n error\n )\n })\n }\n }\n\n function transcludeInWrappers(options, formOptions) {\n const wrapper = getWrapperOption(options, formOptions)\n\n return function transcludeTemplate(template) {\n if (!wrapper.length) {\n return $q.when(template)\n }\n\n wrapper.forEach((aWrapper) => {\n formlyUsability.checkWrapper(aWrapper, options)\n runApiCheck(aWrapper, options)\n })\n const promises = wrapper.map(w => getTemplate(w.template || w.templateUrl, !w.template))\n return $q.all(promises).then(wrappersTemplates => {\n wrappersTemplates.forEach((wrapperTemplate, index) => {\n formlyUsability.checkWrapperTemplate(wrapperTemplate, wrapper[index])\n })\n wrappersTemplates.reverse() // wrapper 0 is wrapped in wrapper 1 and so on...\n let totalWrapper = wrappersTemplates.shift()\n wrappersTemplates.forEach(wrapperTemplate => {\n totalWrapper = doTransclusion(totalWrapper, wrapperTemplate)\n })\n return doTransclusion(totalWrapper, template)\n })\n }\n }\n\n function doTransclusion(wrapper, template) {\n const superWrapper = angular.element('') // this allows people not have to have a single root in wrappers\n superWrapper.append(wrapper)\n let transcludeEl = superWrapper.find('formly-transclude')\n if (!transcludeEl.length) {\n // try it using our custom find function\n transcludeEl = formlyUtil.findByNodeName(superWrapper, 'formly-transclude')\n }\n transcludeEl.replaceWith(template)\n return superWrapper.html()\n }\n\n function getWrapperOption(options, formOptions) {\n /* eslint complexity:[2, 6] */\n let wrapper = options.wrapper\n // explicit null means no wrapper\n if (wrapper === null) {\n return []\n }\n\n // nothing specified means use the default wrapper for the type\n if (!wrapper) {\n // get all wrappers that specify they apply to this type\n wrapper = arrayify(formlyConfig.getWrapperByType(options.type))\n } else {\n wrapper = arrayify(wrapper).map(formlyConfig.getWrapper)\n }\n\n // get all wrappers for that the type specified that it uses.\n const type = formlyConfig.getType(options.type, true, options)\n if (type && type.wrapper) {\n const typeWrappers = arrayify(type.wrapper).map(formlyConfig.getWrapper)\n wrapper = wrapper.concat(typeWrappers)\n }\n\n // add form wrappers\n if (formOptions.wrapper) {\n const formWrappers = arrayify(formOptions.wrapper).map(formlyConfig.getWrapper)\n wrapper = wrapper.concat(formWrappers)\n }\n\n // add the default wrapper last\n const defaultWrapper = formlyConfig.getWrapper()\n if (defaultWrapper) {\n wrapper.push(defaultWrapper)\n }\n return wrapper\n }\n\n function checkApi(options) {\n formlyApiCheck.throw(formlyApiCheck.formlyFieldOptions, options, {\n prefix: 'formly-field directive',\n url: 'formly-field-directive-validation-failed',\n })\n // validate with the type\n const type = options.type && formlyConfig.getType(options.type)\n if (type) {\n runApiCheck(type, options, true)\n }\n if (options.expressionProperties && options.expressionProperties.hide) {\n formlyWarn(\n 'dont-use-expressionproperties.hide-use-hideexpression-instead',\n 'You have specified `hide` in `expressionProperties`. Use `hideExpression` instead',\n options\n )\n }\n }\n\n function checkFieldGroupApi(options) {\n formlyApiCheck.throw(formlyApiCheck.fieldGroup, options, {\n prefix: 'formly-field directive',\n url: 'formly-field-directive-validation-failed',\n })\n }\n\n function runApiCheck({apiCheck, apiCheckInstance, apiCheckFunction, apiCheckOptions}, options, forType) {\n runApiCheckForType(apiCheck, apiCheckInstance, apiCheckFunction, apiCheckOptions, options)\n if (forType && options.type) {\n angular.forEach(formlyConfig.getTypeHeritage(options.type), function(type) {\n runApiCheckForType(type.apiCheck, type.apiCheckInstance, type.apiCheckFunction, type.apiCheckOptions, options)\n })\n }\n }\n\n function runApiCheckForType(apiCheck, apiCheckInstance, apiCheckFunction, apiCheckOptions, options) {\n /* eslint complexity:[2, 9] */\n if (!apiCheck) {\n return\n }\n const instance = apiCheckInstance || formlyConfig.extras.apiCheckInstance || formlyApiCheck\n if (instance.config.disabled || apiCheckFactory.globalConfig.disabled) {\n return\n }\n const fn = apiCheckFunction || 'warn'\n // this is the new API\n const checkerObjects = apiCheck(instance)\n angular.forEach(checkerObjects, (shape, name) => {\n const checker = instance.shape(shape)\n const checkOptions = angular.extend({\n prefix: `formly-field type ${options.type} for property ${name}`,\n url: formlyApiCheck.config.output.docsBaseUrl + 'formly-field-type-apicheck-failed',\n }, apiCheckOptions)\n instance[fn](checker, options[name], checkOptions)\n })\n }\n\n\n}\n\n\n// Stateless util functions\nfunction getDefaultOptionsOptionsTypes(type) {\n return getDefaultOptionsProperty(type, 'optionsTypes', [])\n}\n\nfunction getDefaultOptionsProperty(type, prop, defaultValue) {\n return type.defaultOptions && type.defaultOptions[prop] || defaultValue\n}\n\n\n\n/** WEBPACK FOOTER **\n ** C:/Projects/personal/angular-formly/~/eslint-loader?configFile=./other/src.eslintrc!C:/Projects/personal/angular-formly/src/directives/formly-field.js\n **/","'use strict';\n\nObject.defineProperty(exports, '__esModule', {\n value: true\n});\nexports['default'] = formlyFocus;\n\n// @ngInject\nfunction formlyFocus($timeout, $document) {\n return {\n restrict: 'A',\n link: function formlyFocusLink(scope, element, attrs) {\n var previousEl = null;\n var el = element[0];\n var doc = $document[0];\n attrs.$observe('formlyFocus', function respondToFocusExpressionChange(value) {\n /* eslint no-bitwise:0 */ // I know what I'm doing. I promise...\n if (value === 'true') {\n $timeout(function setElementFocus() {\n previousEl = doc.activeElement;\n el.focus();\n }, ~ ~attrs.focusWait);\n } else if (value === 'false') {\n if (doc.activeElement === el) {\n el.blur();\n if (attrs.hasOwnProperty('refocus') && previousEl) {\n previousEl.focus();\n }\n }\n }\n });\n }\n };\n}\nmodule.exports = exports['default'];\n\n\n/** WEBPACK FOOTER **\n ** ./directives/formly-focus.js\n **/","export default formlyFocus\n\n// @ngInject\nfunction formlyFocus($timeout, $document) {\n return {\n restrict: 'A',\n link: function formlyFocusLink(scope, element, attrs) {\n let previousEl = null\n const el = element[0]\n const doc = $document[0]\n attrs.$observe('formlyFocus', function respondToFocusExpressionChange(value) {\n /* eslint no-bitwise:0 */ // I know what I'm doing. I promise...\n if (value === 'true') {\n $timeout(function setElementFocus() {\n previousEl = doc.activeElement\n el.focus()\n }, ~~attrs.focusWait)\n } else if (value === 'false') {\n if (doc.activeElement === el) {\n el.blur()\n if (attrs.hasOwnProperty('refocus') && previousEl) {\n previousEl.focus()\n }\n }\n }\n })\n },\n }\n}\n\n\n\n/** WEBPACK FOOTER **\n ** C:/Projects/personal/angular-formly/~/eslint-loader?configFile=./other/src.eslintrc!C:/Projects/personal/angular-formly/src/directives/formly-focus.js\n **/","'use strict';\n\nObject.defineProperty(exports, '__esModule', {\n value: true\n});\nvar _slice = Array.prototype.slice;\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\nfunction _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) arr2[i] = arr[i]; return arr2; } else { return Array.from(arr); } }\n\nvar _angularFix = require('angular-fix');\n\nvar _angularFix2 = _interopRequireDefault(_angularFix);\n\nexports['default'] = formlyForm;\n\n/**\n * @ngdoc directive\n * @name formlyForm\n * @restrict AE\n */\n// @ngInject\nfunction formlyForm(formlyUsability, formlyWarn, $parse, formlyConfig, $interpolate) {\n var currentFormId = 1;\n return {\n restrict: 'AE',\n template: formlyFormGetTemplate,\n replace: true,\n transclude: true,\n scope: {\n fields: '=',\n model: '=',\n form: '=?',\n options: '=?'\n },\n controller: FormlyFormController,\n link: formlyFormLink\n };\n\n function formlyFormGetTemplate(el, attrs) {\n var rootEl = getRootEl();\n var fieldRootEl = getFieldRootEl();\n var formId = 'formly_' + currentFormId++;\n var parentFormAttributes = '';\n if (attrs.hasOwnProperty('isFieldGroup') && el.parent().parent().hasClass('formly')) {\n parentFormAttributes = copyAttributes(el.parent().parent()[0].attributes);\n }\n return '\\n <' + rootEl + ' class=\"formly\"\\n name=\"' + getFormName() + '\"\\n role=\"form\" ' + parentFormAttributes + '>\\n <' + fieldRootEl + ' formly-field\\n ng-repeat=\"field in fields ' + getTrackBy() + '\"\\n ' + getHideDirective() + '=\"!field.hide\"\\n class=\"formly-field\"\\n options=\"field\"\\n model=\"field.model\"\\n original-model=\"model\"\\n fields=\"fields\"\\n form=\"theFormlyForm\"\\n form-id=\"' + getFormName() + '\"\\n form-state=\"options.formState\"\\n form-options=\"options\"\\n index=\"$index\">\\n \\n
\\n \\n ';\n\n function getRootEl() {\n return attrs.rootEl || 'ng-form';\n }\n\n function getFieldRootEl() {\n return attrs.fieldRootEl || 'div';\n }\n\n function getHideDirective() {\n return attrs.hideDirective || formlyConfig.extras.defaultHideDirective || 'ng-if';\n }\n\n function getTrackBy() {\n if (!attrs.trackBy) {\n return '';\n } else {\n return 'track by ' + attrs.trackBy;\n }\n }\n\n function getFormName() {\n var formName = formId;\n var bindName = attrs.bindName;\n if (bindName) {\n if (_angularFix2['default'].version.minor < 3) {\n throw formlyUsability.getFormlyError('bind-name attribute on formly-form not allowed in < angular 1.3');\n }\n // we can do a one-time binding here because we know we're in 1.3.x territory\n formName = $interpolate.startSymbol() + '::\\'formly_\\' + ' + bindName + $interpolate.endSymbol();\n }\n return formName;\n }\n\n function getTranscludeClass() {\n return attrs.transcludeClass || '';\n }\n\n function copyAttributes(attributes) {\n var excluded = ['model', 'form', 'fields', 'options', 'name', 'role', 'class', 'data-model', 'data-form', 'data-fields', 'data-options', 'data-name'];\n var arrayAttrs = [];\n _angularFix2['default'].forEach(attributes, function (_ref) {\n var nodeName = _ref.nodeName;\n var value = _ref.value;\n\n if (nodeName !== 'undefined' && excluded.indexOf(nodeName) === -1) {\n arrayAttrs.push(toKebabCase(nodeName) + '=\"' + value + '\"');\n }\n });\n return arrayAttrs.join(' ');\n }\n }\n\n // @ngInject\n function FormlyFormController($scope, formlyApiCheck, formlyUtil) {\n setupOptions();\n $scope.model = $scope.model || {};\n setupFields();\n\n // watch the model and evaluate watch expressions that depend on it.\n if (!$scope.options.manualModelWatcher) {\n $scope.$watch('model', onModelOrFormStateChange, true);\n } else if (_angularFix2['default'].isFunction($scope.options.manualModelWatcher)) {\n $scope.$watch($scope.options.manualModelWatcher, onModelOrFormStateChange, true);\n }\n\n if ($scope.options.formState) {\n $scope.$watch('options.formState', onModelOrFormStateChange, true);\n }\n\n function onModelOrFormStateChange() {\n _angularFix2['default'].forEach($scope.fields, runFieldExpressionProperties);\n }\n\n function validateFormControl(formControl, promise) {\n var validate = formControl.$validate;\n if (promise) {\n promise.then(validate);\n } else {\n validate();\n }\n }\n\n function runFieldExpressionProperties(field, index) {\n var model = field.model || $scope.model;\n var promise = field.runExpressions && field.runExpressions();\n if (field.hideExpression) {\n // can't use hide with expressionProperties reliably\n var val = model[field.key];\n field.hide = evalCloseToFormlyExpression(field.hideExpression, val, field, index);\n }\n if (field.extras && field.extras.validateOnModelChange && field.formControl) {\n if (_angularFix2['default'].isArray(field.formControl)) {\n _angularFix2['default'].forEach(field.formControl, function (formControl) {\n validateFormControl(formControl, promise);\n });\n } else {\n validateFormControl(field.formControl, promise);\n }\n }\n }\n\n function setupFields() {\n $scope.fields = $scope.fields || [];\n\n checkDeprecatedOptions($scope.options);\n\n var fieldTransforms = $scope.options.fieldTransform || formlyConfig.extras.fieldTransform;\n\n if (!_angularFix2['default'].isArray(fieldTransforms)) {\n fieldTransforms = [fieldTransforms];\n }\n\n _angularFix2['default'].forEach(fieldTransforms, function transformFields(fieldTransform) {\n if (fieldTransform) {\n $scope.fields = fieldTransform($scope.fields, $scope.model, $scope.options, $scope.form);\n if (!$scope.fields) {\n throw formlyUsability.getFormlyError('fieldTransform must return an array of fields');\n }\n }\n });\n\n setupModels();\n\n if ($scope.options.watchAllExpressions) {\n _angularFix2['default'].forEach($scope.fields, setupHideExpressionWatcher);\n }\n\n _angularFix2['default'].forEach($scope.fields, attachKey); // attaches a key based on the index if a key isn't specified\n _angularFix2['default'].forEach($scope.fields, setupWatchers); // setup watchers for all fields\n }\n\n function checkDeprecatedOptions(options) {\n if (formlyConfig.extras.fieldTransform && _angularFix2['default'].isFunction(formlyConfig.extras.fieldTransform)) {\n formlyWarn('fieldtransform-as-a-function-deprecated', 'fieldTransform as a function has been deprecated.', 'Attempted for formlyConfig.extras: ' + formlyConfig.extras.fieldTransform.name, formlyConfig.extras);\n } else if (options.fieldTransform && _angularFix2['default'].isFunction(options.fieldTransform)) {\n formlyWarn('fieldtransform-as-a-function-deprecated', 'fieldTransform as a function has been deprecated.', 'Attempted for form', options);\n }\n }\n\n function setupOptions() {\n formlyApiCheck['throw']([formlyApiCheck.formOptionsApi.optional], [$scope.options], { prefix: 'formly-form options check' });\n $scope.options = $scope.options || {};\n $scope.options.formState = $scope.options.formState || {};\n\n _angularFix2['default'].extend($scope.options, {\n updateInitialValue: updateInitialValue,\n resetModel: resetModel\n });\n }\n\n function updateInitialValue() {\n _angularFix2['default'].forEach($scope.fields, function (field) {\n if (isFieldGroup(field) && field.options) {\n field.options.updateInitialValue();\n } else {\n field.updateInitialValue();\n }\n });\n }\n\n function resetModel() {\n _angularFix2['default'].forEach($scope.fields, function (field) {\n if (isFieldGroup(field) && field.options) {\n field.options.resetModel();\n } else if (field.resetModel) {\n field.resetModel();\n }\n });\n }\n\n function setupModels() {\n // a set of field models that are already watched (the $scope.model will have its own watcher)\n var watchedModels = [$scope.model];\n // we will not set up automatic model watchers if manual mode is set\n var manualModelWatcher = $scope.options.manualModelWatcher;\n\n if ($scope.options.formState) {\n // $scope.options.formState will have its own watcher\n watchedModels.push($scope.options.formState);\n }\n\n _angularFix2['default'].forEach($scope.fields, function (field) {\n var isNewModel = initModel(field);\n\n if (field.model && isNewModel && watchedModels.indexOf(field.model) === -1 && !manualModelWatcher) {\n $scope.$watch(function () {\n return field.model;\n }, onModelOrFormStateChange, true);\n watchedModels.push(field.model);\n }\n });\n }\n\n function setupHideExpressionWatcher(field, index) {\n if (field.hideExpression) {\n (function () {\n // can't use hide with expressionProperties reliably\n var model = field.model || $scope.model;\n $scope.$watch(function hideExpressionWatcher() {\n var val = model[field.key];\n return evalCloseToFormlyExpression(field.hideExpression, val, field, index);\n }, function (hide) {\n return field.hide = hide;\n }, true);\n })();\n }\n }\n\n function initModel(field) {\n var isNewModel = true;\n\n if (_angularFix2['default'].isString(field.model)) {\n (function () {\n var expression = field.model;\n\n isNewModel = !referencesCurrentlyWatchedModel(expression);\n\n field.model = resolveStringModel(expression);\n\n $scope.$watch(function () {\n return resolveStringModel(expression);\n }, function (model) {\n return field.model = model;\n });\n })();\n } else if (!field.model) {\n field.model = $scope.model;\n }\n return isNewModel;\n\n function resolveStringModel(expression) {\n var index = $scope.fields.indexOf(field);\n var model = evalCloseToFormlyExpression(expression, undefined, field, index, { model: $scope.model });\n\n if (!model) {\n throw formlyUsability.getFieldError('field-model-must-be-initialized', 'Field model must be initialized. When specifying a model as a string for a field, the result of the' + ' expression must have been initialized ahead of time.', field);\n }\n\n return model;\n }\n }\n\n function referencesCurrentlyWatchedModel(expression) {\n return ['model', 'formState'].some(function (item) {\n return formlyUtil.startsWith(expression, item + '.') || formlyUtil.startsWith(expression, item + '[');\n });\n }\n\n function attachKey(field, index) {\n if (!isFieldGroup(field)) {\n field.key = field.key || index || 0;\n }\n }\n\n function setupWatchers(field, index) {\n if (!_angularFix2['default'].isDefined(field.watcher)) {\n return;\n }\n var watchers = field.watcher;\n if (!_angularFix2['default'].isArray(watchers)) {\n watchers = [watchers];\n }\n _angularFix2['default'].forEach(watchers, function setupWatcher(watcher) {\n if (!_angularFix2['default'].isDefined(watcher.listener) && !watcher.runFieldExpressions) {\n throw formlyUsability.getFieldError('all-field-watchers-must-have-a-listener', 'All field watchers must have a listener', field);\n }\n var watchExpression = getWatchExpression(watcher, field, index);\n var watchListener = getWatchListener(watcher, field, index);\n\n var type = watcher.type || '$watch';\n watcher.stopWatching = $scope[type](watchExpression, watchListener, watcher.watchDeep);\n });\n }\n\n function getWatchExpression(watcher, field, index) {\n var watchExpression = undefined;\n if (!_angularFix2['default'].isUndefined(watcher.expression)) {\n watchExpression = watcher.expression;\n } else if (field.key) {\n watchExpression = 'model[\\'' + field.key.toString().split('.').join('\\'][\\'') + '\\']';\n }\n if (_angularFix2['default'].isFunction(watchExpression)) {\n (function () {\n // wrap the field's watch expression so we can call it with the field as the first arg\n // and the stop function as the last arg as a helper\n var originalExpression = watchExpression;\n watchExpression = function formlyWatchExpression() {\n var args = modifyArgs.apply(undefined, [watcher, index].concat(_slice.call(arguments)));\n return originalExpression.apply(undefined, _toConsumableArray(args));\n };\n watchExpression.displayName = 'Formly Watch Expression for field for ' + field.key;\n })();\n } else if (field.model) {\n watchExpression = $parse(watchExpression).bind(null, $scope, { model: field.model });\n }\n return watchExpression;\n }\n\n function getWatchListener(watcher, field, index) {\n var watchListener = watcher.listener;\n if (_angularFix2['default'].isFunction(watchListener) || watcher.runFieldExpressions) {\n (function () {\n // wrap the field's watch listener so we can call it with the field as the first arg\n // and the stop function as the last arg as a helper\n var originalListener = watchListener;\n watchListener = function formlyWatchListener() {\n var value = undefined;\n if (originalListener) {\n var args = modifyArgs.apply(undefined, [watcher, index].concat(_slice.call(arguments)));\n value = originalListener.apply(undefined, _toConsumableArray(args));\n }\n if (watcher.runFieldExpressions) {\n runFieldExpressionProperties(field, index);\n }\n return value;\n };\n watchListener.displayName = 'Formly Watch Listener for field for ' + field.key;\n })();\n }\n return watchListener;\n }\n\n function modifyArgs(watcher, index) {\n for (var _len = arguments.length, originalArgs = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {\n originalArgs[_key - 2] = arguments[_key];\n }\n\n return [$scope.fields[index]].concat(originalArgs, [watcher.stopWatching]);\n }\n\n function evalCloseToFormlyExpression(expression, val, field, index) {\n var extraLocals = arguments.length <= 4 || arguments[4] === undefined ? {} : arguments[4];\n\n extraLocals = _angularFix2['default'].extend(getFormlyFieldLikeLocals(field, index), extraLocals);\n return formlyUtil.formlyEval($scope, expression, val, val, extraLocals);\n }\n\n function getFormlyFieldLikeLocals(field, index) {\n // this makes it closer to what a regular formlyExpression would be\n return {\n model: field.model,\n options: field,\n index: index,\n formState: $scope.options.formState,\n originalModel: $scope.model,\n formOptions: $scope.options,\n formId: $scope.formId\n };\n }\n }\n\n function formlyFormLink(scope, el, attrs) {\n setFormController();\n fixChromeAutocomplete();\n\n function setFormController() {\n var formId = attrs.name;\n scope.formId = formId;\n scope.theFormlyForm = scope[formId];\n if (attrs.form) {\n var getter = $parse(attrs.form);\n var setter = getter.assign;\n var parentForm = getter(scope.$parent);\n if (parentForm) {\n scope.theFormlyForm = parentForm;\n if (scope[formId]) {\n scope.theFormlyForm.$removeControl(scope[formId]);\n }\n\n // this next line is probably one of the more dangerous things that angular-formly does to improve the\n // API for angular-formly forms. It ensures that the NgModelControllers inside of formly-form will be\n // attached to the form that is passed to formly-form rather than the one that formly-form creates\n // this is necessary because it's confusing to have a step between the form you pass in\n // and the fields in that form. It also is because angular doesn't propagate properties like $submitted down\n // to children forms :-( This line was added to solve this issue:\n // https://github.com/formly-js/angular-formly/issues/287\n // luckily, this is how the formController has been accessed by the NgModelController since angular 1.0.0\n // so I expect it will remain this way for the life of angular 1.x\n el.removeData('$formController');\n } else {\n setter(scope.$parent, scope[formId]);\n }\n }\n if (!scope.theFormlyForm && !formlyConfig.disableWarnings) {\n /* eslint no-console:0 */\n formlyWarn('formly-form-has-no-formcontroller', 'Your formly-form does not have a `form` property. Many functions of the form (like validation) may not work', el, scope);\n }\n }\n\n /*\n * chrome autocomplete lameness\n * see https://code.google.com/p/chromium/issues/detail?id=468153#c14\n * ლ(ಠ益ಠლ) (╯°□°)╯︵ ┻━┻ (◞‸◟;)\n */\n function fixChromeAutocomplete() {\n var global = formlyConfig.extras.removeChromeAutoComplete === true;\n var offInstance = scope.options && scope.options.removeChromeAutoComplete === false;\n var onInstance = scope.options && scope.options.removeChromeAutoComplete === true;\n if (global && !offInstance || onInstance) {\n var input = document.createElement('input');\n input.setAttribute('autocomplete', 'address-level4');\n input.setAttribute('hidden', 'true');\n el[0].appendChild(input);\n }\n }\n }\n\n // stateless util functions\n function toKebabCase(string) {\n if (string) {\n return string.replace(/([A-Z])/g, function ($1) {\n return '-' + $1.toLowerCase();\n });\n } else {\n return '';\n }\n }\n\n function isFieldGroup(field) {\n return field && !!field.fieldGroup;\n }\n}\nmodule.exports = exports['default'];\n\n\n/** WEBPACK FOOTER **\n ** ./directives/formly-form.js\n **/","import angular from 'angular-fix'\n\nexport default formlyForm\n\n/**\n * @ngdoc directive\n * @name formlyForm\n * @restrict AE\n */\n// @ngInject\nfunction formlyForm(formlyUsability, formlyWarn, $parse, formlyConfig, $interpolate) {\n let currentFormId = 1\n return {\n restrict: 'AE',\n template: formlyFormGetTemplate,\n replace: true,\n transclude: true,\n scope: {\n fields: '=',\n model: '=',\n form: '=?',\n options: '=?',\n },\n controller: FormlyFormController,\n link: formlyFormLink,\n }\n\n function formlyFormGetTemplate(el, attrs) {\n const rootEl = getRootEl()\n const fieldRootEl = getFieldRootEl()\n const formId = `formly_${currentFormId++}`\n let parentFormAttributes = ''\n if (attrs.hasOwnProperty('isFieldGroup') && el.parent().parent().hasClass('formly')) {\n parentFormAttributes = copyAttributes(el.parent().parent()[0].attributes)\n }\n return `\n <${rootEl} class=\"formly\"\n name=\"${getFormName()}\"\n role=\"form\" ${parentFormAttributes}>\n <${fieldRootEl} formly-field\n ng-repeat=\"field in fields ${getTrackBy()}\"\n ${getHideDirective()}=\"!field.hide\"\n class=\"formly-field\"\n options=\"field\"\n model=\"field.model\"\n original-model=\"model\"\n fields=\"fields\"\n form=\"theFormlyForm\"\n form-id=\"${getFormName()}\"\n form-state=\"options.formState\"\n form-options=\"options\"\n index=\"$index\">\n \n
\n \n `\n\n function getRootEl() {\n return attrs.rootEl || 'ng-form'\n }\n\n function getFieldRootEl() {\n return attrs.fieldRootEl || 'div'\n }\n\n function getHideDirective() {\n return attrs.hideDirective || formlyConfig.extras.defaultHideDirective || 'ng-if'\n }\n\n function getTrackBy() {\n if (!attrs.trackBy) {\n return ''\n } else {\n return `track by ${attrs.trackBy}`\n }\n }\n\n function getFormName() {\n let formName = formId\n const bindName = attrs.bindName\n if (bindName) {\n if (angular.version.minor < 3) {\n throw formlyUsability.getFormlyError('bind-name attribute on formly-form not allowed in < angular 1.3')\n }\n // we can do a one-time binding here because we know we're in 1.3.x territory\n formName = `${$interpolate.startSymbol()}::'formly_' + ${bindName}${$interpolate.endSymbol()}`\n }\n return formName\n }\n\n function getTranscludeClass() {\n return attrs.transcludeClass || ''\n }\n\n function copyAttributes(attributes) {\n const excluded = ['model', 'form', 'fields', 'options', 'name', 'role', 'class',\n 'data-model', 'data-form', 'data-fields', 'data-options', 'data-name']\n const arrayAttrs = []\n angular.forEach(attributes, ({nodeName, value}) => {\n if (nodeName !== 'undefined' && excluded.indexOf(nodeName) === -1) {\n arrayAttrs.push(`${toKebabCase(nodeName)}=\"${value}\"`)\n }\n })\n return arrayAttrs.join(' ')\n }\n }\n\n // @ngInject\n function FormlyFormController($scope, formlyApiCheck, formlyUtil) {\n setupOptions()\n $scope.model = $scope.model || {}\n setupFields()\n\n // watch the model and evaluate watch expressions that depend on it.\n if (!$scope.options.manualModelWatcher) {\n $scope.$watch('model', onModelOrFormStateChange, true)\n } else if (angular.isFunction($scope.options.manualModelWatcher)) {\n $scope.$watch($scope.options.manualModelWatcher, onModelOrFormStateChange, true)\n }\n\n if ($scope.options.formState) {\n $scope.$watch('options.formState', onModelOrFormStateChange, true)\n }\n\n function onModelOrFormStateChange() {\n angular.forEach($scope.fields, runFieldExpressionProperties)\n }\n\n function validateFormControl(formControl, promise) {\n const validate = formControl.$validate\n if (promise) {\n promise.then(validate)\n } else {\n validate()\n }\n }\n\n function runFieldExpressionProperties(field, index) {\n const model = field.model || $scope.model\n const promise = field.runExpressions && field.runExpressions()\n if (field.hideExpression) { // can't use hide with expressionProperties reliably\n const val = model[field.key]\n field.hide = evalCloseToFormlyExpression(field.hideExpression, val, field, index)\n }\n if (field.extras && field.extras.validateOnModelChange && field.formControl) {\n if (angular.isArray(field.formControl)) {\n angular.forEach(field.formControl, function(formControl) {\n validateFormControl(formControl, promise)\n })\n } else {\n validateFormControl(field.formControl, promise)\n }\n }\n }\n\n function setupFields() {\n $scope.fields = $scope.fields || []\n\n checkDeprecatedOptions($scope.options)\n\n let fieldTransforms = $scope.options.fieldTransform || formlyConfig.extras.fieldTransform\n\n if (!angular.isArray(fieldTransforms)) {\n fieldTransforms = [fieldTransforms]\n }\n\n angular.forEach(fieldTransforms, function transformFields(fieldTransform) {\n if (fieldTransform) {\n $scope.fields = fieldTransform($scope.fields, $scope.model, $scope.options, $scope.form)\n if (!$scope.fields) {\n throw formlyUsability.getFormlyError('fieldTransform must return an array of fields')\n }\n }\n })\n\n setupModels()\n\n if ($scope.options.watchAllExpressions) {\n angular.forEach($scope.fields, setupHideExpressionWatcher)\n }\n\n angular.forEach($scope.fields, attachKey) // attaches a key based on the index if a key isn't specified\n angular.forEach($scope.fields, setupWatchers) // setup watchers for all fields\n }\n\n function checkDeprecatedOptions(options) {\n if (formlyConfig.extras.fieldTransform && angular.isFunction(formlyConfig.extras.fieldTransform)) {\n formlyWarn(\n 'fieldtransform-as-a-function-deprecated',\n 'fieldTransform as a function has been deprecated.',\n `Attempted for formlyConfig.extras: ${formlyConfig.extras.fieldTransform.name}`,\n formlyConfig.extras\n )\n } else if (options.fieldTransform && angular.isFunction(options.fieldTransform)) {\n formlyWarn(\n 'fieldtransform-as-a-function-deprecated',\n 'fieldTransform as a function has been deprecated.',\n `Attempted for form`,\n options\n )\n }\n }\n\n function setupOptions() {\n formlyApiCheck.throw(\n [formlyApiCheck.formOptionsApi.optional], [$scope.options], {prefix: 'formly-form options check'}\n )\n $scope.options = $scope.options || {}\n $scope.options.formState = $scope.options.formState || {}\n\n angular.extend($scope.options, {\n updateInitialValue,\n resetModel,\n })\n\n }\n\n function updateInitialValue() {\n angular.forEach($scope.fields, field => {\n if (isFieldGroup(field) && field.options) {\n field.options.updateInitialValue()\n } else {\n field.updateInitialValue()\n }\n })\n }\n\n function resetModel() {\n angular.forEach($scope.fields, field => {\n if (isFieldGroup(field) && field.options) {\n field.options.resetModel()\n } else if (field.resetModel) {\n field.resetModel()\n }\n })\n }\n\n function setupModels() {\n // a set of field models that are already watched (the $scope.model will have its own watcher)\n const watchedModels = [$scope.model]\n // we will not set up automatic model watchers if manual mode is set\n const manualModelWatcher = $scope.options.manualModelWatcher\n\n if ($scope.options.formState) {\n // $scope.options.formState will have its own watcher\n watchedModels.push($scope.options.formState)\n }\n\n angular.forEach($scope.fields, (field) => {\n const isNewModel = initModel(field)\n\n if (field.model && isNewModel && watchedModels.indexOf(field.model) === -1 && !manualModelWatcher) {\n $scope.$watch(() => field.model, onModelOrFormStateChange, true)\n watchedModels.push(field.model)\n }\n })\n }\n\n function setupHideExpressionWatcher(field, index) {\n if (field.hideExpression) { // can't use hide with expressionProperties reliably\n const model = field.model || $scope.model\n $scope.$watch(function hideExpressionWatcher() {\n const val = model[field.key]\n return evalCloseToFormlyExpression(field.hideExpression, val, field, index)\n }, (hide) => field.hide = hide, true)\n }\n }\n\n function initModel(field) {\n let isNewModel = true\n\n if (angular.isString(field.model)) {\n const expression = field.model\n\n isNewModel = !referencesCurrentlyWatchedModel(expression)\n\n field.model = resolveStringModel(expression)\n\n $scope.$watch(() => resolveStringModel(expression), (model) => field.model = model)\n } else if (!field.model) {\n field.model = $scope.model\n }\n return isNewModel\n\n function resolveStringModel(expression) {\n const index = $scope.fields.indexOf(field)\n const model = evalCloseToFormlyExpression(expression, undefined, field, index, {model: $scope.model})\n\n if (!model) {\n throw formlyUsability.getFieldError(\n 'field-model-must-be-initialized',\n 'Field model must be initialized. When specifying a model as a string for a field, the result of the' +\n ' expression must have been initialized ahead of time.',\n field)\n }\n\n return model\n }\n }\n\n function referencesCurrentlyWatchedModel(expression) {\n return ['model', 'formState'].some(item => {\n return formlyUtil.startsWith(expression, `${item}.`) || formlyUtil.startsWith(expression, `${item}[`)\n })\n }\n\n function attachKey(field, index) {\n if (!isFieldGroup(field)) {\n field.key = field.key || index || 0\n }\n }\n\n function setupWatchers(field, index) {\n if (!angular.isDefined(field.watcher)) {\n return\n }\n let watchers = field.watcher\n if (!angular.isArray(watchers)) {\n watchers = [watchers]\n }\n angular.forEach(watchers, function setupWatcher(watcher) {\n if (!angular.isDefined(watcher.listener) && !watcher.runFieldExpressions) {\n throw formlyUsability.getFieldError(\n 'all-field-watchers-must-have-a-listener',\n 'All field watchers must have a listener', field\n )\n }\n const watchExpression = getWatchExpression(watcher, field, index)\n const watchListener = getWatchListener(watcher, field, index)\n\n const type = watcher.type || '$watch'\n watcher.stopWatching = $scope[type](watchExpression, watchListener, watcher.watchDeep)\n })\n }\n\n function getWatchExpression(watcher, field, index) {\n let watchExpression\n if (!angular.isUndefined(watcher.expression)) {\n watchExpression = watcher.expression\n } else if (field.key) {\n watchExpression = 'model[\\'' + field.key.toString().split('.').join('\\'][\\'') + '\\']'\n }\n if (angular.isFunction(watchExpression)) {\n // wrap the field's watch expression so we can call it with the field as the first arg\n // and the stop function as the last arg as a helper\n const originalExpression = watchExpression\n watchExpression = function formlyWatchExpression() {\n const args = modifyArgs(watcher, index, ...arguments)\n return originalExpression(...args)\n }\n watchExpression.displayName = `Formly Watch Expression for field for ${field.key}`\n } else if (field.model) {\n watchExpression = $parse(watchExpression).bind(null, $scope, {model: field.model})\n }\n return watchExpression\n }\n\n function getWatchListener(watcher, field, index) {\n let watchListener = watcher.listener\n if (angular.isFunction(watchListener) || watcher.runFieldExpressions) {\n // wrap the field's watch listener so we can call it with the field as the first arg\n // and the stop function as the last arg as a helper\n const originalListener = watchListener\n watchListener = function formlyWatchListener() {\n let value\n if (originalListener) {\n const args = modifyArgs(watcher, index, ...arguments)\n value = originalListener(...args)\n }\n if (watcher.runFieldExpressions) {\n runFieldExpressionProperties(field, index)\n }\n return value\n }\n watchListener.displayName = `Formly Watch Listener for field for ${field.key}`\n }\n return watchListener\n }\n\n function modifyArgs(watcher, index, ...originalArgs) {\n return [$scope.fields[index], ...originalArgs, watcher.stopWatching]\n }\n\n function evalCloseToFormlyExpression(expression, val, field, index, extraLocals = {}) {\n extraLocals = angular.extend(getFormlyFieldLikeLocals(field, index), extraLocals)\n return formlyUtil.formlyEval($scope, expression, val, val, extraLocals)\n }\n\n function getFormlyFieldLikeLocals(field, index) {\n // this makes it closer to what a regular formlyExpression would be\n return {\n model: field.model,\n options: field,\n index,\n formState: $scope.options.formState,\n originalModel: $scope.model,\n formOptions: $scope.options,\n formId: $scope.formId,\n }\n }\n }\n\n function formlyFormLink(scope, el, attrs) {\n setFormController()\n fixChromeAutocomplete()\n\n function setFormController() {\n const formId = attrs.name\n scope.formId = formId\n scope.theFormlyForm = scope[formId]\n if (attrs.form) {\n const getter = $parse(attrs.form)\n const setter = getter.assign\n const parentForm = getter(scope.$parent)\n if (parentForm) {\n scope.theFormlyForm = parentForm\n if (scope[formId]) {\n scope.theFormlyForm.$removeControl(scope[formId])\n }\n\n // this next line is probably one of the more dangerous things that angular-formly does to improve the\n // API for angular-formly forms. It ensures that the NgModelControllers inside of formly-form will be\n // attached to the form that is passed to formly-form rather than the one that formly-form creates\n // this is necessary because it's confusing to have a step between the form you pass in\n // and the fields in that form. It also is because angular doesn't propagate properties like $submitted down\n // to children forms :-( This line was added to solve this issue:\n // https://github.com/formly-js/angular-formly/issues/287\n // luckily, this is how the formController has been accessed by the NgModelController since angular 1.0.0\n // so I expect it will remain this way for the life of angular 1.x\n el.removeData('$formController')\n } else {\n setter(scope.$parent, scope[formId])\n }\n }\n if (!scope.theFormlyForm && !formlyConfig.disableWarnings) {\n /* eslint no-console:0 */\n formlyWarn(\n 'formly-form-has-no-formcontroller',\n 'Your formly-form does not have a `form` property. Many functions of the form (like validation) may not work',\n el,\n scope\n )\n }\n }\n\n /*\n * chrome autocomplete lameness\n * see https://code.google.com/p/chromium/issues/detail?id=468153#c14\n * ლ(ಠ益ಠლ) (╯°□°)╯︵ ┻━┻ (◞‸◟;)\n */\n function fixChromeAutocomplete() {\n const global = formlyConfig.extras.removeChromeAutoComplete === true\n const offInstance = scope.options && scope.options.removeChromeAutoComplete === false\n const onInstance = scope.options && scope.options.removeChromeAutoComplete === true\n if ((global && !offInstance) || onInstance) {\n const input = document.createElement('input')\n input.setAttribute('autocomplete', 'address-level4')\n input.setAttribute('hidden', 'true')\n el[0].appendChild(input)\n }\n\n }\n }\n\n\n // stateless util functions\n function toKebabCase(string) {\n if (string) {\n return string.replace(/([A-Z])/g, $1 => '-' + $1.toLowerCase())\n } else {\n return ''\n }\n }\n\n function isFieldGroup(field) {\n return field && !!field.fieldGroup\n }\n}\n\n\n\n/** WEBPACK FOOTER **\n ** C:/Projects/personal/angular-formly/~/eslint-loader?configFile=./other/src.eslintrc!C:/Projects/personal/angular-formly/src/directives/formly-form.js\n **/","'use strict';\n\nObject.defineProperty(exports, '__esModule', {\n value: true\n});\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\nvar _angularFix = require('angular-fix');\n\nvar _angularFix2 = _interopRequireDefault(_angularFix);\n\nvar _providersFormlyApiCheck = require('./providers/formlyApiCheck');\n\nvar _providersFormlyApiCheck2 = _interopRequireDefault(_providersFormlyApiCheck);\n\nvar _otherDocsBaseUrl = require('./other/docsBaseUrl');\n\nvar _otherDocsBaseUrl2 = _interopRequireDefault(_otherDocsBaseUrl);\n\nvar _providersFormlyUsability = require('./providers/formlyUsability');\n\nvar _providersFormlyUsability2 = _interopRequireDefault(_providersFormlyUsability);\n\nvar _providersFormlyConfig = require('./providers/formlyConfig');\n\nvar _providersFormlyConfig2 = _interopRequireDefault(_providersFormlyConfig);\n\nvar _providersFormlyValidationMessages = require('./providers/formlyValidationMessages');\n\nvar _providersFormlyValidationMessages2 = _interopRequireDefault(_providersFormlyValidationMessages);\n\nvar _servicesFormlyUtil = require('./services/formlyUtil');\n\nvar _servicesFormlyUtil2 = _interopRequireDefault(_servicesFormlyUtil);\n\nvar _servicesFormlyWarn = require('./services/formlyWarn');\n\nvar _servicesFormlyWarn2 = _interopRequireDefault(_servicesFormlyWarn);\n\nvar _directivesFormlyCustomValidation = require('./directives/formly-custom-validation');\n\nvar _directivesFormlyCustomValidation2 = _interopRequireDefault(_directivesFormlyCustomValidation);\n\nvar _directivesFormlyField = require('./directives/formly-field');\n\nvar _directivesFormlyField2 = _interopRequireDefault(_directivesFormlyField);\n\nvar _directivesFormlyFocus = require('./directives/formly-focus');\n\nvar _directivesFormlyFocus2 = _interopRequireDefault(_directivesFormlyFocus);\n\nvar _directivesFormlyForm = require('./directives/formly-form');\n\nvar _directivesFormlyForm2 = _interopRequireDefault(_directivesFormlyForm);\n\nvar _runFormlyNgModelAttrsManipulator = require('./run/formlyNgModelAttrsManipulator');\n\nvar _runFormlyNgModelAttrsManipulator2 = _interopRequireDefault(_runFormlyNgModelAttrsManipulator);\n\nvar _runFormlyCustomTags = require('./run/formlyCustomTags');\n\nvar _runFormlyCustomTags2 = _interopRequireDefault(_runFormlyCustomTags);\n\nvar ngModuleName = 'formly';\n\nexports['default'] = ngModuleName;\n\nvar ngModule = _angularFix2['default'].module(ngModuleName, []);\n\nngModule.constant('formlyApiCheck', _providersFormlyApiCheck2['default']);\nngModule.constant('formlyErrorAndWarningsUrlPrefix', _otherDocsBaseUrl2['default']);\nngModule.constant('formlyVersion', VERSION); // <-- webpack variable\n\nngModule.provider('formlyUsability', _providersFormlyUsability2['default']);\nngModule.provider('formlyConfig', _providersFormlyConfig2['default']);\n\nngModule.factory('formlyValidationMessages', _providersFormlyValidationMessages2['default']);\nngModule.factory('formlyUtil', _servicesFormlyUtil2['default']);\nngModule.factory('formlyWarn', _servicesFormlyWarn2['default']);\n\nngModule.directive('formlyCustomValidation', _directivesFormlyCustomValidation2['default']);\nngModule.directive('formlyField', _directivesFormlyField2['default']);\nngModule.directive('formlyFocus', _directivesFormlyFocus2['default']);\nngModule.directive('formlyForm', _directivesFormlyForm2['default']);\n\nngModule.run(_runFormlyNgModelAttrsManipulator2['default']);\nngModule.run(_runFormlyCustomTags2['default']);\nmodule.exports = exports['default'];\n\n\n/** WEBPACK FOOTER **\n ** ./index.common.js\n **/","import angular from 'angular-fix'\n\nimport formlyApiCheck from './providers/formlyApiCheck'\nimport formlyErrorAndWarningsUrlPrefix from './other/docsBaseUrl'\nimport formlyUsability from './providers/formlyUsability'\nimport formlyConfig from './providers/formlyConfig'\nimport formlyValidationMessages from './providers/formlyValidationMessages'\nimport formlyUtil from './services/formlyUtil'\nimport formlyWarn from './services/formlyWarn'\n\nimport formlyCustomValidation from './directives/formly-custom-validation'\nimport formlyField from './directives/formly-field'\nimport formlyFocus from './directives/formly-focus'\nimport formlyForm from './directives/formly-form'\n\nimport formlyNgModelAttrsManipulator from './run/formlyNgModelAttrsManipulator'\nimport formlyCustomTags from './run/formlyCustomTags'\n\nconst ngModuleName = 'formly'\n\nexport default ngModuleName\n\nconst ngModule = angular.module(ngModuleName, [])\n\nngModule.constant('formlyApiCheck', formlyApiCheck)\nngModule.constant('formlyErrorAndWarningsUrlPrefix', formlyErrorAndWarningsUrlPrefix)\nngModule.constant('formlyVersion', VERSION) // <-- webpack variable\n\nngModule.provider('formlyUsability', formlyUsability)\nngModule.provider('formlyConfig', formlyConfig)\n\nngModule.factory('formlyValidationMessages', formlyValidationMessages)\nngModule.factory('formlyUtil', formlyUtil)\nngModule.factory('formlyWarn', formlyWarn)\n\nngModule.directive('formlyCustomValidation', formlyCustomValidation)\nngModule.directive('formlyField', formlyField)\nngModule.directive('formlyFocus', formlyFocus)\nngModule.directive('formlyForm', formlyForm)\n\nngModule.run(formlyNgModelAttrsManipulator)\nngModule.run(formlyCustomTags)\n\n\n\n/** WEBPACK FOOTER **\n ** C:/Projects/personal/angular-formly/~/eslint-loader?configFile=./other/src.eslintrc!C:/Projects/personal/angular-formly/src/index.common.js\n **/","'use strict';\n\nObject.defineProperty(exports, '__esModule', {\n value: true\n});\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\nvar _angularFix = require('angular-fix');\n\nvar _angularFix2 = _interopRequireDefault(_angularFix);\n\nvar _apiCheck = require('api-check');\n\nvar _apiCheck2 = _interopRequireDefault(_apiCheck);\n\nvar apiCheck = (0, _apiCheck2['default'])({\n output: {\n prefix: 'angular-formly:',\n docsBaseUrl: require('../other/docsBaseUrl')\n }\n});\n\nfunction shapeRequiredIfNot(otherProps, propChecker) {\n if (!_angularFix2['default'].isArray(otherProps)) {\n otherProps = [otherProps];\n }\n var type = 'specified if these are not specified: `' + otherProps.join(', ') + '` (otherwise it\\'s optional)';\n\n function shapeRequiredIfNotDefinition(prop, propName, location, obj) {\n var propExists = obj && obj.hasOwnProperty(propName);\n var otherPropsExist = otherProps.some(function (otherProp) {\n return obj && obj.hasOwnProperty(otherProp);\n });\n if (!otherPropsExist && !propExists) {\n return apiCheck.utils.getError(propName, location, type);\n } else if (propExists) {\n return propChecker(prop, propName, location, obj);\n }\n }\n\n shapeRequiredIfNotDefinition.type = type;\n return apiCheck.utils.checkerHelpers.setupChecker(shapeRequiredIfNotDefinition);\n}\n\nvar formlyExpression = apiCheck.oneOfType([apiCheck.string, apiCheck.func]);\nvar specifyWrapperType = apiCheck.typeOrArrayOf(apiCheck.string).nullable;\n\nvar apiCheckProperty = apiCheck.func;\n\nvar apiCheckInstanceProperty = apiCheck.shape.onlyIf('apiCheck', apiCheck.func.withProperties({\n warn: apiCheck.func,\n 'throw': apiCheck.func,\n shape: apiCheck.func\n}));\n\nvar apiCheckFunctionProperty = apiCheck.shape.onlyIf('apiCheck', apiCheck.oneOf(['throw', 'warn']));\n\nvar formlyWrapperType = apiCheck.shape({\n name: shapeRequiredIfNot('types', apiCheck.string).optional,\n template: apiCheck.shape.ifNot('templateUrl', apiCheck.string).optional,\n templateUrl: apiCheck.shape.ifNot('template', apiCheck.string).optional,\n types: apiCheck.typeOrArrayOf(apiCheck.string).optional,\n overwriteOk: apiCheck.bool.optional,\n apiCheck: apiCheckProperty.optional,\n apiCheckInstance: apiCheckInstanceProperty.optional,\n apiCheckFunction: apiCheckFunctionProperty.optional,\n apiCheckOptions: apiCheck.object.optional\n}).strict;\n\nvar expressionProperties = apiCheck.objectOf(apiCheck.oneOfType([formlyExpression, apiCheck.shape({\n expression: formlyExpression,\n message: formlyExpression.optional\n}).strict]));\n\nvar modelChecker = apiCheck.oneOfType([apiCheck.string, apiCheck.object]);\n\nvar templateManipulators = apiCheck.shape({\n preWrapper: apiCheck.arrayOf(apiCheck.func).nullable.optional,\n postWrapper: apiCheck.arrayOf(apiCheck.func).nullable.optional\n}).strict.nullable;\n\nvar validatorChecker = apiCheck.objectOf(apiCheck.oneOfType([formlyExpression, apiCheck.shape({\n expression: formlyExpression,\n message: formlyExpression.optional\n}).strict]));\n\nvar watcherChecker = apiCheck.typeOrArrayOf(apiCheck.shape({\n expression: formlyExpression.optional,\n listener: formlyExpression.optional,\n runFieldExpressions: apiCheck.bool.optional\n}));\n\nvar fieldOptionsApiShape = {\n $$hashKey: apiCheck.any.optional,\n type: apiCheck.shape.ifNot(['template', 'templateUrl'], apiCheck.string).optional,\n template: apiCheck.shape.ifNot(['type', 'templateUrl'], apiCheck.oneOfType([apiCheck.string, apiCheck.func])).optional,\n templateUrl: apiCheck.shape.ifNot(['type', 'template'], apiCheck.oneOfType([apiCheck.string, apiCheck.func])).optional,\n key: apiCheck.oneOfType([apiCheck.string, apiCheck.number]).optional,\n model: modelChecker.optional,\n originalModel: modelChecker.optional,\n className: apiCheck.string.optional,\n id: apiCheck.string.optional,\n name: apiCheck.string.optional,\n expressionProperties: expressionProperties.optional,\n extras: apiCheck.shape({\n validateOnModelChange: apiCheck.bool.optional,\n skipNgModelAttrsManipulator: apiCheck.oneOfType([apiCheck.string, apiCheck.bool]).optional\n }).strict.optional,\n data: apiCheck.object.optional,\n templateOptions: apiCheck.object.optional,\n wrapper: specifyWrapperType.optional,\n modelOptions: apiCheck.shape({\n updateOn: apiCheck.string.optional,\n debounce: apiCheck.oneOfType([apiCheck.objectOf(apiCheck.number), apiCheck.number]).optional,\n allowInvalid: apiCheck.bool.optional,\n getterSetter: apiCheck.bool.optional,\n timezone: apiCheck.string.optional\n }).optional,\n watcher: watcherChecker.optional,\n validators: validatorChecker.optional,\n asyncValidators: validatorChecker.optional,\n parsers: apiCheck.arrayOf(formlyExpression).optional,\n formatters: apiCheck.arrayOf(formlyExpression).optional,\n noFormControl: apiCheck.bool.optional,\n hide: apiCheck.bool.optional,\n hideExpression: formlyExpression.optional,\n ngModelElAttrs: apiCheck.objectOf(apiCheck.string).optional,\n ngModelAttrs: apiCheck.objectOf(apiCheck.shape({\n statement: apiCheck.shape.ifNot(['value', 'attribute', 'bound', 'boolean'], apiCheck.any).optional,\n value: apiCheck.shape.ifNot('statement', apiCheck.any).optional,\n attribute: apiCheck.shape.ifNot('statement', apiCheck.any).optional,\n bound: apiCheck.shape.ifNot('statement', apiCheck.any).optional,\n boolean: apiCheck.shape.ifNot('statement', apiCheck.any).optional\n }).strict).optional,\n elementAttributes: apiCheck.objectOf(apiCheck.string).optional,\n optionsTypes: apiCheck.typeOrArrayOf(apiCheck.string).optional,\n link: apiCheck.func.optional,\n controller: apiCheck.oneOfType([apiCheck.string, apiCheck.func, apiCheck.array]).optional,\n validation: apiCheck.shape({\n show: apiCheck.bool.nullable.optional,\n messages: apiCheck.objectOf(formlyExpression).optional,\n errorExistsAndShouldBeVisible: apiCheck.bool.optional\n }).optional,\n formControl: apiCheck.typeOrArrayOf(apiCheck.object).optional,\n value: apiCheck.func.optional,\n runExpressions: apiCheck.func.optional,\n templateManipulators: templateManipulators.optional,\n resetModel: apiCheck.func.optional,\n updateInitialValue: apiCheck.func.optional,\n initialValue: apiCheck.any.optional,\n defaultValue: apiCheck.any.optional\n};\n\nvar formlyFieldOptions = apiCheck.shape(fieldOptionsApiShape).strict;\n\nvar formOptionsApi = apiCheck.shape({\n formState: apiCheck.object.optional,\n resetModel: apiCheck.func.optional,\n updateInitialValue: apiCheck.func.optional,\n removeChromeAutoComplete: apiCheck.bool.optional,\n templateManipulators: templateManipulators.optional,\n manualModelWatcher: apiCheck.oneOfType([apiCheck.bool, apiCheck.func]).optional,\n watchAllExpressions: apiCheck.bool.optional,\n wrapper: specifyWrapperType.optional,\n fieldTransform: apiCheck.oneOfType([apiCheck.func, apiCheck.array]).optional,\n data: apiCheck.object.optional\n}).strict;\n\nvar fieldGroup = apiCheck.shape({\n $$hashKey: apiCheck.any.optional,\n key: apiCheck.oneOfType([apiCheck.string, apiCheck.number]).optional,\n // danger. Nested field groups wont get api-checked...\n fieldGroup: apiCheck.arrayOf(apiCheck.oneOfType([formlyFieldOptions, apiCheck.object])),\n className: apiCheck.string.optional,\n options: formOptionsApi.optional,\n templateOptions: apiCheck.object.optional,\n wrapper: specifyWrapperType.optional,\n watcher: watcherChecker.optional,\n hide: apiCheck.bool.optional,\n hideExpression: formlyExpression.optional,\n data: apiCheck.object.optional,\n model: modelChecker.optional,\n form: apiCheck.object.optional,\n elementAttributes: apiCheck.objectOf(apiCheck.string).optional\n}).strict;\n\nvar typeOptionsDefaultOptions = _angularFix2['default'].copy(fieldOptionsApiShape);\ntypeOptionsDefaultOptions.key = apiCheck.string.optional;\n\nvar formlyTypeOptions = apiCheck.shape({\n name: apiCheck.string,\n template: apiCheck.shape.ifNot('templateUrl', apiCheck.oneOfType([apiCheck.string, apiCheck.func])).optional,\n templateUrl: apiCheck.shape.ifNot('template', apiCheck.oneOfType([apiCheck.string, apiCheck.func])).optional,\n controller: apiCheck.oneOfType([apiCheck.func, apiCheck.string, apiCheck.array]).optional,\n link: apiCheck.func.optional,\n defaultOptions: apiCheck.oneOfType([apiCheck.func, apiCheck.shape(typeOptionsDefaultOptions)]).optional,\n 'extends': apiCheck.string.optional,\n wrapper: specifyWrapperType.optional,\n data: apiCheck.object.optional,\n apiCheck: apiCheckProperty.optional,\n apiCheckInstance: apiCheckInstanceProperty.optional,\n apiCheckFunction: apiCheckFunctionProperty.optional,\n apiCheckOptions: apiCheck.object.optional,\n overwriteOk: apiCheck.bool.optional\n}).strict;\n\n_angularFix2['default'].extend(apiCheck, {\n formlyTypeOptions: formlyTypeOptions, formlyFieldOptions: formlyFieldOptions, formlyExpression: formlyExpression, formlyWrapperType: formlyWrapperType, fieldGroup: fieldGroup, formOptionsApi: formOptionsApi\n});\n\nexports['default'] = apiCheck;\nmodule.exports = exports['default'];\n\n\n/** WEBPACK FOOTER **\n ** ./providers/formlyApiCheck.js\n **/","import angular from 'angular-fix'\nimport apiCheckFactory from 'api-check'\n\nconst apiCheck = apiCheckFactory({\n output: {\n prefix: 'angular-formly:',\n docsBaseUrl: require('../other/docsBaseUrl'),\n },\n})\n\nfunction shapeRequiredIfNot(otherProps, propChecker) {\n if (!angular.isArray(otherProps)) {\n otherProps = [otherProps]\n }\n const type = `specified if these are not specified: \\`${otherProps.join(', ')}\\` (otherwise it's optional)`\n\n function shapeRequiredIfNotDefinition(prop, propName, location, obj) {\n const propExists = obj && obj.hasOwnProperty(propName)\n const otherPropsExist = otherProps.some(function(otherProp) {\n return obj && obj.hasOwnProperty(otherProp)\n })\n if (!otherPropsExist && !propExists) {\n return apiCheck.utils.getError(propName, location, type)\n } else if (propExists) {\n return propChecker(prop, propName, location, obj)\n }\n }\n\n shapeRequiredIfNotDefinition.type = type\n return apiCheck.utils.checkerHelpers.setupChecker(shapeRequiredIfNotDefinition)\n}\n\nconst formlyExpression = apiCheck.oneOfType([apiCheck.string, apiCheck.func])\nconst specifyWrapperType = apiCheck.typeOrArrayOf(apiCheck.string).nullable\n\nconst apiCheckProperty = apiCheck.func\n\nconst apiCheckInstanceProperty = apiCheck.shape.onlyIf('apiCheck', apiCheck.func.withProperties({\n warn: apiCheck.func,\n throw: apiCheck.func,\n shape: apiCheck.func,\n}))\n\nconst apiCheckFunctionProperty = apiCheck.shape.onlyIf('apiCheck', apiCheck.oneOf(['throw', 'warn']))\n\nconst formlyWrapperType = apiCheck.shape({\n name: shapeRequiredIfNot('types', apiCheck.string).optional,\n template: apiCheck.shape.ifNot('templateUrl', apiCheck.string).optional,\n templateUrl: apiCheck.shape.ifNot('template', apiCheck.string).optional,\n types: apiCheck.typeOrArrayOf(apiCheck.string).optional,\n overwriteOk: apiCheck.bool.optional,\n apiCheck: apiCheckProperty.optional,\n apiCheckInstance: apiCheckInstanceProperty.optional,\n apiCheckFunction: apiCheckFunctionProperty.optional,\n apiCheckOptions: apiCheck.object.optional,\n}).strict\n\nconst expressionProperties = apiCheck.objectOf(apiCheck.oneOfType([\n formlyExpression,\n apiCheck.shape({\n expression: formlyExpression,\n message: formlyExpression.optional,\n }).strict,\n]))\n\nconst modelChecker = apiCheck.oneOfType([apiCheck.string, apiCheck.object])\n\nconst templateManipulators = apiCheck.shape({\n preWrapper: apiCheck.arrayOf(apiCheck.func).nullable.optional,\n postWrapper: apiCheck.arrayOf(apiCheck.func).nullable.optional,\n}).strict.nullable\n\nconst validatorChecker = apiCheck.objectOf(apiCheck.oneOfType([\n formlyExpression, apiCheck.shape({\n expression: formlyExpression,\n message: formlyExpression.optional,\n }).strict,\n]))\n\nconst watcherChecker = apiCheck.typeOrArrayOf(\n apiCheck.shape({\n expression: formlyExpression.optional,\n listener: formlyExpression.optional,\n runFieldExpressions: apiCheck.bool.optional,\n })\n)\n\nconst fieldOptionsApiShape = {\n $$hashKey: apiCheck.any.optional,\n type: apiCheck.shape.ifNot(['template', 'templateUrl'], apiCheck.string).optional,\n template: apiCheck.shape.ifNot(\n ['type', 'templateUrl'],\n apiCheck.oneOfType([apiCheck.string, apiCheck.func])\n ).optional,\n templateUrl: apiCheck.shape.ifNot(\n ['type', 'template'],\n apiCheck.oneOfType([apiCheck.string, apiCheck.func])\n ).optional,\n key: apiCheck.oneOfType([apiCheck.string, apiCheck.number]).optional,\n model: modelChecker.optional,\n originalModel: modelChecker.optional,\n className: apiCheck.string.optional,\n id: apiCheck.string.optional,\n name: apiCheck.string.optional,\n expressionProperties: expressionProperties.optional,\n extras: apiCheck.shape({\n validateOnModelChange: apiCheck.bool.optional,\n skipNgModelAttrsManipulator: apiCheck.oneOfType([\n apiCheck.string, apiCheck.bool,\n ]).optional,\n }).strict.optional,\n data: apiCheck.object.optional,\n templateOptions: apiCheck.object.optional,\n wrapper: specifyWrapperType.optional,\n modelOptions: apiCheck.shape({\n updateOn: apiCheck.string.optional,\n debounce: apiCheck.oneOfType([\n apiCheck.objectOf(apiCheck.number), apiCheck.number,\n ]).optional,\n allowInvalid: apiCheck.bool.optional,\n getterSetter: apiCheck.bool.optional,\n timezone: apiCheck.string.optional,\n }).optional,\n watcher: watcherChecker.optional,\n validators: validatorChecker.optional,\n asyncValidators: validatorChecker.optional,\n parsers: apiCheck.arrayOf(formlyExpression).optional,\n formatters: apiCheck.arrayOf(formlyExpression).optional,\n noFormControl: apiCheck.bool.optional,\n hide: apiCheck.bool.optional,\n hideExpression: formlyExpression.optional,\n ngModelElAttrs: apiCheck.objectOf(apiCheck.string).optional,\n ngModelAttrs: apiCheck.objectOf(apiCheck.shape({\n statement: apiCheck.shape.ifNot(['value', 'attribute', 'bound', 'boolean'], apiCheck.any).optional,\n value: apiCheck.shape.ifNot('statement', apiCheck.any).optional,\n attribute: apiCheck.shape.ifNot('statement', apiCheck.any).optional,\n bound: apiCheck.shape.ifNot('statement', apiCheck.any).optional,\n boolean: apiCheck.shape.ifNot('statement', apiCheck.any).optional,\n }).strict).optional,\n elementAttributes: apiCheck.objectOf(apiCheck.string).optional,\n optionsTypes: apiCheck.typeOrArrayOf(apiCheck.string).optional,\n link: apiCheck.func.optional,\n controller: apiCheck.oneOfType([\n apiCheck.string, apiCheck.func, apiCheck.array,\n ]).optional,\n validation: apiCheck.shape({\n show: apiCheck.bool.nullable.optional,\n messages: apiCheck.objectOf(formlyExpression).optional,\n errorExistsAndShouldBeVisible: apiCheck.bool.optional,\n }).optional,\n formControl: apiCheck.typeOrArrayOf(apiCheck.object).optional,\n value: apiCheck.func.optional,\n runExpressions: apiCheck.func.optional,\n templateManipulators: templateManipulators.optional,\n resetModel: apiCheck.func.optional,\n updateInitialValue: apiCheck.func.optional,\n initialValue: apiCheck.any.optional,\n defaultValue: apiCheck.any.optional,\n}\n\n\nconst formlyFieldOptions = apiCheck.shape(fieldOptionsApiShape).strict\n\nconst formOptionsApi = apiCheck.shape({\n formState: apiCheck.object.optional,\n resetModel: apiCheck.func.optional,\n updateInitialValue: apiCheck.func.optional,\n removeChromeAutoComplete: apiCheck.bool.optional,\n templateManipulators: templateManipulators.optional,\n manualModelWatcher: apiCheck.oneOfType([apiCheck.bool, apiCheck.func]).optional,\n watchAllExpressions: apiCheck.bool.optional,\n wrapper: specifyWrapperType.optional,\n fieldTransform: apiCheck.oneOfType([\n apiCheck.func, apiCheck.array,\n ]).optional,\n data: apiCheck.object.optional,\n}).strict\n\n\nconst fieldGroup = apiCheck.shape({\n $$hashKey: apiCheck.any.optional,\n key: apiCheck.oneOfType([apiCheck.string, apiCheck.number]).optional,\n // danger. Nested field groups wont get api-checked...\n fieldGroup: apiCheck.arrayOf(apiCheck.oneOfType([formlyFieldOptions, apiCheck.object])),\n className: apiCheck.string.optional,\n options: formOptionsApi.optional,\n templateOptions: apiCheck.object.optional,\n wrapper: specifyWrapperType.optional,\n watcher: watcherChecker.optional,\n hide: apiCheck.bool.optional,\n hideExpression: formlyExpression.optional,\n data: apiCheck.object.optional,\n model: modelChecker.optional,\n form: apiCheck.object.optional,\n elementAttributes: apiCheck.objectOf(apiCheck.string).optional,\n}).strict\n\nconst typeOptionsDefaultOptions = angular.copy(fieldOptionsApiShape)\ntypeOptionsDefaultOptions.key = apiCheck.string.optional\n\nconst formlyTypeOptions = apiCheck.shape({\n name: apiCheck.string,\n template: apiCheck.shape.ifNot('templateUrl', apiCheck.oneOfType([apiCheck.string, apiCheck.func])).optional,\n templateUrl: apiCheck.shape.ifNot('template', apiCheck.oneOfType([apiCheck.string, apiCheck.func])).optional,\n controller: apiCheck.oneOfType([\n apiCheck.func, apiCheck.string, apiCheck.array,\n ]).optional,\n link: apiCheck.func.optional,\n defaultOptions: apiCheck.oneOfType([\n apiCheck.func, apiCheck.shape(typeOptionsDefaultOptions),\n ]).optional,\n extends: apiCheck.string.optional,\n wrapper: specifyWrapperType.optional,\n data: apiCheck.object.optional,\n apiCheck: apiCheckProperty.optional,\n apiCheckInstance: apiCheckInstanceProperty.optional,\n apiCheckFunction: apiCheckFunctionProperty.optional,\n apiCheckOptions: apiCheck.object.optional,\n overwriteOk: apiCheck.bool.optional,\n}).strict\n\nangular.extend(apiCheck, {\n formlyTypeOptions, formlyFieldOptions, formlyExpression, formlyWrapperType, fieldGroup, formOptionsApi,\n})\n\nexport default apiCheck\n\n\n\n/** WEBPACK FOOTER **\n ** C:/Projects/personal/angular-formly/~/eslint-loader?configFile=./other/src.eslintrc!C:/Projects/personal/angular-formly/src/providers/formlyApiCheck.js\n **/","'use strict';\n\nObject.defineProperty(exports, '__esModule', {\n value: true\n});\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\nfunction _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) arr2[i] = arr[i]; return arr2; } else { return Array.from(arr); } }\n\nvar _angularFix = require('angular-fix');\n\nvar _angularFix2 = _interopRequireDefault(_angularFix);\n\nvar _otherUtils = require('../other/utils');\n\nvar _otherUtils2 = _interopRequireDefault(_otherUtils);\n\nexports['default'] = formlyConfig;\n\n// @ngInject\nfunction formlyConfig(formlyUsabilityProvider, formlyErrorAndWarningsUrlPrefix, formlyApiCheck) {\n var _this2 = this;\n\n var typeMap = {};\n var templateWrappersMap = {};\n var defaultWrapperName = 'default';\n var _this = this;\n var getError = formlyUsabilityProvider.getFormlyError;\n\n _angularFix2['default'].extend(this, {\n setType: setType,\n getType: getType,\n getTypeHeritage: getTypeHeritage,\n setWrapper: setWrapper,\n getWrapper: getWrapper,\n getWrapperByType: getWrapperByType,\n removeWrapperByName: removeWrapperByName,\n removeWrappersForType: removeWrappersForType,\n disableWarnings: false,\n extras: {\n disableNgModelAttrsManipulator: false,\n fieldTransform: [],\n ngModelAttrsManipulatorPreferUnbound: false,\n removeChromeAutoComplete: false,\n defaultHideDirective: 'ng-if',\n getFieldId: null\n },\n templateManipulators: {\n preWrapper: [],\n postWrapper: []\n },\n $get: function $get() {\n return _this2;\n }\n });\n\n function setType(options) {\n if (_angularFix2['default'].isArray(options)) {\n var _ret = (function () {\n var allTypes = [];\n _angularFix2['default'].forEach(options, function (item) {\n allTypes.push(setType(item));\n });\n return {\n v: allTypes\n };\n })();\n\n if (typeof _ret === 'object') return _ret.v;\n } else if (_angularFix2['default'].isObject(options)) {\n checkType(options);\n if (options['extends']) {\n extendTypeOptions(options);\n }\n typeMap[options.name] = options;\n return typeMap[options.name];\n } else {\n throw getError('You must provide an object or array for setType. You provided: ' + JSON.stringify(arguments));\n }\n }\n\n function checkType(options) {\n formlyApiCheck['throw'](formlyApiCheck.formlyTypeOptions, options, {\n prefix: 'formlyConfig.setType',\n url: 'settype-validation-failed'\n });\n if (!options.overwriteOk) {\n checkOverwrite(options.name, typeMap, options, 'types');\n } else {\n options.overwriteOk = undefined;\n }\n }\n\n function extendTypeOptions(options) {\n var extendsType = getType(options['extends'], true, options);\n extendTypeControllerFunction(options, extendsType);\n extendTypeLinkFunction(options, extendsType);\n extendTypeDefaultOptions(options, extendsType);\n _otherUtils2['default'].reverseDeepMerge(options, extendsType);\n extendTemplate(options, extendsType);\n }\n\n function extendTemplate(options, extendsType) {\n if (options.template && extendsType.templateUrl) {\n delete options.templateUrl;\n } else if (options.templateUrl && extendsType.template) {\n delete options.template;\n }\n }\n\n function extendTypeControllerFunction(options, extendsType) {\n var extendsCtrl = extendsType.controller;\n if (!_angularFix2['default'].isDefined(extendsCtrl)) {\n return;\n }\n var optionsCtrl = options.controller;\n if (_angularFix2['default'].isDefined(optionsCtrl)) {\n options.controller = function ($scope, $controller) {\n $controller(extendsCtrl, { $scope: $scope });\n $controller(optionsCtrl, { $scope: $scope });\n };\n options.controller.$inject = ['$scope', '$controller'];\n } else {\n options.controller = extendsCtrl;\n }\n }\n\n function extendTypeLinkFunction(options, extendsType) {\n var extendsFn = extendsType.link;\n if (!_angularFix2['default'].isDefined(extendsFn)) {\n return;\n }\n var optionsFn = options.link;\n if (_angularFix2['default'].isDefined(optionsFn)) {\n options.link = function () {\n extendsFn.apply(undefined, arguments);\n optionsFn.apply(undefined, arguments);\n };\n } else {\n options.link = extendsFn;\n }\n }\n\n function extendTypeDefaultOptions(options, extendsType) {\n var extendsDO = extendsType.defaultOptions;\n if (!_angularFix2['default'].isDefined(extendsDO)) {\n return;\n }\n var optionsDO = options.defaultOptions;\n var optionsDOIsFn = _angularFix2['default'].isFunction(optionsDO);\n var extendsDOIsFn = _angularFix2['default'].isFunction(extendsDO);\n if (extendsDOIsFn) {\n options.defaultOptions = function defaultOptions(opts, scope) {\n var extendsDefaultOptions = extendsDO(opts, scope);\n var mergedDefaultOptions = {};\n _otherUtils2['default'].reverseDeepMerge(mergedDefaultOptions, opts, extendsDefaultOptions);\n var extenderOptionsDefaultOptions = optionsDO;\n if (optionsDOIsFn) {\n extenderOptionsDefaultOptions = extenderOptionsDefaultOptions(mergedDefaultOptions, scope);\n }\n _otherUtils2['default'].reverseDeepMerge(extendsDefaultOptions, extenderOptionsDefaultOptions);\n return extendsDefaultOptions;\n };\n } else if (optionsDOIsFn) {\n options.defaultOptions = function defaultOptions(opts, scope) {\n var newDefaultOptions = {};\n _otherUtils2['default'].reverseDeepMerge(newDefaultOptions, opts, extendsDO);\n return optionsDO(newDefaultOptions, scope);\n };\n }\n }\n\n function getType(name, throwError, errorContext) {\n if (!name) {\n return undefined;\n }\n var type = typeMap[name];\n if (!type && throwError === true) {\n throw getError('There is no type by the name of \"' + name + '\": ' + JSON.stringify(errorContext));\n } else {\n return type;\n }\n }\n\n function getTypeHeritage(parent) {\n var heritage = [];\n var type = parent;\n if (_angularFix2['default'].isString(type)) {\n type = getType(parent);\n }\n parent = type['extends'];\n while (parent) {\n type = getType(parent);\n heritage.push(type);\n parent = type['extends'];\n }\n return heritage;\n }\n\n function setWrapper(_x, _x2) {\n var _again = true;\n\n _function: while (_again) {\n var options = _x,\n name = _x2;\n _again = false;\n\n if (_angularFix2['default'].isArray(options)) {\n return options.map(function (wrapperOptions) {\n return setWrapper(wrapperOptions);\n });\n } else if (_angularFix2['default'].isObject(options)) {\n options.types = getOptionsTypes(options);\n options.name = getOptionsName(options, name);\n checkWrapperAPI(options);\n templateWrappersMap[options.name] = options;\n return options;\n } else if (_angularFix2['default'].isString(options)) {\n _x = {\n template: options,\n name: name\n };\n _x2 = undefined;\n _again = true;\n continue _function;\n }\n }\n }\n\n function getOptionsTypes(options) {\n if (_angularFix2['default'].isString(options.types)) {\n return [options.types];\n }\n if (!_angularFix2['default'].isDefined(options.types)) {\n return [];\n } else {\n return options.types;\n }\n }\n\n function getOptionsName(options, name) {\n return options.name || name || options.types.join(' ') || defaultWrapperName;\n }\n\n function checkWrapperAPI(options) {\n formlyUsabilityProvider.checkWrapper(options);\n if (options.template) {\n formlyUsabilityProvider.checkWrapperTemplate(options.template, options);\n }\n if (!options.overwriteOk) {\n checkOverwrite(options.name, templateWrappersMap, options, 'templateWrappers');\n } else {\n delete options.overwriteOk;\n }\n checkWrapperTypes(options);\n }\n\n function checkWrapperTypes(options) {\n var shouldThrow = !_angularFix2['default'].isArray(options.types) || !options.types.every(_angularFix2['default'].isString);\n if (shouldThrow) {\n throw getError('Attempted to create a template wrapper with types that is not a string or an array of strings');\n }\n }\n\n function checkOverwrite(property, object, newValue, objectName) {\n if (object.hasOwnProperty(property)) {\n warn('overwriting-types-or-wrappers', ['Attempting to overwrite ' + property + ' on ' + objectName + ' which is currently', JSON.stringify(object[property]) + ' with ' + JSON.stringify(newValue), 'To supress this warning, specify the property \"overwriteOk: true\"'].join(' '));\n }\n }\n\n function getWrapper(name) {\n return templateWrappersMap[name || defaultWrapperName];\n }\n\n function getWrapperByType(type) {\n /* eslint prefer-const:0 */\n var wrappers = [];\n for (var _name in templateWrappersMap) {\n if (templateWrappersMap.hasOwnProperty(_name)) {\n if (templateWrappersMap[_name].types && templateWrappersMap[_name].types.indexOf(type) !== -1) {\n wrappers.push(templateWrappersMap[_name]);\n }\n }\n }\n return wrappers;\n }\n\n function removeWrapperByName(name) {\n var wrapper = templateWrappersMap[name];\n delete templateWrappersMap[name];\n return wrapper;\n }\n\n function removeWrappersForType(type) {\n var wrappers = getWrapperByType(type);\n if (!wrappers) {\n return undefined;\n }\n if (!_angularFix2['default'].isArray(wrappers)) {\n return removeWrapperByName(wrappers.name);\n } else {\n wrappers.forEach(function (wrapper) {\n return removeWrapperByName(wrapper.name);\n });\n return wrappers;\n }\n }\n\n function warn() {\n if (!_this.disableWarnings && console.warn) {\n /* eslint no-console:0 */\n var args = Array.prototype.slice.call(arguments);\n var warnInfoSlug = args.shift();\n args.unshift('Formly Warning:');\n args.push('' + formlyErrorAndWarningsUrlPrefix + warnInfoSlug);\n console.warn.apply(console, _toConsumableArray(args));\n }\n }\n}\nmodule.exports = exports['default'];\n\n\n/** WEBPACK FOOTER **\n ** ./providers/formlyConfig.js\n **/","import angular from 'angular-fix'\nimport utils from '../other/utils'\n\nexport default formlyConfig\n\n// @ngInject\nfunction formlyConfig(formlyUsabilityProvider, formlyErrorAndWarningsUrlPrefix, formlyApiCheck) {\n\n const typeMap = {}\n const templateWrappersMap = {}\n const defaultWrapperName = 'default'\n const _this = this\n const getError = formlyUsabilityProvider.getFormlyError\n\n angular.extend(this, {\n setType,\n getType,\n getTypeHeritage,\n setWrapper,\n getWrapper,\n getWrapperByType,\n removeWrapperByName,\n removeWrappersForType,\n disableWarnings: false,\n extras: {\n disableNgModelAttrsManipulator: false,\n fieldTransform: [],\n ngModelAttrsManipulatorPreferUnbound: false,\n removeChromeAutoComplete: false,\n defaultHideDirective: 'ng-if',\n getFieldId: null,\n },\n templateManipulators: {\n preWrapper: [],\n postWrapper: [],\n },\n $get: () => this,\n })\n\n function setType(options) {\n if (angular.isArray(options)) {\n const allTypes = []\n angular.forEach(options, item => {\n allTypes.push(setType(item))\n })\n return allTypes\n } else if (angular.isObject(options)) {\n checkType(options)\n if (options.extends) {\n extendTypeOptions(options)\n }\n typeMap[options.name] = options\n return typeMap[options.name]\n } else {\n throw getError(`You must provide an object or array for setType. You provided: ${JSON.stringify(arguments)}`)\n }\n }\n\n function checkType(options) {\n formlyApiCheck.throw(formlyApiCheck.formlyTypeOptions, options, {\n prefix: 'formlyConfig.setType',\n url: 'settype-validation-failed',\n })\n if (!options.overwriteOk) {\n checkOverwrite(options.name, typeMap, options, 'types')\n } else {\n options.overwriteOk = undefined\n }\n }\n\n function extendTypeOptions(options) {\n const extendsType = getType(options.extends, true, options)\n extendTypeControllerFunction(options, extendsType)\n extendTypeLinkFunction(options, extendsType)\n extendTypeDefaultOptions(options, extendsType)\n utils.reverseDeepMerge(options, extendsType)\n extendTemplate(options, extendsType)\n }\n\n function extendTemplate(options, extendsType) {\n if (options.template && extendsType.templateUrl) {\n delete options.templateUrl\n } else if (options.templateUrl && extendsType.template) {\n delete options.template\n }\n }\n\n function extendTypeControllerFunction(options, extendsType) {\n const extendsCtrl = extendsType.controller\n if (!angular.isDefined(extendsCtrl)) {\n return\n }\n const optionsCtrl = options.controller\n if (angular.isDefined(optionsCtrl)) {\n options.controller = function($scope, $controller) {\n $controller(extendsCtrl, {$scope})\n $controller(optionsCtrl, {$scope})\n }\n options.controller.$inject = ['$scope', '$controller']\n } else {\n options.controller = extendsCtrl\n }\n }\n\n function extendTypeLinkFunction(options, extendsType) {\n const extendsFn = extendsType.link\n if (!angular.isDefined(extendsFn)) {\n return\n }\n const optionsFn = options.link\n if (angular.isDefined(optionsFn)) {\n options.link = function() {\n extendsFn(...arguments)\n optionsFn(...arguments)\n }\n } else {\n options.link = extendsFn\n }\n }\n\n function extendTypeDefaultOptions(options, extendsType) {\n const extendsDO = extendsType.defaultOptions\n if (!angular.isDefined(extendsDO)) {\n return\n }\n const optionsDO = options.defaultOptions\n const optionsDOIsFn = angular.isFunction(optionsDO)\n const extendsDOIsFn = angular.isFunction(extendsDO)\n if (extendsDOIsFn) {\n options.defaultOptions = function defaultOptions(opts, scope) {\n const extendsDefaultOptions = extendsDO(opts, scope)\n const mergedDefaultOptions = {}\n utils.reverseDeepMerge(mergedDefaultOptions, opts, extendsDefaultOptions)\n let extenderOptionsDefaultOptions = optionsDO\n if (optionsDOIsFn) {\n extenderOptionsDefaultOptions = extenderOptionsDefaultOptions(mergedDefaultOptions, scope)\n }\n utils.reverseDeepMerge(extendsDefaultOptions, extenderOptionsDefaultOptions)\n return extendsDefaultOptions\n }\n } else if (optionsDOIsFn) {\n options.defaultOptions = function defaultOptions(opts, scope) {\n const newDefaultOptions = {}\n utils.reverseDeepMerge(newDefaultOptions, opts, extendsDO)\n return optionsDO(newDefaultOptions, scope)\n }\n }\n }\n\n function getType(name, throwError, errorContext) {\n if (!name) {\n return undefined\n }\n const type = typeMap[name]\n if (!type && throwError === true) {\n throw getError(\n `There is no type by the name of \"${name}\": ${JSON.stringify(errorContext)}`\n )\n } else {\n return type\n }\n }\n\n function getTypeHeritage(parent) {\n const heritage = []\n let type = parent\n if (angular.isString(type)) {\n type = getType(parent)\n }\n parent = type.extends\n while (parent) {\n type = getType(parent)\n heritage.push(type)\n parent = type.extends\n }\n return heritage\n }\n\n\n function setWrapper(options, name) {\n if (angular.isArray(options)) {\n return options.map(wrapperOptions => setWrapper(wrapperOptions))\n } else if (angular.isObject(options)) {\n options.types = getOptionsTypes(options)\n options.name = getOptionsName(options, name)\n checkWrapperAPI(options)\n templateWrappersMap[options.name] = options\n return options\n } else if (angular.isString(options)) {\n return setWrapper({\n template: options,\n name,\n })\n }\n }\n\n function getOptionsTypes(options) {\n if (angular.isString(options.types)) {\n return [options.types]\n }\n if (!angular.isDefined(options.types)) {\n return []\n } else {\n return options.types\n }\n }\n\n function getOptionsName(options, name) {\n return options.name || name || options.types.join(' ') || defaultWrapperName\n }\n\n function checkWrapperAPI(options) {\n formlyUsabilityProvider.checkWrapper(options)\n if (options.template) {\n formlyUsabilityProvider.checkWrapperTemplate(options.template, options)\n }\n if (!options.overwriteOk) {\n checkOverwrite(options.name, templateWrappersMap, options, 'templateWrappers')\n } else {\n delete options.overwriteOk\n }\n checkWrapperTypes(options)\n }\n\n function checkWrapperTypes(options) {\n const shouldThrow = !angular.isArray(options.types) || !options.types.every(angular.isString)\n if (shouldThrow) {\n throw getError(`Attempted to create a template wrapper with types that is not a string or an array of strings`)\n }\n }\n\n function checkOverwrite(property, object, newValue, objectName) {\n if (object.hasOwnProperty(property)) {\n warn('overwriting-types-or-wrappers', [\n `Attempting to overwrite ${property} on ${objectName} which is currently`,\n `${JSON.stringify(object[property])} with ${JSON.stringify(newValue)}`,\n `To supress this warning, specify the property \"overwriteOk: true\"`,\n ].join(' '))\n }\n }\n\n function getWrapper(name) {\n return templateWrappersMap[name || defaultWrapperName]\n }\n\n function getWrapperByType(type) {\n /* eslint prefer-const:0 */\n const wrappers = []\n for (let name in templateWrappersMap) {\n if (templateWrappersMap.hasOwnProperty(name)) {\n if (templateWrappersMap[name].types && templateWrappersMap[name].types.indexOf(type) !== -1) {\n wrappers.push(templateWrappersMap[name])\n }\n }\n }\n return wrappers\n }\n\n function removeWrapperByName(name) {\n const wrapper = templateWrappersMap[name]\n delete templateWrappersMap[name]\n return wrapper\n }\n\n function removeWrappersForType(type) {\n const wrappers = getWrapperByType(type)\n if (!wrappers) {\n return undefined\n }\n if (!angular.isArray(wrappers)) {\n return removeWrapperByName(wrappers.name)\n } else {\n wrappers.forEach((wrapper) => removeWrapperByName(wrapper.name))\n return wrappers\n }\n }\n\n\n function warn() {\n if (!_this.disableWarnings && console.warn) {\n /* eslint no-console:0 */\n const args = Array.prototype.slice.call(arguments)\n const warnInfoSlug = args.shift()\n args.unshift('Formly Warning:')\n args.push(`${formlyErrorAndWarningsUrlPrefix}${warnInfoSlug}`)\n console.warn(...args)\n }\n }\n}\n\n\n\n/** WEBPACK FOOTER **\n ** C:/Projects/personal/angular-formly/~/eslint-loader?configFile=./other/src.eslintrc!C:/Projects/personal/angular-formly/src/providers/formlyConfig.js\n **/","'use strict';\n\nObject.defineProperty(exports, '__esModule', {\n value: true\n});\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\nvar _angularFix = require('angular-fix');\n\nvar _angularFix2 = _interopRequireDefault(_angularFix);\n\nexports['default'] = formlyUsability;\n\n// @ngInject\nfunction formlyUsability(formlyApiCheck, formlyErrorAndWarningsUrlPrefix) {\n var _this = this;\n\n _angularFix2['default'].extend(this, {\n getFormlyError: getFormlyError,\n getFieldError: getFieldError,\n checkWrapper: checkWrapper,\n checkWrapperTemplate: checkWrapperTemplate,\n getErrorMessage: getErrorMessage,\n $get: function $get() {\n return _this;\n }\n });\n\n function getFieldError(errorInfoSlug, message, field) {\n if (arguments.length < 3) {\n field = message;\n message = errorInfoSlug;\n errorInfoSlug = null;\n }\n return new Error(getErrorMessage(errorInfoSlug, message) + (' Field definition: ' + _angularFix2['default'].toJson(field)));\n }\n\n function getFormlyError(errorInfoSlug, message) {\n if (!message) {\n message = errorInfoSlug;\n errorInfoSlug = null;\n }\n return new Error(getErrorMessage(errorInfoSlug, message));\n }\n\n function getErrorMessage(errorInfoSlug, message) {\n var url = '';\n if (errorInfoSlug !== null) {\n url = '' + formlyErrorAndWarningsUrlPrefix + errorInfoSlug;\n }\n return 'Formly Error: ' + message + '. ' + url;\n }\n\n function checkWrapper(wrapper) {\n formlyApiCheck['throw'](formlyApiCheck.formlyWrapperType, wrapper, {\n prefix: 'formlyConfig.setWrapper',\n urlSuffix: 'setwrapper-validation-failed'\n });\n }\n\n function checkWrapperTemplate(template, additionalInfo) {\n var formlyTransclude = '';\n if (template.indexOf(formlyTransclude) === -1) {\n throw getFormlyError('Template wrapper templates must use \"' + formlyTransclude + '\" somewhere in them. ' + ('This one does not have \"\" in it: ' + template) + '\\n' + ('Additional information: ' + JSON.stringify(additionalInfo)));\n }\n }\n}\nmodule.exports = exports['default'];\n\n\n/** WEBPACK FOOTER **\n ** ./providers/formlyUsability.js\n **/","import angular from 'angular-fix'\n\nexport default formlyUsability\n\n// @ngInject\nfunction formlyUsability(formlyApiCheck, formlyErrorAndWarningsUrlPrefix) {\n angular.extend(this, {\n getFormlyError,\n getFieldError,\n checkWrapper,\n checkWrapperTemplate,\n getErrorMessage,\n $get: () => this,\n })\n\n function getFieldError(errorInfoSlug, message, field) {\n if (arguments.length < 3) {\n field = message\n message = errorInfoSlug\n errorInfoSlug = null\n }\n return new Error(getErrorMessage(errorInfoSlug, message) + ` Field definition: ${angular.toJson(field)}`)\n }\n\n function getFormlyError(errorInfoSlug, message) {\n if (!message) {\n message = errorInfoSlug\n errorInfoSlug = null\n }\n return new Error(getErrorMessage(errorInfoSlug, message))\n }\n\n function getErrorMessage(errorInfoSlug, message) {\n let url = ''\n if (errorInfoSlug !== null) {\n url = `${formlyErrorAndWarningsUrlPrefix}${errorInfoSlug}`\n }\n return `Formly Error: ${message}. ${url}`\n }\n\n function checkWrapper(wrapper) {\n formlyApiCheck.throw(formlyApiCheck.formlyWrapperType, wrapper, {\n prefix: 'formlyConfig.setWrapper',\n urlSuffix: 'setwrapper-validation-failed',\n })\n }\n\n function checkWrapperTemplate(template, additionalInfo) {\n const formlyTransclude = ''\n if (template.indexOf(formlyTransclude) === -1) {\n throw getFormlyError(\n `Template wrapper templates must use \"${formlyTransclude}\" somewhere in them. ` +\n `This one does not have \"\" in it: ${template}` + '\\n' +\n `Additional information: ${JSON.stringify(additionalInfo)}`\n )\n }\n }\n}\n\n\n\n/** WEBPACK FOOTER **\n ** C:/Projects/personal/angular-formly/~/eslint-loader?configFile=./other/src.eslintrc!C:/Projects/personal/angular-formly/src/providers/formlyUsability.js\n **/","'use strict';\n\nObject.defineProperty(exports, '__esModule', {\n value: true\n});\nexports['default'] = formlyValidationMessages;\n\n// @ngInject\nfunction formlyValidationMessages() {\n\n var validationMessages = {\n addTemplateOptionValueMessage: addTemplateOptionValueMessage,\n addStringMessage: addStringMessage,\n messages: {}\n };\n\n return validationMessages;\n\n function addTemplateOptionValueMessage(name, prop, prefix, suffix, alternate) {\n validationMessages.messages[name] = templateOptionValue(prop, prefix, suffix, alternate);\n }\n\n function addStringMessage(name, string) {\n validationMessages.messages[name] = function () {\n return string;\n };\n }\n\n function templateOptionValue(prop, prefix, suffix, alternate) {\n return function getValidationMessage(viewValue, modelValue, scope) {\n if (typeof scope.options.templateOptions[prop] !== 'undefined') {\n return prefix + ' ' + scope.options.templateOptions[prop] + ' ' + suffix;\n } else {\n return alternate;\n }\n };\n }\n}\nmodule.exports = exports['default'];\n\n\n/** WEBPACK FOOTER **\n ** ./providers/formlyValidationMessages.js\n **/","export default formlyValidationMessages\n\n\n// @ngInject\nfunction formlyValidationMessages() {\n\n const validationMessages = {\n addTemplateOptionValueMessage,\n addStringMessage,\n messages: {},\n }\n\n return validationMessages\n\n function addTemplateOptionValueMessage(name, prop, prefix, suffix, alternate) {\n validationMessages.messages[name] = templateOptionValue(prop, prefix, suffix, alternate)\n }\n\n function addStringMessage(name, string) {\n validationMessages.messages[name] = () => string\n }\n\n\n function templateOptionValue(prop, prefix, suffix, alternate) {\n return function getValidationMessage(viewValue, modelValue, scope) {\n if (typeof scope.options.templateOptions[prop] !== 'undefined') {\n return `${prefix} ${scope.options.templateOptions[prop]} ${suffix}`\n } else {\n return alternate\n }\n }\n }\n}\n\n\n\n/** WEBPACK FOOTER **\n ** C:/Projects/personal/angular-formly/~/eslint-loader?configFile=./other/src.eslintrc!C:/Projects/personal/angular-formly/src/providers/formlyValidationMessages.js\n **/","'use strict';\n\nObject.defineProperty(exports, '__esModule', {\n value: true\n});\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\nvar _angularFix = require('angular-fix');\n\nvar _angularFix2 = _interopRequireDefault(_angularFix);\n\nexports['default'] = addCustomTags;\n\n// @ngInject\nfunction addCustomTags($document) {\n // IE8 check ->\n // https://msdn.microsoft.com/en-us/library/cc196988(v=vs.85).aspx\n if ($document && $document.documentMode < 9) {\n (function () {\n var document = $document.get(0);\n // add the custom elements that we need for formly\n var customElements = ['formly-field', 'formly-form'];\n _angularFix2['default'].forEach(customElements, function (el) {\n document.createElement(el);\n });\n })();\n }\n}\nmodule.exports = exports['default'];\n\n\n/** WEBPACK FOOTER **\n ** ./run/formlyCustomTags.js\n **/","import angular from 'angular-fix'\nexport default addCustomTags\n\n// @ngInject\nfunction addCustomTags($document) {\n // IE8 check ->\n // https://msdn.microsoft.com/en-us/library/cc196988(v=vs.85).aspx\n if ($document && $document.documentMode < 9) {\n const document = $document.get(0)\n // add the custom elements that we need for formly\n const customElements = [\n 'formly-field', 'formly-form',\n ]\n angular.forEach(customElements, el => {\n document.createElement(el)\n })\n }\n}\n\n\n\n/** WEBPACK FOOTER **\n ** C:/Projects/personal/angular-formly/~/eslint-loader?configFile=./other/src.eslintrc!C:/Projects/personal/angular-formly/src/run/formlyCustomTags.js\n **/","'use strict';\n\nObject.defineProperty(exports, '__esModule', {\n value: true\n});\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\nvar _angularFix = require('angular-fix');\n\nvar _angularFix2 = _interopRequireDefault(_angularFix);\n\nvar _otherUtils = require('../other/utils');\n\nexports['default'] = addFormlyNgModelAttrsManipulator;\n\n// @ngInject\nfunction addFormlyNgModelAttrsManipulator(formlyConfig, $interpolate) {\n if (formlyConfig.extras.disableNgModelAttrsManipulator) {\n return;\n }\n formlyConfig.templateManipulators.preWrapper.push(ngModelAttrsManipulator);\n\n function ngModelAttrsManipulator(template, options, scope) {\n var node = document.createElement('div');\n var skip = options.extras && options.extras.skipNgModelAttrsManipulator;\n if (skip === true) {\n return template;\n }\n node.innerHTML = template;\n\n var modelNodes = getNgModelNodes(node, skip);\n if (!modelNodes || !modelNodes.length) {\n return template;\n }\n\n addIfNotPresent(modelNodes, 'id', scope.id);\n addIfNotPresent(modelNodes, 'name', scope.name || scope.id);\n\n addValidation();\n alterNgModelAttr();\n addModelOptions();\n addTemplateOptionsAttrs();\n addNgModelElAttrs();\n\n return node.innerHTML;\n\n function addValidation() {\n if (_angularFix2['default'].isDefined(options.validators) || _angularFix2['default'].isDefined(options.validation.messages)) {\n addIfNotPresent(modelNodes, 'formly-custom-validation', '');\n }\n }\n\n function alterNgModelAttr() {\n if (isPropertyAccessor(options.key)) {\n addRegardlessOfPresence(modelNodes, 'ng-model', 'model.' + options.key);\n }\n }\n\n function addModelOptions() {\n if (_angularFix2['default'].isDefined(options.modelOptions)) {\n addIfNotPresent(modelNodes, 'ng-model-options', 'options.modelOptions');\n if (options.modelOptions.getterSetter) {\n addRegardlessOfPresence(modelNodes, 'ng-model', 'options.value');\n }\n }\n }\n\n function addTemplateOptionsAttrs() {\n if (!options.templateOptions && !options.expressionProperties) {\n // no need to run these if there are no templateOptions or expressionProperties\n return;\n }\n var to = options.templateOptions || {};\n var ep = options.expressionProperties || {};\n\n var ngModelAttributes = getBuiltInAttributes();\n\n // extend with the user's specifications winning\n _angularFix2['default'].extend(ngModelAttributes, options.ngModelAttrs);\n\n // Feel free to make this more simple :-)\n _angularFix2['default'].forEach(ngModelAttributes, function (val, name) {\n /* eslint complexity:[2, 14] */\n var attrVal = undefined,\n attrName = undefined;\n var ref = 'options.templateOptions[\\'' + name + '\\']';\n var toVal = to[name];\n var epVal = getEpValue(ep, name);\n\n var inTo = _angularFix2['default'].isDefined(toVal);\n var inEp = _angularFix2['default'].isDefined(epVal);\n if (val.value) {\n // I realize this looks backwards, but it's right, trust me...\n attrName = val.value;\n attrVal = name;\n } else if (val.statement && inTo) {\n attrName = val.statement;\n if (_angularFix2['default'].isString(to[name])) {\n attrVal = '$eval(' + ref + ')';\n } else if (_angularFix2['default'].isFunction(to[name])) {\n attrVal = ref + '(model[options.key], options, this, $event)';\n } else {\n throw new Error('options.templateOptions.' + name + ' must be a string or function: ' + JSON.stringify(options));\n }\n } else if (val.bound && inEp) {\n attrName = val.bound;\n attrVal = ref;\n } else if ((val.attribute || val.boolean) && inEp) {\n attrName = val.attribute || val.boolean;\n attrVal = '' + $interpolate.startSymbol() + ref + $interpolate.endSymbol();\n } else if (val.attribute && inTo) {\n attrName = val.attribute;\n attrVal = toVal;\n } else if (val.boolean) {\n if (inTo && !inEp && toVal) {\n attrName = val.boolean;\n attrVal = true;\n } else {\n /* eslint no-empty:0 */\n // empty to illustrate that a boolean will not be added via val.bound\n // if you want it added via val.bound, then put it in expressionProperties\n }\n } else if (val.bound && inTo) {\n attrName = val.bound;\n attrVal = ref;\n }\n\n if (_angularFix2['default'].isDefined(attrName) && _angularFix2['default'].isDefined(attrVal)) {\n addIfNotPresent(modelNodes, attrName, attrVal);\n }\n });\n }\n\n function addNgModelElAttrs() {\n _angularFix2['default'].forEach(options.ngModelElAttrs, function (val, name) {\n addRegardlessOfPresence(modelNodes, name, val);\n });\n }\n }\n\n // Utility functions\n function getNgModelNodes(node, skip) {\n var selectorNot = _angularFix2['default'].isString(skip) ? ':not(' + skip + ')' : '';\n var skipNot = ':not([formly-skip-ng-model-attrs-manipulator])';\n var query = '[ng-model]' + selectorNot + skipNot + ', [data-ng-model]' + selectorNot + skipNot;\n try {\n return node.querySelectorAll(query);\n } catch (e) {\n //this code is needed for IE8, as it does not support the CSS3 ':not' selector\n //it should be removed when IE8 support is dropped\n return getNgModelNodesFallback(node, skip);\n }\n }\n\n function getNgModelNodesFallback(node, skip) {\n var allNgModelNodes = node.querySelectorAll('[ng-model], [data-ng-model]');\n var matchingNgModelNodes = [];\n\n //make sure this array is compatible with NodeList type by adding an 'item' function\n matchingNgModelNodes.item = function (i) {\n return this[i];\n };\n\n for (var i = 0; i < allNgModelNodes.length; i++) {\n var ngModelNode = allNgModelNodes[i];\n if (!ngModelNode.hasAttribute('formly-skip-ng-model-attrs-manipulator') && !(_angularFix2['default'].isString(skip) && nodeMatches(ngModelNode, skip))) {\n matchingNgModelNodes.push(ngModelNode);\n }\n }\n\n return matchingNgModelNodes;\n }\n\n function nodeMatches(node, selector) {\n var div = document.createElement('div');\n div.innerHTML = node.outerHTML;\n return div.querySelector(selector);\n }\n\n function getBuiltInAttributes() {\n var ngModelAttributes = {\n focus: {\n attribute: 'formly-focus'\n }\n };\n var boundOnly = [];\n var bothBooleanAndBound = ['required', 'disabled'];\n var bothAttributeAndBound = ['pattern', 'minlength'];\n var statementOnly = ['change', 'keydown', 'keyup', 'keypress', 'click', 'focus', 'blur'];\n var attributeOnly = ['placeholder', 'min', 'max', 'step', 'tabindex', 'type'];\n if (formlyConfig.extras.ngModelAttrsManipulatorPreferUnbound) {\n bothAttributeAndBound.push('maxlength');\n } else {\n boundOnly.push('maxlength');\n }\n\n _angularFix2['default'].forEach(boundOnly, function (item) {\n ngModelAttributes[item] = { bound: 'ng-' + item };\n });\n\n _angularFix2['default'].forEach(bothBooleanAndBound, function (item) {\n ngModelAttributes[item] = { boolean: item, bound: 'ng-' + item };\n });\n\n _angularFix2['default'].forEach(bothAttributeAndBound, function (item) {\n ngModelAttributes[item] = { attribute: item, bound: 'ng-' + item };\n });\n\n _angularFix2['default'].forEach(statementOnly, function (item) {\n var propName = 'on' + item.substr(0, 1).toUpperCase() + item.substr(1);\n ngModelAttributes[propName] = { statement: 'ng-' + item };\n });\n\n _angularFix2['default'].forEach(attributeOnly, function (item) {\n ngModelAttributes[item] = { attribute: item };\n });\n return ngModelAttributes;\n }\n\n function getEpValue(ep, name) {\n return ep['templateOptions.' + name] || ep['templateOptions[\\'' + name + '\\']'] || ep['templateOptions[\"' + name + '\"]'];\n }\n\n function addIfNotPresent(nodes, attr, val) {\n _angularFix2['default'].forEach(nodes, function (node) {\n if (!node.getAttribute(attr)) {\n node.setAttribute(attr, val);\n }\n });\n }\n\n function addRegardlessOfPresence(nodes, attr, val) {\n _angularFix2['default'].forEach(nodes, function (node) {\n node.setAttribute(attr, val);\n });\n }\n\n function isPropertyAccessor(key) {\n return (0, _otherUtils.contains)(key, '.') || (0, _otherUtils.contains)(key, '[') && (0, _otherUtils.contains)(key, ']');\n }\n}\nmodule.exports = exports['default'];\n\n\n/** WEBPACK FOOTER **\n ** ./run/formlyNgModelAttrsManipulator.js\n **/","import angular from 'angular-fix'\nimport {contains} from '../other/utils'\n\nexport default addFormlyNgModelAttrsManipulator\n\n// @ngInject\nfunction addFormlyNgModelAttrsManipulator(formlyConfig, $interpolate) {\n if (formlyConfig.extras.disableNgModelAttrsManipulator) {\n return\n }\n formlyConfig.templateManipulators.preWrapper.push(ngModelAttrsManipulator)\n\n\n function ngModelAttrsManipulator(template, options, scope) {\n const node = document.createElement('div')\n const skip = options.extras && options.extras.skipNgModelAttrsManipulator\n if (skip === true) {\n return template\n }\n node.innerHTML = template\n\n const modelNodes = getNgModelNodes(node, skip)\n if (!modelNodes || !modelNodes.length) {\n return template\n }\n\n addIfNotPresent(modelNodes, 'id', scope.id)\n addIfNotPresent(modelNodes, 'name', scope.name || scope.id)\n\n addValidation()\n alterNgModelAttr()\n addModelOptions()\n addTemplateOptionsAttrs()\n addNgModelElAttrs()\n\n\n return node.innerHTML\n\n\n function addValidation() {\n if (angular.isDefined(options.validators) || angular.isDefined(options.validation.messages)) {\n addIfNotPresent(modelNodes, 'formly-custom-validation', '')\n }\n }\n\n function alterNgModelAttr() {\n if (isPropertyAccessor(options.key)) {\n addRegardlessOfPresence(modelNodes, 'ng-model', 'model.' + options.key)\n }\n }\n\n function addModelOptions() {\n if (angular.isDefined(options.modelOptions)) {\n addIfNotPresent(modelNodes, 'ng-model-options', 'options.modelOptions')\n if (options.modelOptions.getterSetter) {\n addRegardlessOfPresence(modelNodes, 'ng-model', 'options.value')\n }\n }\n }\n\n function addTemplateOptionsAttrs() {\n if (!options.templateOptions && !options.expressionProperties) {\n // no need to run these if there are no templateOptions or expressionProperties\n return\n }\n const to = options.templateOptions || {}\n const ep = options.expressionProperties || {}\n\n const ngModelAttributes = getBuiltInAttributes()\n\n // extend with the user's specifications winning\n angular.extend(ngModelAttributes, options.ngModelAttrs)\n\n // Feel free to make this more simple :-)\n angular.forEach(ngModelAttributes, (val, name) => {\n /* eslint complexity:[2, 14] */\n let attrVal, attrName\n const ref = `options.templateOptions['${name}']`\n const toVal = to[name]\n const epVal = getEpValue(ep, name)\n\n const inTo = angular.isDefined(toVal)\n const inEp = angular.isDefined(epVal)\n if (val.value) {\n // I realize this looks backwards, but it's right, trust me...\n attrName = val.value\n attrVal = name\n } else if (val.statement && inTo) {\n attrName = val.statement\n if (angular.isString(to[name])) {\n attrVal = `$eval(${ref})`\n } else if (angular.isFunction(to[name])) {\n attrVal = `${ref}(model[options.key], options, this, $event)`\n } else {\n throw new Error(\n `options.templateOptions.${name} must be a string or function: ${JSON.stringify(options)}`\n )\n }\n } else if (val.bound && inEp) {\n attrName = val.bound\n attrVal = ref\n } else if ((val.attribute || val.boolean) && inEp) {\n attrName = val.attribute || val.boolean\n attrVal = `${$interpolate.startSymbol()}${ref}${$interpolate.endSymbol()}`\n } else if (val.attribute && inTo) {\n attrName = val.attribute\n attrVal = toVal\n } else if (val.boolean) {\n if (inTo && !inEp && toVal) {\n attrName = val.boolean\n attrVal = true\n } else {\n /* eslint no-empty:0 */\n // empty to illustrate that a boolean will not be added via val.bound\n // if you want it added via val.bound, then put it in expressionProperties\n }\n } else if (val.bound && inTo) {\n attrName = val.bound\n attrVal = ref\n }\n\n if (angular.isDefined(attrName) && angular.isDefined(attrVal)) {\n addIfNotPresent(modelNodes, attrName, attrVal)\n }\n })\n }\n\n function addNgModelElAttrs() {\n angular.forEach(options.ngModelElAttrs, (val, name) => {\n addRegardlessOfPresence(modelNodes, name, val)\n })\n }\n }\n\n // Utility functions\n function getNgModelNodes(node, skip) {\n const selectorNot = angular.isString(skip) ? `:not(${skip})` : ''\n const skipNot = ':not([formly-skip-ng-model-attrs-manipulator])'\n const query = `[ng-model]${selectorNot}${skipNot}, [data-ng-model]${selectorNot}${skipNot}`\n try {\n return node.querySelectorAll(query)\n } catch (e) {\n //this code is needed for IE8, as it does not support the CSS3 ':not' selector\n //it should be removed when IE8 support is dropped\n return getNgModelNodesFallback(node, skip)\n }\n }\n\n function getNgModelNodesFallback(node, skip) {\n const allNgModelNodes = node.querySelectorAll('[ng-model], [data-ng-model]')\n const matchingNgModelNodes = []\n\n //make sure this array is compatible with NodeList type by adding an 'item' function\n matchingNgModelNodes.item = function(i) {\n return this[i]\n }\n\n for (let i = 0; i < allNgModelNodes.length; i++) {\n const ngModelNode = allNgModelNodes[i]\n if (!ngModelNode.hasAttribute('formly-skip-ng-model-attrs-manipulator') &&\n !(angular.isString(skip) && nodeMatches(ngModelNode, skip))) {\n matchingNgModelNodes.push(ngModelNode)\n }\n }\n\n return matchingNgModelNodes\n }\n\n function nodeMatches(node, selector) {\n const div = document.createElement('div')\n div.innerHTML = node.outerHTML\n return div.querySelector(selector)\n }\n\n function getBuiltInAttributes() {\n const ngModelAttributes = {\n focus: {\n attribute: 'formly-focus',\n },\n }\n const boundOnly = []\n const bothBooleanAndBound = ['required', 'disabled']\n const bothAttributeAndBound = ['pattern', 'minlength']\n const statementOnly = ['change', 'keydown', 'keyup', 'keypress', 'click', 'focus', 'blur']\n const attributeOnly = ['placeholder', 'min', 'max', 'step', 'tabindex', 'type']\n if (formlyConfig.extras.ngModelAttrsManipulatorPreferUnbound) {\n bothAttributeAndBound.push('maxlength')\n } else {\n boundOnly.push('maxlength')\n }\n\n angular.forEach(boundOnly, item => {\n ngModelAttributes[item] = {bound: 'ng-' + item}\n })\n\n angular.forEach(bothBooleanAndBound, item => {\n ngModelAttributes[item] = {boolean: item, bound: 'ng-' + item}\n })\n\n angular.forEach(bothAttributeAndBound, item => {\n ngModelAttributes[item] = {attribute: item, bound: 'ng-' + item}\n })\n\n angular.forEach(statementOnly, item => {\n const propName = 'on' + item.substr(0, 1).toUpperCase() + item.substr(1)\n ngModelAttributes[propName] = {statement: 'ng-' + item}\n })\n\n angular.forEach(attributeOnly, item => {\n ngModelAttributes[item] = {attribute: item}\n })\n return ngModelAttributes\n }\n\n function getEpValue(ep, name) {\n return ep['templateOptions.' + name] ||\n ep[`templateOptions['${name}']`] ||\n ep[`templateOptions[\"${name}\"]`]\n }\n\n function addIfNotPresent(nodes, attr, val) {\n angular.forEach(nodes, node => {\n if (!node.getAttribute(attr)) {\n node.setAttribute(attr, val)\n }\n })\n }\n\n function addRegardlessOfPresence(nodes, attr, val) {\n angular.forEach(nodes, node => {\n node.setAttribute(attr, val)\n })\n }\n\n function isPropertyAccessor(key) {\n return contains(key, '.') || (contains(key, '[') && contains(key, ']'))\n }\n}\n\n\n\n/** WEBPACK FOOTER **\n ** C:/Projects/personal/angular-formly/~/eslint-loader?configFile=./other/src.eslintrc!C:/Projects/personal/angular-formly/src/run/formlyNgModelAttrsManipulator.js\n **/","'use strict';\n\nObject.defineProperty(exports, '__esModule', {\n value: true\n});\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\nvar _otherUtils = require('../other/utils');\n\nvar _otherUtils2 = _interopRequireDefault(_otherUtils);\n\nexports['default'] = formlyUtil;\n\n// @ngInject\nfunction formlyUtil() {\n return _otherUtils2['default'];\n}\nmodule.exports = exports['default'];\n\n\n/** WEBPACK FOOTER **\n ** ./services/formlyUtil.js\n **/","import utils from '../other/utils'\n\nexport default formlyUtil\n\n// @ngInject\nfunction formlyUtil() {\n return utils\n}\n\n\n\n/** WEBPACK FOOTER **\n ** C:/Projects/personal/angular-formly/~/eslint-loader?configFile=./other/src.eslintrc!C:/Projects/personal/angular-formly/src/services/formlyUtil.js\n **/","'use strict';\n\nObject.defineProperty(exports, '__esModule', {\n value: true\n});\n\nfunction _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) arr2[i] = arr[i]; return arr2; } else { return Array.from(arr); } }\n\nexports['default'] = formlyWarn;\n\n// @ngInject\nfunction formlyWarn(formlyConfig, formlyErrorAndWarningsUrlPrefix, $log) {\n return function warn() {\n if (!formlyConfig.disableWarnings) {\n var args = Array.prototype.slice.call(arguments);\n var warnInfoSlug = args.shift();\n args.unshift('Formly Warning:');\n args.push('' + formlyErrorAndWarningsUrlPrefix + warnInfoSlug);\n $log.warn.apply($log, _toConsumableArray(args));\n }\n };\n}\nmodule.exports = exports['default'];\n\n\n/** WEBPACK FOOTER **\n ** ./services/formlyWarn.js\n **/","export default formlyWarn\n\n// @ngInject\nfunction formlyWarn(formlyConfig, formlyErrorAndWarningsUrlPrefix, $log) {\n return function warn() {\n if (!formlyConfig.disableWarnings) {\n const args = Array.prototype.slice.call(arguments)\n const warnInfoSlug = args.shift()\n args.unshift('Formly Warning:')\n args.push(`${formlyErrorAndWarningsUrlPrefix}${warnInfoSlug}`)\n $log.warn(...args)\n }\n }\n}\n\n\n\n/** WEBPACK FOOTER **\n ** C:/Projects/personal/angular-formly/~/eslint-loader?configFile=./other/src.eslintrc!C:/Projects/personal/angular-formly/src/services/formlyWarn.js\n **/","module.exports = __WEBPACK_EXTERNAL_MODULE_18__;\n\n\n/*****************\n ** WEBPACK FOOTER\n ** external \"angular\"\n ** module id = 18\n ** module chunks = 0\n **/"],"sourceRoot":""} \ No newline at end of file diff --git a/package.json b/package.json index 4b4f94ba..12f1cb4a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "angular-formly", - "version": "0.0.0-semantically-released.0", + "version": "8.0.2", "author": "Astrism ", "contributors": [ "Astrism ",