@angular-wave/angular.ts 0.0.40 → 0.0.41

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.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@angular-wave/angular.ts",
3
3
  "license": "MIT",
4
- "version": "0.0.40",
4
+ "version": "0.0.41",
5
5
  "type": "module",
6
6
  "main": "dist/angular-ts.esm.js",
7
7
  "browser": "dist/angular-ts.umd.js",
@@ -1,4 +1,4 @@
1
- import { JQLite } from "../shared/jqlite/jqlite";
1
+ import { getOrSetCacheData, JQLite } from "../shared/jqlite/jqlite";
2
2
  import {
3
3
  isUndefined,
4
4
  forEach,
@@ -757,7 +757,7 @@ export const $$AnimateQueueProvider = [
757
757
  let elementDisabled = disabledElementsLookup.get(node);
758
758
  let animateChildren;
759
759
 
760
- let parentHost = JQLite.data(node, NG_ANIMATE_PIN_DATA);
760
+ let parentHost = getOrSetCacheData(node, NG_ANIMATE_PIN_DATA);
761
761
  if (parentHost) {
762
762
  parentNode = getDomNode(parentHost);
763
763
  }
@@ -794,7 +794,10 @@ export const $$AnimateQueueProvider = [
794
794
  }
795
795
 
796
796
  if (isUndefined(animateChildren) || animateChildren === true) {
797
- const value = JQLite.data(parentNode, NG_ANIMATE_CHILDREN_DATA);
797
+ const value = getOrSetCacheData(
798
+ parentNode,
799
+ NG_ANIMATE_CHILDREN_DATA,
800
+ );
798
801
  if (isDefined(value)) {
799
802
  animateChildren = value;
800
803
  }
@@ -817,7 +820,7 @@ export const $$AnimateQueueProvider = [
817
820
 
818
821
  if (!rootNodeDetected) {
819
822
  // If `rootNode` is not detected, check if `parentNode` is pinned to another element
820
- parentHost = JQLite.data(parentNode, NG_ANIMATE_PIN_DATA);
823
+ parentHost = getOrSetCacheData(parentNode, NG_ANIMATE_PIN_DATA);
821
824
  if (parentHost) {
822
825
  // The pin target element becomes the next parent element
823
826
  parentNode = getDomNode(parentHost);
@@ -1,6 +1,8 @@
1
1
  import {
2
2
  JQLite,
3
+ cleanElementData,
3
4
  getBooleanAttrName,
5
+ getOrSetCacheData,
4
6
  isTextNode,
5
7
  startingTag,
6
8
  } from "../../shared/jqlite/jqlite";
@@ -3111,7 +3113,7 @@ export function $CompileProvider($provide, $$sanitizeUriProvider) {
3111
3113
  // Copy over user data (that includes AngularJS's $scope etc.). Don't copy private
3112
3114
  // data here because there's no public interface in jQuery to do that and copying over
3113
3115
  // event listeners (which is the main use of private data) wouldn't work anyway.
3114
- JQLite.data(newNode, JQLite.data(firstElementToRemove));
3116
+ getOrSetCacheData(newNode, getOrSetCacheData(firstElementToRemove));
3115
3117
 
3116
3118
  // Remove $destroy event listeners from `firstElementToRemove`
3117
3119
  JQLite(firstElementToRemove).off("$destroy");
@@ -3119,7 +3121,7 @@ export function $CompileProvider($provide, $$sanitizeUriProvider) {
3119
3121
 
3120
3122
  // Cleanup any data/listeners on the elements and children.
3121
3123
  // This includes invoking the $destroy event on any elements with listeners.
3122
- JQLite.cleanData(fragment.querySelectorAll("*"));
3124
+ cleanElementData(fragment.querySelectorAll("*"));
3123
3125
 
3124
3126
  // Update the JQLite collection to only contain the `newNode`
3125
3127
  for (i = 1; i < removeCount; i++) {
@@ -1,6 +1,6 @@
1
1
  import { publishExternalAPI } from "../../public";
2
2
  import { createInjector } from "../../injector";
3
- import { dealoc, JQLite } from "../../shared/jqlite/jqlite";
3
+ import { dealoc, JQLite, getOrSetCacheData } from "../../shared/jqlite/jqlite";
4
4
  import {
5
5
  forEach,
6
6
  isFunction,
@@ -6416,47 +6416,6 @@ describe("$compile", () => {
6416
6416
  expect(element.text()).toEqual("3==3");
6417
6417
  });
6418
6418
 
6419
- describe("when directive is in a repeater", () => {
6420
- let is;
6421
- beforeEach(() => {
6422
- is = [1, 2];
6423
- });
6424
-
6425
- function runTest() {
6426
- $templateCache.put(
6427
- "/mock/hello",
6428
- "<span>i=<span ng-transclude></span>;</span>",
6429
- );
6430
- element = JQLite(
6431
- `<div><b hello ng-repeat="i in [${is}]">{{i}}</b></div>`,
6432
- );
6433
- $compile(element)($rootScope);
6434
- $rootScope.$digest();
6435
- expect(element.text()).toEqual(`i=${is.join(";i=")};`);
6436
- }
6437
-
6438
- it("should work with another library patching JQLite/jQuery.cleanData after Angular", () => {
6439
- let cleanedCount = 0;
6440
- const currentCleanData = JQLite.cleanData;
6441
- JQLite.cleanData = function (elems) {
6442
- cleanedCount += elems.length;
6443
- // Don't return the output and explicitly pass only the first parameter
6444
- // so that we're sure we're not relying on either of them. jQuery UI patch
6445
- // behaves in this way.
6446
- currentCleanData(elems);
6447
- };
6448
-
6449
- runTest();
6450
-
6451
- // The initial ng-repeat div is dumped after parsing hence we expect cleanData
6452
- // count to be one larger than size of the iterated array.
6453
- expect(cleanedCount).toBe(is.length + 1);
6454
-
6455
- // Restore the previous cleanData.
6456
- JQLite.cleanData = currentCleanData;
6457
- });
6458
- });
6459
-
6460
6419
  describe("replace and not exactly one root element", () => {
6461
6420
  beforeEach(() => {
6462
6421
  publishExternalAPI().decorator("$exceptionHandler", () => {
@@ -17331,7 +17290,7 @@ describe("$compile", () => {
17331
17290
 
17332
17291
  const preCompiledChildren = getAll(toCompile);
17333
17292
  forEach(preCompiledChildren, (element, i) => {
17334
- JQLite.data(element, "foo", `template#${i}`);
17293
+ getOrSetCacheData(element, "foo", `template#${i}`);
17335
17294
  });
17336
17295
 
17337
17296
  const linkedElements = $compile(toCompile)($rootScope);
@@ -1,5 +1,5 @@
1
1
  import { isDefined } from "../../shared/utils";
2
- import { JQLiteBuildFragment } from "../../shared/jqlite/jqlite";
2
+ import { buildFragment } from "../../shared/jqlite/jqlite";
3
3
 
4
4
  export const ngIncludeDirective = [
5
5
  "$templateRequest",
@@ -11,12 +11,12 @@ export const ngIncludeDirective = [
11
11
  terminal: true,
12
12
  transclude: "element",
13
13
  controller: () => {},
14
- compile(element, attr) {
14
+ compile(_element, attr) {
15
15
  const srcExp = attr.ngInclude || attr.src;
16
16
  const onloadExp = attr.onload || "";
17
17
  const autoScrollExp = attr.autoscroll;
18
18
 
19
- return (scope, $element, $attr, ctrl, $transclude) => {
19
+ return (scope, $element, _$attr, ctrl, $transclude) => {
20
20
  let changeCounter = 0;
21
21
  let currentScope;
22
22
  let previousElement;
@@ -110,15 +110,13 @@ export const ngIncludeFillContentDirective = [
110
110
  restrict: "ECA",
111
111
  priority: -400,
112
112
  require: "ngInclude",
113
- link(scope, $element, $attr, ctrl) {
113
+ link(scope, $element, _$attr, ctrl) {
114
114
  if (toString.call($element[0]).match(/SVG/)) {
115
115
  // WebKit: https://bugs.webkit.org/show_bug.cgi?id=135698 --- SVG elements do not
116
116
  // support innerHTML, so detect this here and try to generate the contents
117
117
  // specially.
118
118
  $element.empty();
119
- $compile(
120
- JQLiteBuildFragment(ctrl.template, window.document).childNodes,
121
- )(
119
+ $compile(buildFragment(ctrl.template).childNodes)(
122
120
  scope,
123
121
  (clone) => {
124
122
  $element.append(clone);
@@ -1,4 +1,4 @@
1
- import { JQLite, JQLiteRemove, startingTag } from "../../shared/jqlite/jqlite";
1
+ import { JQLite, removeElement, startingTag } from "../../shared/jqlite/jqlite";
2
2
  import {
3
3
  equals,
4
4
  forEach,
@@ -594,9 +594,9 @@ export const ngOptionsDirective = [
594
594
  for (let i = options.items.length - 1; i >= 0; i--) {
595
595
  const option = options.items[i];
596
596
  if (isDefined(option.group)) {
597
- JQLiteRemove(option.element.parentNode);
597
+ removeElement(option.element.parentNode);
598
598
  } else {
599
- JQLiteRemove(option.element);
599
+ removeElement(option.element);
600
600
  }
601
601
  }
602
602
  }
@@ -219,13 +219,17 @@ function parseHeaders(headers) {
219
219
  }
220
220
 
221
221
  if (isString(headers)) {
222
- forEach(headers.split("\n"), (line) => {
223
- i = line.indexOf(":");
224
- fillInParsed(
225
- lowercase(trim(line.substr(0, i))),
226
- trim(line.substr(i + 1)),
227
- );
228
- });
222
+ forEach(
223
+ headers.split("\n"),
224
+ /** @param {string} line */
225
+ (line) => {
226
+ i = line.indexOf(":");
227
+ fillInParsed(
228
+ line.substring(0, i).trim().toLowerCase(),
229
+ trim(line.substring(i + 1)),
230
+ );
231
+ },
232
+ );
229
233
  } else if (isObject(headers)) {
230
234
  forEach(headers, (headerVal, headerKey) => {
231
235
  fillInParsed(lowercase(headerKey), trim(headerVal));