@angular-wave/angular.ts 0.0.38 → 0.0.40

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.
Files changed (263) hide show
  1. package/Makefile +8 -5
  2. package/README.md +1 -1
  3. package/dist/angular-ts.esm.js +2 -1
  4. package/dist/angular-ts.umd.js +2 -1
  5. package/package.json +2 -4
  6. package/rollup.config.js +11 -2
  7. package/src/angular.spec.js +25 -26
  8. package/src/animations/animate-css-driver.js +3 -3
  9. package/src/animations/animate-queue.js +7 -7
  10. package/src/animations/animation.js +2 -2
  11. package/src/animations/shared.js +6 -6
  12. package/src/binding.spec.js +7 -7
  13. package/src/core/animate/animate.js +5 -5
  14. package/src/core/animate/animate.spec.js +31 -31
  15. package/src/core/cache/cache-factory.html +18 -0
  16. package/src/core/cache/{cache-factor.test.js → cache-factory.test.js} +1 -1
  17. package/src/core/compile/compile.js +31 -25
  18. package/src/core/compile/compile.md +2 -2
  19. package/src/core/cookie-reader.spec.js +2 -2
  20. package/src/core/core.html +22 -0
  21. package/src/core/core.test.js +12 -0
  22. package/src/core/document.spec.js +4 -4
  23. package/src/core/exception-handler.js +30 -23
  24. package/src/core/interpolate/interpolate.js +7 -0
  25. package/src/core/{cache/cache-factor.html → location/location.html} +1 -1
  26. package/src/core/location/location.js +2 -2
  27. package/src/core/location/location.spec.js +17 -17
  28. package/src/core/location/location.test.js +12 -0
  29. package/src/core/on.spec.js +3 -3
  30. package/src/core/parser/parse.html +18 -0
  31. package/src/core/parser/parse.spec.js +1 -1
  32. package/src/core/parser/parse.test.js +12 -0
  33. package/src/core/prop.spec.js +3 -4
  34. package/src/core/pubsub/pubsub.html +18 -0
  35. package/src/core/pubsub/pubsub.spec.js +1 -1
  36. package/src/core/pubsub/pubsub.test.js +12 -0
  37. package/src/core/q/q.html +18 -0
  38. package/src/core/q/q.js +33 -0
  39. package/src/core/q/q.test.js +0 -0
  40. package/src/core/root-element.spec.js +4 -4
  41. package/src/core/sanitize/sanitize-uri.spec.js +1 -1
  42. package/src/core/sanitize/sanitize-uri.test.js +12 -0
  43. package/src/core/sanitize/sanitize.html +21 -0
  44. package/src/core/sce/sce.html +18 -0
  45. package/src/core/sce/sce.spec.js +2 -1
  46. package/src/core/sce/sce.test.js +12 -0
  47. package/src/core/scope/scope.html +18 -0
  48. package/src/core/scope/scope.js +5 -8
  49. package/src/core/scope/scope.spec.js +1 -1
  50. package/src/core/scope/scope.test.js +12 -0
  51. package/src/core/task-tracker-factory.js +9 -11
  52. package/src/core/timeout/timeout.html +18 -0
  53. package/src/core/timeout/timeout.js +9 -0
  54. package/src/core/timeout/timeout.spec.js +2 -2
  55. package/src/core/timeout/timout.test.js +12 -0
  56. package/src/core/url-utils/url-utils.html +18 -0
  57. package/src/core/url-utils/url-utils.spec.js +4 -2
  58. package/src/core/url-utils/url-utils.test.js +12 -0
  59. package/src/directive/attrs/attrs.spec.js +1 -2
  60. package/src/directive/attrs/boolean.spec.js +1 -2
  61. package/src/directive/attrs/element-style.spec.js +6 -7
  62. package/src/directive/attrs/src.spec.js +1 -2
  63. package/src/directive/bind/bind.spec.js +1 -2
  64. package/src/directive/class/class.spec.js +15 -16
  65. package/src/directive/cloak/cloak.spec.js +3 -4
  66. package/src/directive/controller/controller.spec.js +4 -5
  67. package/src/directive/events/click.spec.js +1 -2
  68. package/src/directive/events/event.spec.js +1 -1
  69. package/src/directive/events/events.js +7 -0
  70. package/src/directive/form/form.spec.js +17 -17
  71. package/src/directive/if/if.spec.js +2 -2
  72. package/src/directive/include/include.js +2 -2
  73. package/src/directive/include/include.spec.js +32 -32
  74. package/src/directive/init/init.spec.js +2 -3
  75. package/src/directive/input/input.spec.js +3 -3
  76. package/src/directive/list/list.spec.js +1 -2
  77. package/src/directive/model/model.js +13 -0
  78. package/src/directive/model/model.spec.js +4 -5
  79. package/src/directive/model-options/model-options.spec.js +3 -3
  80. package/src/directive/non-bindable/non-bindable.spec.js +1 -2
  81. package/src/directive/options/options.js +5 -5
  82. package/src/directive/options/options.spec.js +13 -13
  83. package/src/directive/ref/href.spec.js +1 -2
  84. package/src/directive/repeat/repeat.spec.js +12 -12
  85. package/src/directive/script/script.spec.js +2 -3
  86. package/src/directive/select/select.js +6 -6
  87. package/src/directive/select/select.spec.js +5 -5
  88. package/src/directive/show-hide/show-hide.spec.js +12 -13
  89. package/src/directive/style/style.spec.js +3 -4
  90. package/src/directive/switch/switch.spec.js +2 -3
  91. package/src/directive/validators/validators.spec.js +1 -1
  92. package/src/exts/aria/aria.spec.js +1 -2
  93. package/src/exts/messages/messages.spec.js +5 -5
  94. package/src/filters/filter.spec.js +5 -5
  95. package/src/filters/filters.html +21 -0
  96. package/src/filters/filters.spec.js +3 -3
  97. package/src/filters/filters.test.js +12 -0
  98. package/src/filters/limit-to.md +1 -1
  99. package/src/filters/limit-to.spec.js +4 -4
  100. package/src/filters/order-by.spec.js +2 -2
  101. package/src/index.js +462 -1
  102. package/src/loader.js +62 -17
  103. package/src/public.js +6 -2
  104. package/src/router/directives/state-directives.spec.js +90 -90
  105. package/src/router/directives/view-directive.js +2 -2
  106. package/src/router/directives/view-directive.spec.js +9 -9
  107. package/src/router/state/state.spec.js +2 -4
  108. package/src/router/template-factory.spec.js +2 -2
  109. package/src/router/transition/hook-registry.js +2 -2
  110. package/src/router/view/view.spec.js +1 -1
  111. package/src/services/browser.js +56 -39
  112. package/src/services/document.js +16 -13
  113. package/src/services/log.js +39 -43
  114. package/src/services/template-request.js +9 -0
  115. package/src/shared/common.js +0 -3
  116. package/src/shared/jqlite/jqlite.js +83 -89
  117. package/src/shared/jqlite/jqlite.spec.js +218 -222
  118. package/src/shared/strings.js +2 -2
  119. package/src/shared/test-utils.js +2 -2
  120. package/src/shared/utils.js +8 -11
  121. package/src/src.test.js +10 -0
  122. package/tsconfig.json +1 -1
  123. package/tsconfig.types.json +11 -0
  124. package/types/animations/animate-cache.d.ts +7 -7
  125. package/types/animations/animate-children-directive.d.ts +3 -6
  126. package/types/animations/animate-swap.d.ts +7 -16
  127. package/types/animations/animation.d.ts +2 -11
  128. package/types/animations/raf-scheduler.d.ts +3 -3
  129. package/types/animations/shared.d.ts +9 -24
  130. package/types/core/{animate-css.d.ts → animate/animate-css.d.ts} +2 -8
  131. package/types/core/{cache.d.ts → cache/cache.d.ts} +5 -5
  132. package/types/core/compile/compile.d.ts +173 -0
  133. package/types/core/controller/controller.d.ts +32 -0
  134. package/types/core/exception-handler.d.ts +9 -42
  135. package/types/core/filter/filter.d.ts +9 -0
  136. package/types/core/{interpolate.d.ts → interpolate/interpolate.d.ts} +23 -39
  137. package/types/core/interval/interval-factory.d.ts +4 -0
  138. package/types/core/{interval.d.ts → interval/interval.d.ts} +1 -1
  139. package/types/core/location/location.d.ts +209 -0
  140. package/types/core/pubsub/pubsub.d.ts +156 -0
  141. package/types/core/q/q.d.ts +65 -0
  142. package/types/core/sanitize/sanitize-uri.d.ts +53 -0
  143. package/types/core/{sce.d.ts → sce/sce.d.ts} +80 -86
  144. package/types/core/scope/scope.d.ts +727 -0
  145. package/types/core/task-tracker-factory.d.ts +45 -38
  146. package/types/core/timeout/timeout.d.ts +29 -0
  147. package/types/core/{urlUtils.d.ts → url-utils/url-utils.d.ts} +2 -7
  148. package/types/directive/{bind.d.ts → bind/bind.d.ts} +4 -10
  149. package/types/directive/{class.d.ts → class/class.d.ts} +12 -21
  150. package/types/directive/controller/controller.d.ts +6 -0
  151. package/types/directive/events/events.d.ts +5 -0
  152. package/types/directive/form/form.d.ts +200 -0
  153. package/types/directive/if/if.d.ts +8 -0
  154. package/types/directive/include/include.d.ts +14 -0
  155. package/types/directive/{input.d.ts → input/input.d.ts} +20 -69
  156. package/types/directive/{model.d.ts → model/model.d.ts} +281 -280
  157. package/types/directive/options/options.d.ts +9 -0
  158. package/types/directive/ref/ref.d.ts +5 -0
  159. package/types/directive/repeat/repeat.d.ts +8 -0
  160. package/types/directive/{script.d.ts → script/script.d.ts} +5 -8
  161. package/types/directive/{show-hide.d.ts → show-hide/show-hide.d.ts} +10 -16
  162. package/types/directive/switch/switch.d.ts +17 -0
  163. package/types/directive/transclude/transclude.d.ts +4 -0
  164. package/types/directive/{validators.d.ts → validators/validators.d.ts} +20 -35
  165. package/types/filters/filters.d.ts +10 -16
  166. package/types/filters/order-by.d.ts +2 -4
  167. package/types/index.d.ts +702 -0
  168. package/types/injector.d.ts +12 -0
  169. package/types/public.d.ts +5 -0
  170. package/types/router/common/coreservices.d.ts +2 -2
  171. package/types/router/common/glob.d.ts +9 -9
  172. package/types/router/common/queue.d.ts +13 -13
  173. package/types/router/common/trace.d.ts +43 -43
  174. package/types/router/directives/view-directive.d.ts +13 -32
  175. package/types/router/globals.d.ts +20 -20
  176. package/types/router/hooks/lazy-load.d.ts +2 -11
  177. package/types/router/hooks/redirect-to.d.ts +1 -4
  178. package/types/router/hooks/url.d.ts +1 -5
  179. package/types/router/hooks/views.d.ts +1 -4
  180. package/types/router/params/param-factory.d.ts +5 -5
  181. package/types/router/params/param-type.d.ts +35 -35
  182. package/types/router/params/param-types.d.ts +11 -11
  183. package/types/router/params/param.d.ts +38 -38
  184. package/types/router/params/state-params.d.ts +10 -10
  185. package/types/router/path/path-node.d.ts +34 -34
  186. package/types/router/path/path-utils.d.ts +73 -77
  187. package/types/router/resolve/resolvable.d.ts +32 -32
  188. package/types/router/resolve/resolve-context.d.ts +84 -84
  189. package/types/router/services.d.ts +4 -9
  190. package/types/router/state/state-builder.d.ts +27 -27
  191. package/types/router/state/state-matcher.d.ts +5 -5
  192. package/types/router/state/state-object.d.ts +58 -58
  193. package/types/router/state/state-queue-manager.d.ts +10 -16
  194. package/types/router/state/state-registry.d.ts +100 -107
  195. package/types/router/state/state-service.d.ts +411 -411
  196. package/types/router/state/target-state.d.ts +64 -69
  197. package/types/router/state/views.d.ts +31 -37
  198. package/types/router/state-filters.d.ts +7 -7
  199. package/types/router/state-provider.d.ts +105 -105
  200. package/types/router/template-factory.d.ts +83 -112
  201. package/types/router/transition/hook-builder.d.ts +25 -25
  202. package/types/router/transition/hook-registry.d.ts +68 -83
  203. package/types/router/transition/interface.d.ts +7 -7
  204. package/types/router/transition/reject-factory.d.ts +34 -34
  205. package/types/router/transition/transition-event-type.d.ts +9 -18
  206. package/types/router/transition/transition-hook.d.ts +77 -82
  207. package/types/router/transition/transition-service.d.ts +82 -99
  208. package/types/router/transition/transition.d.ts +369 -377
  209. package/types/router/url/url-config.d.ts +84 -84
  210. package/types/router/url/url-matcher.d.ts +115 -119
  211. package/types/router/url/url-rule.d.ts +114 -124
  212. package/types/router/url/url-rules.d.ts +217 -217
  213. package/types/router/url/url-service.d.ts +264 -269
  214. package/types/router/view/view.d.ts +114 -117
  215. package/types/router/view-scroll.d.ts +2 -2
  216. package/types/services/anchor-scroll.d.ts +2 -8
  217. package/types/services/browser.d.ts +157 -135
  218. package/types/services/cache-factory.d.ts +25 -25
  219. package/types/services/cookie-reader.d.ts +2 -2
  220. package/types/services/document.d.ts +13 -9
  221. package/types/services/http/http.d.ts +145 -0
  222. package/types/services/{http-backend.d.ts → http-backend/http-backend.d.ts} +3 -35
  223. package/types/services/log.d.ts +55 -52
  224. package/types/services/template-request.d.ts +44 -53
  225. package/types/shared/common.d.ts +4 -20
  226. package/types/{constants.d.ts → shared/constants.d.ts} +6 -6
  227. package/types/shared/hof.d.ts +1 -1
  228. package/types/{jqLite.d.ts → shared/jqlite/jqlite.d.ts} +16 -17
  229. package/types/shared/test-utils.d.ts +11 -0
  230. package/types/shared/utils.d.ts +29 -46
  231. package/types-back/global.d.ts +3 -1
  232. package/types-back/index.d.ts +3 -296
  233. package/types/core/compile.d.ts +0 -206
  234. package/types/core/controller.d.ts +0 -42
  235. package/types/core/filter.d.ts +0 -9
  236. package/types/core/interval-factory.d.ts +0 -21
  237. package/types/core/location.d.ts +0 -234
  238. package/types/core/pubsub.d.ts +0 -164
  239. package/types/core/q.d.ts +0 -33
  240. package/types/core/root-scope.d.ts +0 -754
  241. package/types/core/sanitize-uri.d.ts +0 -57
  242. package/types/core/timeout.d.ts +0 -31
  243. package/types/directive/controller.d.ts +0 -6
  244. package/types/directive/events.d.ts +0 -12
  245. package/types/directive/form.d.ts +0 -230
  246. package/types/directive/if.d.ts +0 -17
  247. package/types/directive/include.d.ts +0 -33
  248. package/types/directive/options.d.ts +0 -16
  249. package/types/directive/ref.d.ts +0 -11
  250. package/types/directive/repeat.d.ts +0 -23
  251. package/types/directive/switch.d.ts +0 -23
  252. package/types/directive/transclude.d.ts +0 -15
  253. package/types/services/http.d.ts +0 -157
  254. /package/src/core/cache/{cache-factor.spec.js → cache-factory.spec.js} +0 -0
  255. /package/types/directive/{attrs.d.ts → attrs/attrs.d.ts} +0 -0
  256. /package/types/directive/{change.d.ts → change/change.d.ts} +0 -0
  257. /package/types/directive/{cloak.d.ts → cloak/cloak.d.ts} +0 -0
  258. /package/types/directive/{init.d.ts → init/init.d.ts} +0 -0
  259. /package/types/directive/{list.d.ts → list/list.d.ts} +0 -0
  260. /package/types/directive/{non-bindable.d.ts → non-bindable/non-bindable.d.ts} +0 -0
  261. /package/types/directive/{style.d.ts → style/style.d.ts} +0 -0
  262. /package/types/exts/{aria.d.ts → aria/aria.d.ts} +0 -0
  263. /package/types/exts/{messages.d.ts → messages/messages.d.ts} +0 -0
@@ -17,7 +17,6 @@ import {
17
17
  import { CACHE, EXPANDO } from "../../core/cache/cache";
18
18
 
19
19
  /**
20
- * @ngdoc function
21
20
  * @name angular.element
22
21
  * @module ng
23
22
  * @kind function
@@ -26,24 +25,23 @@ import { CACHE, EXPANDO } from "../../core/cache/cache";
26
25
  * Wraps a raw DOM element or HTML string as a [jQuery](http://jquery.com) element. Regardless of the presence of jQuery, `angular.element`
27
26
  * delegates to AngularJS's built-in subset of jQuery, called "jQuery lite" or **jqLite**.
28
27
  *
29
- * jqLite is a tiny, API-compatible subset of jQuery that allows
30
- * AngularJS to manipulate the DOM in a cross-browser compatible way. jqLite implements only the most
28
+ * JQLite is a tiny, API-compatible subset of jQuery that allows
29
+ * AngularJS to manipulate the DOM in a cross-browser compatible way. JQLite implements only the most
31
30
  * commonly needed functionality with the goal of having a very small footprint.
32
31
  *
33
- *
34
32
  * <div class="alert alert-info">**Note:** All element references in AngularJS are always wrapped with
35
- * jqLite (such as the element argument in a directive's compile / link function). They are never raw DOM references.</div>
33
+ * JQLite (such as the element argument in a directive's compile / link function). They are never raw DOM references.</div>
36
34
  *
37
35
  * <div class="alert alert-warning">**Note:** Keep in mind that this function will not find elements
38
36
  * by tag name / CSS selector. For lookups by tag name, try instead `angular.element(document).find(...)`
39
37
  * or `$document.find()`, or use the standard DOM APIs, e.g. `document.querySelectorAll()`.</div>
40
38
  *
41
- * ## AngularJS's jqLite
42
- * jqLite provides only the following jQuery methods:
39
+ * ## AngularJS's JQLite
40
+ * JQLite provides only the following jQuery methods:
43
41
  *
44
42
  * - [`after()`](http://api.jquery.com/after/)
45
43
  * - [`append()`](http://api.jquery.com/append/) - Contrary to jQuery, this doesn't clone elements
46
- * so will not work correctly when invoked on a jqLite object containing more than one DOM node
44
+ * so will not work correctly when invoked on a JQLite object containing more than one DOM node
47
45
  * - [`attr()`](http://api.jquery.com/attr/) - Does not support functions as parameters
48
46
  * - [`children()`](http://api.jquery.com/children/) - Does not support selectors
49
47
  * - [`data()`](http://api.jquery.com/data/)
@@ -63,10 +61,10 @@ import { CACHE, EXPANDO } from "../../core/cache/cache";
63
61
  * - [`val()`](http://api.jquery.com/val/)
64
62
  *
65
63
  * ## jQuery/jqLite Extras
66
- * AngularJS also provides the following additional methods and events to both jQuery and jqLite:
64
+ * AngularJS also provides the following additional methods and events to both jQuery and JQLite:
67
65
  *
68
66
  * ### Events
69
- * - `$destroy` - AngularJS intercepts all jqLite/jQuery's DOM destruction apis and fires this event
67
+ * - `$destroy` - AngularJS intercepts all JQLite/jQuery's DOM destruction apis and fires this event
70
68
  * on all DOM nodes being removed. This can be used to clean up any 3rd party bindings to the DOM
71
69
  * element before it is removed.
72
70
  *
@@ -93,6 +91,7 @@ import { CACHE, EXPANDO } from "../../core/cache/cache";
93
91
  * @returns {Object} jQuery object.
94
92
  */
95
93
 
94
+ /** @type {number} */
96
95
  let jqId = 1;
97
96
 
98
97
  function jqNextId() {
@@ -102,7 +101,7 @@ function jqNextId() {
102
101
  const DASH_LOWERCASE_REGEXP = /-([a-z])/g;
103
102
  const UNDERSCORE_LOWERCASE_REGEXP = /_([a-z])/g;
104
103
  const MOUSE_EVENT_MAP = { mouseleave: "mouseout", mouseenter: "mouseover" };
105
- const jqLiteMinErr = minErr("jqLite");
104
+ const JQLiteMinErr = minErr("jqLite");
106
105
 
107
106
  /**
108
107
  * @param {string} _all
@@ -180,7 +179,7 @@ function elementAcceptsData(node) {
180
179
  }
181
180
  }
182
181
 
183
- export function jqLiteBuildFragment(html, context) {
182
+ export function JQLiteBuildFragment(html, context) {
184
183
  let tmp;
185
184
  let tag;
186
185
  let wrap;
@@ -225,7 +224,7 @@ export function jqLiteBuildFragment(html, context) {
225
224
  return fragment;
226
225
  }
227
226
 
228
- function jqLiteParseHTML(html, context) {
227
+ function JQLiteParseHTML(html, context) {
229
228
  context = context || window.document;
230
229
  let parsed;
231
230
 
@@ -233,20 +232,13 @@ function jqLiteParseHTML(html, context) {
233
232
  return [context.createElement(parsed[1])];
234
233
  }
235
234
 
236
- if ((parsed = jqLiteBuildFragment(html, context))) {
235
+ if ((parsed = JQLiteBuildFragment(html, context))) {
237
236
  return parsed.childNodes;
238
237
  }
239
238
 
240
239
  return [];
241
240
  }
242
241
 
243
- // IE9-11 has no method "contains" in SVG element and in Node.prototype. Bug #10259.
244
- const jqLiteContains =
245
- window.Node.prototype.contains ||
246
- function (arg) {
247
- return !!(this.compareDocumentPosition(arg) & 16);
248
- };
249
-
250
242
  /// //////////////////////////////////////////
251
243
  export function JQLite(element) {
252
244
  if (element instanceof JQLite) {
@@ -261,26 +253,23 @@ export function JQLite(element) {
261
253
  }
262
254
  if (!(this instanceof JQLite)) {
263
255
  if (argIsString && element.charAt(0) !== "<") {
264
- throw jqLiteMinErr(
256
+ throw JQLiteMinErr(
265
257
  "nosel",
266
- "Looking up elements via selectors is not supported by jqLite! See: http://docs.angularjs.org/api/angular.element",
258
+ "Looking up elements via selectors is not supported by JQLite! See: http://docs.angularjs.org/api/angular.element",
267
259
  );
268
260
  }
269
261
  return new JQLite(element);
270
262
  }
271
263
 
272
264
  if (argIsString) {
273
- const parsed = jqLiteParseHTML(element);
265
+ const parsed = JQLiteParseHTML(element);
274
266
  addNodes(this, parsed);
275
267
  } else if (isFunction(element)) {
276
- jqLiteReady(element);
268
+ JQLiteReady(element);
277
269
  } else {
278
270
  addNodes(this, element);
279
271
  }
280
272
  }
281
- export var jqLite = JQLite;
282
-
283
- jqLite.CACHE = CACHE;
284
273
 
285
274
  /**
286
275
  * @param {Element} element
@@ -290,10 +279,10 @@ jqLite.CACHE = CACHE;
290
279
  export function dealoc(element, onlyDescendants) {
291
280
  if (!element) return;
292
281
  if (!onlyDescendants && elementAcceptsData(element))
293
- jqLiteCleanData([element]);
282
+ JQLiteCleanData([element]);
294
283
 
295
284
  if (element.querySelectorAll) {
296
- jqLiteCleanData(element.querySelectorAll("*"));
285
+ JQLiteCleanData(element.querySelectorAll("*"));
297
286
  }
298
287
  }
299
288
 
@@ -316,14 +305,14 @@ function removeIfEmptyData(element) {
316
305
  }
317
306
  }
318
307
 
319
- function jqLiteOff(element, type, fn, unsupported) {
308
+ function JQLiteOff(element, type, fn, unsupported) {
320
309
  if (isDefined(unsupported))
321
- throw jqLiteMinErr(
310
+ throw JQLiteMinErr(
322
311
  "offargs",
323
312
  "jqLite#off() does not support the `selector` argument",
324
313
  );
325
314
 
326
- const expandoStore = jqLiteExpandoStore(element);
315
+ const expandoStore = JQLiteExpandoStore(element);
327
316
  const events = expandoStore && expandoStore.events;
328
317
  const handle = expandoStore && expandoStore.handle;
329
318
 
@@ -366,7 +355,7 @@ function jqLiteOff(element, type, fn, unsupported) {
366
355
  * @param {Element} element
367
356
  * @param {string} [name] - key of field to remove
368
357
  */
369
- function jqLiteRemoveData(element, name) {
358
+ function JQLiteRemoveData(element, name) {
370
359
  const expandoId = element[EXPANDO];
371
360
  const expandoStore = expandoId && CACHE.get(expandoId);
372
361
 
@@ -382,12 +371,15 @@ function jqLiteRemoveData(element, name) {
382
371
  }
383
372
 
384
373
  /**
374
+ * Stores data associated with an element inside the expando property of the DOM element.
375
+ *
376
+ * @see {@link https://developer.mozilla.org/en-US/docs/Glossary/Expando MDN Glossary: Expando}
385
377
  *
386
378
  * @param {Element} element
387
- * @param {boolean} createIfNecessary
388
- * @returns {import("./core/cache").ExpandoStore}
379
+ * @param {boolean} [createIfNecessary=false]
380
+ * @returns {import("../../core/cache/cache").ExpandoStore}
389
381
  */
390
- function jqLiteExpandoStore(element, createIfNecessary = false) {
382
+ function JQLiteExpandoStore(element, createIfNecessary = false) {
391
383
  let expandoId = element[EXPANDO];
392
384
  let expandoStore = expandoId && CACHE.get(expandoId);
393
385
 
@@ -404,14 +396,14 @@ function jqLiteExpandoStore(element, createIfNecessary = false) {
404
396
  return expandoStore;
405
397
  }
406
398
 
407
- function jqLiteData(element, key, value) {
399
+ function JQLiteData(element, key, value) {
408
400
  if (elementAcceptsData(element)) {
409
401
  let prop;
410
402
 
411
403
  const isSimpleSetter = isDefined(value);
412
404
  const isSimpleGetter = !isSimpleSetter && key && !isObject(key);
413
405
  const massGetter = !key;
414
- const expandoStore = jqLiteExpandoStore(element, !isSimpleGetter);
406
+ const expandoStore = JQLiteExpandoStore(element, !isSimpleGetter);
415
407
  const data = expandoStore && expandoStore.data;
416
408
 
417
409
  if (isSimpleSetter) {
@@ -462,11 +454,11 @@ function addNodes(root, elements) {
462
454
  }
463
455
  }
464
456
 
465
- function jqLiteController(element, name) {
466
- return jqLiteInheritedData(element, `$${name || "ngController"}Controller`);
457
+ function JQLiteController(element, name) {
458
+ return JQLiteInheritedData(element, `$${name || "ngController"}Controller`);
467
459
  }
468
460
 
469
- function jqLiteInheritedData(element, name, value) {
461
+ function JQLiteInheritedData(element, name, value) {
470
462
  // if element is the document object work with the html element instead
471
463
  // this makes $(document).scope() possible
472
464
  if (element.nodeType === Node.DOCUMENT_NODE) {
@@ -476,7 +468,7 @@ function jqLiteInheritedData(element, name, value) {
476
468
 
477
469
  while (element) {
478
470
  for (let i = 0, ii = names.length; i < ii; i++) {
479
- if (isDefined((value = jqLiteData(element, names[i])))) return value;
471
+ if (isDefined((value = JQLiteData(element, names[i])))) return value;
480
472
  }
481
473
 
482
474
  // If dealing with a document fragment node with a host element, and no parent, use the host
@@ -488,20 +480,20 @@ function jqLiteInheritedData(element, name, value) {
488
480
  }
489
481
  }
490
482
 
491
- function jqLiteEmpty(element) {
483
+ function JQLiteEmpty(element) {
492
484
  dealoc(element, true);
493
485
  while (element.firstChild) {
494
486
  element.removeChild(element.firstChild);
495
487
  }
496
488
  }
497
489
 
498
- export function jqLiteRemove(element, keepData) {
490
+ export function JQLiteRemove(element, keepData) {
499
491
  if (!keepData) dealoc(element);
500
492
  const parent = element.parentNode;
501
493
  if (parent) parent.removeChild(element);
502
494
  }
503
495
 
504
- function jqLiteReady(fn) {
496
+ function JQLiteReady(fn) {
505
497
  function trigger() {
506
498
  window.document.removeEventListener("DOMContentLoaded", trigger);
507
499
  window.removeEventListener("load", trigger);
@@ -512,7 +504,7 @@ function jqLiteReady(fn) {
512
504
  if (window.document.readyState === "complete") {
513
505
  window.setTimeout(fn);
514
506
  } else {
515
- // We can not use jqLite since we are not done loading and jQuery could be loaded later.
507
+ // We can not use JQLite since we are not done loading and jQuery could be loaded later.
516
508
 
517
509
  // Works for modern browsers and IE9
518
510
  window.document.addEventListener("DOMContentLoaded", trigger);
@@ -526,7 +518,7 @@ function jqLiteReady(fn) {
526
518
  // Functions which are declared directly.
527
519
  /// ///////////////////////////////////////
528
520
  JQLite.prototype = {
529
- ready: jqLiteReady,
521
+ ready: JQLiteReady,
530
522
  toString() {
531
523
  const value = [];
532
524
  forEach(this, (e) => {
@@ -536,7 +528,7 @@ JQLite.prototype = {
536
528
  },
537
529
 
538
530
  eq(index) {
539
- return index >= 0 ? jqLite(this[index]) : jqLite(this[this.length + index]);
531
+ return index >= 0 ? JQLite(this[index]) : JQLite(this[this.length + index]);
540
532
  },
541
533
 
542
534
  length: 0,
@@ -571,22 +563,22 @@ export function getBooleanAttrName(element, name) {
571
563
  return booleanAttr && BOOLEAN_ELEMENTS[nodeName_(element)] && booleanAttr;
572
564
  }
573
565
 
574
- export function jqLiteCleanData(nodes) {
566
+ export function JQLiteCleanData(nodes) {
575
567
  for (let i = 0, ii = nodes.length; i < ii; i++) {
576
568
  var events = (CACHE.get(nodes[i][EXPANDO]) || {}).events;
577
569
  if (events && events.$destroy) {
578
- jqLite(nodes[i]).triggerHandler("$destroy");
570
+ JQLite(nodes[i]).triggerHandler("$destroy");
579
571
  }
580
- jqLiteRemoveData(nodes[i]);
581
- jqLiteOff(nodes[i]);
572
+ JQLiteRemoveData(nodes[i]);
573
+ JQLiteOff(nodes[i]);
582
574
  }
583
575
  }
584
576
 
585
577
  forEach(
586
578
  {
587
- data: jqLiteData,
588
- removeData: jqLiteRemoveData,
589
- cleanData: jqLiteCleanData,
579
+ data: JQLiteData,
580
+ removeData: JQLiteRemoveData,
581
+ cleanData: JQLiteCleanData,
590
582
  },
591
583
  (fn, name) => {
592
584
  JQLite[name] = fn;
@@ -595,14 +587,14 @@ forEach(
595
587
 
596
588
  forEach(
597
589
  {
598
- data: jqLiteData,
599
- inheritedData: jqLiteInheritedData,
590
+ data: JQLiteData,
591
+ inheritedData: JQLiteInheritedData,
600
592
 
601
593
  scope(element) {
602
- // Can't use jqLiteData here directly so we stay compatible with jQuery!
594
+ // Can't use JQLiteData here directly so we stay compatible with jQuery!
603
595
  return (
604
- jqLiteData(element, "$scope") ||
605
- jqLiteInheritedData(element.parentNode || element, [
596
+ JQLiteData(element, "$scope") ||
597
+ JQLiteInheritedData(element.parentNode || element, [
606
598
  "$isolateScope",
607
599
  "$scope",
608
600
  ])
@@ -610,17 +602,17 @@ forEach(
610
602
  },
611
603
 
612
604
  isolateScope(element) {
613
- // Can't use jqLiteData here directly so we stay compatible with jQuery!
605
+ // Can't use JQLiteData here directly so we stay compatible with jQuery!
614
606
  return (
615
- jqLiteData(element, "$isolateScope") ||
616
- jqLiteData(element, "$isolateScopeNoTemplate")
607
+ JQLiteData(element, "$isolateScope") ||
608
+ JQLiteData(element, "$isolateScopeNoTemplate")
617
609
  );
618
610
  },
619
611
 
620
- controller: jqLiteController,
612
+ controller: JQLiteController,
621
613
 
622
614
  injector(element) {
623
- return jqLiteInheritedData(element, "$injector");
615
+ return JQLiteInheritedData(element, "$injector");
624
616
  },
625
617
 
626
618
  attr(element, name, value) {
@@ -697,7 +689,7 @@ forEach(
697
689
  element.innerHTML = value;
698
690
  },
699
691
 
700
- empty: jqLiteEmpty,
692
+ empty: JQLiteEmpty,
701
693
  },
702
694
  (fn, name) => {
703
695
  /**
@@ -708,15 +700,15 @@ forEach(
708
700
  let key;
709
701
  const nodeCount = this.length;
710
702
 
711
- // jqLiteEmpty takes no arguments but is a setter.
703
+ // JQLiteEmpty takes no arguments but is a setter.
712
704
  if (
713
- fn !== jqLiteEmpty &&
714
- isUndefined(fn.length === 2 && fn !== jqLiteController ? arg1 : arg2)
705
+ fn !== JQLiteEmpty &&
706
+ isUndefined(fn.length === 2 && fn !== JQLiteController ? arg1 : arg2)
715
707
  ) {
716
708
  if (isObject(arg1)) {
717
709
  // we are a write, but the object properties are the key/values
718
710
  for (i = 0; i < nodeCount; i++) {
719
- if (fn === jqLiteData) {
711
+ if (fn === JQLiteData) {
720
712
  fn(this[i], arg1);
721
713
  } else {
722
714
  for (key in arg1) {
@@ -805,6 +797,11 @@ function defaultHandlerWrapper(element, event, handler) {
805
797
  handler.call(element, event);
806
798
  }
807
799
 
800
+ /**
801
+ * @param {Node} target
802
+ * @param {*} event
803
+ * @param {*} handler
804
+ */
808
805
  function specialMouseHandlerWrapper(target, event, handler) {
809
806
  // Refer to jQuery's implementation of mouseenter & mouseleave
810
807
  // Read about mouseenter and mouseleave:
@@ -812,10 +809,7 @@ function specialMouseHandlerWrapper(target, event, handler) {
812
809
  const related = event.relatedTarget;
813
810
  // For mousenter/leave call the handler if related is outside the target.
814
811
  // NB: No relatedTarget if the mouse left/entered the browser window
815
- if (
816
- !related ||
817
- (related !== target && !jqLiteContains.call(target, related))
818
- ) {
812
+ if (!related || (related !== target && !target.contains(related))) {
819
813
  handler.call(target, event);
820
814
  }
821
815
  }
@@ -827,10 +821,10 @@ function specialMouseHandlerWrapper(target, event, handler) {
827
821
  /// ///////////////////////////////////////
828
822
  forEach(
829
823
  {
830
- removeData: jqLiteRemoveData,
824
+ removeData: JQLiteRemoveData,
831
825
  on: (element, type, fn, unsupported) => {
832
826
  if (isDefined(unsupported))
833
- throw jqLiteMinErr(
827
+ throw JQLiteMinErr(
834
828
  "onargs",
835
829
  "jqLite#on() does not support the `selector` or `eventData` parameters",
836
830
  );
@@ -840,7 +834,7 @@ forEach(
840
834
  return;
841
835
  }
842
836
 
843
- const expandoStore = jqLiteExpandoStore(element, true);
837
+ const expandoStore = JQLiteExpandoStore(element, true);
844
838
  const { events } = expandoStore;
845
839
  let { handle } = expandoStore;
846
840
 
@@ -881,7 +875,7 @@ forEach(
881
875
  }
882
876
  },
883
877
 
884
- off: jqLiteOff,
878
+ off: JQLiteOff,
885
879
 
886
880
  replaceWith(element, replaceNode) {
887
881
  let index;
@@ -928,10 +922,10 @@ forEach(
928
922
  }
929
923
  },
930
924
 
931
- remove: jqLiteRemove,
925
+ remove: JQLiteRemove,
932
926
 
933
927
  detach(element) {
934
- jqLiteRemove(element, true);
928
+ JQLiteRemove(element, true);
935
929
  },
936
930
 
937
931
  after(element, newElement) {
@@ -956,7 +950,7 @@ forEach(
956
950
  : null;
957
951
  },
958
952
 
959
- // TODO: remove after migrating tests away from jqLite
953
+ // TODO: remove after migrating tests away from JQLite
960
954
  find(element, selector) {
961
955
  if (element.getElementsByTagName) {
962
956
  return element.getElementsByTagName(selector);
@@ -969,7 +963,7 @@ forEach(
969
963
  let eventFnsCopy;
970
964
  let handlerArgs;
971
965
  const eventName = event.type || event;
972
- const expandoStore = jqLiteExpandoStore(element);
966
+ const expandoStore = JQLiteExpandoStore(element);
973
967
  const events = expandoStore && expandoStore.events;
974
968
  const eventFns = events && events[eventName];
975
969
 
@@ -1024,7 +1018,7 @@ forEach(
1024
1018
  value = fn(this[i], arg1, arg2, arg3);
1025
1019
  if (isDefined(value)) {
1026
1020
  // any function which returns a value needs to be wrapped
1027
- value = jqLite(value);
1021
+ value = JQLite(value);
1028
1022
  }
1029
1023
  } else {
1030
1024
  addNodes(value, fn(this[i], arg1, arg2, arg3));
@@ -1040,9 +1034,9 @@ forEach(
1040
1034
  * @returns {string} Returns the string representation of the element.
1041
1035
  */
1042
1036
  export function startingTag(elementStr) {
1043
- const clone = jqLite(elementStr)[0].cloneNode(true);
1044
- const element = jqLite(clone).empty();
1045
- var elemHtml = jqLite("<div></div>").append(element).html();
1037
+ const clone = JQLite(elementStr)[0].cloneNode(true);
1038
+ const element = JQLite(clone).empty();
1039
+ var elemHtml = JQLite("<div></div>").append(element).html();
1046
1040
  try {
1047
1041
  return element[0].nodeType === Node.TEXT_NODE
1048
1042
  ? lowercase(elemHtml)
@@ -1059,7 +1053,7 @@ export function startingTag(elementStr) {
1059
1053
  /**
1060
1054
  * Return the DOM siblings between the first and last node in the given array.
1061
1055
  * @param {Array} nodes An array-like object
1062
- * @returns {Array} the inputted object or a jqLite collection containing the nodes
1056
+ * @returns {Array} the inputted object or a JQLite collection containing the nodes
1063
1057
  */
1064
1058
  export function getBlockNodes(nodes) {
1065
1059
  // TODO(perf): update `nodes` instead of creating a new object?
@@ -1071,7 +1065,7 @@ export function getBlockNodes(nodes) {
1071
1065
  if (blockNodes || nodes[i] !== node) {
1072
1066
  if (!blockNodes) {
1073
1067
  // use element to avoid circular dependency
1074
- blockNodes = jqLite(Array.prototype.slice.call(nodes, 0, i));
1068
+ blockNodes = JQLite(Array.prototype.slice.call(nodes, 0, i));
1075
1069
  }
1076
1070
  blockNodes.push(node);
1077
1071
  }