diff --git a/dist/formly.js b/dist/formly.js index f255d95d..82751d01 100644 --- a/dist/formly.js +++ b/dist/formly.js @@ -1,4 +1,4 @@ -//! angular-formly version 6.26.9 built with ♥ by Astrism , Kent C. Dodds (ó ì_í)=óò=(ì_í ò) +//! angular-formly version 7.0.0 built with ♥ by Astrism , Kent C. Dodds (ó ì_í)=óò=(ì_í ò) (function webpackUniversalModuleDefinition(root, factory) { if(typeof exports === 'object' && typeof module === 'object') @@ -147,7 +147,7 @@ return /******/ (function(modules) { // webpackBootstrap ngModule.constant('formlyApiCheck', _providersFormlyApiCheck2['default']); ngModule.constant('formlyErrorAndWarningsUrlPrefix', _otherDocsBaseUrl2['default']); - ngModule.constant('formlyVersion', ("6.26.9")); // <-- webpack variable + ngModule.constant('formlyVersion', ("7.0.0")); // <-- webpack variable ngModule.provider('formlyUsability', _providersFormlyUsability2['default']); ngModule.provider('formlyConfig', _providersFormlyConfig2['default']); @@ -269,15 +269,10 @@ return /******/ (function(modules) { // webpackBootstrap return apiCheck.utils.checkerHelpers.setupChecker(shapeRequiredIfNotDefinition); } - // TODO in 7.0.0 .nullable is available on all checkers - function nullable(checker) { - return apiCheck.oneOfType([apiCheck.oneOf([null]), checker]); - } - var formlyExpression = apiCheck.oneOfType([apiCheck.string, apiCheck.func]); - var specifyWrapperType = nullable(apiCheck.typeOrArrayOf(apiCheck.string)); + var specifyWrapperType = apiCheck.typeOrArrayOf(apiCheck.string).nullable; - var apiCheckProperty = apiCheck.oneOfType([apiCheck.func, apiCheck.objectOf(apiCheck.func)]); + var apiCheckProperty = apiCheck.func; var apiCheckInstanceProperty = apiCheck.shape.onlyIf('apiCheck', apiCheck.func.withProperties({ warn: apiCheck.func, @@ -293,7 +288,6 @@ return /******/ (function(modules) { // webpackBootstrap templateUrl: apiCheck.shape.ifNot('template', apiCheck.string).optional, types: apiCheck.typeOrArrayOf(apiCheck.string).optional, overwriteOk: apiCheck.bool.optional, - validateOptions: apiCheck.func.optional, apiCheck: apiCheckProperty.optional, apiCheckInstance: apiCheckInstanceProperty.optional, apiCheckFunction: apiCheckFunctionProperty.optional, @@ -307,10 +301,10 @@ return /******/ (function(modules) { // webpackBootstrap var modelChecker = apiCheck.oneOfType([apiCheck.string, apiCheck.object]); - var templateManipulators = nullable(apiCheck.shape({ - preWrapper: nullable(apiCheck.arrayOf(apiCheck.func)).optional, - postWrapper: nullable(apiCheck.arrayOf(apiCheck.func)).optional - }).strict); + 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, @@ -356,18 +350,18 @@ return /******/ (function(modules) { // webpackBootstrap hideExpression: formlyExpression.optional, ngModelElAttrs: apiCheck.objectOf(apiCheck.string).optional, ngModelAttrs: apiCheck.objectOf(apiCheck.shape({ - expression: apiCheck.shape.ifNot(['value', 'attribute', 'bound', 'boolean'], apiCheck.any).optional, - value: apiCheck.shape.ifNot('expression', apiCheck.any).optional, - attribute: apiCheck.shape.ifNot('expression', apiCheck.any).optional, - bound: apiCheck.shape.ifNot('expression', apiCheck.any).optional, - boolean: apiCheck.shape.ifNot('expression', apiCheck.any).optional + 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: nullable(apiCheck.bool).optional, + show: apiCheck.bool.nullable.optional, messages: apiCheck.objectOf(formlyExpression).optional, errorExistsAndShouldBeVisible: apiCheck.bool.optional }).optional, @@ -422,7 +416,6 @@ return /******/ (function(modules) { // webpackBootstrap 'extends': apiCheck.string.optional, wrapper: specifyWrapperType.optional, data: apiCheck.object.optional, - validateOptions: apiCheck.func.optional, apiCheck: apiCheckProperty.optional, apiCheckInstance: apiCheckInstanceProperty.optional, apiCheckFunction: apiCheckFunctionProperty.optional, @@ -452,7 +445,7 @@ return /******/ (function(modules) { // webpackBootstrap Object.defineProperty(exports, "__esModule", { value: true }); - exports["default"] = "https://github.com/formly-js/angular-formly/blob/" + ("6.26.9") + "/other/ERRORS_AND_WARNINGS.md#"; + exports["default"] = "https://github.com/formly-js/angular-formly/blob/" + ("7.0.0") + "/other/ERRORS_AND_WARNINGS.md#"; module.exports = exports["default"]; /***/ }, @@ -621,7 +614,6 @@ return /******/ (function(modules) { // webpackBootstrap prefix: 'formlyConfig.setType', url: 'settype-validation-failed' }); - checkDeprecatedOptions(options); if (!options.overwriteOk) { checkOverwrite(options.name, typeMap, options, 'types'); } else { @@ -633,7 +625,6 @@ return /******/ (function(modules) { // webpackBootstrap var extendsType = getType(options['extends'], true, options); extendTypeControllerFunction(options, extendsType); extendTypeLinkFunction(options, extendsType); - extendTypeValidateOptionsFunction(options, extendsType); extendTypeDefaultOptions(options, extendsType); _otherUtils2['default'].reverseDeepMerge(options, extendsType); extendTemplate(options, extendsType); @@ -680,31 +671,6 @@ return /******/ (function(modules) { // webpackBootstrap } } - function extendTypeValidateOptionsFunction(options, extendsType) { - var extendsFn = extendsType.validateOptions; - if (!_angularFix2['default'].isDefined(extendsFn)) { - return; - } - var optionsFn = options.validateOptions; - var originalDefaultOptions = options.defaultOptions; - if (_angularFix2['default'].isDefined(optionsFn)) { - options.validateOptions = function (opts) { - optionsFn(opts); - var mergedOptions = _angularFix2['default'].copy(opts); - var defaultOptions = originalDefaultOptions; - if (defaultOptions) { - if (_angularFix2['default'].isFunction(defaultOptions)) { - defaultOptions = defaultOptions(mergedOptions); - } - _otherUtils2['default'].reverseDeepMerge(mergedOptions, defaultOptions); - } - extendsFn(mergedOptions); - }; - } else { - options.validateOptions = extendsFn; - } - } - function extendTypeDefaultOptions(options, extendsType) { var extendsDO = extendsType.defaultOptions; if (!_angularFix2['default'].isDefined(extendsDO)) { @@ -811,7 +777,6 @@ return /******/ (function(modules) { // webpackBootstrap if (options.template) { formlyUsabilityProvider.checkWrapperTemplate(options.template, options); } - checkDeprecatedOptions(options); if (!options.overwriteOk) { checkOverwrite(options.name, templateWrappersMap, options, 'templateWrappers'); } else { @@ -833,15 +798,6 @@ return /******/ (function(modules) { // webpackBootstrap } } - function checkDeprecatedOptions(options) { - if (options.apiCheck && !_angularFix2['default'].isFunction(options.apiCheck)) { - warn('apicheck-as-an-object-deprecated', 'apiCheck as an object has been deprecated.', 'Attempted for type: ' + options.name, options); - } - if (options.validateOptions) { - warn('validateoptions-deprecated', 'the `validateOptions` property has been deprecated.', 'Attempted for type: ' + options.name, options); - } - } - function getWrapper(name) { return templateWrappersMap[name || defaultWrapperName]; } @@ -910,7 +866,9 @@ return /******/ (function(modules) { // webpackBootstrap var _angularFix2 = _interopRequireDefault(_angularFix); - exports['default'] = { formlyEval: formlyEval, getFieldId: getFieldId, reverseDeepMerge: reverseDeepMerge, findByNodeName: findByNodeName, arrayify: arrayify, extendFunction: extendFunction, extendArray: extendArray, startsWith: startsWith }; + exports['default'] = { + formlyEval: formlyEval, getFieldId: getFieldId, reverseDeepMerge: reverseDeepMerge, findByNodeName: findByNodeName, arrayify: arrayify, extendFunction: extendFunction, extendArray: extendArray, startsWith: startsWith, contains: contains + }; function formlyEval(scope, expression, $modelValue, $viewValue, extraLocals) { if (_angularFix2['default'].isFunction(expression)) { @@ -1022,6 +980,14 @@ return /******/ (function(modules) { // webpackBootstrap 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']; /***/ }, @@ -1111,13 +1077,12 @@ return /******/ (function(modules) { // webpackBootstrap exports['default'] = formlyCustomValidation; // @ngInject - function formlyCustomValidation(formlyConfig, formlyUtil, $q, formlyWarn) { + function formlyCustomValidation(formlyUtil) { return { restrict: 'A', require: 'ngModel', link: function formlyCustomValidationLink(scope, el, attrs, ctrl) { var opts = scope.options; - var warnedValidators = []; opts.validation.messages = opts.validation.messages || {}; _angularFix2['default'].forEach(opts.validation.messages, function (message, key) { opts.validation.messages[key] = function () { @@ -1149,31 +1114,10 @@ return /******/ (function(modules) { // webpackBootstrap } function setupWithValidators(validator, name, isAsync) { - var isPossiblyAsync = !_angularFix2['default'].isString(validator); - var validatorCollection = isPossiblyAsync || isAsync ? '$asyncValidators' : '$validators'; - - // UPDATE IN 7.0.0 - // this is temporary until we can have a breaking change. Allow people to get the wins of the explicitAsync api - if (formlyConfig.extras.explicitAsync && !isAsync) { - validatorCollection = '$validators'; - } + var validatorCollection = isAsync ? '$asyncValidators' : '$validators'; ctrl[validatorCollection][name] = function evalValidity(modelValue, viewValue) { - var value = formlyUtil.formlyEval(scope, validator, modelValue, viewValue); - // UPDATE IN 7.0.0 - // In the next breaking change, this code should simply return the value - if (isAsync) { - return value; - } else if (isPossiblyAsync && !formlyConfig.extras.explicitAsync) { - if (isPromiseLike(value)) { - logAsyncValidatorsDeprecationNotice(validator, opts); - return value; - } else { - return value ? $q.when(value) : $q.reject(value); - } - } else { - return value; - } + return formlyUtil.formlyEval(scope, validator, modelValue, viewValue); }; } @@ -1181,13 +1125,7 @@ return /******/ (function(modules) { // webpackBootstrap var inFlightValidator = undefined; ctrl.$parsers.unshift(function evalValidityOfParser(viewValue) { var isValid = formlyUtil.formlyEval(scope, validator, ctrl.$modelValue, viewValue); - // UPDATE IN 7.0.0 - // In the next breaking change, rather than checking for isPromiseLike, it should just check for isAsync. - - if (isAsync || isPromiseLike(isValid)) { - if (!isAsync) { - logAsyncValidatorsDeprecationNotice(validator, opts); - } + if (isAsync) { ctrl.$pending = ctrl.$pending || {}; ctrl.$pending[name] = true; inFlightValidator = isValid; @@ -1213,23 +1151,10 @@ return /******/ (function(modules) { // webpackBootstrap return viewValue; }); } - - function logAsyncValidatorsDeprecationNotice(validator, options) { - if (warnedValidators.indexOf(validator) !== -1) { - // we've warned about this one before. No spam necessary... - return; - } - warnedValidators.push(validator); - formlyWarn('validators-returning-promises-should-use-asyncvalidators', 'Validators returning promises should use asyncValidators instead of validators.', options); - } } }; - - function isPromiseLike(obj) { - return obj && _angularFix2['default'].isFunction(obj.then); - } } - formlyCustomValidation.$inject = ["formlyConfig", "formlyUtil", "$q", "formlyWarn"]; + formlyCustomValidation.$inject = ["formlyUtil"]; module.exports = exports['default']; /***/ }, @@ -1807,7 +1732,6 @@ return /******/ (function(modules) { // webpackBootstrap wrapper.forEach(function (aWrapper) { formlyUsability.checkWrapper(aWrapper, options); - aWrapper.validateOptions && aWrapper.validateOptions(options); runApiCheck(aWrapper, options); }); var promises = wrapper.map(function (w) { @@ -1884,9 +1808,6 @@ return /******/ (function(modules) { // webpackBootstrap // validate with the type var type = options.type && formlyConfig.getType(options.type); if (type) { - if (type.validateOptions) { - type.validateOptions(options); - } runApiCheck(type, options, true); } if (options.expressionProperties && options.expressionProperties.hide) { @@ -1925,26 +1846,16 @@ return /******/ (function(modules) { // webpackBootstrap return; } var fn = apiCheckFunction || 'warn'; - if (_angularFix2['default'].isFunction(apiCheck)) { - // 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); - }); - } else { - // TODO this is the deprecated API. Remove this in a breaking change. - var checker = instance.shape(apiCheck); - var checkOptions = apiCheckOptions || { - prefix: 'formly-field type ' + options.type, + // 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' - }; - instance[fn](checker, options, checkOptions); - } + }, apiCheckOptions); + instance[fn](checker, options[name], checkOptions); + }); } } formlyField.$inject = ["$http", "$q", "$compile", "$templateCache", "$interpolate", "formlyConfig", "formlyApiCheck", "formlyUtil", "formlyUsability", "formlyWarn"]; @@ -2400,10 +2311,12 @@ return /******/ (function(modules) { // webpackBootstrap var _angularFix2 = _interopRequireDefault(_angularFix); + var _otherUtils = __webpack_require__(10); + exports['default'] = addFormlyNgModelAttrsManipulator; // @ngInject - function addFormlyNgModelAttrsManipulator(formlyConfig, $interpolate, formlyWarn) { + function addFormlyNgModelAttrsManipulator(formlyConfig, $interpolate) { if (formlyConfig.extras.disableNgModelAttrsManipulator) { return; } @@ -2411,7 +2324,7 @@ return /******/ (function(modules) { // webpackBootstrap function ngModelAttrsManipulator(template, options, scope) { var node = document.createElement('div'); - var skip = getSkip(options); + var skip = options.extras && options.extras.skipNgModelAttrsManipulator; if (skip === true) { return template; } @@ -2426,6 +2339,7 @@ return /******/ (function(modules) { // webpackBootstrap addIfNotPresent(modelNodes, 'name', scope.name || scope.id); addValidation(); + alterNgModelAttr(); addModelOptions(); addTemplateOptionsAttrs(); addNgModelElAttrs(); @@ -2438,13 +2352,17 @@ return /******/ (function(modules) { // webpackBootstrap } } + 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) { - _angularFix2['default'].forEach(modelNodes, function (modelNode) { - modelNode.setAttribute('ng-model', 'options.value'); - }); + addRegardlessOfPresence(modelNodes, 'ng-model', 'options.value'); } } } @@ -2477,8 +2395,8 @@ return /******/ (function(modules) { // webpackBootstrap // I realize this looks backwards, but it's right, trust me... attrName = val.value; attrVal = name; - } else if (val.expression && inTo) { - attrName = val.expression; + } else if (val.statement && inTo) { + attrName = val.statement; if (_angularFix2['default'].isString(to[name])) { attrVal = '$eval(' + ref + ')'; } else if (_angularFix2['default'].isFunction(to[name])) { @@ -2517,7 +2435,7 @@ return /******/ (function(modules) { // webpackBootstrap function addNgModelElAttrs() { _angularFix2['default'].forEach(options.ngModelElAttrs, function (val, name) { - addIfNotPresent(modelNodes, name, val); + addRegardlessOfPresence(modelNodes, name, val); }); } } @@ -2561,18 +2479,6 @@ return /******/ (function(modules) { // webpackBootstrap return div.querySelector(selector); } - function getSkip(options) { - // UPDATE IN 7.0.0 - var skip = options.extras && options.extras.skipNgModelAttrsManipulator; - if (!_angularFix2['default'].isDefined(skip)) { - skip = options.data && options.data.skipNgModelAttrsManipulator; - if (_angularFix2['default'].isDefined(skip)) { - formlyWarn('skipngmodelattrsmanipulator-moved', 'The skipNgModelAttrsManipulator property has been moved from the `data` property to the `extras` property', options); - } - } - return skip; - } - function getBuiltInAttributes() { var ngModelAttributes = { focus: { @@ -2582,7 +2488,7 @@ return /******/ (function(modules) { // webpackBootstrap var boundOnly = []; var bothBooleanAndBound = ['required', 'disabled']; var bothAttributeAndBound = ['pattern', 'minlength']; - var expressionOnly = ['change', 'keydown', 'keyup', 'keypress', 'click', 'focus', 'blur']; + var statementOnly = ['change', 'keydown', 'keyup', 'keypress', 'click', 'focus', 'blur']; var attributeOnly = ['placeholder', 'min', 'max', 'tabindex', 'type']; if (formlyConfig.extras.ngModelAttrsManipulatorPreferUnbound) { bothAttributeAndBound.push('maxlength'); @@ -2602,9 +2508,9 @@ return /******/ (function(modules) { // webpackBootstrap ngModelAttributes[item] = { attribute: item, bound: 'ng-' + item }; }); - _angularFix2['default'].forEach(expressionOnly, function (item) { + _angularFix2['default'].forEach(statementOnly, function (item) { var propName = 'on' + item.substr(0, 1).toUpperCase() + item.substr(1); - ngModelAttributes[propName] = { expression: 'ng-' + item }; + ngModelAttributes[propName] = { statement: 'ng-' + item }; }); _angularFix2['default'].forEach(attributeOnly, function (item) { @@ -2624,8 +2530,18 @@ return /******/ (function(modules) { // webpackBootstrap } }); } + + 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", "formlyWarn"]; + addFormlyNgModelAttrsManipulator.$inject = ["formlyConfig", "$interpolate"]; module.exports = exports['default']; /***/ }, diff --git a/dist/formly.min.js b/dist/formly.min.js index 58b93970..dc7dab37 100644 --- a/dist/formly.min.js +++ b/dist/formly.min.js @@ -1,4 +1,4 @@ -//! angular-formly version 6.26.9 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(n){if(o[n])return o[n].exports;var r=o[n]={exports:{},id:n,loaded:!1};return e[n].call(r.exports,r,r.exports,t),r.loaded=!0,r.exports}var o={};return t.m=e,t.c=o,t.p="",t(0)}([function(e,t,o){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var r=o(9),i=n(r);t["default"]=i["default"],e.exports=t["default"]},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=o(18);n.version||(n=window.angular),t["default"]=n,e.exports=t["default"]},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t["default"]="https://github.com/formly-js/angular-formly/blob/6.26.9/other/ERRORS_AND_WARNINGS.md#",e.exports=t["default"]},function(e,t,o){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function r(e,t,o,n,r){return m["default"].isFunction(t)?t(n,o,e,r):e.$eval(t,m["default"].extend({$viewValue:n,$modelValue:o},r))}function i(e,t,o){if(t.id)return t.id;var n=t.type;return!n&&t.template?n="template":!n&&t.templateUrl&&(n="templateUrl"),[e,n,t.key,o].join("_")}function a(e){return m["default"].forEach(arguments,function(t,o){o&&m["default"].forEach(t,function(t,o){m["default"].isDefined(e[o])?l(e[o],t)&&a(e[o],t):e[o]=m["default"].copy(t)})}),e}function l(e,t){return m["default"].isObject(e)&&m["default"].isObject(t)&&Object.getPrototypeOf(e)===Object.getPrototypeOf(t)}function f(e,t){if(e.prop||(e=m["default"].element(e)),e.prop("nodeName")===t.toUpperCase())return e;for(var o=e.children(),n=0;o&&no;o++)t[o]=arguments[o];return function(){var e=arguments;t.forEach(function(t){return t.apply(null,e)})}}function p(e,t,o){return o&&(e=e[o],t=t[o]),t&&e?(m["default"].forEach(t,function(t){-1===e.indexOf(t)&&e.push(t)}),e):t?t:e}function d(e,t){return m["default"].isString(e)&&m["default"].isString(t)?e.length>=t.length&&e.substring(0,t.length)===t:!1}Object.defineProperty(t,"__esModule",{value:!0});var c=o(1),m=n(c);t["default"]={formlyEval:r,getFieldId:i,reverseDeepMerge:a,findByNodeName:f,arrayify:s,extendFunction:u,extendArray:p,startsWith:d},e.exports=t["default"]},function(t,o){t.exports=e},function(e,t,o){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function r(e,t,o,n){function r(e){return e&&a["default"].isFunction(e.then)}return{restrict:"A",require:"ngModel",link:function(i,l,f,s){function u(e,t,o){p(t,o),t=a["default"].isObject(t)?t.expression:t,h?d(t,o,e):c(t,o,e)}function p(e,o){var n=e.message;n&&(y.validation.messages[o]=function(){return t.formlyEval(i,n,s.$modelValue,s.$viewValue)})}function d(n,l,f){var u=!a["default"].isString(n),p=u||f?"$asyncValidators":"$validators";e.extras.explicitAsync&&!f&&(p="$validators"),s[p][l]=function(a,l){var s=t.formlyEval(i,n,a,l);return f?s:u&&!e.extras.explicitAsync?r(s)?(m(n,y),s):s?o.when(s):o.reject(s):s}}function c(e,o,n){var a=void 0;s.$parsers.unshift(function(l){var f=t.formlyEval(i,e,s.$modelValue,l);return n||r(f)?(n||m(e,y),s.$pending=s.$pending||{},s.$pending[o]=!0,a=f,f.then(function(){a===f&&s.$setValidity(o,!0)})["catch"](function(){a===f&&s.$setValidity(o,!1)})["finally"](function(){var e=s.$pending||{};1===Object.keys(e).length?delete s.$pending:delete s.$pending[o]})):s.$setValidity(o,f),l})}function m(e,t){-1===v.indexOf(e)&&(v.push(e),n("validators-returning-promises-should-use-asyncvalidators","Validators returning promises should use asyncValidators instead of validators.",t))}var y=i.options,v=[];y.validation.messages=y.validation.messages||{},a["default"].forEach(y.validation.messages,function(e,o){y.validation.messages[o]=function(){return t.formlyEval(i,e,s.$modelValue,s.$viewValue)}});var h=s.hasOwnProperty("$validators")&&!f.hasOwnProperty("useParsers");a["default"].forEach(y.validators,u.bind(null,!1)),a["default"].forEach(y.asyncValidators,u.bind(null,!0))}}}Object.defineProperty(t,"__esModule",{value:!0});var i=o(1),a=n(i);t["default"]=r,r.$inject=["formlyConfig","formlyUtil","$q","formlyWarn"],e.exports=t["default"]},function(e,t,o){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function r(e){if(Array.isArray(e)){for(var t=0,o=Array(e.length);t\n \n ")}function y(){e.options.elementAttributes&&n.attr(e.options.elementAttributes)}function v(){e.options.className&&n.addClass(e.options.className),e.options.type&&n.addClass("formly-field-"+e.options.type)}function x(t){return n.html(h(t)),o(n.contents())(e),t}function A(t){function o(t){var o=/\{\{(.*?)}}/,r=o.exec(t);r&&(t=i(t)(e)),n(t)}function n(t){e.$watch('form["'+t+'"]',function(t){t&&(F>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,o=e.options,n=e.fc;if(n.$invalid){if("boolean"==typeof o.validation.show)return o.validation.show;if(t)return d.formlyEval(e,t,n.$modelValue,n.$viewValue);var r=s["default"].isUndefined(n.$touched)&&n.$dirty;return e.fc.$touched||r}return!1},function(t){e.options.validation.errorExistsAndShouldBeVisible=t,e.showError=t})}function p(){m("parsers")}function c(){m("formatters");var t=e.fc,o=e.form.$pristine;e.options.formatters&&!function(){var n=t.$modelValue;t.$formatters.forEach(function(e){n=e(n)}),t.$setViewValue(n),t.$render(),t.$setPristine(),o&&e.form.$setPristine()}()}function m(t){function o(r){if(!r)return[];s["default"].isString(r)&&(r=f.getType(r,!0,e.options));var i=[];return r["extends"]&&(i=d.extendArray(i,o(r["extends"]))),i=d.extendArray(i,l(r,t,[])),i=d.extendArray(i,n(a(r)))}function n(){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,o(e))}),t}function i(t){function o(o){var n=e.options.value();return d.formlyEval(e,t,n,o)}return o[u]=t,o}var u="originalParser";"formatters"===t&&(u="originalFormatter");var p=o(M);p=d.extendArray(p,n(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 o;e["$"+t]=(o=e["$"+t]).concat.apply(o,r(p))})}var y=s["default"].noop;if(!e.options.noFormControl){var v=s["default"].element("
"+t+"
"),h=v[0].querySelectorAll("[ng-model],[data-ng-model]");h.length&&s["default"].forEach(h,function(e){F++,o(e.getAttribute("name"))})}}function E(){M&&M.link&&M.link.apply(_,C),e.options.link&&e.options.link.apply(_,C)}function $(o){return function(n){var r=t.when(n);return s["default"].forEach(o,function(o){r=r.then(function(n){return t.when(o(n,e.options,e)).then(function(e){return s["default"].isString(e)?e:h(e)})})}),r}}if(e.options.fieldGroup)return void c();!p&&e.options.model&&e.$watch("options.model",function(){return e.options.runExpressions()},!0),y(),v();var M=g(e.options),C=arguments,_=this,F=0,T=b(e.options,e.formOptions);O(e.options).then($(T.preWrapper)).then(k(e.options,e.formOptions)).then($(T.postWrapper)).then(x).then(A).then(E)["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 h(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 o(e){var t=e||{},o=t.preWrapper,i=void 0===o?[]:o,a=t.postWrapper,l=void 0===a?[]:a;n=n.concat(i),r=r.concat(l)}var n=[],r=[];return o(e.templateManipulators),o(t.templateManipulators),o(f.templateManipulators),{preWrapper:n,postWrapper:r}}function O(e){function t(t,o){return s["default"].isDefined(e[t])?e[t]:o&&s["default"].isDefined(o[t])?o[t]:void 0}var o=f.getType(e.type,!0,e),n=t("template",o),r=t("templateUrl",o);if(s["default"].isUndefined(n)&&!r)throw c.getFieldError("type-type-has-no-template","Type '"+e.type+"' has no template. On element:",e);return x(r||n,s["default"].isUndefined(n),e)}function x(o,r,i){var a=void 0;if(a=s["default"].isFunction(o)?t.when(o(i)):t.when(o),!r)return a;var l=function(){var t={cache:n};return{v:a.then(function(o){return e.get(o,t)}).then(function(e){return e.data})["catch"](function(e){m("problem-loading-template-for-templateurl","Problem loading template for "+o,e)})}}();return"object"==typeof l?l.v:void 0}function k(e,o){var n=E(e,o);return function(o){if(!n.length)return t.when(o);n.forEach(function(t){c.checkWrapper(t,e),t.validateOptions&&t.validateOptions(e),M(t,e)});var r=n.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,n[t])}),e.reverse();var t=e.shift();return e.forEach(function(e){t=A(t,e)}),A(t,o)})}}function A(e,t){var o=s["default"].element("");o.append(e);var n=o.find("formly-transclude");return n.length||(n=d.findByNodeName(o,"formly-transclude")),n.replaceWith(t),o.html()}function E(e,t){var o=e.wrapper;if(null===o)return[];o=o?j(o).map(f.getWrapper):j(f.getWrapperByType(e.type));var n=f.getType(e.type,!0,e);if(n&&n.wrapper){var r=j(n.wrapper).map(f.getWrapper);o=o.concat(r)}if(t.wrapper){var i=j(t.wrapper).map(f.getWrapper);o=o.concat(i)}var a=f.getWrapper();return a&&o.push(a),o}function $(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&&(t.validateOptions&&t.validateOptions(e),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 w(e){u["throw"](u.fieldGroup,e,{prefix:"formly-field directive",url:"formly-field-directive-validation-failed"})}function M(e,t,o){var n=e.apiCheck,r=e.apiCheckInstance,i=e.apiCheckFunction,a=e.apiCheckOptions;C(n,r,i,a,t),o&&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,o,n,r){if(e){var i=t||f.extras.apiCheckInstance||u;if(!i.config.disabled&&!p["default"].globalConfig.disabled){var a=o||"warn";if(s["default"].isFunction(e)){var l=e(i);s["default"].forEach(l,function(e,t){var o=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"},n);i[a](o,r[t],l)})}else{var d=i.shape(e),c=n||{prefix:"formly-field type "+r.type,url:u.config.output.docsBaseUrl+"formly-field-type-apicheck-failed"};i[a](d,r,c)}}}}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:v}}function a(e){return l(e,"optionsTypes",[])}function l(e,t,o){return e.defaultOptions&&e.defaultOptions[t]||o}Object.defineProperty(t,"__esModule",{value:!0});var f=o(1),s=n(f),u=o(4),p=n(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 o(e,t){return{restrict:"A",link:function(o,n,r){var i=null,a=n[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"]=o,o.$inject=["$timeout","$document"],e.exports=t["default"]},function(e,t,o){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function r(e){if(Array.isArray(e)){for(var t=0,o=Array(e.length);t\n <"+v+' formly-field\n ng-repeat="field in fields '+s()+'"\n '+l()+'="!field.hide"\n class="formly-field"\n options="field"\n model="field.model || 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(t,o,i){function l(){f["default"].forEach(t.fields,function(e,o){var n=e.model||t.model;if(e.runExpressions&&e.runExpressions(),e.hideExpression){var r=n[e.key];e.hide=k(e.hideExpression,r,e,o)}e.extras&&e.extras.validateOnModelChange&&e.formControl&&e.formControl.$validate()})}function s(){t.fields=t.fields||[];var o=t.options.fieldTransform||n.extras.fieldTransform;if(o&&(t.fields=o(t.fields,t.model,t.options,t.form),!t.fields))throw e.getFormlyError("fieldTransform must return an array of fields");m(),f["default"].forEach(t.fields,h),f["default"].forEach(t.fields,g)}function u(){o["throw"]([o.formOptionsApi.optional],[t.options],{prefix:"formly-form options check"}),t.options=t.options||{},t.options.formState=t.options.formState||{},f["default"].extend(t.options,{updateInitialValue:p,resetModel:c})}function p(){f["default"].forEach(t.fields,function(e){d(e)&&e.options?e.options.updateInitialValue():e.updateInitialValue()})}function c(){f["default"].forEach(t.fields,function(e){d(e)&&e.options?e.options.resetModel():e.resetModel&&e.resetModel()})}function m(){var e=[t.model];t.options.formState&&e.push(t.options.formState),f["default"].forEach(t.fields,function(o){var n=y(o);o.model&&n&&-1===e.indexOf(o.model)&&(t.$watch(function(){return o.model},l,!0),e.push(o.model))})}function y(o){var n=!0;if(f["default"].isString(o.model)){var r=o.model,i=t.fields.indexOf(o);if(n=!v(r),o.model=k(r,void 0,o,i),!o.model)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.",o)}return n}function v(e){return["model","formState"].some(function(t){return i.startsWith(e,t+".")||i.startsWith(e,t+"[")})}function h(e,t){d(e)||(e.key=e.key||t||0)}function g(o,n){if(!d(o)&&f["default"].isDefined(o.watcher)){var r=o.watcher;f["default"].isArray(r)||(r=[r]),f["default"].forEach(r,function(r){if(!f["default"].isDefined(r.listener))throw e.getFieldError("all-field-watchers-must-have-a-listener","All field watchers must have a listener",o);var i=b(r,o,n),a=O(r,o,n),l=r.type||"$watch";r.stopWatching=t[l](i,a,r.watchDeep)})}}function b(e,t,o){var n=e.expression||"model['"+t.key+"']";return f["default"].isFunction(n)&&!function(){var i=n;n=function(){var t=x.apply(void 0,[e,o].concat(a.call(arguments)));return i.apply(void 0,r(t))},n.displayName="Formly Watch Expression for field for "+t.key}(),n}function O(e,t,o){var n=e.listener;return f["default"].isFunction(n)&&!function(){var i=n;n=function(){var t=x.apply(void 0,[e,o].concat(a.call(arguments)));return i.apply(void 0,r(t))},n.displayName="Formly Watch Listener for field for "+t.key}(),n}function x(e,o){for(var n=arguments.length,r=Array(n>2?n-2:0),i=2;n>i;i++)r[i-2]=arguments[i];return[t.fields[o]].concat(r,[e.stopWatching])}function k(e,o,n,r){var a=A(n,r);return i.formlyEval(t,e,o,o,a)}function A(e,o){return{options:e,index:o,formState:t.options.formState,formId:t.formId}}u(),t.model=t.model||{},s(),t.$watch("model",l,!0),t.options.formState&&t.$watch("options.formState",l,!0)}function u(e,r,i){function a(){var a=i.name;if(e.formId=a,e.theFormlyForm=e[a],i.form){var l=o(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||n.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=n.extras.removeChromeAutoComplete===!0,o=e.options&&e.options.removeChromeAutoComplete===!1,i=e.options&&e.options.removeChromeAutoComplete===!0;if(t&&!o||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=o(1),f=n(l);t["default"]=i,i.$inject=["formlyUsability","formlyWarn","$parse","formlyConfig","$interpolate"],e.exports=t["default"]},function(e,t,o){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var r=o(1),i=n(r),a=o(10),l=n(a),f=o(2),s=n(f),u=o(12),p=n(u),d=o(11),c=n(d),m=o(13),y=n(m),v=o(16),h=n(v),g=o(17),b=n(g),O=o(5),x=n(O),k=o(6),A=n(k),E=o(7),$=n(E),w=o(8),M=n(w),C=o(15),j=n(C),_=o(14),F=n(_),T="formly";t["default"]=T;var W=i["default"].module(T,[]);W.constant("formlyApiCheck",l["default"]),W.constant("formlyErrorAndWarningsUrlPrefix",s["default"]),W.constant("formlyVersion","6.26.9"),W.provider("formlyUsability",p["default"]),W.provider("formlyConfig",c["default"]),W.factory("formlyValidationMessages",y["default"]),W.factory("formlyUtil",h["default"]),W.factory("formlyWarn",b["default"]),W.directive("formlyCustomValidation",x["default"]),W.directive("formlyField",A["default"]),W.directive("formlyFocus",$["default"]),W.directive("formlyForm",M["default"]),W.run(j["default"]),W.run(F["default"]),e.exports=t["default"]},function(e,t,o){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function r(e,t){function o(o,r,i,a){var l=a&&a.hasOwnProperty(r),f=e.some(function(e){return a&&a.hasOwnProperty(e)});return f||l?l?t(o,r,i,a):void 0:u.utils.getError(r,i,n)}l["default"].isArray(e)||(e=[e]);var n="specified if these are not specified: `"+e.join(", ")+"` (otherwise it's optional)";return o.type=n,u.utils.checkerHelpers.setupChecker(o)}function i(e){return u.oneOfType([u.oneOf([null]),e])}Object.defineProperty(t,"__esModule",{value:!0});var a=o(1),l=n(a),f=o(4),s=n(f),u=s["default"]({output:{prefix:"angular-formly:",docsBaseUrl:o(2)}}),p=u.oneOfType([u.string,u.func]),d=i(u.typeOrArrayOf(u.string)),c=u.oneOfType([u.func,u.objectOf(u.func)]),m=u.shape.onlyIf("apiCheck",u.func.withProperties({warn:u.func,"throw":u.func,shape:u.func})),y=u.shape.onlyIf("apiCheck",u.oneOf(["throw","warn"])),v=u.shape({name:r("types",u.string).optional,template:u.shape.ifNot("templateUrl",u.string).optional,templateUrl:u.shape.ifNot("template",u.string).optional,types:u.typeOrArrayOf(u.string).optional,overwriteOk:u.bool.optional,validateOptions:u.func.optional,apiCheck:c.optional,apiCheckInstance:m.optional,apiCheckFunction:y.optional,apiCheckOptions:u.object.optional}).strict,h=u.objectOf(u.oneOfType([p,u.shape({expression:p,message:p.optional}).strict])),g=u.oneOfType([u.string,u.object]),b=i(u.shape({preWrapper:i(u.arrayOf(u.func)).optional,postWrapper:i(u.arrayOf(u.func)).optional}).strict),O=u.objectOf(u.oneOfType([p,u.shape({expression:p,message:p.optional}).strict])),x={$$hashKey:u.any.optional,type:u.shape.ifNot(["template","templateUrl"],u.string).optional,template:u.shape.ifNot(["type","templateUrl"],u.oneOfType([u.string,u.func])).optional,templateUrl:u.shape.ifNot(["type","template"],u.oneOfType([u.string,u.func])).optional,key:u.oneOfType([u.string,u.number]).optional,model:g.optional,originalModel:g.optional,className:u.string.optional,id:u.string.optional,name:u.string.optional,expressionProperties:h.optional,extras:u.shape({validateOnModelChange:u.bool.optional,skipNgModelAttrsManipulator:u.oneOfType([u.string,u.bool]).optional}).strict.optional,data:u.object.optional,templateOptions:u.object.optional,wrapper:d.optional,modelOptions:u.shape({updateOn:u.string.optional,debounce:u.oneOfType([u.objectOf(u.number),u.number]).optional,allowInvalid:u.bool.optional,getterSetter:u.bool.optional,timezone:u.string.optional}).optional,watcher:u.typeOrArrayOf(u.shape({expression:p.optional,listener:p})).optional,validators:O.optional,asyncValidators:O.optional,parsers:u.arrayOf(p).optional,formatters:u.arrayOf(p).optional,noFormControl:u.bool.optional,hide:u.bool.optional,hideExpression:p.optional,ngModelElAttrs:u.objectOf(u.string).optional,ngModelAttrs:u.objectOf(u.shape({expression:u.shape.ifNot(["value","attribute","bound","boolean"],u.any).optional,value:u.shape.ifNot("expression",u.any).optional,attribute:u.shape.ifNot("expression",u.any).optional,bound:u.shape.ifNot("expression",u.any).optional,"boolean":u.shape.ifNot("expression",u.any).optional}).strict).optional,elementAttributes:u.objectOf(u.string).optional,optionsTypes:u.typeOrArrayOf(u.string).optional,link:u.func.optional,controller:u.oneOfType([u.string,u.func,u.array]).optional,validation:u.shape({show:i(u.bool).optional,messages:u.objectOf(p).optional,errorExistsAndShouldBeVisible:u.bool.optional}).optional,formControl:u.typeOrArrayOf(u.object).optional,value:u.func.optional,runExpressions:u.func.optional,templateManipulators:b.optional,resetModel:u.func.optional,updateInitialValue:u.func.optional,initialValue:u.any.optional,defaultValue:u.any.optional},k=u.shape(x).strict,A=u.shape({formState:u.object.optional,resetModel:u.func.optional,updateInitialValue:u.func.optional,removeChromeAutoComplete:u.bool.optional,templateManipulators:b.optional,wrapper:d.optional,fieldTransform:u.func.optional,data:u.object.optional}).strict,E=u.shape({$$hashKey:u.any.optional,key:u.oneOfType([u.string,u.number]).optional,fieldGroup:u.arrayOf(u.oneOfType([k,u.object])),className:u.string.optional,options:A.optional,hide:u.bool.optional,hideExpression:p.optional,data:u.object.optional,model:g.optional,form:u.object.optional,elementAttributes:u.objectOf(u.string).optional}).strict,$=l["default"].copy(x);$.key=u.string.optional;var w=u.shape({name:u.string,template:u.shape.ifNot("templateUrl",u.oneOfType([u.string,u.func])).optional,templateUrl:u.shape.ifNot("template",u.oneOfType([u.string,u.func])).optional,controller:u.oneOfType([u.func,u.string,u.array]).optional,link:u.func.optional,defaultOptions:u.oneOfType([u.func,u.shape($)]).optional,"extends":u.string.optional,wrapper:d.optional,data:u.object.optional,validateOptions:u.func.optional,apiCheck:c.optional,apiCheckInstance:m.optional,apiCheckFunction:y.optional,apiCheckOptions:u.object.optional,overwriteOk:u.bool.optional}).strict;l["default"].extend(u,{formlyTypeOptions:w,formlyFieldOptions:k,formlyExpression:p,formlyWrapperType:v,fieldGroup:E,formOptionsApi:A}),t["default"]=u,e.exports=t["default"]},function(e,t,o){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function r(e){if(Array.isArray(e)){for(var t=0,o=Array(e.length);t" in it: '+e+"\nAdditional information: "+JSON.stringify(t))}var f=this;a["default"].extend(this,{getFormlyError:n,getFieldError:o,checkWrapper:i,checkWrapperTemplate:l,getErrorMessage:r,$get:function(){return f}})}Object.defineProperty(t,"__esModule",{value:!0});var i=o(1),a=n(i);t["default"]=r,r.$inject=["formlyApiCheck","formlyErrorAndWarningsUrlPrefix"],e.exports=t["default"]},function(e,t){"use strict";function o(){function e(e,t,r,i,a){n.messages[e]=o(t,r,i,a)}function t(e,t){n.messages[e]=function(){return t}}function o(e,t,o,n){return function(r,i,a){return a.options.templateOptions[e]?t+" "+a.options.templateOptions[e]+" "+o:n}}var n={addTemplateOptionValueMessage:e,addStringMessage:t,messages:{}};return n}Object.defineProperty(t,"__esModule",{value:!0}),t["default"]=o,e.exports=t["default"]},function(e,t,o){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function r(e){e&&e.get&&!function(){var t=e.get(0),o=t.createElement("div");o.innerHTML="";var n=1===o.getElementsByTagName("i").length;if(n){var r=["formly-field","formly-form","formly-custom-validation","formly-focus","formly-transpose"];a["default"].forEach(r,function(e){t.createElement(e)})}}()}Object.defineProperty(t,"__esModule",{value:!0});var i=o(1),a=n(i);t["default"]=r,r.$inject=["$document"],e.exports=t["default"]},function(e,t,o){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function r(e,t,o){function n(e,o,n){function i(){(a["default"].isDefined(o.validators)||a["default"].isDefined(o.validation.messages))&&p(v,"formly-custom-validation","")}function l(){a["default"].isDefined(o.modelOptions)&&(p(v,"ng-model-options","options.modelOptions"),o.modelOptions.getterSetter&&a["default"].forEach(v,function(e){e.setAttribute("ng-model","options.value")}))}function d(){if(o.templateOptions||o.expressionProperties){var e=o.templateOptions||{},n=o.expressionProperties||{},r=s();a["default"].extend(r,o.ngModelAttrs),a["default"].forEach(r,function(r,i){var l=void 0,f=void 0,s="options.templateOptions['"+i+"']",d=e[i],c=u(n,i),m=a["default"].isDefined(d),y=a["default"].isDefined(c);if(r.value)f=r.value,l=i;else if(r.expression&&m)if(f=r.expression,a["default"].isString(e[i]))l="$eval("+s+")";else{if(!a["default"].isFunction(e[i]))throw new Error("options.templateOptions."+i+" must be a string or function: "+JSON.stringify(o));l=s+"(model[options.key], options, this, $event)"}else r.bound&&y?(f=r.bound,l=s):(r.attribute||r["boolean"])&&y?(f=r.attribute||r["boolean"],l=""+t.startSymbol()+s+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=s);a["default"].isDefined(f)&&a["default"].isDefined(l)&&p(v,f,l)})}}function c(){a["default"].forEach(o.ngModelElAttrs,function(e,t){p(v,t,e)})}var m=document.createElement("div"),y=f(o);if(y===!0)return e;m.innerHTML=e;var v=r(m,y);return v&&v.length?(p(v,"id",n.id),p(v,"name",n.name||n.id),i(),l(),d(),c(),m.innerHTML):e}function r(e,t){var o=a["default"].isString(t)?":not("+t+")":"",n=":not([formly-skip-ng-model-attrs-manipulator])",r="[ng-model]"+o+n+", [data-ng-model]"+o+n;try{return e.querySelectorAll(r)}catch(l){return i(e,t)}}function i(e,t){var o=e.querySelectorAll("[ng-model], [data-ng-model]"),n=[];n.item=function(e){return this[e]};for(var r=0;r, 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,t,n,o,r){return y["default"].isFunction(t)?t(o,n,e,r):e.$eval(t,y["default"].extend({$viewValue:o,$modelValue:n},r))}function i(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 a(e){return y["default"].forEach(arguments,function(t,n){n&&y["default"].forEach(t,function(t,n){y["default"].isDefined(e[n])?l(e[n],t)&&a(e[n],t):e[n]=y["default"].copy(t)})}),e}function l(e,t){return y["default"].isObject(e)&&y["default"].isObject(t)&&Object.getPrototypeOf(e)===Object.getPrototypeOf(t)}function f(e,t){if(e.prop||(e=y["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 p(e,t,n){return n&&(e=e[n],t=t[n]),t&&e?(y["default"].forEach(t,function(t){-1===e.indexOf(t)&&e.push(t)}),e):t?t:e}function d(e,t){return y["default"].isString(e)&&y["default"].isString(t)?e.length>=t.length&&e.substring(0,t.length)===t:!1}function c(e,t){return y["default"].isString(e)&&y["default"].isString(t)?e.length>=t.length&&-1!==e.indexOf(t):!1}Object.defineProperty(t,"__esModule",{value:!0});var m=n(1),y=o(m);t["default"]={formlyEval:r,getFieldId:i,reverseDeepMerge:a,findByNodeName:f,arrayify:s,extendFunction:u,extendArray:p,startsWith:d,contains:c},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/7.0.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,i.bind(null,!1)),a["default"].forEach(u.asyncValidators,i.bind(null,!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 ")}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 x(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&&(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=e.fc;if(o.$invalid){if("boolean"==typeof n.validation.show)return n.validation.show;if(t)return d.formlyEval(e,t,o.$modelValue,o.$viewValue);var r=s["default"].isUndefined(o.$touched)&&o.$dirty;return e.fc.$touched||r}return!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(M);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){T++,n(e.getAttribute("name"))})}}function k(){M&&M.link&&M.link.apply(_,C),e.options.link&&e.options.link.apply(_,C)}function w(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 M=g(e.options),C=arguments,_=this,T=0,F=b(e.options,e.formOptions);O(e.options).then(w(F.preWrapper)).then(E(e.options,e.formOptions)).then(w(F.postWrapper)).then(x).then($).then(k)["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=k(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=$(t,e)}),$(t,n)})}}function $(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 k(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 w(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 A(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 || 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(t,n,i){function l(){f["default"].forEach(t.fields,function(e,n){var o=e.model||t.model;if(e.runExpressions&&e.runExpressions(),e.hideExpression){var r=o[e.key];e.hide=E(e.hideExpression,r,e,n)}e.extras&&e.extras.validateOnModelChange&&e.formControl&&e.formControl.$validate()})}function s(){t.fields=t.fields||[];var n=t.options.fieldTransform||o.extras.fieldTransform;if(n&&(t.fields=n(t.fields,t.model,t.options,t.form),!t.fields))throw e.getFormlyError("fieldTransform must return an array of fields");m(),f["default"].forEach(t.fields,v),f["default"].forEach(t.fields,g)}function u(){n["throw"]([n.formOptionsApi.optional],[t.options],{prefix:"formly-form options check"}),t.options=t.options||{},t.options.formState=t.options.formState||{},f["default"].extend(t.options,{updateInitialValue:p,resetModel:c})}function p(){f["default"].forEach(t.fields,function(e){d(e)&&e.options?e.options.updateInitialValue():e.updateInitialValue()})}function c(){f["default"].forEach(t.fields,function(e){d(e)&&e.options?e.options.resetModel():e.resetModel&&e.resetModel()})}function m(){var e=[t.model];t.options.formState&&e.push(t.options.formState),f["default"].forEach(t.fields,function(n){var o=y(n);n.model&&o&&-1===e.indexOf(n.model)&&(t.$watch(function(){return n.model},l,!0),e.push(n.model))})}function y(n){var o=!0;if(f["default"].isString(n.model)){var r=n.model,i=t.fields.indexOf(n);if(o=!h(r),n.model=E(r,void 0,n,i),!n.model)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.",n)}return o}function h(e){return["model","formState"].some(function(t){return i.startsWith(e,t+".")||i.startsWith(e,t+"[")})}function v(e,t){d(e)||(e.key=e.key||t||0)}function g(n,o){if(!d(n)&&f["default"].isDefined(n.watcher)){var r=n.watcher;f["default"].isArray(r)||(r=[r]),f["default"].forEach(r,function(r){if(!f["default"].isDefined(r.listener))throw e.getFieldError("all-field-watchers-must-have-a-listener","All field watchers must have a listener",n);var i=b(r,n,o),a=O(r,n,o),l=r.type||"$watch";r.stopWatching=t[l](i,a,r.watchDeep)})}}function b(e,t,n){var o=e.expression||"model['"+t.key+"']";return f["default"].isFunction(o)&&!function(){var i=o;o=function(){var t=x.apply(void 0,[e,n].concat(a.call(arguments)));return i.apply(void 0,r(t))},o.displayName="Formly Watch Expression for field for "+t.key}(),o}function O(e,t,n){var o=e.listener;return f["default"].isFunction(o)&&!function(){var i=o;o=function(){var t=x.apply(void 0,[e,n].concat(a.call(arguments)));return i.apply(void 0,r(t))},o.displayName="Formly Watch Listener for field for "+t.key}(),o}function x(e,n){for(var o=arguments.length,r=Array(o>2?o-2:0),i=2;o>i;i++)r[i-2]=arguments[i];return[t.fields[n]].concat(r,[e.stopWatching])}function E(e,n,o,r){var a=$(o,r);return i.formlyEval(t,e,n,n,a)}function $(e,n){return{options:e,index:n,formState:t.options.formState,formId:t.formId}}u(),t.model=t.model||{},s(),t.$watch("model",l,!0),t.options.formState&&t.$watch("options.formState",l,!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),$=o(E),k=n(7),w=o(k),A=n(8),M=o(A),C=n(15),j=o(C),_=n(14),T=o(_),F="formly";t["default"]=F;var W=i["default"].module(F,[]);W.constant("formlyApiCheck",l["default"]),W.constant("formlyErrorAndWarningsUrlPrefix",s["default"]),W.constant("formlyVersion","7.0.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",$["default"]),W.directive("formlyFocus",w["default"]),W.directive("formlyForm",M["default"]),W.run(j["default"]),W.run(T["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={$$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:s.typeOrArrayOf(s.shape({expression:u.optional,listener:u})).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},x=s.shape(O).strict,E=s.shape({formState:s.object.optional,resetModel:s.func.optional,updateInitialValue:s.func.optional,removeChromeAutoComplete:s.bool.optional,templateManipulators:g.optional,wrapper:p.optional,fieldTransform:s.func.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([x,s.object])),className:s.string.optional,options:E.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,k=a["default"].copy(O);k.key=s.string.optional;var w=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(k)]).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:w,formlyFieldOptions:x,formlyExpression:u,formlyWrapperType:y,fieldGroup:$,formOptionsApi:E}),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 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.get&&!function(){var t=e.get(0),n=t.createElement("div");n.innerHTML="";var o=1===n.getElementsByTagName("i").length;if(o){var r=["formly-field","formly-form","formly-custom-validation","formly-focus","formly-transpose"];a["default"].forEach(r,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\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\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\texports[\"default\"] = \"https://github.com/formly-js/angular-formly/blob/\" + (\"6.26.9\") + \"/other/ERRORS_AND_WARNINGS.md#\";\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\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'] = { formlyEval: formlyEval, getFieldId: getFieldId, reverseDeepMerge: reverseDeepMerge, findByNodeName: findByNodeName, arrayify: arrayify, extendFunction: extendFunction, extendArray: extendArray, startsWith: startsWith };\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\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(formlyConfig, formlyUtil, $q, formlyWarn) {\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 var warnedValidators = [];\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, addValidatorToPipeline.bind(null, false));\n\t _angularFix2['default'].forEach(opts.asyncValidators, addValidatorToPipeline.bind(null, 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 isPossiblyAsync = !_angularFix2['default'].isString(validator);\n\t var validatorCollection = isPossiblyAsync || isAsync ? '$asyncValidators' : '$validators';\n\t\n\t // UPDATE IN 7.0.0\n\t // this is temporary until we can have a breaking change. Allow people to get the wins of the explicitAsync api\n\t if (formlyConfig.extras.explicitAsync && !isAsync) {\n\t validatorCollection = '$validators';\n\t }\n\t\n\t ctrl[validatorCollection][name] = function evalValidity(modelValue, viewValue) {\n\t var value = formlyUtil.formlyEval(scope, validator, modelValue, viewValue);\n\t // UPDATE IN 7.0.0\n\t // In the next breaking change, this code should simply return the value\n\t if (isAsync) {\n\t return value;\n\t } else if (isPossiblyAsync && !formlyConfig.extras.explicitAsync) {\n\t if (isPromiseLike(value)) {\n\t logAsyncValidatorsDeprecationNotice(validator, opts);\n\t return value;\n\t } else {\n\t return value ? $q.when(value) : $q.reject(value);\n\t }\n\t } else {\n\t return value;\n\t }\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 // UPDATE IN 7.0.0\n\t // In the next breaking change, rather than checking for isPromiseLike, it should just check for isAsync.\n\t\n\t if (isAsync || isPromiseLike(isValid)) {\n\t if (!isAsync) {\n\t logAsyncValidatorsDeprecationNotice(validator, opts);\n\t }\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 function logAsyncValidatorsDeprecationNotice(validator, options) {\n\t if (warnedValidators.indexOf(validator) !== -1) {\n\t // we've warned about this one before. No spam necessary...\n\t return;\n\t }\n\t warnedValidators.push(validator);\n\t formlyWarn('validators-returning-promises-should-use-asyncvalidators', 'Validators returning promises should use asyncValidators instead of validators.', options);\n\t }\n\t }\n\t };\n\t\n\t function isPromiseLike(obj) {\n\t return obj && _angularFix2['default'].isFunction(obj.then);\n\t }\n\t}\n\tformlyCustomValidation.$inject = [\"formlyConfig\", \"formlyUtil\", \"$q\", \"formlyWarn\"];\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: '=?' // TODO require form in a breaking release\n\t },\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, 31] */\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 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 $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 });\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 $scope.model[$scope.options.key] = newVal;\n\t }\n\t return $scope.model[$scope.options.key];\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($scope.model[$scope.options.key])) {\n\t $scope.model[$scope.options.key] = $scope.options.defaultValue;\n\t }\n\t }\n\t\n\t function setInitialValue() {\n\t $scope.options.initialValue = $scope.model && $scope.model[$scope.options.key];\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 $scope.model[$scope.options.key] = $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 }\n\t\n\t function resetFormControl(formControl, isMultiNgModel) {\n\t if (!isMultiNgModel) {\n\t formControl.$setViewValue($scope.model[$scope.options.key]);\n\t }\n\t\n\t formControl.$render();\n\t 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 = $scope.model[$scope.options.key];\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 }\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 setElementTemplate('\\n \\n \\n ');\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 fc = scope.fc;\n\t\n\t if (!fc.$invalid) {\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 formlyUtil.formlyEval(scope, customExpression, fc.$modelValue, fc.$viewValue);\n\t } else {\n\t var noTouchedButDirty = _angularFix2['default'].isUndefined(fc.$touched) && fc.$dirty;\n\t return scope.fc.$touched || noTouchedButDirty;\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 _ret2 = (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 _ret2 === 'object') return _ret2.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 aWrapper.validateOptions && aWrapper.validateOptions(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 if (type.validateOptions) {\n\t type.validateOptions(options);\n\t }\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 if (_angularFix2['default'].isFunction(apiCheck)) {\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 } else {\n\t // TODO this is the deprecated API. Remove this in a breaking change.\n\t var checker = instance.shape(apiCheck);\n\t var checkOptions = apiCheckOptions || {\n\t prefix: 'formly-field type ' + options.type,\n\t url: formlyApiCheck.config.output.docsBaseUrl + 'formly-field-type-apicheck-failed'\n\t };\n\t instance[fn](checker, options, 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 || 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 $scope.$watch('model', onModelOrFormStateChange, true);\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, function runFieldExpressionProperties(field, index) {\n\t var model = field.model || $scope.model;\n\t 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 field.formControl.$validate();\n\t }\n\t });\n\t }\n\t\n\t function setupFields() {\n\t $scope.fields = $scope.fields || [];\n\t var fieldTransform = $scope.options.fieldTransform || formlyConfig.extras.fieldTransform;\n\t\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 setupModels();\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 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\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) {\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 initModel(field) {\n\t var isNewModel = true;\n\t\n\t if (_angularFix2['default'].isString(field.model)) {\n\t var expression = field.model;\n\t var index = $scope.fields.indexOf(field);\n\t\n\t isNewModel = !refrencesCurrentlyWatchedModel(expression);\n\t\n\t field.model = evalCloseToFormlyExpression(expression, undefined, field, index);\n\t if (!field.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 isNewModel;\n\t }\n\t\n\t function refrencesCurrentlyWatchedModel(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 (isFieldGroup(field) || !_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)) {\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 = watcher.expression || 'model[\\'' + field.key + '\\']';\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 }\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)) {\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 args = modifyArgs.apply(undefined, [watcher, index].concat(_slice.call(arguments)));\n\t return originalListener.apply(undefined, _toConsumableArray(args));\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 = getFormlyFieldLikeLocals(field, index);\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 options: field,\n\t index: index,\n\t formState: $scope.options.formState,\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__(2);\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', (\"6.26.9\")); // <-- 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__(2)\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\t// TODO in 7.0.0 .nullable is available on all checkers\n\tfunction nullable(checker) {\n\t return apiCheck.oneOfType([apiCheck.oneOf([null]), checker]);\n\t}\n\t\n\tvar formlyExpression = apiCheck.oneOfType([apiCheck.string, apiCheck.func]);\n\tvar specifyWrapperType = nullable(apiCheck.typeOrArrayOf(apiCheck.string));\n\t\n\tvar apiCheckProperty = apiCheck.oneOfType([apiCheck.func, apiCheck.objectOf(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 validateOptions: apiCheck.func.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 = nullable(apiCheck.shape({\n\t preWrapper: nullable(apiCheck.arrayOf(apiCheck.func)).optional,\n\t postWrapper: nullable(apiCheck.arrayOf(apiCheck.func)).optional\n\t}).strict);\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 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: apiCheck.typeOrArrayOf(apiCheck.shape({\n\t expression: formlyExpression.optional,\n\t listener: formlyExpression\n\t })).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 expression: apiCheck.shape.ifNot(['value', 'attribute', 'bound', 'boolean'], apiCheck.any).optional,\n\t value: apiCheck.shape.ifNot('expression', apiCheck.any).optional,\n\t attribute: apiCheck.shape.ifNot('expression', apiCheck.any).optional,\n\t bound: apiCheck.shape.ifNot('expression', apiCheck.any).optional,\n\t boolean: apiCheck.shape.ifNot('expression', 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: nullable(apiCheck.bool).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 wrapper: specifyWrapperType.optional,\n\t fieldTransform: apiCheck.func.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 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 validateOptions: apiCheck.func.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__(3);\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 ngModelAttrsManipulatorPreferUnbound: false,\n\t removeChromeAutoComplete: false,\n\t defaultHideDirective: 'ng-if',\n\t getFieldId: null,\n\t explicitAsync: false\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 checkDeprecatedOptions(options);\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 extendTypeValidateOptionsFunction(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 extendTypeValidateOptionsFunction(options, extendsType) {\n\t var extendsFn = extendsType.validateOptions;\n\t if (!_angularFix2['default'].isDefined(extendsFn)) {\n\t return;\n\t }\n\t var optionsFn = options.validateOptions;\n\t var originalDefaultOptions = options.defaultOptions;\n\t if (_angularFix2['default'].isDefined(optionsFn)) {\n\t options.validateOptions = function (opts) {\n\t optionsFn(opts);\n\t var mergedOptions = _angularFix2['default'].copy(opts);\n\t var defaultOptions = originalDefaultOptions;\n\t if (defaultOptions) {\n\t if (_angularFix2['default'].isFunction(defaultOptions)) {\n\t defaultOptions = defaultOptions(mergedOptions);\n\t }\n\t _otherUtils2['default'].reverseDeepMerge(mergedOptions, defaultOptions);\n\t }\n\t extendsFn(mergedOptions);\n\t };\n\t } else {\n\t options.validateOptions = 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 checkDeprecatedOptions(options);\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 checkDeprecatedOptions(options) {\n\t if (options.apiCheck && !_angularFix2['default'].isFunction(options.apiCheck)) {\n\t warn('apicheck-as-an-object-deprecated', 'apiCheck as an object has been deprecated.', 'Attempted for type: ' + options.name, options);\n\t }\n\t if (options.validateOptions) {\n\t warn('validateoptions-deprecated', 'the `validateOptions` property has been deprecated.', 'Attempted for type: ' + options.name, options);\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 (scope.options.templateOptions[prop]) {\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 if ($document && $document.get) {\n\t (function () {\n\t // IE8 check ->\n\t // http://stackoverflow.com/questions/10964966/detect-ie-version-prior-to-v9-in-javascript/10965203#10965203\n\t var document = $document.get(0);\n\t var div = document.createElement('div');\n\t div.innerHTML = '';\n\t var isIeLessThan9 = div.getElementsByTagName('i').length === 1;\n\t\n\t if (isIeLessThan9) {\n\t // add the custom elements that we need for formly\n\t var customElements = ['formly-field', 'formly-form', 'formly-custom-validation', 'formly-focus', 'formly-transpose'];\n\t _angularFix2['default'].forEach(customElements, function (el) {\n\t document.createElement(el);\n\t });\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\texports['default'] = addFormlyNgModelAttrsManipulator;\n\t\n\t// @ngInject\n\tfunction addFormlyNgModelAttrsManipulator(formlyConfig, $interpolate, formlyWarn) {\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 = getSkip(options);\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 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 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 _angularFix2['default'].forEach(modelNodes, function (modelNode) {\n\t modelNode.setAttribute('ng-model', 'options.value');\n\t });\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.expression && inTo) {\n\t attrName = val.expression;\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 addIfNotPresent(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 getSkip(options) {\n\t // UPDATE IN 7.0.0\n\t var skip = options.extras && options.extras.skipNgModelAttrsManipulator;\n\t if (!_angularFix2['default'].isDefined(skip)) {\n\t skip = options.data && options.data.skipNgModelAttrsManipulator;\n\t if (_angularFix2['default'].isDefined(skip)) {\n\t formlyWarn('skipngmodelattrsmanipulator-moved', 'The skipNgModelAttrsManipulator property has been moved from the `data` property to the `extras` property', options);\n\t }\n\t }\n\t return skip;\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 expressionOnly = ['change', 'keydown', 'keyup', 'keypress', 'click', 'focus', 'blur'];\n\t var attributeOnly = ['placeholder', 'min', 'max', '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(expressionOnly, function (item) {\n\t var propName = 'on' + item.substr(0, 1).toUpperCase() + item.substr(1);\n\t ngModelAttributes[propName] = { expression: '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\taddFormlyNgModelAttrsManipulator.$inject = [\"formlyConfig\", \"$interpolate\", \"formlyWarn\"];\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__(3);\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 a307b7d6646911eb48c9\n **/","import index from './index.common';\nexport default index;\n\n\n\n/** WEBPACK FOOTER **\n ** ../~/eslint-loader!./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 ** ../~/eslint-loader!./angular-fix/index.js\n **/","import angular from 'angular-fix';\n\nexport default {formlyEval, getFieldId, reverseDeepMerge, findByNodeName, arrayify, extendFunction, extendArray, startsWith};\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\n\n\n/** WEBPACK FOOTER **\n ** ../~/eslint-loader!./other/utils.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 **/","import angular from 'angular-fix';\nexport default formlyCustomValidation;\n\n// @ngInject\nfunction formlyCustomValidation(formlyConfig, formlyUtil, $q, formlyWarn) {\n return {\n restrict: 'A',\n require: 'ngModel',\n link: function formlyCustomValidationLink(scope, el, attrs, ctrl) {\n const opts = scope.options;\n const warnedValidators = [];\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, addValidatorToPipeline.bind(null, false));\n angular.forEach(opts.asyncValidators, addValidatorToPipeline.bind(null, 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 isPossiblyAsync = !angular.isString(validator);\n let validatorCollection = (isPossiblyAsync || isAsync) ? '$asyncValidators' : '$validators';\n\n // UPDATE IN 7.0.0\n // this is temporary until we can have a breaking change. Allow people to get the wins of the explicitAsync api\n if (formlyConfig.extras.explicitAsync && !isAsync) {\n validatorCollection = '$validators';\n }\n\n ctrl[validatorCollection][name] = function evalValidity(modelValue, viewValue) {\n const value = formlyUtil.formlyEval(scope, validator, modelValue, viewValue);\n // UPDATE IN 7.0.0\n // In the next breaking change, this code should simply return the value\n if (isAsync) {\n return value;\n } else if (isPossiblyAsync && !formlyConfig.extras.explicitAsync) {\n if (isPromiseLike(value)) {\n logAsyncValidatorsDeprecationNotice(validator, opts);\n return value;\n } else {\n return value ? $q.when(value) : $q.reject(value);\n }\n } else {\n return value;\n }\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 // UPDATE IN 7.0.0\n // In the next breaking change, rather than checking for isPromiseLike, it should just check for isAsync.\n\n if (isAsync || isPromiseLike(isValid)) {\n if (!isAsync) {\n logAsyncValidatorsDeprecationNotice(validator, opts);\n }\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 function logAsyncValidatorsDeprecationNotice(validator, options) {\n if (warnedValidators.indexOf(validator) !== -1) {\n // we've warned about this one before. No spam necessary...\n return;\n }\n warnedValidators.push(validator);\n formlyWarn(\n 'validators-returning-promises-should-use-asyncvalidators',\n 'Validators returning promises should use asyncValidators instead of validators.',\n options\n );\n }\n }\n };\n\n\n function isPromiseLike(obj) {\n return obj && angular.isFunction(obj.then);\n }\n}\n\n\n\n/** WEBPACK FOOTER **\n ** ../~/eslint-loader!./directives/formly-custom-validation.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, 31] */\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 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 $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 });\n }\n\n function valueGetterSetter(newVal) {\n if (!$scope.model || !$scope.options.key) {\n return undefined;\n }\n if (angular.isDefined(newVal)) {\n $scope.model[$scope.options.key] = newVal;\n }\n return $scope.model[$scope.options.key];\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) && !angular.isDefined($scope.model[$scope.options.key])) {\n $scope.model[$scope.options.key] = $scope.options.defaultValue;\n }\n }\n\n function setInitialValue() {\n $scope.options.initialValue = $scope.model && $scope.model[$scope.options.key];\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 $scope.model[$scope.options.key] = $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 }\n\n function resetFormControl(formControl, isMultiNgModel) {\n if (!isMultiNgModel) {\n formControl.$setViewValue($scope.model[$scope.options.key]);\n }\n\n formControl.$render();\n 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 = $scope.model[$scope.options.key];\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 }\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 setElementTemplate(`\n \n \n `);\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, fc} = scope;\n if (!fc.$invalid) {\n return false;\n } else if (typeof options.validation.show === 'boolean') {\n return options.validation.show;\n } else if (customExpression) {\n return formlyUtil.formlyEval(scope, customExpression, fc.$modelValue, fc.$viewValue);\n } else {\n const noTouchedButDirty = (angular.isUndefined(fc.$touched) && fc.$dirty);\n return (scope.fc.$touched || noTouchedButDirty);\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 aWrapper.validateOptions && aWrapper.validateOptions(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 if (type.validateOptions) {\n type.validateOptions(options);\n }\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 if (angular.isFunction(apiCheck)) {\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 } else {\n // TODO this is the deprecated API. Remove this in a breaking change.\n const checker = instance.shape(apiCheck);\n const checkOptions = apiCheckOptions || {\n prefix: `formly-field type ${options.type}`,\n url: formlyApiCheck.config.output.docsBaseUrl + 'formly-field-type-apicheck-failed'\n };\n instance[fn](checker, options, 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 ** ../~/eslint-loader!./directives/formly-field.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 ** ../~/eslint-loader!./directives/formly-focus.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 || 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 $scope.$watch('model', onModelOrFormStateChange, true);\n if ($scope.options.formState) {\n $scope.$watch('options.formState', onModelOrFormStateChange, true);\n }\n\n function onModelOrFormStateChange() {\n angular.forEach($scope.fields, function runFieldExpressionProperties(field, index) {\n const model = field.model || $scope.model;\n 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 field.formControl.$validate();\n }\n });\n }\n\n function setupFields() {\n $scope.fields = $scope.fields || [];\n const fieldTransform = $scope.options.fieldTransform || formlyConfig.extras.fieldTransform;\n\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 setupModels();\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\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\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) {\n $scope.$watch(() => field.model, onModelOrFormStateChange, true);\n watchedModels.push(field.model);\n }\n });\n }\n\n function initModel(field) {\n let isNewModel = true;\n\n if (angular.isString(field.model)) {\n const expression = field.model;\n const index = $scope.fields.indexOf(field);\n\n isNewModel = !refrencesCurrentlyWatchedModel(expression);\n\n field.model = evalCloseToFormlyExpression(expression, undefined, field, index);\n if (!field.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 isNewModel;\n }\n\n function refrencesCurrentlyWatchedModel(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 (isFieldGroup(field) || !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)) {\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 = watcher.expression || `model['${field.key}']`;\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 }\n return watchExpression;\n }\n\n function getWatchListener(watcher, field, index) {\n let watchListener = watcher.listener;\n if (angular.isFunction(watchListener)) {\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 const args = modifyArgs(watcher, index, ...arguments);\n return originalListener(...args);\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) {\n const extraLocals = getFormlyFieldLikeLocals(field, index);\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 options: field,\n index,\n formState: $scope.options.formState,\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 ** ../~/eslint-loader!./directives/formly-form.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 ** ../~/eslint-loader!./index.common.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\n// TODO in 7.0.0 .nullable is available on all checkers\nfunction nullable(checker) {\n return apiCheck.oneOfType([\n apiCheck.oneOf([null]), checker\n ]);\n}\n\nconst formlyExpression = apiCheck.oneOfType([apiCheck.string, apiCheck.func]);\nconst specifyWrapperType = nullable(apiCheck.typeOrArrayOf(apiCheck.string));\n\nconst apiCheckProperty = apiCheck.oneOfType([apiCheck.func, apiCheck.objectOf(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 validateOptions: apiCheck.func.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 = nullable(apiCheck.shape({\n preWrapper: nullable(apiCheck.arrayOf(apiCheck.func)).optional,\n postWrapper: nullable(apiCheck.arrayOf(apiCheck.func)).optional\n}).strict);\n\nconst validatorChecker = apiCheck.objectOf(apiCheck.oneOfType([\n formlyExpression, apiCheck.shape({\n expression: formlyExpression,\n message: formlyExpression.optional\n }).strict\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: apiCheck.typeOrArrayOf(\n apiCheck.shape({\n expression: formlyExpression.optional,\n listener: formlyExpression\n })\n ).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 expression: apiCheck.shape.ifNot(['value', 'attribute', 'bound', 'boolean'], apiCheck.any).optional,\n value: apiCheck.shape.ifNot('expression', apiCheck.any).optional,\n attribute: apiCheck.shape.ifNot('expression', apiCheck.any).optional,\n bound: apiCheck.shape.ifNot('expression', apiCheck.any).optional,\n boolean: apiCheck.shape.ifNot('expression', 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: nullable(apiCheck.bool).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\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 wrapper: specifyWrapperType.optional,\n fieldTransform: apiCheck.func.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 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 validateOptions: apiCheck.func.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 ** ../~/eslint-loader!./providers/formlyApiCheck.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 ngModelAttrsManipulatorPreferUnbound: false,\n removeChromeAutoComplete: false,\n defaultHideDirective: 'ng-if',\n getFieldId: null,\n explicitAsync: false\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 checkDeprecatedOptions(options);\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 extendTypeValidateOptionsFunction(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 extendTypeValidateOptionsFunction(options, extendsType) {\n const extendsFn = extendsType.validateOptions;\n if (!angular.isDefined(extendsFn)) {\n return;\n }\n const optionsFn = options.validateOptions;\n const originalDefaultOptions = options.defaultOptions;\n if (angular.isDefined(optionsFn)) {\n options.validateOptions = function(opts) {\n optionsFn(opts);\n const mergedOptions = angular.copy(opts);\n let defaultOptions = originalDefaultOptions;\n if (defaultOptions) {\n if (angular.isFunction(defaultOptions)) {\n defaultOptions = defaultOptions(mergedOptions);\n }\n utils.reverseDeepMerge(mergedOptions, defaultOptions);\n }\n extendsFn(mergedOptions);\n };\n } else {\n options.validateOptions = 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 checkDeprecatedOptions(options);\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 checkDeprecatedOptions(options) {\n if (options.apiCheck && !angular.isFunction(options.apiCheck)) {\n warn(\n 'apicheck-as-an-object-deprecated',\n 'apiCheck as an object has been deprecated.',\n `Attempted for type: ${options.name}`,\n options\n );\n }\n if (options.validateOptions) {\n warn(\n 'validateoptions-deprecated',\n 'the `validateOptions` property has been deprecated.',\n `Attempted for type: ${options.name}`,\n options\n );\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 ** ../~/eslint-loader!./providers/formlyConfig.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 ** ../~/eslint-loader!./providers/formlyUsability.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 (scope.options.templateOptions[prop]) {\n return `${prefix} ${scope.options.templateOptions[prop]} ${suffix}`;\n } else {\n return alternate;\n }\n };\n }\n}\n\n\n\n/** WEBPACK FOOTER **\n ** ../~/eslint-loader!./providers/formlyValidationMessages.js\n **/","import angular from 'angular-fix';\nexport default addCustomTags;\n\n// @ngInject\nfunction addCustomTags($document) {\n if ($document && $document.get) {\n // IE8 check ->\n // http://stackoverflow.com/questions/10964966/detect-ie-version-prior-to-v9-in-javascript/10965203#10965203\n const document = $document.get(0);\n const div = document.createElement('div');\n div.innerHTML = '';\n const isIeLessThan9 = (div.getElementsByTagName('i').length === 1);\n\n if (isIeLessThan9) {\n // add the custom elements that we need for formly\n const customElements = [\n 'formly-field', 'formly-form', 'formly-custom-validation', 'formly-focus', 'formly-transpose'\n ];\n angular.forEach(customElements, el => {\n document.createElement(el);\n });\n }\n }\n}\n\n\n\n/** WEBPACK FOOTER **\n ** ../~/eslint-loader!./run/formlyCustomTags.js\n **/","import angular from 'angular-fix';\n\nexport default addFormlyNgModelAttrsManipulator;\n\n// @ngInject\nfunction addFormlyNgModelAttrsManipulator(formlyConfig, $interpolate, formlyWarn) {\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 = getSkip(options);\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 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 addModelOptions() {\n if (angular.isDefined(options.modelOptions)) {\n addIfNotPresent(modelNodes, 'ng-model-options', 'options.modelOptions');\n if (options.modelOptions.getterSetter) {\n angular.forEach(modelNodes, modelNode => {\n modelNode.setAttribute('ng-model', 'options.value');\n });\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.expression && inTo) {\n attrName = val.expression;\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 addIfNotPresent(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 getSkip(options) {\n // UPDATE IN 7.0.0\n let skip = options.extras && options.extras.skipNgModelAttrsManipulator;\n if (!angular.isDefined(skip)) {\n skip = options.data && options.data.skipNgModelAttrsManipulator;\n if (angular.isDefined(skip)) {\n formlyWarn(\n 'skipngmodelattrsmanipulator-moved',\n 'The skipNgModelAttrsManipulator property has been moved from the `data` property to the `extras` property',\n options\n );\n }\n }\n return skip;\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 expressionOnly = ['change', 'keydown', 'keyup', 'keypress', 'click', 'focus', 'blur'];\n const attributeOnly = ['placeholder', 'min', 'max', '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(expressionOnly, item => {\n const propName = 'on' + item.substr(0, 1).toUpperCase() + item.substr(1);\n ngModelAttributes[propName] = {expression: '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\n\n\n/** WEBPACK FOOTER **\n ** ../~/eslint-loader!./run/formlyNgModelAttrsManipulator.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 ** ../~/eslint-loader!./services/formlyUtil.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 ** ../~/eslint-loader!./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":""} +{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///dist/formly.min.js","webpack:///webpack/bootstrap def44cb2438f0dbc3fa8","webpack:///./index.js","webpack:///./angular-fix/index.js","webpack:///./other/utils.js","webpack:///external {\"root\":\"apiCheck\",\"amd\":\"api-check\",\"commonjs2\":\"api-check\",\"commonjs\":\"api-check\"}","webpack:///./directives/formly-custom-validation.js","webpack:///./directives/formly-field.js","webpack:///./directives/formly-focus.js","webpack:///./directives/formly-form.js","webpack:///./index.common.js","webpack:///./providers/formlyApiCheck.js","webpack:///./providers/formlyConfig.js","webpack:///./providers/formlyUsability.js","webpack:///./providers/formlyValidationMessages.js","webpack:///./run/formlyCustomTags.js","webpack:///./run/formlyNgModelAttrsManipulator.js","webpack:///./services/formlyUtil.js","webpack:///./services/formlyWarn.js","webpack:///external \"angular\""],"names":["root","factory","exports","module","require","define","amd","this","__WEBPACK_EXTERNAL_MODULE_4__","__WEBPACK_EXTERNAL_MODULE_18__","modules","__webpack_require__","moduleId","installedModules","id","loaded","call","m","c","p","_interopRequireDefault","obj","__esModule","default","Object","defineProperty","value","_indexCommon","_indexCommon2","angular","version","window","formlyEval","scope","expression","$modelValue","$viewValue","extraLocals","_angularFix2","isFunction","$eval","extend","getFieldId","formId","options","index","type","template","templateUrl","key","join","reverseDeepMerge","dest","forEach","arguments","src","val","prop","isDefined","objAndSameType","copy","obj1","obj2","isObject","getPrototypeOf","findByNodeName","el","nodeName","element","toUpperCase","children","i","length","node","arrayify","isArray","extendFunction","_len","fns","Array","_key","args","fn","apply","extendArray","primary","secondary","property","item","indexOf","push","startsWith","str","search","isString","substring","contains","_angularFix","formlyCustomValidation","formlyUtil","restrict","link","attrs","ctrl","addValidatorToPipeline","isAsync","validator","name","setupMessage","useNewValidatorsApi","setupWithValidators","setupWithParsers","message","opts","validation","messages","validatorCollection","modelValue","viewValue","inFlightValidator","undefined","$parsers","unshift","isValid","$pending","then","$setValidity","keys","hasOwnProperty","validators","bind","asyncValidators","$inject","_toConsumableArray","arr","arr2","from","formlyField","$http","$q","$compile","$templateCache","$interpolate","formlyConfig","formlyApiCheck","formlyUsability","formlyWarn","FormlyFieldController","$scope","$timeout","$parse","$controller","formlyValidationMessages","runExpressions","field","currentValue","valueGetterSetter","expressionProperties","setter","assign","promise","when","newVal","model","simplifyLife","originalModel","extras","data","templateOptions","to","formOptions","setFieldIdAndName","formName","form","$name","setDefaultValue","defaultValue","setInitialValue","initialValue","mergeFieldOptionsWithTypeDefaults","mergeOptions","defaultOptions","properOrder","optionsTypes","reverse","typeName","getType","extraOptions","extendOptionsWithDefaults","resetModel","updateInitialValue","formControl","resetFormControl","isMultiNgModel","$setViewValue","$render","$setUntouched","$setPristine","$root","$$phase","$digest","addValidationMessages","invokeControllers","controller","setupFieldGroup","formState","fieldGroup","fieldType","getFieldType","checkApi","fieldLink","formlyFormCtrl","setFieldGroupTemplate","checkFieldGroupApi","addClass","extraAttributes","elementAttributes","map","setElementTemplate","className","addAttributes","attr","addClasses","templateString","html","asHtml","contents","watchFormControl","watchFieldNameOrExistence","nameExpressionRegex","nameExpression","exec","watchFieldExistence","$watch","fieldCount","fc","stopWatchingShowError","addShowMessagesWatcher","addParsers","addFormatters","customExpression","errorExistsAndShouldBeVisibleExpression","$invalid","show","noTouchedButDirty","isUndefined","$touched","$dirty","errorExistsAndShouldBeVisible","showError","setParsersOrFormatters","formWasPristine","$pristine","formatters","$formatters","formatter","which","getThingsFromType","theType","typeThings","getDefaultOptionsProperty","getThingsFromOptionsTypes","getDefaultOptionsOptionsTypes","optionsTypesThings","optionsTypeName","getFormlyExpressionThing","thing","formlyExpressionParserOrFormatterFunction","originalThingProp","things","ngModelCtrls","ngModelCtrl","_ngModelCtrl","concat","noop","noFormControl","templateEl","ngModelNodes","querySelectorAll","ngModelNode","getAttribute","callLinkFunctions","thusly","runManipulators","manipulators","templateToManipulate","chain","manipulator","newTemplate","fieldManipulators","getManipulators","getFieldTemplate","preWrapper","transcludeInWrappers","postWrapper","error","wrapper","append","addManipulators","_ref","_ref$preWrapper","pre","_ref$postWrapper","post","templateManipulators","fromOptionsOrType","getFieldError","getTemplate","isUrl","templatePromise","_ret2","httpOptions","cache","v","url","get","response","getWrapperOption","aWrapper","checkWrapper","runApiCheck","promises","w","all","wrappersTemplates","wrapperTemplate","checkWrapperTemplate","totalWrapper","shift","doTransclusion","superWrapper","transcludeEl","find","replaceWith","getWrapper","getWrapperByType","typeWrappers","formWrappers","defaultWrapper","formlyFieldOptions","prefix","hide","_ref2","forType","apiCheck","apiCheckInstance","apiCheckFunction","apiCheckOptions","runApiCheckForType","getTypeHeritage","instance","config","disabled","_apiCheck2","globalConfig","checkerObjects","shape","checker","checkOptions","output","docsBaseUrl","transclude","fields","_apiCheck","formlyFocus","$document","previousEl","doc","$observe","activeElement","focus","focusWait","blur","formlyForm","formlyFormGetTemplate","getRootEl","rootEl","getFieldRootEl","fieldRootEl","getHideDirective","hideDirective","defaultHideDirective","getTrackBy","trackBy","getFormName","bindName","minor","getFormlyError","startSymbol","endSymbol","getTranscludeClass","transcludeClass","copyAttributes","attributes","excluded","arrayAttrs","toKebabCase","currentFormId","parentFormAttributes","parent","hasClass","FormlyFormController","onModelOrFormStateChange","hideExpression","evalCloseToFormlyExpression","validateOnModelChange","$validate","setupFields","fieldTransform","setupModels","attachKey","setupWatchers","setupOptions","formOptionsApi","optional","isFieldGroup","watchedModels","isNewModel","initModel","refrencesCurrentlyWatchedModel","some","watcher","watchers","listener","watchExpression","getWatchExpression","watchListener","getWatchListener","stopWatching","watchDeep","originalExpression","modifyArgs","_slice","displayName","originalListener","originalArgs","getFormlyFieldLikeLocals","formlyFormLink","setFormController","theFormlyForm","getter","parentForm","$parent","$removeControl","removeData","disableWarnings","fixChromeAutocomplete","global","removeChromeAutoComplete","offInstance","onInstance","input","document","createElement","setAttribute","appendChild","string","replace","$1","toLowerCase","prototype","slice","_providersFormlyApiCheck","_providersFormlyApiCheck2","_otherDocsBaseUrl","_otherDocsBaseUrl2","_providersFormlyUsability","_providersFormlyUsability2","_providersFormlyConfig","_providersFormlyConfig2","_providersFormlyValidationMessages","_providersFormlyValidationMessages2","_servicesFormlyUtil","_servicesFormlyUtil2","_servicesFormlyWarn","_servicesFormlyWarn2","_directivesFormlyCustomValidation","_directivesFormlyCustomValidation2","_directivesFormlyField","_directivesFormlyField2","_directivesFormlyFocus","_directivesFormlyFocus2","_directivesFormlyForm","_directivesFormlyForm2","_runFormlyNgModelAttrsManipulator","_runFormlyNgModelAttrsManipulator2","_runFormlyCustomTags","_runFormlyCustomTags2","ngModuleName","ngModule","constant","provider","directive","run","shapeRequiredIfNot","otherProps","propChecker","shapeRequiredIfNotDefinition","propName","location","propExists","otherPropsExist","otherProp","utils","getError","checkerHelpers","setupChecker","formlyExpression","oneOfType","func","specifyWrapperType","typeOrArrayOf","nullable","apiCheckProperty","apiCheckInstanceProperty","onlyIf","withProperties","warn","throw","apiCheckFunctionProperty","oneOf","formlyWrapperType","ifNot","types","overwriteOk","bool","object","strict","objectOf","modelChecker","arrayOf","validatorChecker","fieldOptionsApiShape","$$hashKey","any","number","skipNgModelAttrsManipulator","modelOptions","updateOn","debounce","allowInvalid","getterSetter","timezone","parsers","ngModelElAttrs","ngModelAttrs","statement","attribute","bound","boolean","array","typeOptionsDefaultOptions","formlyTypeOptions","extends","formlyUsabilityProvider","formlyErrorAndWarningsUrlPrefix","setType","checkType","extendTypeOptions","typeMap","JSON","stringify","_ret","allTypes","checkOverwrite","extendsType","extendTypeControllerFunction","extendTypeLinkFunction","extendTypeDefaultOptions","_otherUtils2","extendTemplate","extendsCtrl","optionsCtrl","extendsFn","optionsFn","extendsDO","optionsDO","optionsDOIsFn","extendsDOIsFn","extendsDefaultOptions","mergedDefaultOptions","extenderOptionsDefaultOptions","newDefaultOptions","throwError","errorContext","heritage","setWrapper","_x","_x2","_again","wrapperOptions","getOptionsTypes","getOptionsName","checkWrapperAPI","templateWrappersMap","defaultWrapperName","checkWrapperTypes","shouldThrow","every","newValue","objectName","wrappers","_name","removeWrapperByName","removeWrappersForType","_this","console","warnInfoSlug","_this2","disableNgModelAttrsManipulator","ngModelAttrsManipulatorPreferUnbound","explicitAsync","$get","_otherUtils","errorInfoSlug","Error","getErrorMessage","toJson","urlSuffix","additionalInfo","formlyTransclude","addTemplateOptionValueMessage","suffix","alternate","validationMessages","templateOptionValue","addStringMessage","addCustomTags","div","innerHTML","isIeLessThan9","getElementsByTagName","customElements","addFormlyNgModelAttrsManipulator","ngModelAttrsManipulator","addValidation","addIfNotPresent","modelNodes","alterNgModelAttr","isPropertyAccessor","addRegardlessOfPresence","addModelOptions","addTemplateOptionsAttrs","ep","ngModelAttributes","getBuiltInAttributes","attrVal","attrName","ref","toVal","epVal","getEpValue","inTo","inEp","addNgModelElAttrs","skip","getNgModelNodes","selectorNot","skipNot","query","e","getNgModelNodesFallback","allNgModelNodes","matchingNgModelNodes","hasAttribute","nodeMatches","selector","outerHTML","querySelector","boundOnly","bothBooleanAndBound","bothAttributeAndBound","statementOnly","attributeOnly","substr","nodes","$log"],"mappings":";CAAA,SAAAA,EAAAC,GACA,gBAAAC,UAAA,gBAAAC,QACAA,OAAAD,QAAAD,EAAAG,QAAA,aAAAA,QAAA,YACA,kBAAAC,gBAAAC,IACAD,QAAA,uBAAAJ,GACA,gBAAAC,SACAA,QAAA,SAAAD,EAAAG,QAAA,aAAAA,QAAA,YAEAJ,EAAA,SAAAC,EAAAD,EAAA,SAAAA,EAAA,UACCO,KAAA,SAAAC,EAAAC,GACD,MCEgB,UAAUC,GCR1B,QAAAC,GAAAC,GAGA,GAAAC,EAAAD,GACA,MAAAC,GAAAD,GAAAV,OAGA,IAAAC,GAAAU,EAAAD,IACAV,WACAY,GAAAF,EACAG,QAAA,EAUA,OANAL,GAAAE,GAAAI,KAAAb,EAAAD,QAAAC,IAAAD,QAAAS,GAGAR,EAAAY,QAAA,EAGAZ,EAAAD,QAvBA,GAAAW,KAqCA,OATAF,GAAAM,EAAAP,EAGAC,EAAAO,EAAAL,EAGAF,EAAAQ,EAAA,GAGAR,EAAA,KDkBM,SAASR,EAAQD,EAASS,GAE/B,YAMA,SAASS,GAAuBC,GAAO,MAAOA,IAAOA,EAAIC,WAAaD,GAAQE,UAAWF,GAJzFG,OAAOC,eAAevB,EA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IpB,SAASC,EAAQD,EAASS,GAE/B,YAMA,SAASS,GAAuBC,GAAO,MAAOA,IAAOA,EAAIC,WAAaD,GAAQE,UAAWF,GiBt+E1F,QAAS8E,KACP,MAAAsd,GAAA,WjBi+EDjiB,OAAOC,eAAevB,EAAS,cAC7BwB,OAAO,GAKT,IAAI2kB,GAAc1lB,EiB7+ED,GjB++Eb8iB,EAAeriB,EAAuBilB,EAE1CnmB,GAAQ,WiB/+EMiG,EjBq/EdhG,EAAOD,QAAUA,EAAQ,YAIpB,SAASC,EAAQD,GAEtB,YAMA,SAASmI,GAAmBC,GAAO,GAAIvD,MAAMJ,QAAQ2D,GAAM,CAAE,IAAK,GAAI/D,GAAI,EAAGgE,EAAOxD,MAAMuD,EAAI9D,QAASD,EAAI+D,EAAI9D,OAAQD,IAAKgE,EAAKhE,GAAK+D,EAAI/D,EAAI,OAAOgE,GAAe,MAAOxD,OAAMyD,KAAKF,GkBhgFvL,QAASY,GAAWH,EAAc4Z,EAAiCyH,GACjE,MAAO,YACL,IAAKrhB,EAAa8S,gBAAiB,CACjC,GAAM5W,GAAOF,MAAM6X,UAAUC,MAAM7b,KAAKsC,WAClCyiB,EAAe9gB,EAAKuP,OAC1BvP,GAAKyC,QAAQ,mBACbzC,EAAKS,KAAI,GAAIid,EAAkCoD,GAC/CqE,EAAK/J,KAAIlb,MAATilB,EAAI/hB,EAASpD,MlBq/ElBzD,OAAOC,eAAevB,EAAS,cAC7BwB,OAAO,IAKTxB,EAAQ,WkBrgFMgJ,ElBmhFdA,EAAWd,SAAW,eAAgB,kCAAmC,QACzEjI,EAAOD,QAAUA,EAAQ,YAIpB,SAASC,EAAQD,GmBxhFvBC,EAAAD,QAAAO","file":"dist/formly.min.js","sourcesContent":["(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 \n\n\n/** WEBPACK FOOTER **\n ** webpack/universalModuleDefinition\n **/","//! angular-formly version 7.0.0 built with ♥ by Astrism , Kent C. Dodds (ó ì_í)=óò=(ì_í ò)\n\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\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 formlyEval: formlyEval, getFieldId: getFieldId, reverseDeepMerge: reverseDeepMerge, findByNodeName: findByNodeName, arrayify: arrayify, extendFunction: extendFunction, extendArray: extendArray, startsWith: startsWith, contains: contains\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/\" + (\"7.0.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, addValidatorToPipeline.bind(null, false));\n\t _angularFix2['default'].forEach(opts.asyncValidators, addValidatorToPipeline.bind(null, 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: '=?' // TODO require form in a breaking release\n\t },\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, 31] */\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 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 $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 });\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 $scope.model[$scope.options.key] = newVal;\n\t }\n\t return $scope.model[$scope.options.key];\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($scope.model[$scope.options.key])) {\n\t $scope.model[$scope.options.key] = $scope.options.defaultValue;\n\t }\n\t }\n\t\n\t function setInitialValue() {\n\t $scope.options.initialValue = $scope.model && $scope.model[$scope.options.key];\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 $scope.model[$scope.options.key] = $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 }\n\t\n\t function resetFormControl(formControl, isMultiNgModel) {\n\t if (!isMultiNgModel) {\n\t formControl.$setViewValue($scope.model[$scope.options.key]);\n\t }\n\t\n\t formControl.$render();\n\t 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 = $scope.model[$scope.options.key];\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 }\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 setElementTemplate('\\n \\n \\n ');\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 fc = scope.fc;\n\t\n\t if (!fc.$invalid) {\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 formlyUtil.formlyEval(scope, customExpression, fc.$modelValue, fc.$viewValue);\n\t } else {\n\t var noTouchedButDirty = _angularFix2['default'].isUndefined(fc.$touched) && fc.$dirty;\n\t return scope.fc.$touched || noTouchedButDirty;\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 _ret2 = (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 _ret2 === 'object') return _ret2.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 || 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 $scope.$watch('model', onModelOrFormStateChange, true);\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, function runFieldExpressionProperties(field, index) {\n\t var model = field.model || $scope.model;\n\t 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 field.formControl.$validate();\n\t }\n\t });\n\t }\n\t\n\t function setupFields() {\n\t $scope.fields = $scope.fields || [];\n\t var fieldTransform = $scope.options.fieldTransform || formlyConfig.extras.fieldTransform;\n\t\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 setupModels();\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 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\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) {\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 initModel(field) {\n\t var isNewModel = true;\n\t\n\t if (_angularFix2['default'].isString(field.model)) {\n\t var expression = field.model;\n\t var index = $scope.fields.indexOf(field);\n\t\n\t isNewModel = !refrencesCurrentlyWatchedModel(expression);\n\t\n\t field.model = evalCloseToFormlyExpression(expression, undefined, field, index);\n\t if (!field.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 isNewModel;\n\t }\n\t\n\t function refrencesCurrentlyWatchedModel(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 (isFieldGroup(field) || !_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)) {\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 = watcher.expression || 'model[\\'' + field.key + '\\']';\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 }\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)) {\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 args = modifyArgs.apply(undefined, [watcher, index].concat(_slice.call(arguments)));\n\t return originalListener.apply(undefined, _toConsumableArray(args));\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 = getFormlyFieldLikeLocals(field, index);\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 options: field,\n\t index: index,\n\t formState: $scope.options.formState,\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', (\"7.0.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 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: apiCheck.typeOrArrayOf(apiCheck.shape({\n\t expression: formlyExpression.optional,\n\t listener: formlyExpression\n\t })).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 wrapper: specifyWrapperType.optional,\n\t fieldTransform: apiCheck.func.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 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 ngModelAttrsManipulatorPreferUnbound: false,\n\t removeChromeAutoComplete: false,\n\t defaultHideDirective: 'ng-if',\n\t getFieldId: null,\n\t explicitAsync: false\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 (scope.options.templateOptions[prop]) {\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 if ($document && $document.get) {\n\t (function () {\n\t // IE8 check ->\n\t // http://stackoverflow.com/questions/10964966/detect-ie-version-prior-to-v9-in-javascript/10965203#10965203\n\t var document = $document.get(0);\n\t var div = document.createElement('div');\n\t div.innerHTML = '';\n\t var isIeLessThan9 = div.getElementsByTagName('i').length === 1;\n\t\n\t if (isIeLessThan9) {\n\t // add the custom elements that we need for formly\n\t var customElements = ['formly-field', 'formly-form', 'formly-custom-validation', 'formly-focus', 'formly-transpose'];\n\t _angularFix2['default'].forEach(customElements, function (el) {\n\t document.createElement(el);\n\t });\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', '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 def44cb2438f0dbc3fa8\n **/","import index from './index.common';\nexport default index;\n\n\n\n/** WEBPACK FOOTER **\n ** ../~/eslint-loader!./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 ** ../~/eslint-loader!./angular-fix/index.js\n **/","import angular from 'angular-fix';\n\nexport default {\n formlyEval, getFieldId, reverseDeepMerge, findByNodeName, arrayify, extendFunction, extendArray, startsWith, contains\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 ** ../~/eslint-loader!./other/utils.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 **/","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, addValidatorToPipeline.bind(null, false));\n angular.forEach(opts.asyncValidators, addValidatorToPipeline.bind(null, 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 ** ../~/eslint-loader!./directives/formly-custom-validation.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, 31] */\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 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 $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 });\n }\n\n function valueGetterSetter(newVal) {\n if (!$scope.model || !$scope.options.key) {\n return undefined;\n }\n if (angular.isDefined(newVal)) {\n $scope.model[$scope.options.key] = newVal;\n }\n return $scope.model[$scope.options.key];\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) && !angular.isDefined($scope.model[$scope.options.key])) {\n $scope.model[$scope.options.key] = $scope.options.defaultValue;\n }\n }\n\n function setInitialValue() {\n $scope.options.initialValue = $scope.model && $scope.model[$scope.options.key];\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 $scope.model[$scope.options.key] = $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 }\n\n function resetFormControl(formControl, isMultiNgModel) {\n if (!isMultiNgModel) {\n formControl.$setViewValue($scope.model[$scope.options.key]);\n }\n\n formControl.$render();\n 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 = $scope.model[$scope.options.key];\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 }\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 setElementTemplate(`\n \n \n `);\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, fc} = scope;\n if (!fc.$invalid) {\n return false;\n } else if (typeof options.validation.show === 'boolean') {\n return options.validation.show;\n } else if (customExpression) {\n return formlyUtil.formlyEval(scope, customExpression, fc.$modelValue, fc.$viewValue);\n } else {\n const noTouchedButDirty = (angular.isUndefined(fc.$touched) && fc.$dirty);\n return (scope.fc.$touched || noTouchedButDirty);\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 ** ../~/eslint-loader!./directives/formly-field.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 ** ../~/eslint-loader!./directives/formly-focus.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 || 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 $scope.$watch('model', onModelOrFormStateChange, true);\n if ($scope.options.formState) {\n $scope.$watch('options.formState', onModelOrFormStateChange, true);\n }\n\n function onModelOrFormStateChange() {\n angular.forEach($scope.fields, function runFieldExpressionProperties(field, index) {\n const model = field.model || $scope.model;\n 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 field.formControl.$validate();\n }\n });\n }\n\n function setupFields() {\n $scope.fields = $scope.fields || [];\n const fieldTransform = $scope.options.fieldTransform || formlyConfig.extras.fieldTransform;\n\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 setupModels();\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\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\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) {\n $scope.$watch(() => field.model, onModelOrFormStateChange, true);\n watchedModels.push(field.model);\n }\n });\n }\n\n function initModel(field) {\n let isNewModel = true;\n\n if (angular.isString(field.model)) {\n const expression = field.model;\n const index = $scope.fields.indexOf(field);\n\n isNewModel = !refrencesCurrentlyWatchedModel(expression);\n\n field.model = evalCloseToFormlyExpression(expression, undefined, field, index);\n if (!field.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 isNewModel;\n }\n\n function refrencesCurrentlyWatchedModel(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 (isFieldGroup(field) || !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)) {\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 = watcher.expression || `model['${field.key}']`;\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 }\n return watchExpression;\n }\n\n function getWatchListener(watcher, field, index) {\n let watchListener = watcher.listener;\n if (angular.isFunction(watchListener)) {\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 const args = modifyArgs(watcher, index, ...arguments);\n return originalListener(...args);\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) {\n const extraLocals = getFormlyFieldLikeLocals(field, index);\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 options: field,\n index,\n formState: $scope.options.formState,\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 ** ../~/eslint-loader!./directives/formly-form.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 ** ../~/eslint-loader!./index.common.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 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: apiCheck.typeOrArrayOf(\n apiCheck.shape({\n expression: formlyExpression.optional,\n listener: formlyExpression\n })\n ).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\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 wrapper: specifyWrapperType.optional,\n fieldTransform: apiCheck.func.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 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 ** ../~/eslint-loader!./providers/formlyApiCheck.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 ngModelAttrsManipulatorPreferUnbound: false,\n removeChromeAutoComplete: false,\n defaultHideDirective: 'ng-if',\n getFieldId: null,\n explicitAsync: false\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 ** ../~/eslint-loader!./providers/formlyConfig.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 ** ../~/eslint-loader!./providers/formlyUsability.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 (scope.options.templateOptions[prop]) {\n return `${prefix} ${scope.options.templateOptions[prop]} ${suffix}`;\n } else {\n return alternate;\n }\n };\n }\n}\n\n\n\n/** WEBPACK FOOTER **\n ** ../~/eslint-loader!./providers/formlyValidationMessages.js\n **/","import angular from 'angular-fix';\nexport default addCustomTags;\n\n// @ngInject\nfunction addCustomTags($document) {\n if ($document && $document.get) {\n // IE8 check ->\n // http://stackoverflow.com/questions/10964966/detect-ie-version-prior-to-v9-in-javascript/10965203#10965203\n const document = $document.get(0);\n const div = document.createElement('div');\n div.innerHTML = '';\n const isIeLessThan9 = (div.getElementsByTagName('i').length === 1);\n\n if (isIeLessThan9) {\n // add the custom elements that we need for formly\n const customElements = [\n 'formly-field', 'formly-form', 'formly-custom-validation', 'formly-focus', 'formly-transpose'\n ];\n angular.forEach(customElements, el => {\n document.createElement(el);\n });\n }\n }\n}\n\n\n\n/** WEBPACK FOOTER **\n ** ../~/eslint-loader!./run/formlyCustomTags.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', '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 ** ../~/eslint-loader!./run/formlyNgModelAttrsManipulator.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 ** ../~/eslint-loader!./services/formlyUtil.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 ** ../~/eslint-loader!./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":""} diff --git a/other/ERRORS_AND_WARNINGS.md b/other/ERRORS_AND_WARNINGS.md index 9dfb20b7..32d03c2e 100644 --- a/other/ERRORS_AND_WARNINGS.md +++ b/other/ERRORS_AND_WARNINGS.md @@ -127,53 +127,6 @@ of the expression, the scope you're passed wont have all the properties you may See documentation [here](http://docs.angular-formly.com/docs/field-configuration-object#hideexpression-string--function) and an example [here](http://angular-formly.com/#/example/field-options/hide-fields) -# Validators returning promises should use asyncValidators - -Due to some issues with treating all function validators as async validators, the functionality has been split into -simply `validators` and `asyncValidators`. The ability to return a promise from a validator has been deprecated and you -should use `asyncValidators` for those now. For more info, see -[#369](https://github.com/formly-js/angular-formly/issues/369). - -# apiCheck as an object deprecated - -As a performance optimization, the `apiCheck` property has been changed to a function. This is good because when -apiCheck is disabled (either globally or the specified `apiCheckInstance`), the function is not even called which means -the apiCheck checkers are never even created. Not much we can do about the couple of extra bytes, but that's not really -a big issue. For more info, see [#334](https://github.com/formly-js/angular-formly/issues/334). Note, this will be -removed in a major release. - -# validateOptions deprecated - -Because angular-formly already has a dependency on `api-check` and this is just a better way to validate your options, -you should use this method instead. In an effort to simplify things. This has been deprecated in favor of the `apiCheck` -property. - -# skipNgModelAttrsManipulator moved - -This property has been moved from the `data` property to the `extras` property. - -Before: - -```javascript -{ - template: '
', - data: { - skipNgModelAttrsManipulator: true - } -} -``` - -After: - -```javascript -{ - template: '
', - extras: { - skipNgModelAttrsManipulator: true - } -} -``` - # Notes It is recommended to disable warnings in production using `formlyConfigProvider.disableWarnings = true`. Note: This will diff --git a/package.json b/package.json index b21bf680..3a5a0723 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "angular-formly", - "version": "6.26.9", + "version": "7.0.0", "author": "Astrism ", "contributors": [ "Astrism ", diff --git a/src/directives/formly-custom-validation.js b/src/directives/formly-custom-validation.js index 20990720..f5c5e4b9 100644 --- a/src/directives/formly-custom-validation.js +++ b/src/directives/formly-custom-validation.js @@ -2,13 +2,12 @@ import angular from 'angular-fix'; export default formlyCustomValidation; // @ngInject -function formlyCustomValidation(formlyConfig, formlyUtil, $q, formlyWarn) { +function formlyCustomValidation(formlyUtil) { return { restrict: 'A', require: 'ngModel', link: function formlyCustomValidationLink(scope, el, attrs, ctrl) { const opts = scope.options; - const warnedValidators = []; opts.validation.messages = opts.validation.messages || {}; angular.forEach(opts.validation.messages, (message, key) => { opts.validation.messages[key] = () => { @@ -41,31 +40,10 @@ function formlyCustomValidation(formlyConfig, formlyUtil, $q, formlyWarn) { } function setupWithValidators(validator, name, isAsync) { - const isPossiblyAsync = !angular.isString(validator); - let validatorCollection = (isPossiblyAsync || isAsync) ? '$asyncValidators' : '$validators'; - - // UPDATE IN 7.0.0 - // this is temporary until we can have a breaking change. Allow people to get the wins of the explicitAsync api - if (formlyConfig.extras.explicitAsync && !isAsync) { - validatorCollection = '$validators'; - } + const validatorCollection = isAsync ? '$asyncValidators' : '$validators'; ctrl[validatorCollection][name] = function evalValidity(modelValue, viewValue) { - const value = formlyUtil.formlyEval(scope, validator, modelValue, viewValue); - // UPDATE IN 7.0.0 - // In the next breaking change, this code should simply return the value - if (isAsync) { - return value; - } else if (isPossiblyAsync && !formlyConfig.extras.explicitAsync) { - if (isPromiseLike(value)) { - logAsyncValidatorsDeprecationNotice(validator, opts); - return value; - } else { - return value ? $q.when(value) : $q.reject(value); - } - } else { - return value; - } + return formlyUtil.formlyEval(scope, validator, modelValue, viewValue); }; } @@ -73,13 +51,7 @@ function formlyCustomValidation(formlyConfig, formlyUtil, $q, formlyWarn) { let inFlightValidator; ctrl.$parsers.unshift(function evalValidityOfParser(viewValue) { const isValid = formlyUtil.formlyEval(scope, validator, ctrl.$modelValue, viewValue); - // UPDATE IN 7.0.0 - // In the next breaking change, rather than checking for isPromiseLike, it should just check for isAsync. - - if (isAsync || isPromiseLike(isValid)) { - if (!isAsync) { - logAsyncValidatorsDeprecationNotice(validator, opts); - } + if (isAsync) { ctrl.$pending = ctrl.$pending || {}; ctrl.$pending[name] = true; inFlightValidator = isValid; @@ -105,24 +77,6 @@ function formlyCustomValidation(formlyConfig, formlyUtil, $q, formlyWarn) { return viewValue; }); } - - function logAsyncValidatorsDeprecationNotice(validator, options) { - if (warnedValidators.indexOf(validator) !== -1) { - // we've warned about this one before. No spam necessary... - return; - } - warnedValidators.push(validator); - formlyWarn( - 'validators-returning-promises-should-use-asyncvalidators', - 'Validators returning promises should use asyncValidators instead of validators.', - options - ); - } } }; - - - function isPromiseLike(obj) { - return obj && angular.isFunction(obj.then); - } } diff --git a/src/directives/formly-custom-validation.test.js b/src/directives/formly-custom-validation.test.js index 48cb9324..cc9dd4e6 100644 --- a/src/directives/formly-custom-validation.test.js +++ b/src/directives/formly-custom-validation.test.js @@ -30,37 +30,6 @@ describe(`formly-custom-validation`, function() { checkApi(formTemplate.replace( `TEMPLATE`, `` )); - - describe(`validators that are functions placement`, () => { - it(`should be placed in $asyncValidators because it can return a promise`, () => { - scope.options.validators.isHello = viewValue => viewValue === 'hello'; - $compile( - `
` - )(scope); - scope.$digest(); - const field = scope.myForm.field; - expect(field.$validators.isHello).to.not.exist; - expect(field.$asyncValidators.isHello).to.exist; - }); - - it(`should be placed in $validators if formlyConfig.extras.explicitAsync`, () => { - formlyConfig.extras.explicitAsync = true; - scope.options.validators.isHello = viewValue => viewValue === 'hello'; - $compile( - `
` - )(scope); - scope.$digest(); - const field = scope.myForm.field; - expect(field.$validators.isHello).to.exist; - expect(field.$asyncValidators.isHello).to.not.exist; - }); - - it(`should validate properly when explicitAsync is true`, () => { - formlyConfig.extras.explicitAsync = true; - const template = `
`; - doValidation(template, 'hello', false, viewValue => viewValue !== 'hello', false); - }); - }); }); describe(`options.validation.messages`, () => { @@ -100,18 +69,6 @@ describe(`formly-custom-validation`, function() { it(`should fail if it's a function that fails`, () => { validate(viewValue => viewValue !== value, false); }); - - it(`should warn if it's a function that returns a promise for a regular validator (should use asyncValidators instead)`, () => { - const logArgs = [ - 'Formly Warning:', - 'Validators returning promises should use asyncValidators instead of validators.', - scope.options, - /validators-returning-promises-should-use-asyncvalidators/ - ]; - shouldWarnWithLog($log, logArgs, () => { - validate(() => $q.when(), true); - }); - }); }); describe(`asyncValidators`, () => { diff --git a/src/directives/formly-field.js b/src/directives/formly-field.js index 03b44e5a..b75d0b20 100644 --- a/src/directives/formly-field.js +++ b/src/directives/formly-field.js @@ -564,7 +564,6 @@ function formlyField($http, $q, $compile, $templateCache, $interpolate, formlyCo wrapper.forEach((aWrapper) => { formlyUsability.checkWrapper(aWrapper, options); - aWrapper.validateOptions && aWrapper.validateOptions(options); runApiCheck(aWrapper, options); }); const promises = wrapper.map(w => getTemplate(w.template || w.templateUrl, !w.template)); @@ -639,9 +638,6 @@ function formlyField($http, $q, $compile, $templateCache, $interpolate, formlyCo // validate with the type const type = options.type && formlyConfig.getType(options.type); if (type) { - if (type.validateOptions) { - type.validateOptions(options); - } runApiCheck(type, options, true); } if (options.expressionProperties && options.expressionProperties.hide) { @@ -679,26 +675,16 @@ function formlyField($http, $q, $compile, $templateCache, $interpolate, formlyCo return; } const fn = apiCheckFunction || 'warn'; - if (angular.isFunction(apiCheck)) { - // this is the new API - const checkerObjects = apiCheck(instance); - angular.forEach(checkerObjects, (shape, name) => { - const checker = instance.shape(shape); - const checkOptions = angular.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); - }); - } else { - // TODO this is the deprecated API. Remove this in a breaking change. - const checker = instance.shape(apiCheck); - const checkOptions = apiCheckOptions || { - prefix: `formly-field type ${options.type}`, + // this is the new API + const checkerObjects = apiCheck(instance); + angular.forEach(checkerObjects, (shape, name) => { + const checker = instance.shape(shape); + const checkOptions = angular.extend({ + prefix: `formly-field type ${options.type} for property ${name}`, url: formlyApiCheck.config.output.docsBaseUrl + 'formly-field-type-apicheck-failed' - }; - instance[fn](checker, options, checkOptions); - } + }, apiCheckOptions); + instance[fn](checker, options[name], checkOptions); + }); } diff --git a/src/directives/formly-field.test.js b/src/directives/formly-field.test.js index d59b8902..e10475f1 100644 --- a/src/directives/formly-field.test.js +++ b/src/directives/formly-field.test.js @@ -102,15 +102,12 @@ describe('formly-field', function() { describe('api check', () => { - let validateOptions; beforeEach(() => { /* eslint no-console:0 */ const originalWarn = console.warn; console.warn = () => {}; - validateOptions = sinon.spy(); formlyConfig.setType({ - name: 'text', template: ``, - validateOptions + name: 'text', template: `` }); scope.model = {}; console.warn = originalWarn; @@ -127,13 +124,6 @@ describe('formly-field', function() { expect(() => compileAndDigest()).to.throw(/extra.*properties.*extraProp/); }); - - it(`should invoke the validateOptions property of the type`, () => { - const field = {type: 'text'}; - scope.fields = [field]; - compileAndDigest(); - expect(validateOptions).to.have.been.calledWith(field); - }); }); describe('default type options', () => { @@ -184,7 +174,7 @@ describe('formly-field', function() { attribute: 'required' }, myChange: { - expression: 'ng-change' + statement: 'ng-change' } }, templateOptions: { @@ -632,28 +622,6 @@ describe('formly-field', function() { expect(type.apiCheck).to.have.been.calledWith(formlyApiCheck); })); - it(`should work with the old api`, () => { - shouldWarn( - /deprecated/, - () => { - formlyConfig.setType({ - name: 'someOtherType', - template: '', - apiCheck: { - templateOptions: apiCheck.shape({ - label: apiCheck.string - }) - } - }); - } - ); - scope.fields = [{type: 'someOtherType'}]; - shouldWarn( - /angular-formly: formly-field type someOtherType apiCheck failed.*?Required `label`.*?templateOptions.*?`String`/, - compileAndDigest - ); - }); - it(`should not warn if everything's fine`, () => { scope.fields = [ {type, templateOptions: {label: 'string', className: 'string'}} diff --git a/src/other/utils.js b/src/other/utils.js index 2f7d6f14..e330d9e6 100644 --- a/src/other/utils.js +++ b/src/other/utils.js @@ -1,6 +1,8 @@ import angular from 'angular-fix'; -export default {formlyEval, getFieldId, reverseDeepMerge, findByNodeName, arrayify, extendFunction, extendArray, startsWith}; +export default { + formlyEval, getFieldId, reverseDeepMerge, findByNodeName, arrayify, extendFunction, extendArray, startsWith, contains +}; function formlyEval(scope, expression, $modelValue, $viewValue, extraLocals) { if (angular.isFunction(expression)) { @@ -109,3 +111,11 @@ function startsWith(str, search) { return false; } } + +function contains(str, search) { + if (angular.isString(str) && angular.isString(search)) { + return str.length >= search.length && str.indexOf(search) !== -1; + } else { + return false; + } +} diff --git a/src/providers/formlyApiCheck.js b/src/providers/formlyApiCheck.js index 2bc88715..7aa250d6 100644 --- a/src/providers/formlyApiCheck.js +++ b/src/providers/formlyApiCheck.js @@ -30,17 +30,10 @@ function shapeRequiredIfNot(otherProps, propChecker) { return apiCheck.utils.checkerHelpers.setupChecker(shapeRequiredIfNotDefinition); } -// TODO in 7.0.0 .nullable is available on all checkers -function nullable(checker) { - return apiCheck.oneOfType([ - apiCheck.oneOf([null]), checker - ]); -} - const formlyExpression = apiCheck.oneOfType([apiCheck.string, apiCheck.func]); -const specifyWrapperType = nullable(apiCheck.typeOrArrayOf(apiCheck.string)); +const specifyWrapperType = apiCheck.typeOrArrayOf(apiCheck.string).nullable; -const apiCheckProperty = apiCheck.oneOfType([apiCheck.func, apiCheck.objectOf(apiCheck.func)]); +const apiCheckProperty = apiCheck.func; const apiCheckInstanceProperty = apiCheck.shape.onlyIf('apiCheck', apiCheck.func.withProperties({ warn: apiCheck.func, @@ -56,7 +49,6 @@ const formlyWrapperType = apiCheck.shape({ templateUrl: apiCheck.shape.ifNot('template', apiCheck.string).optional, types: apiCheck.typeOrArrayOf(apiCheck.string).optional, overwriteOk: apiCheck.bool.optional, - validateOptions: apiCheck.func.optional, apiCheck: apiCheckProperty.optional, apiCheckInstance: apiCheckInstanceProperty.optional, apiCheckFunction: apiCheckFunctionProperty.optional, @@ -73,10 +65,10 @@ const expressionProperties = apiCheck.objectOf(apiCheck.oneOfType([ const modelChecker = apiCheck.oneOfType([apiCheck.string, apiCheck.object]); -const templateManipulators = nullable(apiCheck.shape({ - preWrapper: nullable(apiCheck.arrayOf(apiCheck.func)).optional, - postWrapper: nullable(apiCheck.arrayOf(apiCheck.func)).optional -}).strict); +const templateManipulators = apiCheck.shape({ + preWrapper: apiCheck.arrayOf(apiCheck.func).nullable.optional, + postWrapper: apiCheck.arrayOf(apiCheck.func).nullable.optional +}).strict.nullable; const validatorChecker = apiCheck.objectOf(apiCheck.oneOfType([ formlyExpression, apiCheck.shape({ @@ -136,11 +128,11 @@ const fieldOptionsApiShape = { hideExpression: formlyExpression.optional, ngModelElAttrs: apiCheck.objectOf(apiCheck.string).optional, ngModelAttrs: apiCheck.objectOf(apiCheck.shape({ - expression: apiCheck.shape.ifNot(['value', 'attribute', 'bound', 'boolean'], apiCheck.any).optional, - value: apiCheck.shape.ifNot('expression', apiCheck.any).optional, - attribute: apiCheck.shape.ifNot('expression', apiCheck.any).optional, - bound: apiCheck.shape.ifNot('expression', apiCheck.any).optional, - boolean: apiCheck.shape.ifNot('expression', apiCheck.any).optional + 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, @@ -149,7 +141,7 @@ const fieldOptionsApiShape = { apiCheck.string, apiCheck.func, apiCheck.array ]).optional, validation: apiCheck.shape({ - show: nullable(apiCheck.bool).optional, + show: apiCheck.bool.nullable.optional, messages: apiCheck.objectOf(formlyExpression).optional, errorExistsAndShouldBeVisible: apiCheck.bool.optional }).optional, @@ -211,7 +203,6 @@ const formlyTypeOptions = apiCheck.shape({ extends: apiCheck.string.optional, wrapper: specifyWrapperType.optional, data: apiCheck.object.optional, - validateOptions: apiCheck.func.optional, apiCheck: apiCheckProperty.optional, apiCheckInstance: apiCheckInstanceProperty.optional, apiCheckFunction: apiCheckFunctionProperty.optional, diff --git a/src/providers/formlyConfig.js b/src/providers/formlyConfig.js index c5d73e09..2035f4da 100644 --- a/src/providers/formlyConfig.js +++ b/src/providers/formlyConfig.js @@ -61,7 +61,6 @@ function formlyConfig(formlyUsabilityProvider, formlyErrorAndWarningsUrlPrefix, prefix: 'formlyConfig.setType', url: 'settype-validation-failed' }); - checkDeprecatedOptions(options); if (!options.overwriteOk) { checkOverwrite(options.name, typeMap, options, 'types'); } else { @@ -73,7 +72,6 @@ function formlyConfig(formlyUsabilityProvider, formlyErrorAndWarningsUrlPrefix, const extendsType = getType(options.extends, true, options); extendTypeControllerFunction(options, extendsType); extendTypeLinkFunction(options, extendsType); - extendTypeValidateOptionsFunction(options, extendsType); extendTypeDefaultOptions(options, extendsType); utils.reverseDeepMerge(options, extendsType); extendTemplate(options, extendsType); @@ -120,31 +118,6 @@ function formlyConfig(formlyUsabilityProvider, formlyErrorAndWarningsUrlPrefix, } } - function extendTypeValidateOptionsFunction(options, extendsType) { - const extendsFn = extendsType.validateOptions; - if (!angular.isDefined(extendsFn)) { - return; - } - const optionsFn = options.validateOptions; - const originalDefaultOptions = options.defaultOptions; - if (angular.isDefined(optionsFn)) { - options.validateOptions = function(opts) { - optionsFn(opts); - const mergedOptions = angular.copy(opts); - let defaultOptions = originalDefaultOptions; - if (defaultOptions) { - if (angular.isFunction(defaultOptions)) { - defaultOptions = defaultOptions(mergedOptions); - } - utils.reverseDeepMerge(mergedOptions, defaultOptions); - } - extendsFn(mergedOptions); - }; - } else { - options.validateOptions = extendsFn; - } - } - function extendTypeDefaultOptions(options, extendsType) { const extendsDO = extendsType.defaultOptions; if (!angular.isDefined(extendsDO)) { @@ -241,7 +214,6 @@ function formlyConfig(formlyUsabilityProvider, formlyErrorAndWarningsUrlPrefix, if (options.template) { formlyUsabilityProvider.checkWrapperTemplate(options.template, options); } - checkDeprecatedOptions(options); if (!options.overwriteOk) { checkOverwrite(options.name, templateWrappersMap, options, 'templateWrappers'); } else { @@ -267,25 +239,6 @@ function formlyConfig(formlyUsabilityProvider, formlyErrorAndWarningsUrlPrefix, } } - function checkDeprecatedOptions(options) { - if (options.apiCheck && !angular.isFunction(options.apiCheck)) { - warn( - 'apicheck-as-an-object-deprecated', - 'apiCheck as an object has been deprecated.', - `Attempted for type: ${options.name}`, - options - ); - } - if (options.validateOptions) { - warn( - 'validateoptions-deprecated', - 'the `validateOptions` property has been deprecated.', - `Attempted for type: ${options.name}`, - options - ); - } - } - function getWrapper(name) { return templateWrappersMap[name || defaultWrapperName]; } diff --git a/src/providers/formlyConfig.test.js b/src/providers/formlyConfig.test.js index 130f7c28..27025956 100644 --- a/src/providers/formlyConfig.test.js +++ b/src/providers/formlyConfig.test.js @@ -424,85 +424,6 @@ describe('formlyConfig', () => { }); - describe(`validateOptions functions`, () => { - let options, parentFn, childFn; - beforeEach(() => { - options = { - data: { - a: 'b', - c: {d: 'e'} - } - }; - parentFn = sinon.spy(); - childFn = sinon.spy(); - }); - - it(`should give a deprecation warning when specified as part of a type`, () => { - shouldWarn( - /Formly Warning: the `validateOptions` property has been deprecated. Attempted for type: foobar/, - function() { - setterFn({ - name: 'foobar', - validateOptions() {} - }); - } - ); - }); - - describe(`old functionality`, () => { - let originalWarn; - beforeEach(() => { - originalWarn = console.warn; - console.warn = () => {}; - }); - - it(`should call the parent validateOptions function when there is no child function`, () => { - setterFn([ - {name, template, validateOptions: parentFn}, - {name: 'type2', extends: name} - ]); - getterFn('type2').validateOptions(options); - expect(parentFn).to.have.been.calledWith(options); - }); - - it(`should call the child validateOptions function when there is no parent function`, () => { - setterFn([ - {name, template}, - {name: 'type2', extends: name, validateOptions: childFn} - ]); - getterFn('type2').validateOptions(options); - expect(childFn).to.have.been.calledWith(options); - }); - - it(`should call the child validateOptions function and the parent validateOptions function when they are both present`, () => { - setterFn([ - {name, template, validateOptions: parentFn}, - {name: 'type2', extends: name, validateOptions: childFn} - ]); - getterFn('type2').validateOptions(options); - expect(childFn).to.have.been.calledWith(options); - expect(parentFn).to.have.been.calledWith(options); - }); - - it(`should pass the result of the child's defaultOptions with the given options to the parent's validateOptions function`, () => { - const defaultOptions = {data: {f: 'g'}}; - const combinedOptions = {data: {a: 'b', c: {d: 'e'}, f: 'g'}}; - setterFn([ - {name, template, validateOptions: parentFn}, - {name: 'type2', extends: name, validateOptions: childFn, defaultOptions} - ]); - getterFn('type2').validateOptions(options); - expect(childFn).to.have.been.calledWith(options); - expect(parentFn).to.have.been.calledWith(combinedOptions); - }); - - afterEach(() => { - console.warn = originalWarn; - }); - }); - - }); - describe(`controller functions`, () => { let parentFn, childFn, $controller, $scope; beforeEach(inject(($rootScope, _$controller_) => { @@ -607,19 +528,6 @@ describe('formlyConfig', () => { } }); - it(`should give a deprecation warning when providing apiCheck as an object rather than a function`, () => { - shouldWarn( - /Formly Warning: apiCheck as an object has been deprecated. Attempted for type: input/, - function() { - setterFn({ - name, - apiCheck: {}, - template - }); - } - ); - }); - describe(`apiCheckInstance`, () => { let apiCheckInstance; beforeEach(() => { diff --git a/src/run/formlyNgModelAttrsManipulator.js b/src/run/formlyNgModelAttrsManipulator.js index 28763926..1db56893 100644 --- a/src/run/formlyNgModelAttrsManipulator.js +++ b/src/run/formlyNgModelAttrsManipulator.js @@ -1,9 +1,10 @@ import angular from 'angular-fix'; +import {contains} from '../other/utils'; export default addFormlyNgModelAttrsManipulator; // @ngInject -function addFormlyNgModelAttrsManipulator(formlyConfig, $interpolate, formlyWarn) { +function addFormlyNgModelAttrsManipulator(formlyConfig, $interpolate) { if (formlyConfig.extras.disableNgModelAttrsManipulator) { return; } @@ -12,7 +13,7 @@ function addFormlyNgModelAttrsManipulator(formlyConfig, $interpolate, formlyWarn function ngModelAttrsManipulator(template, options, scope) { const node = document.createElement('div'); - const skip = getSkip(options); + const skip = options.extras && options.extras.skipNgModelAttrsManipulator; if (skip === true) { return template; } @@ -27,6 +28,7 @@ function addFormlyNgModelAttrsManipulator(formlyConfig, $interpolate, formlyWarn addIfNotPresent(modelNodes, 'name', scope.name || scope.id); addValidation(); + alterNgModelAttr(); addModelOptions(); addTemplateOptionsAttrs(); addNgModelElAttrs(); @@ -41,13 +43,17 @@ function addFormlyNgModelAttrsManipulator(formlyConfig, $interpolate, formlyWarn } } + function alterNgModelAttr() { + if (isPropertyAccessor(options.key)) { + addRegardlessOfPresence(modelNodes, 'ng-model', 'model.' + options.key); + } + } + function addModelOptions() { if (angular.isDefined(options.modelOptions)) { addIfNotPresent(modelNodes, 'ng-model-options', 'options.modelOptions'); if (options.modelOptions.getterSetter) { - angular.forEach(modelNodes, modelNode => { - modelNode.setAttribute('ng-model', 'options.value'); - }); + addRegardlessOfPresence(modelNodes, 'ng-model', 'options.value'); } } } @@ -79,8 +85,8 @@ function addFormlyNgModelAttrsManipulator(formlyConfig, $interpolate, formlyWarn // I realize this looks backwards, but it's right, trust me... attrName = val.value; attrVal = name; - } else if (val.expression && inTo) { - attrName = val.expression; + } else if (val.statement && inTo) { + attrName = val.statement; if (angular.isString(to[name])) { attrVal = `$eval(${ref})`; } else if (angular.isFunction(to[name])) { @@ -121,7 +127,7 @@ function addFormlyNgModelAttrsManipulator(formlyConfig, $interpolate, formlyWarn function addNgModelElAttrs() { angular.forEach(options.ngModelElAttrs, (val, name) => { - addIfNotPresent(modelNodes, name, val); + addRegardlessOfPresence(modelNodes, name, val); }); } } @@ -166,22 +172,6 @@ function addFormlyNgModelAttrsManipulator(formlyConfig, $interpolate, formlyWarn return div.querySelector(selector); } - function getSkip(options) { - // UPDATE IN 7.0.0 - let skip = options.extras && options.extras.skipNgModelAttrsManipulator; - if (!angular.isDefined(skip)) { - skip = options.data && options.data.skipNgModelAttrsManipulator; - if (angular.isDefined(skip)) { - formlyWarn( - 'skipngmodelattrsmanipulator-moved', - 'The skipNgModelAttrsManipulator property has been moved from the `data` property to the `extras` property', - options - ); - } - } - return skip; - } - function getBuiltInAttributes() { const ngModelAttributes = { focus: { @@ -191,7 +181,7 @@ function addFormlyNgModelAttrsManipulator(formlyConfig, $interpolate, formlyWarn const boundOnly = []; const bothBooleanAndBound = ['required', 'disabled']; const bothAttributeAndBound = ['pattern', 'minlength']; - const expressionOnly = ['change', 'keydown', 'keyup', 'keypress', 'click', 'focus', 'blur']; + const statementOnly = ['change', 'keydown', 'keyup', 'keypress', 'click', 'focus', 'blur']; const attributeOnly = ['placeholder', 'min', 'max', 'tabindex', 'type']; if (formlyConfig.extras.ngModelAttrsManipulatorPreferUnbound) { bothAttributeAndBound.push('maxlength'); @@ -211,9 +201,9 @@ function addFormlyNgModelAttrsManipulator(formlyConfig, $interpolate, formlyWarn ngModelAttributes[item] = {attribute: item, bound: 'ng-' + item}; }); - angular.forEach(expressionOnly, item => { + angular.forEach(statementOnly, item => { const propName = 'on' + item.substr(0, 1).toUpperCase() + item.substr(1); - ngModelAttributes[propName] = {expression: 'ng-' + item}; + ngModelAttributes[propName] = {statement: 'ng-' + item}; }); angular.forEach(attributeOnly, item => { @@ -235,4 +225,14 @@ function addFormlyNgModelAttrsManipulator(formlyConfig, $interpolate, formlyWarn } }); } + + function addRegardlessOfPresence(nodes, attr, val) { + angular.forEach(nodes, node => { + node.setAttribute(attr, val); + }); + } + + function isPropertyAccessor(key) { + return contains(key, '.') || (contains(key, '[') && contains(key, ']')); + } } diff --git a/src/run/formlyNgModelAttrsManipulator.test.js b/src/run/formlyNgModelAttrsManipulator.test.js index 328adf4a..008a44b0 100644 --- a/src/run/formlyNgModelAttrsManipulator.test.js +++ b/src/run/formlyNgModelAttrsManipulator.test.js @@ -2,18 +2,13 @@ import angular from 'angular'; import _ from 'lodash'; -import testUtils from '../test.utils.js'; - -const {shouldWarnWithLog} = testUtils; - describe('formlyNgModelAttrsManipulator', () => { beforeEach(window.module('formly')); - let formlyConfig, manipulator, scope, field, result, resultEl, resultNode, $log; + let formlyConfig, manipulator, scope, field, result, resultEl, resultNode; const template = ''; - beforeEach(inject((_formlyConfig_, $rootScope, _$log_) => { - $log = _$log_; + beforeEach(inject((_formlyConfig_, $rootScope) => { formlyConfig = _formlyConfig_; manipulator = formlyConfig.templateManipulators.preWrapper[0]; scope = $rootScope.$new(); @@ -27,17 +22,6 @@ describe('formlyNgModelAttrsManipulator', () => { })); describe(`skipping`, () => { - it(`should give a deprecation warning when using the data property`, () => { - field.data.skipNgModelAttrsManipulator = true; - const logArgs = [ - 'Formly Warning:', - 'The skipNgModelAttrsManipulator property has been moved from the `data` property to the `extras` property', - field, - /skipngmodelattrsmanipulator-moved/ - ]; - shouldWarnWithLog($log, logArgs, manipulate); - }); - it(`should allow you to skip the manipulator wholesale for the field`, () => { field.extras.skipNgModelAttrsManipulator = true; @@ -194,6 +178,19 @@ describe('formlyNgModelAttrsManipulator', () => { }); }); + describe(`selector key notation`, () => { + it(`should change the ng-model when the key is a dot property accessor`, () => { + field.key = 'bar.foo'; + manipulate(); + expect(resultEl.attr('ng-model')).to.equal('model.' + field.key); + }); + + it(`should change the ng-model when the key is a bracket property accessor`, () => { + field.key = 'bar["foo-bar"]'; + manipulate(); + expect(resultEl.attr('ng-model')).to.equal('model.' + field.key); + }); + }); describe(`formly-custom-validation`, () => { it(`shouldn't be added if there aren't validators or messages`, () => { @@ -349,6 +346,14 @@ describe('formlyNgModelAttrsManipulator', () => { ).to.equal('{{::to.bar}}'); }); + + it(`should override existing attributes`, () => { + field.ngModelElAttrs = { + 'ng-model': 'formState.foo.bar' + }; + manipulate(); + expect(resultEl.attr('ng-model')).to.equal('formState.foo.bar'); + }); });