angularjs-rails 1.6.2 → 1.6.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 23afdb781688c26abfe8bc2ce1c734ea809a65a2
4
- data.tar.gz: b5d272c8676965124a0ade2096d3e4f969cf99c5
3
+ metadata.gz: d0346663d08de97950aad209fbb29e10a07aba4e
4
+ data.tar.gz: 1df11a0d515a6f1f6b89b60086ac4c1d03d99618
5
5
  SHA512:
6
- metadata.gz: 848da558e3fd2f1f250134e65b4100a9e9609df7244b01de57b0bbac4bbef299f4751cc70f507d63ea558904eb18ca9de422adfc8f3a7208050df878e64aea30
7
- data.tar.gz: 378a7c4d86b7f6fc53ffd1e589072c3b2656db1851aebd458a076be54b8b8931bc95b14d78c9b1ce029f67e2ade5be6b2205cb4a3dff4ee48938c2047bfbbffa
6
+ metadata.gz: cc80cc06c5356f0d6db204b91bc19aed73200f352270bf28dbc709ee01d3a73dfe279fe2dcc7d9bb7c8d610e41d004ca5ae7bb0f06594d310b7a72b32ab04f27
7
+ data.tar.gz: dc410a57c0a4c62b9921f4a44370d72368052799acf1783a3fc4ef3cd4e1134c76607a42de00fca3fcc3ab947b9d3a24491003f618362b1e62f0e1dc35ff6aba
@@ -1,6 +1,6 @@
1
1
  module AngularJS
2
2
  module Rails
3
- VERSION = "1.6.2"
3
+ VERSION = "1.6.8"
4
4
  UNSTABLE_VERSION = "2.0.0-beta.17"
5
5
  end
6
6
  end
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license AngularJS v1.6.2
2
+ * @license AngularJS v1.6.8
3
3
  * (c) 2010-2017 Google, Inc. http://angularjs.org
4
4
  * License: MIT
5
5
  */
@@ -528,7 +528,7 @@ var ANIMATE_TIMER_KEY = '$$animateCss';
528
528
  * Note that only browsers that support CSS transitions and/or keyframe animations are capable of
529
529
  * rendering animations triggered via `$animateCss` (bad news for IE9 and lower).
530
530
  *
531
- * ## Usage
531
+ * ## General Use
532
532
  * Once again, `$animateCss` is designed to be used inside of a registered JavaScript animation that
533
533
  * is powered by ngAnimate. It is possible to use `$animateCss` directly inside of a directive, however,
534
534
  * any automatic control over cancelling animations and/or preventing animations from being run on
@@ -1315,6 +1315,12 @@ var $AnimateCssProvider = ['$animateProvider', /** @this */ function($animatePro
1315
1315
  event.stopPropagation();
1316
1316
  var ev = event.originalEvent || event;
1317
1317
 
1318
+ if (ev.target !== node) {
1319
+ // Since TransitionEvent / AnimationEvent bubble up,
1320
+ // we have to ignore events by finished child animations
1321
+ return;
1322
+ }
1323
+
1318
1324
  // we now always use `Date.now()` due to the recent changes with
1319
1325
  // event.timeStamp in Firefox, Webkit and Chrome (see #13494 for more info)
1320
1326
  var timeStamp = ev.$manualTimeStamp || Date.now();
@@ -2294,14 +2300,17 @@ var $$AnimateQueueProvider = ['$animateProvider', /** @this */ function($animate
2294
2300
 
2295
2301
  var callbackRegistry = Object.create(null);
2296
2302
 
2297
- // remember that the classNameFilter is set during the provider/config
2298
- // stage therefore we can optimize here and setup a helper function
2303
+ // remember that the `customFilter`/`classNameFilter` are set during the
2304
+ // provider/config stage therefore we can optimize here and setup helper functions
2305
+ var customFilter = $animateProvider.customFilter();
2299
2306
  var classNameFilter = $animateProvider.classNameFilter();
2300
- var isAnimatableClassName = !classNameFilter
2301
- ? function() { return true; }
2302
- : function(className) {
2303
- return classNameFilter.test(className);
2304
- };
2307
+ var returnTrue = function() { return true; };
2308
+
2309
+ var isAnimatableByFilter = customFilter || returnTrue;
2310
+ var isAnimatableClassName = !classNameFilter ? returnTrue : function(node, options) {
2311
+ var className = [node.getAttribute('class'), options.addClass, options.removeClass].join(' ');
2312
+ return classNameFilter.test(className);
2313
+ };
2305
2314
 
2306
2315
  var applyAnimationClasses = applyAnimationClassesFactory($$jqLite);
2307
2316
 
@@ -2479,16 +2488,13 @@ var $$AnimateQueueProvider = ['$animateProvider', /** @this */ function($animate
2479
2488
  options.to = null;
2480
2489
  }
2481
2490
 
2482
- // there are situations where a directive issues an animation for
2483
- // a jqLite wrapper that contains only comment nodes... If this
2484
- // happens then there is no way we can perform an animation
2485
- if (!node) {
2486
- close();
2487
- return runner;
2488
- }
2489
-
2490
- var className = [node.getAttribute('class'), options.addClass, options.removeClass].join(' ');
2491
- if (!isAnimatableClassName(className)) {
2491
+ // If animations are hard-disabled for the whole application there is no need to continue.
2492
+ // There are also situations where a directive issues an animation for a jqLite wrapper that
2493
+ // contains only comment nodes. In this case, there is no way we can perform an animation.
2494
+ if (!animationsEnabled ||
2495
+ !node ||
2496
+ !isAnimatableByFilter(node, event, initialOptions) ||
2497
+ !isAnimatableClassName(node, options)) {
2492
2498
  close();
2493
2499
  return runner;
2494
2500
  }
@@ -2497,12 +2503,11 @@ var $$AnimateQueueProvider = ['$animateProvider', /** @this */ function($animate
2497
2503
 
2498
2504
  var documentHidden = $$isDocumentHidden();
2499
2505
 
2500
- // this is a hard disable of all animations for the application or on
2501
- // the element itself, therefore there is no need to continue further
2502
- // past this point if not enabled
2506
+ // This is a hard disable of all animations the element itself, therefore there is no need to
2507
+ // continue further past this point if not enabled
2503
2508
  // Animations are also disabled if the document is currently hidden (page is not visible
2504
2509
  // to the user), because browsers slow down or do not flush calls to requestAnimationFrame
2505
- var skipAnimations = !animationsEnabled || documentHidden || disabledElementsLookup.get(node);
2510
+ var skipAnimations = documentHidden || disabledElementsLookup.get(node);
2506
2511
  var existingAnimation = (!skipAnimations && activeAnimationsLookup.get(node)) || {};
2507
2512
  var hasExistingAnimation = !!existingAnimation.state;
2508
2513
 
@@ -3384,9 +3389,7 @@ var ngAnimateSwapDirective = ['$animate', '$rootScope', function($animate, $root
3384
3389
  * The `ngAnimate` module provides support for CSS-based animations (keyframes and transitions) as well as JavaScript-based animations via
3385
3390
  * callback hooks. Animations are not enabled by default, however, by including `ngAnimate` the animation hooks are enabled for an Angular app.
3386
3391
  *
3387
- * <div doc-module-components="ngAnimate"></div>
3388
- *
3389
- * # Usage
3392
+ * ## Usage
3390
3393
  * Simply put, there are two ways to make use of animations when ngAnimate is used: by using **CSS** and **JavaScript**. The former works purely based
3391
3394
  * using CSS (by using matching CSS selectors/styles) and the latter triggers animations that are registered via `module.animation()`. For
3392
3395
  * both CSS and JS animations the sole requirement is to have a matching `CSS class` that exists both in the registered animation and within
@@ -3404,7 +3407,7 @@ var ngAnimateSwapDirective = ['$animate', '$rootScope', function($animate, $root
3404
3407
  * | {@link ng.directive:ngIf#animations ngIf} | enter and leave |
3405
3408
  * | {@link ng.directive:ngClass#animations ngClass} | add and remove (the CSS class(es) present) |
3406
3409
  * | {@link ng.directive:ngShow#animations ngShow} & {@link ng.directive:ngHide#animations ngHide} | add and remove (the ng-hide class value) |
3407
- * | {@link ng.directive:form#animation-hooks form} & {@link ng.directive:ngModel#animation-hooks ngModel} | add and remove (dirty, pristine, valid, invalid & all other validations) |
3410
+ * | {@link ng.directive:form#animations form} & {@link ng.directive:ngModel#animations ngModel} | add and remove (dirty, pristine, valid, invalid & all other validations) |
3408
3411
  * | {@link module:ngMessages#animations ngMessages} | add and remove (ng-active & ng-inactive) |
3409
3412
  * | {@link module:ngMessages#animations ngMessage} | enter and leave |
3410
3413
  *
@@ -3553,6 +3556,10 @@ var ngAnimateSwapDirective = ['$animate', '$rootScope', function($animate, $root
3553
3556
  * /&#42; As of 1.4.4, this must always be set: it signals ngAnimate
3554
3557
  * to not accidentally inherit a delay property from another CSS class &#42;/
3555
3558
  * transition-duration: 0s;
3559
+ *
3560
+ * /&#42; if you are using animations instead of transitions you should configure as follows:
3561
+ * animation-delay: 0.1s;
3562
+ * animation-duration: 0s; &#42;/
3556
3563
  * }
3557
3564
  * .my-animation.ng-enter.ng-enter-active {
3558
3565
  * /&#42; standard transition styles &#42;/
@@ -4132,6 +4139,7 @@ angular.module('ngAnimate', [], function initAngularHelpers() {
4132
4139
  isFunction = angular.isFunction;
4133
4140
  isElement = angular.isElement;
4134
4141
  })
4142
+ .info({ angularVersion: '1.6.8' })
4135
4143
  .directive('ngAnimateSwap', ngAnimateSwapDirective)
4136
4144
 
4137
4145
  .directive('ngAnimateChildren', $$AnimateChildrenDirective)
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license AngularJS v1.6.2
2
+ * @license AngularJS v1.6.8
3
3
  * (c) 2010-2017 Google, Inc. http://angularjs.org
4
4
  * License: MIT
5
5
  */
@@ -15,8 +15,6 @@
15
15
  * attributes that convey state or semantic information about the application for users
16
16
  * of assistive technologies, such as screen readers.
17
17
  *
18
- * <div doc-module-components="ngAria"></div>
19
- *
20
18
  * ## Usage
21
19
  *
22
20
  * For ngAria to do its magic, simply include the module `ngAria` as a dependency. The following
@@ -59,6 +57,7 @@
59
57
  * {@link guide/accessibility Developer Guide}.
60
58
  */
61
59
  var ngAriaModule = angular.module('ngAria', ['ng']).
60
+ info({ angularVersion: '1.6.8' }).
62
61
  provider('$aria', $AriaProvider);
63
62
 
64
63
  /**
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license AngularJS v1.6.2
2
+ * @license AngularJS v1.6.8
3
3
  * (c) 2010-2017 Google, Inc. http://angularjs.org
4
4
  * License: MIT
5
5
  */
@@ -10,18 +10,14 @@
10
10
  * @name ngCookies
11
11
  * @description
12
12
  *
13
- * # ngCookies
14
- *
15
13
  * The `ngCookies` module provides a convenient wrapper for reading and writing browser cookies.
16
14
  *
17
- *
18
- * <div doc-module-components="ngCookies"></div>
19
- *
20
15
  * See {@link ngCookies.$cookies `$cookies`} for usage.
21
16
  */
22
17
 
23
18
 
24
19
  angular.module('ngCookies', ['ng']).
20
+ info({ angularVersion: '1.6.8' }).
25
21
  /**
26
22
  * @ngdoc provider
27
23
  * @name $cookiesProvider
@@ -1,17 +1,51 @@
1
1
  /**
2
- * @license AngularJS v1.6.2
2
+ * @license AngularJS v1.6.8
3
3
  * (c) 2010-2017 Google, Inc. http://angularjs.org
4
4
  * License: MIT
5
5
  */
6
6
 
7
7
  (function() {'use strict';
8
- function isFunction(value) {return typeof value === 'function';};
8
+ // NOTE:
9
+ // These functions are copied here from `src/Angular.js`, because they are needed inside the
10
+ // `angular-loader.js` closure and need to be available before the main `angular.js` script has
11
+ // been loaded.
12
+ function isFunction(value) {return typeof value === 'function';}
13
+ function isDefined(value) {return typeof value !== 'undefined';}
14
+ function isNumber(value) {return typeof value === 'number';}
15
+ function isObject(value) {return value !== null && typeof value === 'object';}
16
+ function isScope(obj) {return obj && obj.$evalAsync && obj.$watch;}
17
+ function isUndefined(value) {return typeof value === 'undefined';}
18
+ function isWindow(obj) {return obj && obj.window === obj;}
19
+ function sliceArgs(args, startIndex) {return Array.prototype.slice.call(args, startIndex || 0);}
20
+ function toJsonReplacer(key, value) {
21
+ var val = value;
22
+
23
+ if (typeof key === 'string' && key.charAt(0) === '$' && key.charAt(1) === '$') {
24
+ val = undefined;
25
+ } else if (isWindow(value)) {
26
+ val = '$WINDOW';
27
+ } else if (value && window.document === value) {
28
+ val = '$DOCUMENT';
29
+ } else if (isScope(value)) {
30
+ val = '$SCOPE';
31
+ }
32
+
33
+ return val;
34
+ }
9
35
 
10
- /* global toDebugString: true */
36
+ /* exported toDebugString */
11
37
 
12
- function serializeObject(obj) {
38
+ function serializeObject(obj, maxDepth) {
13
39
  var seen = [];
14
40
 
41
+ // There is no direct way to stringify object until reaching a specific depth
42
+ // and a very deep object can cause a performance issue, so we copy the object
43
+ // based on this specific depth and then stringify it.
44
+ if (isValidObjectMaxDepth(maxDepth)) {
45
+ // This file is also included in `angular-loader`, so `copy()` might not always be available in
46
+ // the closure. Therefore, it is lazily retrieved as `angular.copy()` when needed.
47
+ obj = angular.copy(obj, null, maxDepth);
48
+ }
15
49
  return JSON.stringify(obj, function(key, val) {
16
50
  val = toJsonReplacer(key, val);
17
51
  if (isObject(val)) {
@@ -24,17 +58,67 @@ function serializeObject(obj) {
24
58
  });
25
59
  }
26
60
 
27
- function toDebugString(obj) {
61
+ function toDebugString(obj, maxDepth) {
28
62
  if (typeof obj === 'function') {
29
63
  return obj.toString().replace(/ \{[\s\S]*$/, '');
30
64
  } else if (isUndefined(obj)) {
31
65
  return 'undefined';
32
66
  } else if (typeof obj !== 'string') {
33
- return serializeObject(obj);
67
+ return serializeObject(obj, maxDepth);
34
68
  }
35
69
  return obj;
36
70
  }
37
71
 
72
+ /* exported
73
+ minErrConfig,
74
+ errorHandlingConfig,
75
+ isValidObjectMaxDepth
76
+ */
77
+
78
+ var minErrConfig = {
79
+ objectMaxDepth: 5
80
+ };
81
+
82
+ /**
83
+ * @ngdoc function
84
+ * @name angular.errorHandlingConfig
85
+ * @module ng
86
+ * @kind function
87
+ *
88
+ * @description
89
+ * Configure several aspects of error handling in AngularJS if used as a setter or return the
90
+ * current configuration if used as a getter. The following options are supported:
91
+ *
92
+ * - **objectMaxDepth**: The maximum depth to which objects are traversed when stringified for error messages.
93
+ *
94
+ * Omitted or undefined options will leave the corresponding configuration values unchanged.
95
+ *
96
+ * @param {Object=} config - The configuration object. May only contain the options that need to be
97
+ * updated. Supported keys:
98
+ *
99
+ * * `objectMaxDepth` **{Number}** - The max depth for stringifying objects. Setting to a
100
+ * non-positive or non-numeric value, removes the max depth limit.
101
+ * Default: 5
102
+ */
103
+ function errorHandlingConfig(config) {
104
+ if (isObject(config)) {
105
+ if (isDefined(config.objectMaxDepth)) {
106
+ minErrConfig.objectMaxDepth = isValidObjectMaxDepth(config.objectMaxDepth) ? config.objectMaxDepth : NaN;
107
+ }
108
+ } else {
109
+ return minErrConfig;
110
+ }
111
+ }
112
+
113
+ /**
114
+ * @private
115
+ * @param {Number} maxDepth
116
+ * @return {boolean}
117
+ */
118
+ function isValidObjectMaxDepth(maxDepth) {
119
+ return isNumber(maxDepth) && maxDepth > 0;
120
+ }
121
+
38
122
  /**
39
123
  * @description
40
124
  *
@@ -68,31 +152,29 @@ function toDebugString(obj) {
68
152
  function minErr(module, ErrorConstructor) {
69
153
  ErrorConstructor = ErrorConstructor || Error;
70
154
  return function() {
71
- var SKIP_INDEXES = 2;
72
-
73
- var templateArgs = arguments,
74
- code = templateArgs[0],
155
+ var code = arguments[0],
156
+ template = arguments[1],
75
157
  message = '[' + (module ? module + ':' : '') + code + '] ',
76
- template = templateArgs[1],
158
+ templateArgs = sliceArgs(arguments, 2).map(function(arg) {
159
+ return toDebugString(arg, minErrConfig.objectMaxDepth);
160
+ }),
77
161
  paramPrefix, i;
78
162
 
79
163
  message += template.replace(/\{\d+\}/g, function(match) {
80
- var index = +match.slice(1, -1),
81
- shiftedIndex = index + SKIP_INDEXES;
164
+ var index = +match.slice(1, -1);
82
165
 
83
- if (shiftedIndex < templateArgs.length) {
84
- return toDebugString(templateArgs[shiftedIndex]);
166
+ if (index < templateArgs.length) {
167
+ return templateArgs[index];
85
168
  }
86
169
 
87
170
  return match;
88
171
  });
89
172
 
90
- message += '\nhttp://errors.angularjs.org/1.6.2/' +
173
+ message += '\nhttp://errors.angularjs.org/1.6.8/' +
91
174
  (module ? module + '/' : '') + code;
92
175
 
93
- for (i = SKIP_INDEXES, paramPrefix = '?'; i < templateArgs.length; i++, paramPrefix = '&') {
94
- message += paramPrefix + 'p' + (i - SKIP_INDEXES) + '=' +
95
- encodeURIComponent(toDebugString(templateArgs[i]));
176
+ for (i = 0, paramPrefix = '?'; i < templateArgs.length; i++, paramPrefix = '&') {
177
+ message += paramPrefix + 'p' + i + '=' + encodeURIComponent(templateArgs[i]);
96
178
  }
97
179
 
98
180
  return new ErrorConstructor(message);
@@ -178,6 +260,9 @@ function setupModuleLoader(window) {
178
260
  * @returns {angular.Module} new module with the {@link angular.Module} api.
179
261
  */
180
262
  return function module(name, requires, configFn) {
263
+
264
+ var info = {};
265
+
181
266
  var assertNotHasOwnProperty = function(name, context) {
182
267
  if (name === 'hasOwnProperty') {
183
268
  throw ngMinErr('badname', 'hasOwnProperty is not a valid {0} name', context);
@@ -213,6 +298,45 @@ function setupModuleLoader(window) {
213
298
  _configBlocks: configBlocks,
214
299
  _runBlocks: runBlocks,
215
300
 
301
+ /**
302
+ * @ngdoc method
303
+ * @name angular.Module#info
304
+ * @module ng
305
+ *
306
+ * @param {Object=} info Information about the module
307
+ * @returns {Object|Module} The current info object for this module if called as a getter,
308
+ * or `this` if called as a setter.
309
+ *
310
+ * @description
311
+ * Read and write custom information about this module.
312
+ * For example you could put the version of the module in here.
313
+ *
314
+ * ```js
315
+ * angular.module('myModule', []).info({ version: '1.0.0' });
316
+ * ```
317
+ *
318
+ * The version could then be read back out by accessing the module elsewhere:
319
+ *
320
+ * ```
321
+ * var version = angular.module('myModule').info().version;
322
+ * ```
323
+ *
324
+ * You can also retrieve this information during runtime via the
325
+ * {@link $injector#modules `$injector.modules`} property:
326
+ *
327
+ * ```js
328
+ * var version = $injector.modules['myModule'].info().version;
329
+ * ```
330
+ */
331
+ info: function(value) {
332
+ if (isDefined(value)) {
333
+ if (!isObject(value)) throw ngMinErr('aobj', 'Argument \'{0}\' must be an object', 'value');
334
+ info = value;
335
+ return this;
336
+ }
337
+ return info;
338
+ },
339
+
216
340
  /**
217
341
  * @ngdoc property
218
342
  * @name angular.Module#requires
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license AngularJS v1.6.2
2
+ * @license AngularJS v1.6.8
3
3
  * (c) 2010-2017 Google, Inc. http://angularjs.org
4
4
  * License: MIT
5
5
  */
@@ -39,7 +39,7 @@ function parseTextLiteral(text) {
39
39
  parsedFn['$$watchDelegate'] = function watchDelegate(scope, listener, objectEquality) {
40
40
  var unwatch = scope['$watch'](noop,
41
41
  function textLiteralWatcher() {
42
- if (isFunction(listener)) { listener(text, text, scope); }
42
+ listener(text, text, scope);
43
43
  unwatch();
44
44
  },
45
45
  objectEquality);
@@ -63,7 +63,7 @@ function subtractOffset(expressionFn, offset) {
63
63
  parsedFn['$$watchDelegate'] = function watchDelegate(scope, listener, objectEquality) {
64
64
  unwatch = scope['$watch'](expressionFn,
65
65
  function pluralExpressionWatchListener(newValue, oldValue) {
66
- if (isFunction(listener)) { listener(minusOffset(newValue), minusOffset(oldValue), scope); }
66
+ listener(minusOffset(newValue), minusOffset(oldValue), scope);
67
67
  },
68
68
  objectEquality);
69
69
  return unwatch;
@@ -137,9 +137,7 @@ MessageSelectorWatchers.prototype.expressionFnListener = function expressionFnLi
137
137
  };
138
138
 
139
139
  MessageSelectorWatchers.prototype.messageFnListener = function messageFnListener(newMessage, oldMessage) {
140
- if (isFunction(this.listener)) {
141
- this.listener.call(null, newMessage, newMessage === oldMessage ? newMessage : this.lastMessage, this.scope);
142
- }
140
+ this.listener.call(null, newMessage, newMessage === oldMessage ? newMessage : this.lastMessage, this.scope);
143
141
  this.lastMessage = newMessage;
144
142
  };
145
143
 
@@ -313,9 +311,7 @@ function InterpolationPartsWatcher(interpolationParts, scope, listener, objectEq
313
311
 
314
312
  InterpolationPartsWatcher.prototype.watchListener = function watchListener(newExpressionValues, oldExpressionValues) {
315
313
  var result = this.interpolationParts.getResult(newExpressionValues);
316
- if (isFunction(this.listener)) {
317
- this.listener.call(null, result, newExpressionValues === oldExpressionValues ? result : this.previousResult, this.scope);
318
- }
314
+ this.listener.call(null, result, newExpressionValues === oldExpressionValues ? result : this.previousResult, this.scope);
319
315
  this.previousResult = result;
320
316
  };
321
317
 
@@ -1060,6 +1056,7 @@ var toJson;
1060
1056
  var $$stringify;
1061
1057
 
1062
1058
  var module = window['angular']['module']('ngMessageFormat', ['ng']);
1059
+ module['info']({ 'angularVersion': '1.6.8' });
1063
1060
  module['factory']('$$messageFormat', $$MessageFormatFactory);
1064
1061
  module['config'](['$provide', function($provide) {
1065
1062
  $interpolateMinErr = window['angular']['$interpolateMinErr'];