forked from mgcrea/angular-strap
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathparse-options.min.js
More file actions
9 lines (9 loc) · 1.16 KB
/
parse-options.min.js
File metadata and controls
9 lines (9 loc) · 1.16 KB
1
2
3
4
5
6
7
8
9
/**
* angular-strap
* @version v2.3.8 - 2016-03-31
* @link http://mgcrea.github.io/angular-strap
* @author Olivier Louvignes <olivier@mg-crea.com> (https://github.com/mgcrea)
* @license MIT License, http://www.opensource.org/licenses/MIT
*/
'use strict';angular.module('mgcrea.ngStrap.helpers.parseOptions',[]).provider('$parseOptions',function(){var n=this.defaults={regexp:/^\s*(.*?)(?:\s+as\s+(.*?))?(?:\s+group\s+by\s+(.*))?\s+for\s+(?:([\$\w][\$\w]*)|(?:\(\s*([\$\w][\$\w]*)\s*,\s*([\$\w][\$\w]*)\s*\)))\s+in\s+(.*?)(?:\s+track\s+by\s+(.*?))?$/};this.$get=['$parse','$q',function(r,e){function s(s,t){function a(n,r){return n.map(function(n,e){var s,t,a={};return a[$]=n,s=o(r,a),t=f(r,a),{label:s,value:t,index:e}})}var u={},i=angular.extend({},n,t);u.$values=[];var l,o,$,c,p,f,v;return u.init=function(){u.$match=l=s.match(i.regexp),o=r(l[2]||l[1]),$=l[4]||l[6],c=l[5],p=r(l[3]||''),f=r(l[2]?l[1]:$),v=r(l[7])},u.valuesFn=function(n,r){return e.when(v(n,r)).then(function(r){return angular.isArray(r)||(r=[]),u.$values=r.length?a(r,n):[],u.$values})},u.displayValue=function(n){var r={};return r[$]=n,o(r)},u.init(),u}return s}]});
//# sourceMappingURL=parse-options.min.js.map