diff --git a/.gitignore b/.gitignore index 6ae5b82..b308cbc 100644 --- a/.gitignore +++ b/.gitignore @@ -6,4 +6,5 @@ tmp .DS_Store .idea src/libs +src/dist data/db.json \ No newline at end of file diff --git a/README.md b/README.md index 07a6302..23a582b 100644 --- a/README.md +++ b/README.md @@ -18,4 +18,34 @@ To run the application we type `npm start` - this loads the application using a local webserver, check the console for the port number to use. -The application is a simple contacts application where you can search, create or edit a contact. \ No newline at end of file +The application is a simple contacts application where you can search, create or edit a contact. + +## Steps + +### Step 1 - Style guide + +- Ensure all entities are in separate files + +### Step 2 - TypeScript & build tools + +*Files* +- Renamed all js files into ts files and added `index.ts` files to make importing easier. +- Copy packages from `bower.json` into `package.json`, run `npm install` and fix some issues are we go along + - "ngInfiniteScroll" => "ng-infinite-scroll" + - "AngularJS-Toaster" => "angularjs-toaster" + - "angular-auto-validate": "^1.19.6" => "angular-auto-validate": "^1.19.0" +- Created entry point `src/main.ts` which contains imports for all required packages, which webpack uses to figure out what to bundle. + +*Tooling* +- Installed packages for build tooling `rimraf`, `ts-loader`, `typescript` and `webpack` via package.json +- Added `tsconfig.json` and `webpack.config.js` to configure typescript compilation and bundling via webpack. +- Added build script in `package.json` so we can run the build tools using `npm run build`. +- Fix any problems which we had when running the above command. + - Some errors with contacts service due to stricter checking + - Add `import * as angular from 'angular';` so that typescript knows where to load angular from. + - Add `"@types/angular": "^1.4.0"` to `package.json` to remove any typescript errors + +*Consuming* +- Replace all the js files in index.html with just one script tag `` + + diff --git a/package.json b/package.json index 2e9e524..2c26c4b 100644 --- a/package.json +++ b/package.json @@ -6,14 +6,35 @@ "scripts": { "server": "cp ./data/orig-db.json ./data/db.json && json-server --watch ./data/db.json", "setup": "bower install", - "start": "cd src && serve" + "start": "cd src && serve", + "build": "rimraf src/dist && webpack --bail --progress --profile" }, "author": "", "license": "ISC", - "dependencies": {}, + "dependencies": { + "angular": "^1.4.0", + "angular-animate": "^1.4.0", + "angular-auto-validate": "^1.19.0", + "angular-ladda": "^0.4.3", + "angular-resource": "^1.4.0", + "angular-strap": "^2.3.12", + "angularjs-toaster": "^2.1.0", + "bootstrap": "3.3.2", + "bootstrap-additions": "0.3.1", + "font-awesome": "4.3.0", + "jquery": "2.1.3", + "ng-infinite-scroll": "1.2.1", + "angular-ui-router": "^0.4.2", + "angular-spinner": "^1.0.1" + }, "devDependencies": { + "@types/angular": "^1.4.0", "bower": "^1.8.0", "json-server": "^0.9.6", - "serve": "^5.1.2" + "serve": "^5.1.2", + "rimraf": "^2.6.0", + "ts-loader": "^2.0.1", + "typescript": "^2.2.1", + "webpack": "^2.2.1" } } diff --git a/src/app/app.main.js b/src/app/app.main.ts similarity index 92% rename from src/app/app.main.js rename to src/app/app.main.ts index bf20e48..5f15b5e 100644 --- a/src/app/app.main.js +++ b/src/app/app.main.ts @@ -1,3 +1,5 @@ +import * as angular from 'angular'; + angular.module('codecraft', [ 'ngResource', 'infinite-scroll', diff --git a/src/app/app.routes.js b/src/app/app.routes.ts similarity index 96% rename from src/app/app.routes.js rename to src/app/app.routes.ts index c96fd39..1d158ba 100644 --- a/src/app/app.routes.js +++ b/src/app/app.routes.ts @@ -1,3 +1,5 @@ +import * as angular from 'angular'; + angular .module('codecraft') .config(function ($stateProvider, $urlRouterProvider) { diff --git a/src/app/controllers/index.ts b/src/app/controllers/index.ts new file mode 100644 index 0000000..9270349 --- /dev/null +++ b/src/app/controllers/index.ts @@ -0,0 +1,4 @@ +import "./person-create.controller"; +import "./person-edit.controller"; +import "./person-list.controller"; +import "./search.controller"; diff --git a/src/app/controllers/person-create.controller.js b/src/app/controllers/person-create.controller.ts similarity index 91% rename from src/app/controllers/person-create.controller.js rename to src/app/controllers/person-create.controller.ts index e277431..04f7c88 100644 --- a/src/app/controllers/person-create.controller.js +++ b/src/app/controllers/person-create.controller.ts @@ -1,3 +1,5 @@ +import * as angular from 'angular'; + angular .module('codecraft') .controller('PersonCreateController', function ($scope, $state, ContactService) { diff --git a/src/app/controllers/person-edit.controller.js b/src/app/controllers/person-edit.controller.ts similarity index 93% rename from src/app/controllers/person-edit.controller.js rename to src/app/controllers/person-edit.controller.ts index 3ea7dd5..9074c1a 100644 --- a/src/app/controllers/person-edit.controller.js +++ b/src/app/controllers/person-edit.controller.ts @@ -1,3 +1,5 @@ +import * as angular from 'angular'; + angular .module('codecraft') .controller('PersonEditController', function ($scope, $stateParams, $state, ContactService) { diff --git a/src/app/controllers/person-list.controller.js b/src/app/controllers/person-list.controller.ts similarity index 80% rename from src/app/controllers/person-list.controller.js rename to src/app/controllers/person-list.controller.ts index 0f14a3b..e37dcef 100644 --- a/src/app/controllers/person-list.controller.js +++ b/src/app/controllers/person-list.controller.ts @@ -1,3 +1,5 @@ +import * as angular from 'angular'; + angular .module('codecraft') .controller('PersonListController', function ($scope, ContactService) { diff --git a/src/app/controllers/search.controller.js b/src/app/controllers/search.controller.ts similarity index 86% rename from src/app/controllers/search.controller.js rename to src/app/controllers/search.controller.ts index 27a3c07..9b001a2 100644 --- a/src/app/controllers/search.controller.js +++ b/src/app/controllers/search.controller.ts @@ -1,3 +1,5 @@ +import * as angular from 'angular'; + angular .module('codecraft') .controller('SearchController', function ($scope, ContactService) { diff --git a/src/app/directives/card.directive.js b/src/app/directives/card.directive.ts similarity index 93% rename from src/app/directives/card.directive.js rename to src/app/directives/card.directive.ts index 1c72bb6..e60f303 100644 --- a/src/app/directives/card.directive.js +++ b/src/app/directives/card.directive.ts @@ -1,3 +1,5 @@ +import * as angular from 'angular'; + angular .module('codecraft') .directive('ccCard', function () { diff --git a/src/app/directives/index.ts b/src/app/directives/index.ts new file mode 100644 index 0000000..b3d3c13 --- /dev/null +++ b/src/app/directives/index.ts @@ -0,0 +1,2 @@ +import "./card.directive"; +import "./spinner.directive"; diff --git a/src/app/directives/spinner.directive.js b/src/app/directives/spinner.directive.ts similarity index 88% rename from src/app/directives/spinner.directive.js rename to src/app/directives/spinner.directive.ts index 5486b4b..4479b55 100644 --- a/src/app/directives/spinner.directive.js +++ b/src/app/directives/spinner.directive.ts @@ -1,3 +1,5 @@ +import * as angular from 'angular'; + angular .module('codecraft') .directive('ccSpinner', function () { diff --git a/src/app/filters/default-image.filter.js b/src/app/filters/default-image.filter.ts similarity index 88% rename from src/app/filters/default-image.filter.js rename to src/app/filters/default-image.filter.ts index b9ed4c6..e7debc6 100644 --- a/src/app/filters/default-image.filter.js +++ b/src/app/filters/default-image.filter.ts @@ -1,3 +1,5 @@ +import * as angular from 'angular'; + angular .module('codecraft') .filter('defaultImage', function () { diff --git a/src/app/filters/index.ts b/src/app/filters/index.ts new file mode 100644 index 0000000..96a546b --- /dev/null +++ b/src/app/filters/index.ts @@ -0,0 +1 @@ +import "./default-image.filter"; diff --git a/src/app/main.ts b/src/app/main.ts new file mode 100644 index 0000000..375ef99 --- /dev/null +++ b/src/app/main.ts @@ -0,0 +1,18 @@ +import 'angular'; +import 'angular-resource'; +import 'angular-animate'; +import 'ng-infinite-scroll'; +import 'angular-spinner'; +import 'angular-auto-validate/dist/jcs-auto-validate'; +import 'angular-ladda'; +import 'angular-strap'; +import 'angularjs-toaster'; +import 'angular-ui-router'; + +import './app.main'; +import './services'; +import './directives'; +import './filters'; +import './controllers'; +import './app.routes'; + diff --git a/src/app/services/contact.resource.js b/src/app/services/contact.resource.ts similarity index 85% rename from src/app/services/contact.resource.js rename to src/app/services/contact.resource.ts index aeb63b8..3814a9e 100644 --- a/src/app/services/contact.resource.js +++ b/src/app/services/contact.resource.ts @@ -1,3 +1,5 @@ +import * as angular from 'angular'; + angular .module('codecraft') .factory("Contact", function ($resource) { diff --git a/src/app/services/contact.service.js b/src/app/services/contact.service.ts similarity index 97% rename from src/app/services/contact.service.js rename to src/app/services/contact.service.ts index aec4c59..e57be01 100644 --- a/src/app/services/contact.service.js +++ b/src/app/services/contact.service.ts @@ -1,3 +1,5 @@ +import * as angular from 'angular'; + angular .module('codecraft') .factory('ContactService', function (Contact, $rootScope, $q, toaster) { @@ -14,6 +16,7 @@ angular }, 'page' : 1, 'hasMore' : true, + 'isDeleting' : false, 'isLoading' : false, 'isSaving' : false, 'persons' : [], @@ -76,7 +79,7 @@ angular 'removeContact': function (person) { var d = $q.defer(); self.isDeleting = true; - name = person.name; + var name = person.name; person.$remove().then(function () { self.isDeleting = false; var index = self.persons.indexOf(person); diff --git a/src/app/services/index.ts b/src/app/services/index.ts new file mode 100644 index 0000000..3856587 --- /dev/null +++ b/src/app/services/index.ts @@ -0,0 +1,3 @@ +import "./contact.service"; +import "./contact.resource"; + diff --git a/src/dist/bundle.js b/src/dist/bundle.js index f32bf7d..cb0b526 100644 --- a/src/dist/bundle.js +++ b/src/dist/bundle.js @@ -1,41 +1,41 @@ /******/ (function(modules) { // webpackBootstrap /******/ // The module cache /******/ var installedModules = {}; - +/******/ /******/ // The require function /******/ function __webpack_require__(moduleId) { - +/******/ /******/ // Check if module is in cache /******/ if(installedModules[moduleId]) /******/ return installedModules[moduleId].exports; - +/******/ /******/ // Create a new module (and put it into the cache) /******/ var module = installedModules[moduleId] = { /******/ i: moduleId, /******/ l: false, /******/ exports: {} /******/ }; - +/******/ /******/ // Execute the module function /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); - +/******/ /******/ // Flag the module as loaded /******/ module.l = true; - +/******/ /******/ // Return the exports of the module /******/ return module.exports; /******/ } - - +/******/ +/******/ /******/ // expose the modules object (__webpack_modules__) /******/ __webpack_require__.m = modules; - +/******/ /******/ // expose the module cache /******/ __webpack_require__.c = installedModules; - +/******/ /******/ // identity function for calling harmony imports with the correct context /******/ __webpack_require__.i = function(value) { return value; }; - +/******/ /******/ // define getter function for harmony exports /******/ __webpack_require__.d = function(exports, name, getter) { /******/ if(!__webpack_require__.o(exports, name)) { @@ -46,7 +46,7 @@ /******/ }); /******/ } /******/ }; - +/******/ /******/ // getDefaultExport function for compatibility with non-harmony modules /******/ __webpack_require__.n = function(module) { /******/ var getter = module && module.__esModule ? @@ -55,90156 +55,7289 @@ /******/ __webpack_require__.d(getter, 'a', getter); /******/ return getter; /******/ }; - +/******/ /******/ // Object.prototype.hasOwnProperty.call /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; - +/******/ /******/ // __webpack_public_path__ /******/ __webpack_require__.p = ""; - +/******/ /******/ // Load entry module and return exports -/******/ return __webpack_require__(__webpack_require__.s = 1096); +/******/ return __webpack_require__(__webpack_require__.s = 31); /******/ }) /************************************************************************/ /******/ ([ /* 0 */ /***/ (function(module, exports, __webpack_require__) { -"use strict"; +__webpack_require__(20); +module.exports = angular; -var root_1 = __webpack_require__(27); -var toSubscriber_1 = __webpack_require__(1076); -var observable_1 = __webpack_require__(145); -/** - * A representation of any set of values over any amount of time. This the most basic building block - * of RxJS. - * - * @class Observable - */ -var Observable = (function () { - /** - * @constructor - * @param {Function} subscribe the function that is called when the Observable is - * initially subscribed to. This function is given a Subscriber, to which new values - * can be `next`ed, or an `error` method can be called to raise an error, or - * `complete` can be called to notify of a successful completion. - */ - function Observable(subscribe) { - this._isScalar = false; - if (subscribe) { - this._subscribe = subscribe; - } - } - /** - * Creates a new Observable, with this Observable as the source, and the passed - * operator defined as the new observable's operator. - * @method lift - * @param {Operator} operator the operator defining the operation to take on the observable - * @return {Observable} a new observable with the Operator applied - */ - Observable.prototype.lift = function (operator) { - var observable = new Observable(); - observable.source = this; - observable.operator = operator; - return observable; - }; - Observable.prototype.subscribe = function (observerOrNext, error, complete) { - var operator = this.operator; - var sink = toSubscriber_1.toSubscriber(observerOrNext, error, complete); - if (operator) { - operator.call(sink, this.source); - } - else { - sink.add(this._trySubscribe(sink)); - } - if (sink.syncErrorThrowable) { - sink.syncErrorThrowable = false; - if (sink.syncErrorThrown) { - throw sink.syncErrorValue; - } - } - return sink; - }; - Observable.prototype._trySubscribe = function (sink) { - try { - return this._subscribe(sink); - } - catch (err) { - sink.syncErrorThrown = true; - sink.syncErrorValue = err; - sink.error(err); - } - }; - /** - * @method forEach - * @param {Function} next a handler for each value emitted by the observable - * @param {PromiseConstructor} [PromiseCtor] a constructor function used to instantiate the Promise - * @return {Promise} a promise that either resolves on observable completion or - * rejects with the handled error - */ - Observable.prototype.forEach = function (next, PromiseCtor) { - var _this = this; - if (!PromiseCtor) { - if (root_1.root.Rx && root_1.root.Rx.config && root_1.root.Rx.config.Promise) { - PromiseCtor = root_1.root.Rx.config.Promise; - } - else if (root_1.root.Promise) { - PromiseCtor = root_1.root.Promise; - } - } - if (!PromiseCtor) { - throw new Error('no Promise impl found'); - } - return new PromiseCtor(function (resolve, reject) { - var subscription = _this.subscribe(function (value) { - if (subscription) { - // if there is a subscription, then we can surmise - // the next handling is asynchronous. Any errors thrown - // need to be rejected explicitly and unsubscribe must be - // called manually - try { - next(value); - } - catch (err) { - reject(err); - subscription.unsubscribe(); - } - } - else { - // if there is NO subscription, then we're getting a nexted - // value synchronously during subscription. We can just call it. - // If it errors, Observable's `subscribe` will ensure the - // unsubscription logic is called, then synchronously rethrow the error. - // After that, Promise will trap the error and send it - // down the rejection path. - next(value); - } - }, reject, resolve); - }); - }; - Observable.prototype._subscribe = function (subscriber) { - return this.source.subscribe(subscriber); - }; - /** - * An interop point defined by the es7-observable spec https://github.com/zenparsing/es-observable - * @method Symbol.observable - * @return {Observable} this instance of the observable - */ - Observable.prototype[observable_1.$$observable] = function () { - return this; - }; - // HACK: Since TypeScript inherits static properties too, we have to - // fight against TypeScript here so Subject can have a different static create signature - /** - * Creates a new cold Observable by calling the Observable constructor - * @static true - * @owner Observable - * @method create - * @param {Function} subscribe? the subscriber function to be passed to the Observable constructor - * @return {Observable} a new cold observable - */ - Observable.create = function (subscribe) { - return new Observable(subscribe); - }; - return Observable; -}()); -exports.Observable = Observable; -//# sourceMappingURL=Observable.js.map /***/ }), /* 1 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/***/ (function(module, exports, __webpack_require__) { -"use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__src_core__ = __webpack_require__(580); -/* unused harmony reexport createPlatform */ -/* unused harmony reexport assertPlatform */ -/* unused harmony reexport destroyPlatform */ -/* unused harmony reexport getPlatform */ -/* unused harmony reexport PlatformRef */ -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "K", function() { return __WEBPACK_IMPORTED_MODULE_0__src_core__["K"]; }); -/* unused harmony reexport enableProdMode */ -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "E", function() { return __WEBPACK_IMPORTED_MODULE_0__src_core__["E"]; }); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return __WEBPACK_IMPORTED_MODULE_0__src_core__["a"]; }); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "M", function() { return __WEBPACK_IMPORTED_MODULE_0__src_core__["L"]; }); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "N", function() { return __WEBPACK_IMPORTED_MODULE_0__src_core__["N"]; }); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "_1", function() { return __WEBPACK_IMPORTED_MODULE_0__src_core__["_1"]; }); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "g", function() { return __WEBPACK_IMPORTED_MODULE_0__src_core__["g"]; }); -/* unused harmony reexport APP_BOOTSTRAP_LISTENER */ -/* unused harmony reexport APP_INITIALIZER */ -/* unused harmony reexport ApplicationInitStatus */ -/* unused harmony reexport DebugElement */ -/* unused harmony reexport DebugNode */ -/* unused harmony reexport asNativeElements */ -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "L", function() { return __WEBPACK_IMPORTED_MODULE_0__src_core__["M"]; }); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "l", function() { return __WEBPACK_IMPORTED_MODULE_0__src_core__["h"]; }); -/* unused harmony reexport TestabilityRegistry */ -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "P", function() { return __WEBPACK_IMPORTED_MODULE_0__src_core__["P"]; }); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "_31", function() { return __WEBPACK_IMPORTED_MODULE_0__src_core__["_31"]; }); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "_0", function() { return __WEBPACK_IMPORTED_MODULE_0__src_core__["R"]; }); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "r", function() { return __WEBPACK_IMPORTED_MODULE_0__src_core__["q"]; }); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "m", function() { return __WEBPACK_IMPORTED_MODULE_0__src_core__["i"]; }); -/* unused harmony reexport wtfCreateScope */ -/* unused harmony reexport wtfLeave */ -/* unused harmony reexport wtfStartTimeRange */ -/* unused harmony reexport wtfEndTimeRange */ -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "_14", function() { return __WEBPACK_IMPORTED_MODULE_0__src_core__["_4"]; }); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "G", function() { return __WEBPACK_IMPORTED_MODULE_0__src_core__["G"]; }); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "j", function() { return __WEBPACK_IMPORTED_MODULE_0__src_core__["j"]; }); -/* unused harmony reexport AnimationTransitionEvent */ -/* unused harmony reexport AnimationPlayer */ -/* unused harmony reexport AnimationStyles */ -/* unused harmony reexport AnimationKeyframe */ -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "h", function() { return __WEBPACK_IMPORTED_MODULE_0__src_core__["k"]; }); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "J", function() { return __WEBPACK_IMPORTED_MODULE_0__src_core__["J"]; }); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "R", function() { return __WEBPACK_IMPORTED_MODULE_0__src_core__["S"]; }); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "x", function() { return __WEBPACK_IMPORTED_MODULE_0__src_core__["v"]; }); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "_19", function() { return __WEBPACK_IMPORTED_MODULE_0__src_core__["_19"]; }); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "_20", function() { return __WEBPACK_IMPORTED_MODULE_0__src_core__["_20"]; }); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "_18", function() { return __WEBPACK_IMPORTED_MODULE_0__src_core__["_15"]; }); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "_21", function() { return __WEBPACK_IMPORTED_MODULE_0__src_core__["_21"]; }); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "_22", function() { return __WEBPACK_IMPORTED_MODULE_0__src_core__["_22"]; }); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "_12", function() { return __WEBPACK_IMPORTED_MODULE_0__src_core__["_5"]; }); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "v", function() { return __WEBPACK_IMPORTED_MODULE_0__src_core__["w"]; }); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "_16", function() { return __WEBPACK_IMPORTED_MODULE_0__src_core__["_16"]; }); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "_17", function() { return __WEBPACK_IMPORTED_MODULE_0__src_core__["_17"]; }); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "w", function() { return __WEBPACK_IMPORTED_MODULE_0__src_core__["x"]; }); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "_15", function() { return __WEBPACK_IMPORTED_MODULE_0__src_core__["_18"]; }); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "p", function() { return __WEBPACK_IMPORTED_MODULE_0__src_core__["p"]; }); -/* unused harmony reexport AfterContentChecked */ -/* unused harmony reexport AfterContentInit */ -/* unused harmony reexport AfterViewChecked */ -/* unused harmony reexport AfterViewInit */ -/* unused harmony reexport DoCheck */ -/* unused harmony reexport OnChanges */ -/* unused harmony reexport OnDestroy */ -/* unused harmony reexport OnInit */ -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "_3", function() { return __WEBPACK_IMPORTED_MODULE_0__src_core__["_2"]; }); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "_2", function() { return __WEBPACK_IMPORTED_MODULE_0__src_core__["_3"]; }); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return __WEBPACK_IMPORTED_MODULE_0__src_core__["b"]; }); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "O", function() { return __WEBPACK_IMPORTED_MODULE_0__src_core__["O"]; }); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return __WEBPACK_IMPORTED_MODULE_0__src_core__["e"]; }); -/* unused harmony reexport VERSION */ -/* unused harmony reexport Class */ -/* unused harmony reexport forwardRef */ -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "_11", function() { return __WEBPACK_IMPORTED_MODULE_0__src_core__["_6"]; }); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "Y", function() { return __WEBPACK_IMPORTED_MODULE_0__src_core__["T"]; }); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "_33", function() { return __WEBPACK_IMPORTED_MODULE_0__src_core__["_32"]; }); -/* unused harmony reexport ResolvedReflectiveFactory */ -/* unused harmony reexport ReflectiveKey */ -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "H", function() { return __WEBPACK_IMPORTED_MODULE_0__src_core__["H"]; }); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "q", function() { return __WEBPACK_IMPORTED_MODULE_0__src_core__["r"]; }); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "n", function() { return __WEBPACK_IMPORTED_MODULE_0__src_core__["l"]; }); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return __WEBPACK_IMPORTED_MODULE_0__src_core__["c"]; }); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "_13", function() { return __WEBPACK_IMPORTED_MODULE_0__src_core__["_7"]; }); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "o", function() { return __WEBPACK_IMPORTED_MODULE_0__src_core__["m"]; }); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "A", function() { return __WEBPACK_IMPORTED_MODULE_0__src_core__["y"]; }); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "I", function() { return __WEBPACK_IMPORTED_MODULE_0__src_core__["I"]; }); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "S", function() { return __WEBPACK_IMPORTED_MODULE_0__src_core__["U"]; }); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "D", function() { return __WEBPACK_IMPORTED_MODULE_0__src_core__["B"]; }); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "k", function() { return __WEBPACK_IMPORTED_MODULE_0__src_core__["n"]; }); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return __WEBPACK_IMPORTED_MODULE_0__src_core__["d"]; }); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "_32", function() { return __WEBPACK_IMPORTED_MODULE_0__src_core__["_33"]; }); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "_34", function() { return __WEBPACK_IMPORTED_MODULE_0__src_core__["_34"]; }); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "_35", function() { return __WEBPACK_IMPORTED_MODULE_0__src_core__["_35"]; }); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "V", function() { return __WEBPACK_IMPORTED_MODULE_0__src_core__["V"]; }); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "W", function() { return __WEBPACK_IMPORTED_MODULE_0__src_core__["W"]; }); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "U", function() { return __WEBPACK_IMPORTED_MODULE_0__src_core__["X"]; }); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "C", function() { return __WEBPACK_IMPORTED_MODULE_0__src_core__["C"]; }); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "X", function() { return __WEBPACK_IMPORTED_MODULE_0__src_core__["Y"]; }); -/* unused harmony reexport NgModuleRef */ -/* unused harmony reexport NgModuleFactoryLoader */ -/* unused harmony reexport getModuleFactory */ -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "T", function() { return __WEBPACK_IMPORTED_MODULE_0__src_core__["Z"]; }); -/* unused harmony reexport SystemJsNgModuleLoader */ -/* unused harmony reexport SystemJsNgModuleLoaderConfig */ -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "y", function() { return __WEBPACK_IMPORTED_MODULE_0__src_core__["z"]; }); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "z", function() { return __WEBPACK_IMPORTED_MODULE_0__src_core__["A"]; }); -/* unused harmony reexport EmbeddedViewRef */ -/* unused harmony reexport ViewRef */ -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "Q", function() { return __WEBPACK_IMPORTED_MODULE_0__src_core__["Q"]; }); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "t", function() { return __WEBPACK_IMPORTED_MODULE_0__src_core__["s"]; }); -/* unused harmony reexport CollectionChangeRecord */ -/* unused harmony reexport DefaultIterableDiffer */ -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "F", function() { return __WEBPACK_IMPORTED_MODULE_0__src_core__["F"]; }); -/* unused harmony reexport KeyValueChangeRecord */ -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "B", function() { return __WEBPACK_IMPORTED_MODULE_0__src_core__["D"]; }); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "Z", function() { return __WEBPACK_IMPORTED_MODULE_0__src_core__["_0"]; }); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "s", function() { return __WEBPACK_IMPORTED_MODULE_0__src_core__["t"]; }); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "i", function() { return __WEBPACK_IMPORTED_MODULE_0__src_core__["o"]; }); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "u", function() { return __WEBPACK_IMPORTED_MODULE_0__src_core__["u"]; }); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return __WEBPACK_IMPORTED_MODULE_0__src_core__["f"]; }); -/* unused harmony reexport AnimationEntryMetadata */ -/* unused harmony reexport AnimationStateMetadata */ -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "_4", function() { return __WEBPACK_IMPORTED_MODULE_0__src_core__["_8"]; }); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "_5", function() { return __WEBPACK_IMPORTED_MODULE_0__src_core__["_9"]; }); -/* unused harmony reexport AnimationMetadata */ -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "_7", function() { return __WEBPACK_IMPORTED_MODULE_0__src_core__["_10"]; }); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "_6", function() { return __WEBPACK_IMPORTED_MODULE_0__src_core__["_11"]; }); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "_8", function() { return __WEBPACK_IMPORTED_MODULE_0__src_core__["_12"]; }); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "_9", function() { return __WEBPACK_IMPORTED_MODULE_0__src_core__["_13"]; }); -/* unused harmony reexport AnimationSequenceMetadata */ -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "_10", function() { return __WEBPACK_IMPORTED_MODULE_0__src_core__["_14"]; }); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "_27", function() { return __WEBPACK_IMPORTED_MODULE_0__src_core__["_23"]; }); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "_30", function() { return __WEBPACK_IMPORTED_MODULE_0__src_core__["_24"]; }); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "_29", function() { return __WEBPACK_IMPORTED_MODULE_0__src_core__["_25"]; }); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "_26", function() { return __WEBPACK_IMPORTED_MODULE_0__src_core__["_26"]; }); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "_24", function() { return __WEBPACK_IMPORTED_MODULE_0__src_core__["_27"]; }); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "_28", function() { return __WEBPACK_IMPORTED_MODULE_0__src_core__["_28"]; }); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "_25", function() { return __WEBPACK_IMPORTED_MODULE_0__src_core__["_29"]; }); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "_23", function() { return __WEBPACK_IMPORTED_MODULE_0__src_core__["_30"]; }); -/** - * @license - * Copyright Google Inc. All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.io/license - */ -/** - * @module - * @description - * Entry point for all public APIs of the core package. - */ +__webpack_require__(16); +module.exports = 'ngAnimate'; -//# sourceMappingURL=index.js.map /***/ }), /* 2 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module, exports) { -var global = __webpack_require__(22) - , core = __webpack_require__(21) - , hide = __webpack_require__(58) - , redefine = __webpack_require__(34) - , ctx = __webpack_require__(100) - , PROTOTYPE = 'prototype'; - -var $export = function(type, name, source){ - var IS_FORCED = type & $export.F - , IS_GLOBAL = type & $export.G - , IS_STATIC = type & $export.S - , IS_PROTO = type & $export.P - , IS_BIND = type & $export.B - , target = IS_GLOBAL ? global : IS_STATIC ? global[name] || (global[name] = {}) : (global[name] || {})[PROTOTYPE] - , exports = IS_GLOBAL ? core : core[name] || (core[name] = {}) - , expProto = exports[PROTOTYPE] || (exports[PROTOTYPE] = {}) - , key, own, out, exp; - if(IS_GLOBAL)source = name; - for(key in source){ - // contains in native - own = !IS_FORCED && target && target[key] !== undefined; - // export native or passed - out = (own ? target : source)[key]; - // bind timers to global for call from export context - exp = IS_BIND && own ? ctx(out, global) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out; - // extend global - if(target)redefine(target, key, out, type & $export.U); - // export - if(exports[key] != out)hide(exports, key, exp); - if(IS_PROTO && expProto[key] != out)expProto[key] = out; - } -}; -global.core = core; -// type bitmap -$export.F = 1; // forced -$export.G = 2; // global -$export.S = 4; // static -$export.P = 8; // proto -$export.B = 16; // bind -$export.W = 32; // wrap -$export.U = 64; // safe -$export.R = 128; // real proto method for `library` -module.exports = $export; +/* + * angular-auto-validate - v1.19.0 - 2015-10-25 + * https://github.com/jonsamwell/angular-auto-validate + * Copyright (c) 2015 Jon Samwell (http://www.jonsamwell.com) + */ +(function (String, angular) { + 'use strict'; -/***/ }), -/* 3 */ -/***/ (function(module, exports, __webpack_require__) { +angular.module('jcs-autoValidate', []); -"use strict"; +function ValidatorFn() { + var elementStateModifiers = {}, + enableValidElementStyling = true, + enableInvalidElementStyling = true, + validationEnabled = true, -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; -var isFunction_1 = __webpack_require__(207); -var Subscription_1 = __webpack_require__(23); -var Observer_1 = __webpack_require__(460); -var rxSubscriber_1 = __webpack_require__(203); -/** - * Implements the {@link Observer} interface and extends the - * {@link Subscription} class. While the {@link Observer} is the public API for - * consuming the values of an {@link Observable}, all Observers get converted to - * a Subscriber, in order to provide Subscription-like capabilities such as - * `unsubscribe`. Subscriber is a common type in RxJS, and crucial for - * implementing operators, but it is rarely used as a public API. - * - * @class Subscriber - */ -var Subscriber = (function (_super) { - __extends(Subscriber, _super); - /** - * @param {Observer|function(value: T): void} [destinationOrNext] A partially - * defined Observer or a `next` callback function. - * @param {function(e: ?any): void} [error] The `error` callback of an - * Observer. - * @param {function(): void} [complete] The `complete` callback of an - * Observer. - */ - function Subscriber(destinationOrNext, error, complete) { - _super.call(this); - this.syncErrorValue = null; - this.syncErrorThrown = false; - this.syncErrorThrowable = false; - this.isStopped = false; - switch (arguments.length) { - case 0: - this.destination = Observer_1.empty; - break; - case 1: - if (!destinationOrNext) { - this.destination = Observer_1.empty; - break; - } - if (typeof destinationOrNext === 'object') { - if (destinationOrNext instanceof Subscriber) { - this.destination = destinationOrNext; - this.destination.add(this); - } - else { - this.syncErrorThrowable = true; - this.destination = new SafeSubscriber(this, destinationOrNext); - } - break; - } - default: - this.syncErrorThrowable = true; - this.destination = new SafeSubscriber(this, destinationOrNext, error, complete); - break; - } - } - Subscriber.prototype[rxSubscriber_1.$$rxSubscriber] = function () { return this; }; - /** - * A static factory for a Subscriber, given a (potentially partial) definition - * of an Observer. - * @param {function(x: ?T): void} [next] The `next` callback of an Observer. - * @param {function(e: ?any): void} [error] The `error` callback of an - * Observer. - * @param {function(): void} [complete] The `complete` callback of an - * Observer. - * @return {Subscriber} A Subscriber wrapping the (partially defined) - * Observer represented by the given arguments. - */ - Subscriber.create = function (next, error, complete) { - var subscriber = new Subscriber(next, error, complete); - subscriber.syncErrorThrowable = false; - return subscriber; - }; - /** - * The {@link Observer} callback to receive notifications of type `next` from - * the Observable, with a value. The Observable may call this method 0 or more - * times. - * @param {T} [value] The `next` value. - * @return {void} - */ - Subscriber.prototype.next = function (value) { - if (!this.isStopped) { - this._next(value); - } - }; - /** - * The {@link Observer} callback to receive notifications of type `error` from - * the Observable, with an attached {@link Error}. Notifies the Observer that - * the Observable has experienced an error condition. - * @param {any} [err] The `error` exception. - * @return {void} - */ - Subscriber.prototype.error = function (err) { - if (!this.isStopped) { - this.isStopped = true; - this._error(err); - } - }; - /** - * The {@link Observer} callback to receive a valueless notification of type - * `complete` from the Observable. Notifies the Observer that the Observable - * has finished sending push-based notifications. - * @return {void} - */ - Subscriber.prototype.complete = function () { - if (!this.isStopped) { - this.isStopped = true; - this._complete(); - } - }; - Subscriber.prototype.unsubscribe = function () { - if (this.closed) { - return; - } - this.isStopped = true; - _super.prototype.unsubscribe.call(this); - }; - Subscriber.prototype._next = function (value) { - this.destination.next(value); - }; - Subscriber.prototype._error = function (err) { - this.destination.error(err); - this.unsubscribe(); - }; - Subscriber.prototype._complete = function () { - this.destination.complete(); - this.unsubscribe(); - }; - Subscriber.prototype._unsubscribeAndRecycle = function () { - var _a = this, _parent = _a._parent, _parents = _a._parents; - this._parent = null; - this._parents = null; - this.unsubscribe(); - this.closed = false; - this.isStopped = false; - this._parent = _parent; - this._parents = _parents; - return this; - }; - return Subscriber; -}(Subscription_1.Subscription)); -exports.Subscriber = Subscriber; -/** - * We need this JSDoc comment for affecting ESDoc. - * @ignore - * @extends {Ignored} - */ -var SafeSubscriber = (function (_super) { - __extends(SafeSubscriber, _super); - function SafeSubscriber(_parentSubscriber, observerOrNext, error, complete) { - _super.call(this); - this._parentSubscriber = _parentSubscriber; - var next; - var context = this; - if (isFunction_1.isFunction(observerOrNext)) { - next = observerOrNext; - } - else if (observerOrNext) { - context = observerOrNext; - next = observerOrNext.next; - error = observerOrNext.error; - complete = observerOrNext.complete; - if (isFunction_1.isFunction(context.unsubscribe)) { - this.add(context.unsubscribe.bind(context)); - } - context.unsubscribe = this.unsubscribe.bind(this); - } - this._context = context; - this._next = next; - this._error = error; - this._complete = complete; - } - SafeSubscriber.prototype.next = function (value) { - if (!this.isStopped && this._next) { - var _parentSubscriber = this._parentSubscriber; - if (!_parentSubscriber.syncErrorThrowable) { - this.__tryOrUnsub(this._next, value); - } - else if (this.__tryOrSetError(_parentSubscriber, this._next, value)) { - this.unsubscribe(); - } - } - }; - SafeSubscriber.prototype.error = function (err) { - if (!this.isStopped) { - var _parentSubscriber = this._parentSubscriber; - if (this._error) { - if (!_parentSubscriber.syncErrorThrowable) { - this.__tryOrUnsub(this._error, err); - this.unsubscribe(); - } - else { - this.__tryOrSetError(_parentSubscriber, this._error, err); - this.unsubscribe(); - } - } - else if (!_parentSubscriber.syncErrorThrowable) { - this.unsubscribe(); - throw err; - } - else { - _parentSubscriber.syncErrorValue = err; - _parentSubscriber.syncErrorThrown = true; - this.unsubscribe(); - } - } - }; - SafeSubscriber.prototype.complete = function () { - if (!this.isStopped) { - var _parentSubscriber = this._parentSubscriber; - if (this._complete) { - if (!_parentSubscriber.syncErrorThrowable) { - this.__tryOrUnsub(this._complete); - this.unsubscribe(); - } - else { - this.__tryOrSetError(_parentSubscriber, this._complete); - this.unsubscribe(); - } - } - else { - this.unsubscribe(); - } - } - }; - SafeSubscriber.prototype.__tryOrUnsub = function (fn, value) { - try { - fn.call(this._context, value); - } - catch (err) { - this.unsubscribe(); - throw err; - } - }; - SafeSubscriber.prototype.__tryOrSetError = function (parent, fn, value) { - try { - fn.call(this._context, value); - } - catch (err) { - parent.syncErrorValue = err; - parent.syncErrorThrown = true; - return true; - } - return false; - }; - SafeSubscriber.prototype._unsubscribe = function () { - var _parentSubscriber = this._parentSubscriber; - this._context = null; - this._parentSubscriber = null; - _parentSubscriber.unsubscribe(); + toBoolean = function (value) { + var v; + if (value && value.length !== 0) { + v = value.toLowerCase(); + value = !(v === 'f' || v === '0' || v === 'false'); + } else { + value = false; + } + + return value; + }, + + getAttributeValue = function (el, attrName) { + var val; + + if (el !== undefined) { + val = el.attr(attrName) || el.attr('data-' + attrName); + } + + return val; + }, + + attributeExists = function (el, attrName) { + var exists; + + if (el !== undefined) { + exists = el.attr(attrName) !== undefined || el.attr('data-' + attrName) !== undefined; + } + + return exists; + }, + + getBooleanAttributeValue = function (el, attrName) { + return toBoolean(getAttributeValue(el, attrName)); + }, + + validElementStylingEnabled = function (el) { + return enableValidElementStyling && !getBooleanAttributeValue(el, 'disable-valid-styling'); + }, + + autoValidateEnabledOnControl = function (el) { + return !getBooleanAttributeValue(el, 'disable-auto-validate'); + }, + + invalidElementStylingEnabled = function (el) { + return enableInvalidElementStyling && !getBooleanAttributeValue(el, 'disable-invalid-styling'); }; - return SafeSubscriber; -}(Subscriber)); -//# sourceMappingURL=Subscriber.js.map -/***/ }), -/* 4 */, -/* 5 */, -/* 6 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { + /** + * @ngdoc function + * @name validator#enable + * @methodOf validator + * + * @description + * By default auto validate will validate all forms and elements with an ngModel directive on. By + * setting enabled to false you will explicitly have to opt in to enable validation on forms and child + * elements. + * + * Note: this can be overridden by add the 'auto-validate-enabled="true/false' attribute to a form. + * + * Example: + *
+   *  app.config(function (validator) {
+   *    validator.enable(false);
+   *  });
+   * 
+ * + * @param {Boolean} isEnabled true to enable, false to disable. + */ + this.enable = function (isEnabled) { + validationEnabled = isEnabled; + }; -"use strict"; -/* WEBPACK VAR INJECTION */(function(global) {/* unused harmony export scheduleMicroTask */ -/* unused harmony export global */ -/* unused harmony export getTypeNameForDebugging */ -/* harmony export (immutable) */ __webpack_exports__["c"] = isPresent; -/* harmony export (immutable) */ __webpack_exports__["d"] = isBlank; -/* harmony export (immutable) */ __webpack_exports__["a"] = isStrictStringMap; -/* harmony export (immutable) */ __webpack_exports__["e"] = stringify; -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "i", function() { return NumberWrapper; }); -/* unused harmony export looseIdentical */ -/* harmony export (immutable) */ __webpack_exports__["f"] = isJsObject; -/* unused harmony export print */ -/* unused harmony export warn */ -/* unused harmony export setValueOnPath */ -/* harmony export (immutable) */ __webpack_exports__["g"] = getSymbolIterator; -/* harmony export (immutable) */ __webpack_exports__["b"] = isPrimitive; -/* harmony export (immutable) */ __webpack_exports__["h"] = escapeRegExp; -/** - * @license - * Copyright Google Inc. All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.io/license - */ -var /** @type {?} */ globalScope; -if (typeof window === 'undefined') { - if (typeof WorkerGlobalScope !== 'undefined' && self instanceof WorkerGlobalScope) { - // TODO: Replace any with WorkerGlobalScope from lib.webworker.d.ts #3492 - globalScope = (self); - } - else { - globalScope = (global); - } -} -else { - globalScope = (window); -} -/** - * @param {?} fn - * @return {?} - */ -function scheduleMicroTask(fn) { - Zone.current.scheduleMicroTask('scheduleMicrotask', fn); -} -// Need to declare a new variable for global here since TypeScript -// exports the original value of the symbol. -var /** @type {?} */ _global = globalScope; + /** + * @ngdoc function + * @name validator#isEnabled + * @methodOf validator + * + * @description + * Returns true if the library is enabeld. + * + * @return {Boolean} true if enabled, otherwise false. + */ + this.isEnabled = function () { + return validationEnabled; + }; -/** - * @param {?} type - * @return {?} - */ -function getTypeNameForDebugging(type) { - return type['name'] || typeof type; -} -// TODO: remove calls to assert in production environment -// Note: Can't just export this and import in in other files -// as `assert` is a reserved keyword in Dart -_global.assert = function assert(condition) { - // TODO: to be fixed properly via #2830, noop for now -}; -/** - * @param {?} obj - * @return {?} - */ -function isPresent(obj) { - return obj != null; -} -/** - * @param {?} obj - * @return {?} - */ -function isBlank(obj) { - return obj == null; -} -var /** @type {?} */ STRING_MAP_PROTO = Object.getPrototypeOf({}); -/** - * @param {?} obj - * @return {?} - */ -function isStrictStringMap(obj) { - return typeof obj === 'object' && obj !== null && Object.getPrototypeOf(obj) === STRING_MAP_PROTO; -} -/** - * @param {?} token - * @return {?} - */ -function stringify(token) { - if (typeof token === 'string') { - return token; + /** + * @ngdoc function + * @name validator#setDefaultElementModifier + * @methodOf validator + * + * @description + * Sets the default element modifier that will be used by the validator + * to change an elements UI state. Please ensure the modifier has been registered + * before setting it as default. + * + * Note: this can be changed by setting the + * element modifier attribute on the input element 'data-element-modifier="myCustomModifier"' + * + * Example: + *
+   *  app.config(function (validator) {
+   *    validator.setDefaultElementModifier('myCustomModifier');
+   *  });
+   * 
+ * + * @param {string} key The key name of the modifier. + */ + this.setDefaultElementModifier = function (key) { + if (elementStateModifiers[key] === undefined) { + throw new Error('Element modifier not registered: ' + key); } - if (token == null) { - return '' + token; + + this.defaultElementModifier = key; + }; + + /** + * @ngdoc function + * @name validator#registerDomModifier + * @methodOf validator + * + * @description + * Registers an object that adheres to the elementModifier interface and is + * able to modifier an elements dom so that appears valid / invalid for a specific + * scenario i.e. the Twitter Bootstrap css framework, Foundation CSS framework etc. + * + * Example: + *
+   *  app.config(function (validator) {
+   *    validator.registerDomModifier('customDomModifier', {
+   *      makeValid: function (el) {
+   *          el.removeClass(el, 'invalid');
+   *          el.addClass(el, 'valid');
+   *      },
+   *      makeInvalid: function (el, err, domManipulator) {
+   *          el.removeClass(el, 'valid');
+   *          el.addClass(el, 'invalid');
+   *      }
+   *    });
+   *  });
+   * 
+ * + * @param {string} key The key name of the modifier + * @param {object} modifier An object which implements the elementModifier interface + */ + this.registerDomModifier = function (key, modifier) { + elementStateModifiers[key] = modifier; + }; + + /** + * @ngdoc function + * @name validator#setErrorMessageResolver + * @methodOf validator + * + * @description + * Registers an object that adheres to the elementModifier interface and is + * able to modifier an elements dom so that appears valid / invalid for a specific + * scenario i.e. the Twitter Bootstrap css framework, Foundation CSS framework etc. + * + * Example: + *
+   *  app.config(function (validator) {
+   *    validator.setErrorMessageResolver(function (errorKey, el) {
+   *      var defer = $q.defer();
+   *      // resolve the correct error from the given key and resolve the returned promise.
+   *      return defer.promise();
+   *    });
+   *  });
+   * 
+ * + * @param {function} resolver A method that returns a promise with the resolved error message in. + */ + this.setErrorMessageResolver = function (resolver) { + this.errorMessageResolver = resolver; + }; + + /** + * @ngdoc function + * @name validator#getErrorMessage + * @methodOf validator + * + * @description + * Resolves the error message for the given error type. + * + * @param {String} errorKey The error type. + * @param {Element} el The UI element that is the focus of the error. + * It is provided as the error message may need information from the element i.e. ng-min (the min allowed value). + */ + this.getErrorMessage = function (errorKey, el) { + var defer; + if (this.errorMessageResolver === undefined) { + throw new Error('Please set an error message resolver via the setErrorMessageResolver function before attempting to resolve an error message.'); } - if (token.overriddenName) { - return "" + token.overriddenName; + + if (attributeExists(el, 'disable-validation-message')) { + defer = angular.injector(['ng']).get('$q').defer(); + defer.resolve(''); + return defer.promise; + } else { + return this.errorMessageResolver(errorKey, el); } - if (token.name) { - return "" + token.name; + }; + + /** + * @ngdoc function + * @name validator#setValidElementStyling + * @methodOf validator + * + * @description + * Globally enables valid element visual styling. This is enabled by default. + * + * @param {Boolean} enabled True to enable style otherwise false. + */ + this.setValidElementStyling = function (enabled) { + enableValidElementStyling = enabled; + }; + + /** + * @ngdoc function + * @name validator#setInvalidElementStyling + * @methodOf validator + * + * @description + * Globally enables invalid element visual styling. This is enabled by default. + * + * @param {Boolean} enabled True to enable style otherwise false. + */ + this.setInvalidElementStyling = function (enabled) { + enableInvalidElementStyling = enabled; + }; + + this.getDomModifier = function (el) { + var modifierKey = (el !== undefined ? el.attr('element-modifier') : this.defaultElementModifier) || + (el !== undefined ? el.attr('data-element-modifier') : this.defaultElementModifier) || + this.defaultElementModifier; + + if (modifierKey === undefined) { + throw new Error('Please set a default dom modifier via the setDefaultElementModifier method on the validator class.'); } - var /** @type {?} */ res = token.toString(); - var /** @type {?} */ newLineIndex = res.indexOf('\n'); - return newLineIndex === -1 ? res : res.substring(0, newLineIndex); -} -var NumberWrapper = (function () { - function NumberWrapper() { + + return elementStateModifiers[modifierKey]; + }; + + this.makeValid = function (el) { + if (autoValidateEnabledOnControl(el)) { + if (validElementStylingEnabled(el)) { + this.getDomModifier(el).makeValid(el); + } else { + this.makeDefault(el); + } } - /** - * @param {?} text - * @return {?} - */ - NumberWrapper.parseIntAutoRadix = function (text) { - var /** @type {?} */ result = parseInt(text); - if (isNaN(result)) { - throw new Error('Invalid integer literal when parsing ' + text); - } - return result; - }; - /** - * @param {?} value - * @return {?} - */ - NumberWrapper.isNumeric = function (value) { return !isNaN(value - parseFloat(value)); }; - return NumberWrapper; -}()); -/** - * @param {?} a - * @param {?} b - * @return {?} - */ -function looseIdentical(a, b) { - return a === b || typeof a === 'number' && typeof b === 'number' && isNaN(a) && isNaN(b); -} -/** - * @param {?} o - * @return {?} - */ -function isJsObject(o) { - return o !== null && (typeof o === 'function' || typeof o === 'object'); -} -/** - * @param {?} obj - * @return {?} - */ -function print(obj) { - // tslint:disable-next-line:no-console - console.log(obj); -} -/** - * @param {?} obj - * @return {?} - */ -function warn(obj) { - console.warn(obj); -} -/** - * @param {?} global - * @param {?} path - * @param {?} value - * @return {?} - */ -function setValueOnPath(global, path, value) { - var /** @type {?} */ parts = path.split('.'); - var /** @type {?} */ obj = global; - while (parts.length > 1) { - var /** @type {?} */ name_1 = parts.shift(); - if (obj.hasOwnProperty(name_1) && obj[name_1] != null) { - obj = obj[name_1]; - } - else { - obj = obj[name_1] = {}; - } + }; + + this.makeInvalid = function (el, errorMsg) { + if (autoValidateEnabledOnControl(el)) { + if (invalidElementStylingEnabled(el)) { + this.getDomModifier(el).makeInvalid(el, errorMsg); + } else { + this.makeDefault(el); + } } - if (obj === undefined || obj === null) { - obj = {}; + }; + + this.makeDefault = function (el) { + if (autoValidateEnabledOnControl(el)) { + var dm = this.getDomModifier(el); + if (dm.makeDefault) { + dm.makeDefault(el); + } } - obj[parts.shift()] = value; -} -var /** @type {?} */ _symbolIterator = null; -/** - * @return {?} - */ -function getSymbolIterator() { - if (!_symbolIterator) { - if (((globalScope)).Symbol && Symbol.iterator) { - _symbolIterator = Symbol.iterator; - } - else { - // es6-shim specific logic - var /** @type {?} */ keys = Object.getOwnPropertyNames(Map.prototype); - for (var /** @type {?} */ i = 0; i < keys.length; ++i) { - var /** @type {?} */ key = keys[i]; - if (key !== 'entries' && key !== 'size' && - ((Map)).prototype[key] === Map.prototype['entries']) { - _symbolIterator = key; - } - } - } + }; + + this.defaultFormValidationOptions = { + forceValidation: false, + disabled: false, + validateNonVisibleControls: false, + removeExternalValidationErrorsOnSubmit: true, + validateOnFormSubmit: false + }; + + this.$get = [ + function () { + return this; } - return _symbolIterator; -} -/** - * @param {?} obj - * @return {?} - */ -function isPrimitive(obj) { - return !isJsObject(obj); -} -/** - * @param {?} s - * @return {?} - */ -function escapeRegExp(s) { - return s.replace(/([.*+?^=!:${}()|[\]\/\\])/g, '\\$1'); + ]; } -//# sourceMappingURL=lang.js.map -/* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__(53))) -/***/ }), -/* 7 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* WEBPACK VAR INJECTION */(function(global) {/* harmony export (immutable) */ __webpack_exports__["a"] = scheduleMicroTask; -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return _global; }); -/* harmony export (immutable) */ __webpack_exports__["l"] = getTypeNameForDebugging; -/* harmony export (immutable) */ __webpack_exports__["b"] = isPresent; -/* harmony export (immutable) */ __webpack_exports__["k"] = isBlank; -/* unused harmony export isStrictStringMap */ -/* harmony export (immutable) */ __webpack_exports__["c"] = stringify; -/* unused harmony export NumberWrapper */ -/* harmony export (immutable) */ __webpack_exports__["j"] = looseIdentical; -/* harmony export (immutable) */ __webpack_exports__["e"] = isJsObject; -/* harmony export (immutable) */ __webpack_exports__["g"] = print; -/* harmony export (immutable) */ __webpack_exports__["h"] = warn; -/* unused harmony export setValueOnPath */ -/* harmony export (immutable) */ __webpack_exports__["f"] = getSymbolIterator; -/* harmony export (immutable) */ __webpack_exports__["i"] = isPrimitive; -/* unused harmony export escapeRegExp */ -/** - * @license - * Copyright Google Inc. All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.io/license - */ -var /** @type {?} */ globalScope; -if (typeof window === 'undefined') { - if (typeof WorkerGlobalScope !== 'undefined' && self instanceof WorkerGlobalScope) { - // TODO: Replace any with WorkerGlobalScope from lib.webworker.d.ts #3492 - globalScope = (self); - } - else { - globalScope = (global); - } -} -else { - globalScope = (window); -} -/** - * @param {?} fn - * @return {?} - */ -function scheduleMicroTask(fn) { - Zone.current.scheduleMicroTask('scheduleMicrotask', fn); -} -// Need to declare a new variable for global here since TypeScript -// exports the original value of the symbol. -var /** @type {?} */ _global = globalScope; +angular.module('jcs-autoValidate').provider('validator', ValidatorFn); -/** - * @param {?} type - * @return {?} - */ -function getTypeNameForDebugging(type) { - return type['name'] || typeof type; -} -// TODO: remove calls to assert in production environment -// Note: Can't just export this and import in in other files -// as `assert` is a reserved keyword in Dart -_global.assert = function assert(condition) { - // TODO: to be fixed properly via #2830, noop for now -}; -/** - * @param {?} obj - * @return {?} - */ -function isPresent(obj) { - return obj != null; -} -/** - * @param {?} obj - * @return {?} - */ -function isBlank(obj) { - return obj == null; -} -var /** @type {?} */ STRING_MAP_PROTO = Object.getPrototypeOf({}); -/** - * @param {?} obj - * @return {?} - */ -function isStrictStringMap(obj) { - return typeof obj === 'object' && obj !== null && Object.getPrototypeOf(obj) === STRING_MAP_PROTO; -} -/** - * @param {?} token - * @return {?} - */ -function stringify(token) { - if (typeof token === 'string') { - return token; - } - if (token == null) { - return '' + token; - } - if (token.overriddenName) { - return "" + token.overriddenName; - } - if (token.name) { - return "" + token.name; - } - var /** @type {?} */ res = token.toString(); - var /** @type {?} */ newLineIndex = res.indexOf('\n'); - return newLineIndex === -1 ? res : res.substring(0, newLineIndex); -} -var NumberWrapper = (function () { - function NumberWrapper() { - } - /** - * @param {?} text - * @return {?} - */ - NumberWrapper.parseIntAutoRadix = function (text) { - var /** @type {?} */ result = parseInt(text); - if (isNaN(result)) { - throw new Error('Invalid integer literal when parsing ' + text); - } - return result; - }; - /** - * @param {?} value - * @return {?} - */ - NumberWrapper.isNumeric = function (value) { return !isNaN(value - parseFloat(value)); }; - return NumberWrapper; -}()); -/** - * @param {?} a - * @param {?} b - * @return {?} - */ -function looseIdentical(a, b) { - return a === b || typeof a === 'number' && typeof b === 'number' && isNaN(a) && isNaN(b); -} -/** - * @param {?} o - * @return {?} - */ -function isJsObject(o) { - return o !== null && (typeof o === 'function' || typeof o === 'object'); -} -/** - * @param {?} obj - * @return {?} - */ -function print(obj) { - // tslint:disable-next-line:no-console - console.log(obj); -} -/** - * @param {?} obj - * @return {?} - */ -function warn(obj) { - console.warn(obj); -} -/** - * @param {?} global - * @param {?} path - * @param {?} value - * @return {?} - */ -function setValueOnPath(global, path, value) { - var /** @type {?} */ parts = path.split('.'); - var /** @type {?} */ obj = global; - while (parts.length > 1) { - var /** @type {?} */ name_1 = parts.shift(); - if (obj.hasOwnProperty(name_1) && obj[name_1] != null) { - obj = obj[name_1]; - } - else { - obj = obj[name_1] = {}; +function Bootstrap3ElementModifierFn($log) { + var reset = function (el) { + angular.forEach(el.find('span'), function (spanEl) { + spanEl = angular.element(spanEl); + if (spanEl.hasClass('error-msg') || spanEl.hasClass('form-control-feedback') || spanEl.hasClass('control-feedback')) { + spanEl.remove(); } - } - if (obj === undefined || obj === null) { - obj = {}; - } - obj[parts.shift()] = value; -} -var /** @type {?} */ _symbolIterator = null; -/** - * @return {?} - */ -function getSymbolIterator() { - if (!_symbolIterator) { - if (((globalScope)).Symbol && Symbol.iterator) { - _symbolIterator = Symbol.iterator; - } - else { - // es6-shim specific logic - var /** @type {?} */ keys = Object.getOwnPropertyNames(Map.prototype); - for (var /** @type {?} */ i = 0; i < keys.length; ++i) { - var /** @type {?} */ key = keys[i]; - if (key !== 'entries' && key !== 'size' && - ((Map)).prototype[key] === Map.prototype['entries']) { - _symbolIterator = key; - } - } + }); + + el.removeClass('has-success has-error has-feedback'); + }, + findWithClassElementAsc = function (el, klass) { + var returnEl, + parent = el; + for (var i = 0; i <= 10; i += 1) { + if (parent !== undefined && parent.hasClass(klass)) { + returnEl = parent; + break; + } else if (parent !== undefined) { + parent = parent.parent(); } - } - return _symbolIterator; -} -/** - * @param {?} obj - * @return {?} - */ -function isPrimitive(obj) { - return !isJsObject(obj); -} -/** - * @param {?} s - * @return {?} - */ -function escapeRegExp(s) { - return s.replace(/([.*+?^=!:${}()|[\]\/\\])/g, '\\$1'); -} -//# sourceMappingURL=lang.js.map -/* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__(53))) + } -/***/ }), -/* 8 */ -/***/ (function(module, exports, __webpack_require__) { + return returnEl; + }, -"use strict"; -/** - * Random utility functions used in the UI-Router code - * - * These functions are exported, but are subject to change without notice. - * - * @preferred - * @module common - */ /** for typedoc */ - -var predicates_1 = __webpack_require__(12); -var hof_1 = __webpack_require__(16); -var coreservices_1 = __webpack_require__(31); -var w = typeof window === 'undefined' ? {} : window; -var angular = w.angular || {}; -exports.fromJson = angular.fromJson || JSON.parse.bind(JSON); -exports.toJson = angular.toJson || JSON.stringify.bind(JSON); -exports.copy = angular.copy || _copy; -exports.forEach = angular.forEach || _forEach; -exports.extend = angular.extend || _extend; -exports.equals = angular.equals || _equals; -exports.identity = function (x) { return x; }; -exports.noop = function () { return undefined; }; -/** - * Builds proxy functions on the `to` object which pass through to the `from` object. - * - * For each key in `fnNames`, creates a proxy function on the `to` object. - * The proxy function calls the real function on the `from` object. - * - * - * #### Example: - * This example creates an new class instance whose functions are prebound to the new'd object. - * ```js - * class Foo { - * constructor(data) { - * // Binds all functions from Foo.prototype to 'this', - * // then copies them to 'this' - * bindFunctions(Foo.prototype, this, this); - * this.data = data; - * } - * - * log() { - * console.log(this.data); - * } - * } - * - * let myFoo = new Foo([1,2,3]); - * var logit = myFoo.log; - * logit(); // logs [1, 2, 3] from the myFoo 'this' instance - * ``` - * - * #### Example: - * This example creates a bound version of a service function, and copies it to another object - * ``` - * - * var SomeService = { - * this.data = [3, 4, 5]; - * this.log = function() { - * console.log(this.data); - * } - * } - * - * // Constructor fn - * function OtherThing() { - * // Binds all functions from SomeService to SomeService, - * // then copies them to 'this' - * bindFunctions(SomeService, this, SomeService); - * } - * - * let myOtherThing = new OtherThing(); - * myOtherThing.log(); // logs [3, 4, 5] from SomeService's 'this' - * ``` - * - * @param source A function that returns the source object which contains the original functions to be bound - * @param target A function that returns the target object which will receive the bound functions - * @param bind A function that returns the object which the functions will be bound to - * @param fnNames The function names which will be bound (Defaults to all the functions found on the 'from' object) - * @param latebind If true, the binding of the function is delayed until the first time it's invoked - */ -function createProxyFunctions(source, target, bind, fnNames, latebind) { - if (latebind === void 0) { latebind = false; } - var bindFunction = function (fnName) { - return source()[fnName].bind(bind()); - }; - var makeLateRebindFn = function (fnName) { return function lateRebindFunction() { - target[fnName] = bindFunction(fnName); - return target[fnName].apply(null, arguments); - }; }; - fnNames = fnNames || Object.keys(source()); - return fnNames.reduce(function (acc, name) { - acc[name] = latebind ? makeLateRebindFn(name) : bindFunction(name); - return acc; - }, target); -} -exports.createProxyFunctions = createProxyFunctions; -/** - * prototypal inheritance helper. - * Creates a new object which has `parent` object as its prototype, and then copies the properties from `extra` onto it - */ -exports.inherit = function (parent, extra) { - return exports.extend(new (exports.extend(function () { }, { prototype: parent }))(), extra); -}; -/** - * Given an arguments object, converts the arguments at index idx and above to an array. - * This is similar to es6 rest parameters. - * - * Optionally, the argument at index idx may itself already be an array. - * - * For example, - * given either: - * arguments = [ obj, "foo", "bar" ] - * or: - * arguments = [ obj, ["foo", "bar"] ] - * then: - * restArgs(arguments, 1) == ["foo", "bar"] - * - * This allows functions like pick() to be implemented such that it allows either a bunch - * of string arguments (like es6 rest parameters), or a single array of strings: - * - * given: - * var obj = { foo: 1, bar: 2, baz: 3 }; - * then: - * pick(obj, "foo", "bar"); // returns { foo: 1, bar: 2 } - * pick(obj, ["foo", "bar"]); // returns { foo: 1, bar: 2 } - */ -var restArgs = function (args, idx) { - if (idx === void 0) { idx = 0; } - return Array.prototype.concat.apply(Array.prototype, Array.prototype.slice.call(args, idx)); -}; -/** Given an array, returns true if the object is found in the array, (using indexOf) */ -exports.inArray = hof_1.curry(_inArray); -function _inArray(array, obj) { - return array.indexOf(obj) !== -1; -} -exports._inArray = _inArray; -/** - * Given an array, and an item, if the item is found in the array, it removes it (in-place). - * The same array is returned - */ -exports.removeFrom = hof_1.curry(_removeFrom); -function _removeFrom(array, obj) { - var idx = array.indexOf(obj); - if (idx >= 0) - array.splice(idx, 1); - return array; -} -exports._removeFrom = _removeFrom; -/** pushes a values to an array and returns the value */ -exports.pushTo = hof_1.curry(_pushTo); -function _pushTo(arr, val) { - return (arr.push(val), val); -} -exports._pushTo = _pushTo; -/** Given an array of (deregistration) functions, calls all functions and removes each one from the source array */ -exports.deregAll = function (functions) { - return functions.slice().forEach(function (fn) { - typeof fn === 'function' && fn(); - exports.removeFrom(functions, fn); - }); -}; -/** - * Applies a set of defaults to an options object. The options object is filtered - * to only those properties of the objects in the defaultsList. - * Earlier objects in the defaultsList take precedence when applying defaults. - */ -function defaults(opts) { - if (opts === void 0) { opts = {}; } - var defaultsList = []; - for (var _i = 1; _i < arguments.length; _i++) { - defaultsList[_i - 1] = arguments[_i]; - } - var defaults = merge.apply(null, [{}].concat(defaultsList)); - return exports.extend({}, defaults, pick(opts || {}, Object.keys(defaults))); -} -exports.defaults = defaults; -/** - * Merges properties from the list of objects to the destination object. - * If a property already exists in the destination object, then it is not overwritten. - */ -function merge(dst) { - var objs = []; - for (var _i = 1; _i < arguments.length; _i++) { - objs[_i - 1] = arguments[_i]; - } - exports.forEach(objs, function (obj) { - exports.forEach(obj, function (value, key) { - if (!dst.hasOwnProperty(key)) - dst[key] = value; - }); - }); - return dst; -} -exports.merge = merge; -/** Reduce function that merges each element of the list into a single object, using extend */ -exports.mergeR = function (memo, item) { return exports.extend(memo, item); }; -/** - * Finds the common ancestor path between two states. - * - * @param {Object} first The first state. - * @param {Object} second The second state. - * @return {Array} Returns an array of state names in descending order, not including the root. - */ -function ancestors(first, second) { - var path = []; - for (var n in first.path) { - if (first.path[n] !== second.path[n]) + findWithClassElementDesc = function (el, klass) { + var child; + for (var i = 0; i < el.children.length; i += 1) { + child = el.children[i]; + if (child !== undefined && angular.element(child).hasClass(klass)) { + break; + } else if (child.children !== undefined) { + child = findWithClassElementDesc(child, klass); + if (child.length > 0) { break; - path.push(first.path[n]); - } - return path; -} -exports.ancestors = ancestors; -function pickOmitImpl(predicate, obj) { - var keys = []; - for (var _i = 2; _i < arguments.length; _i++) { - keys[_i - 2] = arguments[_i]; - } - var objCopy = {}; - for (var key in obj) { - if (predicate(keys, key)) - objCopy[key] = obj[key]; - } - return objCopy; -} -/** Return a copy of the object only containing the whitelisted properties. */ -function pick(obj) { - return pickOmitImpl.apply(null, [exports.inArray].concat(restArgs(arguments))); -} -exports.pick = pick; -/** Return a copy of the object omitting the blacklisted properties. */ -function omit(obj) { - var notInArray = function (array, item) { return !exports.inArray(array, item); }; - return pickOmitImpl.apply(null, [notInArray].concat(restArgs(arguments))); -} -exports.omit = omit; -/** - * Maps an array, or object to a property (by name) - */ -function pluck(collection, propName) { - return map(collection, hof_1.prop(propName)); -} -exports.pluck = pluck; -/** Filters an Array or an Object's properties based on a predicate */ -function filter(collection, callback) { - var arr = predicates_1.isArray(collection), result = arr ? [] : {}; - var accept = arr ? function (x) { return result.push(x); } : function (x, key) { return result[key] = x; }; - exports.forEach(collection, function (item, i) { - if (callback(item, i)) - accept(item, i); - }); - return result; -} -exports.filter = filter; -/** Finds an object from an array, or a property of an object, that matches a predicate */ -function find(collection, callback) { - var result; - exports.forEach(collection, function (item, i) { - if (result) - return; - if (callback(item, i)) - result = item; - }); - return result; -} -exports.find = find; -/** Given an object, returns a new object, where each property is transformed by the callback function */ -exports.mapObj = map; -/** Maps an array or object properties using a callback function */ -function map(collection, callback) { - var result = predicates_1.isArray(collection) ? [] : {}; - exports.forEach(collection, function (item, i) { return result[i] = callback(item, i); }); - return result; -} -exports.map = map; -/** - * Given an object, return its enumerable property values - * - * @example - * ``` - * - * let foo = { a: 1, b: 2, c: 3 } - * let vals = values(foo); // [ 1, 2, 3 ] - * ``` - */ -exports.values = function (obj) { - return Object.keys(obj).map(function (key) { return obj[key]; }); -}; -/** - * Reduce function that returns true if all of the values are truthy. - * - * @example - * ``` - * - * let vals = [ 1, true, {}, "hello world"]; - * vals.reduce(allTrueR, true); // true - * - * vals.push(0); - * vals.reduce(allTrueR, true); // false - * ``` - */ -exports.allTrueR = function (memo, elem) { return memo && elem; }; -/** - * Reduce function that returns true if any of the values are truthy. - * - * * @example - * ``` - * - * let vals = [ 0, null, undefined ]; - * vals.reduce(anyTrueR, true); // false - * - * vals.push("hello world"); - * vals.reduce(anyTrueR, true); // true - * ``` - */ -exports.anyTrueR = function (memo, elem) { return memo || elem; }; -/** - * Reduce function which un-nests a single level of arrays - * @example - * ``` - * - * let input = [ [ "a", "b" ], [ "c", "d" ], [ [ "double", "nested" ] ] ]; - * input.reduce(unnestR, []) // [ "a", "b", "c", "d", [ "double, "nested" ] ] - * ``` - */ -exports.unnestR = function (memo, elem) { return memo.concat(elem); }; -/** - * Reduce function which recursively un-nests all arrays - * - * @example - * ``` - * - * let input = [ [ "a", "b" ], [ "c", "d" ], [ [ "double", "nested" ] ] ]; - * input.reduce(unnestR, []) // [ "a", "b", "c", "d", "double, "nested" ] - * ``` - */ -exports.flattenR = function (memo, elem) { - return predicates_1.isArray(elem) ? memo.concat(elem.reduce(exports.flattenR, [])) : pushR(memo, elem); -}; -/** - * Reduce function that pushes an object to an array, then returns the array. - * Mostly just for [[flattenR]] and [[uniqR]] - */ -function pushR(arr, obj) { - arr.push(obj); - return arr; -} -exports.pushR = pushR; -/** Reduce function that filters out duplicates */ -exports.uniqR = function (acc, token) { - return exports.inArray(acc, token) ? acc : pushR(acc, token); -}; -/** - * Return a new array with a single level of arrays unnested. - * - * @example - * ``` - * - * let input = [ [ "a", "b" ], [ "c", "d" ], [ [ "double", "nested" ] ] ]; - * unnest(input) // [ "a", "b", "c", "d", [ "double, "nested" ] ] - * ``` - */ -exports.unnest = function (arr) { return arr.reduce(exports.unnestR, []); }; -/** - * Return a completely flattened version of an array. - * - * @example - * ``` - * - * let input = [ [ "a", "b" ], [ "c", "d" ], [ [ "double", "nested" ] ] ]; - * flatten(input) // [ "a", "b", "c", "d", "double, "nested" ] - * ``` - */ -exports.flatten = function (arr) { return arr.reduce(exports.flattenR, []); }; -/** - * Given a .filter Predicate, builds a .filter Predicate which throws an error if any elements do not pass. - * @example - * ``` - * - * let isNumber = (obj) => typeof(obj) === 'number'; - * let allNumbers = [ 1, 2, 3, 4, 5 ]; - * allNumbers.filter(assertPredicate(isNumber)); //OK - * - * let oneString = [ 1, 2, 3, 4, "5" ]; - * oneString.filter(assertPredicate(isNumber, "Not all numbers")); // throws Error(""Not all numbers""); - * ``` - */ -exports.assertPredicate = assertFn; -/** - * Given a .map function, builds a .map function which throws an error if any mapped elements do not pass a truthyness test. - * @example - * ``` - * - * var data = { foo: 1, bar: 2 }; - * - * let keys = [ 'foo', 'bar' ] - * let values = keys.map(assertMap(key => data[key], "Key not found")); - * // values is [1, 2] - * - * let keys = [ 'foo', 'bar', 'baz' ] - * let values = keys.map(assertMap(key => data[key], "Key not found")); - * // throws Error("Key not found") - * ``` - */ -exports.assertMap = assertFn; -function assertFn(predicateOrMap, errMsg) { - if (errMsg === void 0) { errMsg = "assert failure"; } - return function (obj) { - var result = predicateOrMap(obj); - if (!result) { - throw new Error(predicates_1.isFunction(errMsg) ? errMsg(obj) : errMsg); + } } - return result; - }; -} -exports.assertFn = assertFn; -/** - * Like _.pairs: Given an object, returns an array of key/value pairs - * - * @example - * ``` - * - * pairs({ foo: "FOO", bar: "BAR }) // [ [ "foo", "FOO" ], [ "bar": "BAR" ] ] - * ``` - */ -exports.pairs = function (obj) { - return Object.keys(obj).map(function (key) { return [key, obj[key]]; }); -}; -/** - * Given two or more parallel arrays, returns an array of tuples where - * each tuple is composed of [ a[i], b[i], ... z[i] ] - * - * @example - * ``` - * - * let foo = [ 0, 2, 4, 6 ]; - * let bar = [ 1, 3, 5, 7 ]; - * let baz = [ 10, 30, 50, 70 ]; - * arrayTuples(foo, bar); // [ [0, 1], [2, 3], [4, 5], [6, 7] ] - * arrayTuples(foo, bar, baz); // [ [0, 1, 10], [2, 3, 30], [4, 5, 50], [6, 7, 70] ] - * ``` - */ -function arrayTuples() { - var arrayArgs = []; - for (var _i = 0; _i < arguments.length; _i++) { - arrayArgs[_i] = arguments[_i]; - } - if (arrayArgs.length === 0) - return []; - var length = arrayArgs.reduce(function (min, arr) { return Math.min(arr.length, min); }, 9007199254740991); // aka 2^53 − 1 aka Number.MAX_SAFE_INTEGER - return Array.apply(null, Array(length)).map(function (ignored, idx) { return arrayArgs.map(function (arr) { return arr[idx]; }); }); -} -exports.arrayTuples = arrayTuples; -/** - * Reduce function which builds an object from an array of [key, value] pairs. - * - * Each iteration sets the key/val pair on the memo object, then returns the memo for the next iteration. - * - * Each keyValueTuple should be an array with values [ key: string, value: any ] - * - * @example - * ``` - * - * var pairs = [ ["fookey", "fooval"], ["barkey", "barval"] ] - * - * var pairsToObj = pairs.reduce((memo, pair) => applyPairs(memo, pair), {}) - * // pairsToObj == { fookey: "fooval", barkey: "barval" } - * - * // Or, more simply: - * var pairsToObj = pairs.reduce(applyPairs, {}) - * // pairsToObj == { fookey: "fooval", barkey: "barval" } - * ``` - */ -function applyPairs(memo, keyValTuple) { - var key, value; - if (predicates_1.isArray(keyValTuple)) - key = keyValTuple[0], value = keyValTuple[1]; - if (!predicates_1.isString(key)) - throw new Error("invalid parameters to applyPairs"); - memo[key] = value; - return memo; -} -exports.applyPairs = applyPairs; -/** Get the last element of an array */ -function tail(arr) { - return arr.length && arr[arr.length - 1] || undefined; -} -exports.tail = tail; -/** - * shallow copy from src to dest - * - * note: This is a shallow copy, while angular.copy is a deep copy. - * ui-router uses `copy` only to make copies of state parameters. - */ -function _copy(src, dest) { - if (dest) - Object.keys(dest).forEach(function (key) { return delete dest[key]; }); - if (!dest) - dest = {}; - return exports.extend(dest, src); -} -/** Naive forEach implementation works with Objects or Arrays */ -function _forEach(obj, cb, _this) { - if (predicates_1.isArray(obj)) - return obj.forEach(cb, _this); - Object.keys(obj).forEach(function (key) { return cb(obj[key], key); }); -} -function _copyProps(to, from) { - Object.keys(from).forEach(function (key) { return to[key] = from[key]; }); - return to; -} -function _extend(toObj) { - return restArgs(arguments, 1).filter(exports.identity).reduce(_copyProps, toObj); -} -function _equals(o1, o2) { - if (o1 === o2) - return true; - if (o1 === null || o2 === null) - return false; - if (o1 !== o1 && o2 !== o2) - return true; // NaN === NaN - var t1 = typeof o1, t2 = typeof o2; - if (t1 !== t2 || t1 !== 'object') - return false; - var tup = [o1, o2]; - if (hof_1.all(predicates_1.isArray)(tup)) - return _arraysEq(o1, o2); - if (hof_1.all(predicates_1.isDate)(tup)) - return o1.getTime() === o2.getTime(); - if (hof_1.all(predicates_1.isRegExp)(tup)) - return o1.toString() === o2.toString(); - if (hof_1.all(predicates_1.isFunction)(tup)) - return true; // meh - var predicates = [predicates_1.isFunction, predicates_1.isArray, predicates_1.isDate, predicates_1.isRegExp]; - if (predicates.map(hof_1.any).reduce(function (b, fn) { return b || !!fn(tup); }, false)) - return false; - var key, keys = {}; - for (key in o1) { - if (!_equals(o1[key], o2[key])) - return false; - keys[key] = true; - } - for (key in o2) { - if (!keys[key]) - return false; - } - return true; -} -function _arraysEq(a1, a2) { - if (a1.length !== a2.length) - return false; - return arrayTuples(a1, a2).reduce(function (b, t) { return b && _equals(t[0], t[1]); }, true); -} -/** - * Create a sort function - * - * Creates a sort function which sorts by a numeric property. - * - * The `propFn` should return the property as a number which can be sorted. - * - * #### Example: - * This example returns the `priority` prop. - * ```js - * var sortfn = sortBy(obj => obj.priority) - * // equivalent to: - * var longhandSortFn = (a, b) => a.priority - b.priority; - * ``` - * - * #### Example: - * This example uses [[prop]] - * ```js - * var sortfn = sortBy(prop('priority')) - * ``` - * - * The `checkFn` can be used to exclude objects from sorting. - * - * #### Example: - * This example only sorts objects with type === 'FOO' - * ```js - * var sortfn = sortBy(prop('priority'), propEq('type', 'FOO')) - * ``` - * - * @param propFn a function that returns the property (as a number) - * @param checkFn a predicate - * - * @return a sort function like: `(a, b) => (checkFn(a) && checkFn(b)) ? propFn(a) - propFn(b) : 0` - */ -exports.sortBy = function (propFn, checkFn) { - if (checkFn === void 0) { checkFn = hof_1.val(true); } - return function (a, b) { - return (checkFn(a) && checkFn(b)) ? propFn(a) - propFn(b) : 0; - }; -}; -/** - * Composes a list of sort functions - * - * Creates a sort function composed of multiple sort functions. - * Each sort function is invoked in series. - * The first sort function to return non-zero "wins". - * - * @param sortFns list of sort functions - */ -exports.composeSort = function () { - var sortFns = []; - for (var _i = 0; _i < arguments.length; _i++) { - sortFns[_i] = arguments[_i]; - } - return function (a, b) { - return sortFns.reduce(function (prev, fn) { return prev || fn(a, b); }, 0); - }; -}; -// issue #2676 -exports.silenceUncaughtInPromise = function (promise) { - return promise.catch(function (e) { return 0; }) && promise; -}; -exports.silentRejection = function (error) { - return exports.silenceUncaughtInPromise(coreservices_1.services.$q.reject(error)); -}; -//# sourceMappingURL=common.js.map + } -/***/ }), -/* 9 */ -/***/ (function(module, exports, __webpack_require__) { + return angular.element(child); + }, -var isObject = __webpack_require__(14); -module.exports = function(it){ - if(!isObject(it))throw TypeError(it + ' is not an object!'); - return it; -}; + findFormGroupElement = function (el) { + return findWithClassElementAsc(el, 'form-group'); + }, -/***/ }), -/* 10 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { + findInputGroupElement = function (el) { + return findWithClassElementDesc(el, 'input-group'); + }, -"use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__facade_lang__ = __webpack_require__(6); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "j", function() { return TypeModifier; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "S", function() { return Type; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "U", function() { return BuiltinTypeName; }); -/* unused harmony export BuiltinType */ -/* unused harmony export ExpressionType */ -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "i", function() { return ArrayType; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "n", function() { return MapType; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "m", function() { return DYNAMIC_TYPE; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "s", function() { return BOOL_TYPE; }); -/* unused harmony export INT_TYPE */ -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "p", function() { return NUMBER_TYPE; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "r", function() { return STRING_TYPE; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "M", function() { return FUNCTION_TYPE; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "T", function() { return NULL_TYPE; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "y", function() { return BinaryOperator; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "L", function() { return Expression; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "F", function() { return BuiltinVar; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "A", function() { return ReadVarExpr; }); -/* unused harmony export WriteVarExpr */ -/* unused harmony export WriteKeyExpr */ -/* unused harmony export WritePropExpr */ -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "O", function() { return BuiltinMethod; }); -/* unused harmony export InvokeMethodExpr */ -/* unused harmony export InvokeFunctionExpr */ -/* unused harmony export InstantiateExpr */ -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "N", function() { return LiteralExpr; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Q", function() { return ExternalExpr; }); -/* unused harmony export ConditionalExpr */ -/* unused harmony export NotExpr */ -/* unused harmony export CastExpr */ -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "o", function() { return FnParam; }); -/* unused harmony export FunctionExpr */ -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "z", function() { return BinaryOperatorExpr; }); -/* unused harmony export ReadPropExpr */ -/* unused harmony export ReadKeyExpr */ -/* unused harmony export LiteralArrayExpr */ -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "J", function() { return LiteralMapEntry; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "K", function() { return LiteralMapExpr; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return THIS_EXPR; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "D", function() { return SUPER_EXPR; }); -/* unused harmony export CATCH_ERROR_VAR */ -/* unused harmony export CATCH_STACK_VAR */ -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return NULL_EXPR; }); -/* unused harmony export TYPED_NULL_EXPR */ -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "k", function() { return StmtModifier; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "R", function() { return Statement; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "x", function() { return DeclareVarStmt; }); -/* unused harmony export DeclareFunctionStmt */ -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "C", function() { return ExpressionStatement; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "t", function() { return ReturnStatement; }); -/* unused harmony export AbstractClassPart */ -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return ClassField; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "q", function() { return ClassMethod; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "H", function() { return ClassGetter; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "E", function() { return ClassStmt; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "u", function() { return IfStmt; }); -/* unused harmony export CommentStmt */ -/* unused harmony export TryCatchStmt */ -/* unused harmony export ThrowStmt */ -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "G", function() { return ExpressionTransformer; }); -/* unused harmony export RecursiveExpressionVisitor */ -/* harmony export (immutable) */ __webpack_exports__["I"] = replaceVarInExpression; -/* harmony export (immutable) */ __webpack_exports__["w"] = findReadVarNames; -/* harmony export (immutable) */ __webpack_exports__["a"] = variable; -/* harmony export (immutable) */ __webpack_exports__["g"] = importExpr; -/* harmony export (immutable) */ __webpack_exports__["d"] = importType; -/* harmony export (immutable) */ __webpack_exports__["P"] = expressionType; -/* harmony export (immutable) */ __webpack_exports__["h"] = literalArr; -/* harmony export (immutable) */ __webpack_exports__["l"] = literalMap; -/* harmony export (immutable) */ __webpack_exports__["v"] = not; -/* harmony export (immutable) */ __webpack_exports__["B"] = fn; -/* harmony export (immutable) */ __webpack_exports__["f"] = literal; -/** - * @license - * Copyright Google Inc. All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.io/license - */ -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; + insertAfter = function (referenceNode, newNode) { + referenceNode[0].parentNode.insertBefore(newNode[0], referenceNode[0].nextSibling); + }, -var TypeModifier = {}; -TypeModifier.Const = 0; -TypeModifier[TypeModifier.Const] = "Const"; -/** - * @abstract - */ -var Type = (function () { - /** - * @param {?=} modifiers - */ - function Type(modifiers) { - if (modifiers === void 0) { modifiers = null; } - this.modifiers = modifiers; - if (!modifiers) { - this.modifiers = []; - } - } - /** - * @abstract - * @param {?} visitor - * @param {?} context - * @return {?} - */ - Type.prototype.visitType = function (visitor, context) { }; - /** - * @param {?} modifier - * @return {?} - */ - Type.prototype.hasModifier = function (modifier) { return this.modifiers.indexOf(modifier) !== -1; }; - return Type; -}()); -function Type_tsickle_Closure_declarations() { - /** @type {?} */ - Type.prototype.modifiers; -} -var BuiltinTypeName = {}; -BuiltinTypeName.Dynamic = 0; -BuiltinTypeName.Bool = 1; -BuiltinTypeName.String = 2; -BuiltinTypeName.Int = 3; -BuiltinTypeName.Number = 4; -BuiltinTypeName.Function = 5; -BuiltinTypeName.Null = 6; -BuiltinTypeName[BuiltinTypeName.Dynamic] = "Dynamic"; -BuiltinTypeName[BuiltinTypeName.Bool] = "Bool"; -BuiltinTypeName[BuiltinTypeName.String] = "String"; -BuiltinTypeName[BuiltinTypeName.Int] = "Int"; -BuiltinTypeName[BuiltinTypeName.Number] = "Number"; -BuiltinTypeName[BuiltinTypeName.Function] = "Function"; -BuiltinTypeName[BuiltinTypeName.Null] = "Null"; -var BuiltinType = (function (_super) { - __extends(BuiltinType, _super); - /** - * @param {?} name - * @param {?=} modifiers - */ - function BuiltinType(name, modifiers) { - if (modifiers === void 0) { modifiers = null; } - _super.call(this, modifiers); - this.name = name; - } /** - * @param {?} visitor - * @param {?} context - * @return {?} + * @ngdoc property + * @name bootstrap3ElementModifier#addValidationStateIcons + * @propertyOf bootstrap3ElementModifier + * @returns {bool} True if an state icon will be added to the element in the valid and invalid control + * states. The default is false. */ - BuiltinType.prototype.visitType = function (visitor, context) { - return visitor.visitBuiltintType(this, context); - }; - return BuiltinType; -}(Type)); -function BuiltinType_tsickle_Closure_declarations() { - /** @type {?} */ - BuiltinType.prototype.name; -} -var ExpressionType = (function (_super) { - __extends(ExpressionType, _super); + addValidationStateIcons = false, + /** - * @param {?} value - * @param {?=} typeParams - * @param {?=} modifiers + * @ngdoc function + * @name bootstrap3ElementModifier#enableValidationStateIcons + * @methodOf bootstrap3ElementModifier + * + * @description + * Makes an element appear invalid by apply an icon to the input element. + * + * @param {bool} enable - True to enable the icon otherwise false. */ - function ExpressionType(value, typeParams, modifiers) { - if (typeParams === void 0) { typeParams = null; } - if (modifiers === void 0) { modifiers = null; } - _super.call(this, modifiers); - this.value = value; - this.typeParams = typeParams; - } + enableValidationStateIcons = function (enable) { + addValidationStateIcons = enable; + }, + /** - * @param {?} visitor - * @param {?} context - * @return {?} + * @ngdoc function + * @name bootstrap3ElementModifier#makeValid + * @methodOf bootstrap3ElementModifier + * + * @description + * Makes an element appear valid by apply bootstrap 3 specific styles and child elements. If the service + * property 'addValidationStateIcons' is true it will also append validation glyphicon to the element. + * See: http://getbootstrap.com/css/#forms-control-validation + * + * @param {Element} el - The input control element that is the target of the validation. */ - ExpressionType.prototype.visitType = function (visitor, context) { - return visitor.visitExpressionType(this, context); - }; - return ExpressionType; -}(Type)); -function ExpressionType_tsickle_Closure_declarations() { - /** @type {?} */ - ExpressionType.prototype.value; - /** @type {?} */ - ExpressionType.prototype.typeParams; -} -var ArrayType = (function (_super) { - __extends(ArrayType, _super); + makeValid = function (el) { + var frmGroupEl = findFormGroupElement(el), + inputGroupEl; + + if (frmGroupEl) { + reset(frmGroupEl); + inputGroupEl = findInputGroupElement(frmGroupEl[0]); + frmGroupEl.addClass('has-success ' + (inputGroupEl.length > 0 || addValidationStateIcons === false ? '' : 'has-feedback')); + if (addValidationStateIcons) { + var iconElText = ''; + if (inputGroupEl.length > 0) { + iconElText = iconElText.replace('form-', ''); + iconElText = ''), + inputGroupEl; + + if (frmGroupEl) { + reset(frmGroupEl); + inputGroupEl = findInputGroupElement(frmGroupEl[0]); + frmGroupEl.addClass('has-error ' + (inputGroupEl.length > 0 || addValidationStateIcons === false ? '' : 'has-feedback')); + insertAfter(inputGroupEl.length > 0 ? inputGroupEl : getCorrectElementToPlaceErrorElementAfter(el), helpTextEl); + if (addValidationStateIcons) { + var iconElText = ''; + if (inputGroupEl.length > 0) { + iconElText = iconElText.replace('form-', ''); + iconElText = '