@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.
- package/Makefile +8 -5
- package/README.md +1 -1
- package/dist/angular-ts.esm.js +2 -1
- package/dist/angular-ts.umd.js +2 -1
- package/package.json +2 -4
- package/rollup.config.js +11 -2
- package/src/angular.spec.js +25 -26
- package/src/animations/animate-css-driver.js +3 -3
- package/src/animations/animate-queue.js +7 -7
- package/src/animations/animation.js +2 -2
- package/src/animations/shared.js +6 -6
- package/src/binding.spec.js +7 -7
- package/src/core/animate/animate.js +5 -5
- package/src/core/animate/animate.spec.js +31 -31
- package/src/core/cache/cache-factory.html +18 -0
- package/src/core/cache/{cache-factor.test.js → cache-factory.test.js} +1 -1
- package/src/core/compile/compile.js +31 -25
- package/src/core/compile/compile.md +2 -2
- package/src/core/cookie-reader.spec.js +2 -2
- package/src/core/core.html +22 -0
- package/src/core/core.test.js +12 -0
- package/src/core/document.spec.js +4 -4
- package/src/core/exception-handler.js +30 -23
- package/src/core/interpolate/interpolate.js +7 -0
- package/src/core/{cache/cache-factor.html → location/location.html} +1 -1
- package/src/core/location/location.js +2 -2
- package/src/core/location/location.spec.js +17 -17
- package/src/core/location/location.test.js +12 -0
- package/src/core/on.spec.js +3 -3
- package/src/core/parser/parse.html +18 -0
- package/src/core/parser/parse.spec.js +1 -1
- package/src/core/parser/parse.test.js +12 -0
- package/src/core/prop.spec.js +3 -4
- package/src/core/pubsub/pubsub.html +18 -0
- package/src/core/pubsub/pubsub.spec.js +1 -1
- package/src/core/pubsub/pubsub.test.js +12 -0
- package/src/core/q/q.html +18 -0
- package/src/core/q/q.js +33 -0
- package/src/core/q/q.test.js +0 -0
- package/src/core/root-element.spec.js +4 -4
- package/src/core/sanitize/sanitize-uri.spec.js +1 -1
- package/src/core/sanitize/sanitize-uri.test.js +12 -0
- package/src/core/sanitize/sanitize.html +21 -0
- package/src/core/sce/sce.html +18 -0
- package/src/core/sce/sce.spec.js +2 -1
- package/src/core/sce/sce.test.js +12 -0
- package/src/core/scope/scope.html +18 -0
- package/src/core/scope/scope.js +5 -8
- package/src/core/scope/scope.spec.js +1 -1
- package/src/core/scope/scope.test.js +12 -0
- package/src/core/task-tracker-factory.js +9 -11
- package/src/core/timeout/timeout.html +18 -0
- package/src/core/timeout/timeout.js +9 -0
- package/src/core/timeout/timeout.spec.js +2 -2
- package/src/core/timeout/timout.test.js +12 -0
- package/src/core/url-utils/url-utils.html +18 -0
- package/src/core/url-utils/url-utils.spec.js +4 -2
- package/src/core/url-utils/url-utils.test.js +12 -0
- package/src/directive/attrs/attrs.spec.js +1 -2
- package/src/directive/attrs/boolean.spec.js +1 -2
- package/src/directive/attrs/element-style.spec.js +6 -7
- package/src/directive/attrs/src.spec.js +1 -2
- package/src/directive/bind/bind.spec.js +1 -2
- package/src/directive/class/class.spec.js +15 -16
- package/src/directive/cloak/cloak.spec.js +3 -4
- package/src/directive/controller/controller.spec.js +4 -5
- package/src/directive/events/click.spec.js +1 -2
- package/src/directive/events/event.spec.js +1 -1
- package/src/directive/events/events.js +7 -0
- package/src/directive/form/form.spec.js +17 -17
- package/src/directive/if/if.spec.js +2 -2
- package/src/directive/include/include.js +2 -2
- package/src/directive/include/include.spec.js +32 -32
- package/src/directive/init/init.spec.js +2 -3
- package/src/directive/input/input.spec.js +3 -3
- package/src/directive/list/list.spec.js +1 -2
- package/src/directive/model/model.js +13 -0
- package/src/directive/model/model.spec.js +4 -5
- package/src/directive/model-options/model-options.spec.js +3 -3
- package/src/directive/non-bindable/non-bindable.spec.js +1 -2
- package/src/directive/options/options.js +5 -5
- package/src/directive/options/options.spec.js +13 -13
- package/src/directive/ref/href.spec.js +1 -2
- package/src/directive/repeat/repeat.spec.js +12 -12
- package/src/directive/script/script.spec.js +2 -3
- package/src/directive/select/select.js +6 -6
- package/src/directive/select/select.spec.js +5 -5
- package/src/directive/show-hide/show-hide.spec.js +12 -13
- package/src/directive/style/style.spec.js +3 -4
- package/src/directive/switch/switch.spec.js +2 -3
- package/src/directive/validators/validators.spec.js +1 -1
- package/src/exts/aria/aria.spec.js +1 -2
- package/src/exts/messages/messages.spec.js +5 -5
- package/src/filters/filter.spec.js +5 -5
- package/src/filters/filters.html +21 -0
- package/src/filters/filters.spec.js +3 -3
- package/src/filters/filters.test.js +12 -0
- package/src/filters/limit-to.md +1 -1
- package/src/filters/limit-to.spec.js +4 -4
- package/src/filters/order-by.spec.js +2 -2
- package/src/index.js +462 -1
- package/src/loader.js +62 -17
- package/src/public.js +6 -2
- package/src/router/directives/state-directives.spec.js +90 -90
- package/src/router/directives/view-directive.js +2 -2
- package/src/router/directives/view-directive.spec.js +9 -9
- package/src/router/state/state.spec.js +2 -4
- package/src/router/template-factory.spec.js +2 -2
- package/src/router/transition/hook-registry.js +2 -2
- package/src/router/view/view.spec.js +1 -1
- package/src/services/browser.js +56 -39
- package/src/services/document.js +16 -13
- package/src/services/log.js +39 -43
- package/src/services/template-request.js +9 -0
- package/src/shared/common.js +0 -3
- package/src/shared/jqlite/jqlite.js +83 -89
- package/src/shared/jqlite/jqlite.spec.js +218 -222
- package/src/shared/strings.js +2 -2
- package/src/shared/test-utils.js +2 -2
- package/src/shared/utils.js +8 -11
- package/src/src.test.js +10 -0
- package/tsconfig.json +1 -1
- package/tsconfig.types.json +11 -0
- package/types/animations/animate-cache.d.ts +7 -7
- package/types/animations/animate-children-directive.d.ts +3 -6
- package/types/animations/animate-swap.d.ts +7 -16
- package/types/animations/animation.d.ts +2 -11
- package/types/animations/raf-scheduler.d.ts +3 -3
- package/types/animations/shared.d.ts +9 -24
- package/types/core/{animate-css.d.ts → animate/animate-css.d.ts} +2 -8
- package/types/core/{cache.d.ts → cache/cache.d.ts} +5 -5
- package/types/core/compile/compile.d.ts +173 -0
- package/types/core/controller/controller.d.ts +32 -0
- package/types/core/exception-handler.d.ts +9 -42
- package/types/core/filter/filter.d.ts +9 -0
- package/types/core/{interpolate.d.ts → interpolate/interpolate.d.ts} +23 -39
- package/types/core/interval/interval-factory.d.ts +4 -0
- package/types/core/{interval.d.ts → interval/interval.d.ts} +1 -1
- package/types/core/location/location.d.ts +209 -0
- package/types/core/pubsub/pubsub.d.ts +156 -0
- package/types/core/q/q.d.ts +65 -0
- package/types/core/sanitize/sanitize-uri.d.ts +53 -0
- package/types/core/{sce.d.ts → sce/sce.d.ts} +80 -86
- package/types/core/scope/scope.d.ts +727 -0
- package/types/core/task-tracker-factory.d.ts +45 -38
- package/types/core/timeout/timeout.d.ts +29 -0
- package/types/core/{urlUtils.d.ts → url-utils/url-utils.d.ts} +2 -7
- package/types/directive/{bind.d.ts → bind/bind.d.ts} +4 -10
- package/types/directive/{class.d.ts → class/class.d.ts} +12 -21
- package/types/directive/controller/controller.d.ts +6 -0
- package/types/directive/events/events.d.ts +5 -0
- package/types/directive/form/form.d.ts +200 -0
- package/types/directive/if/if.d.ts +8 -0
- package/types/directive/include/include.d.ts +14 -0
- package/types/directive/{input.d.ts → input/input.d.ts} +20 -69
- package/types/directive/{model.d.ts → model/model.d.ts} +281 -280
- package/types/directive/options/options.d.ts +9 -0
- package/types/directive/ref/ref.d.ts +5 -0
- package/types/directive/repeat/repeat.d.ts +8 -0
- package/types/directive/{script.d.ts → script/script.d.ts} +5 -8
- package/types/directive/{show-hide.d.ts → show-hide/show-hide.d.ts} +10 -16
- package/types/directive/switch/switch.d.ts +17 -0
- package/types/directive/transclude/transclude.d.ts +4 -0
- package/types/directive/{validators.d.ts → validators/validators.d.ts} +20 -35
- package/types/filters/filters.d.ts +10 -16
- package/types/filters/order-by.d.ts +2 -4
- package/types/index.d.ts +702 -0
- package/types/injector.d.ts +12 -0
- package/types/public.d.ts +5 -0
- package/types/router/common/coreservices.d.ts +2 -2
- package/types/router/common/glob.d.ts +9 -9
- package/types/router/common/queue.d.ts +13 -13
- package/types/router/common/trace.d.ts +43 -43
- package/types/router/directives/view-directive.d.ts +13 -32
- package/types/router/globals.d.ts +20 -20
- package/types/router/hooks/lazy-load.d.ts +2 -11
- package/types/router/hooks/redirect-to.d.ts +1 -4
- package/types/router/hooks/url.d.ts +1 -5
- package/types/router/hooks/views.d.ts +1 -4
- package/types/router/params/param-factory.d.ts +5 -5
- package/types/router/params/param-type.d.ts +35 -35
- package/types/router/params/param-types.d.ts +11 -11
- package/types/router/params/param.d.ts +38 -38
- package/types/router/params/state-params.d.ts +10 -10
- package/types/router/path/path-node.d.ts +34 -34
- package/types/router/path/path-utils.d.ts +73 -77
- package/types/router/resolve/resolvable.d.ts +32 -32
- package/types/router/resolve/resolve-context.d.ts +84 -84
- package/types/router/services.d.ts +4 -9
- package/types/router/state/state-builder.d.ts +27 -27
- package/types/router/state/state-matcher.d.ts +5 -5
- package/types/router/state/state-object.d.ts +58 -58
- package/types/router/state/state-queue-manager.d.ts +10 -16
- package/types/router/state/state-registry.d.ts +100 -107
- package/types/router/state/state-service.d.ts +411 -411
- package/types/router/state/target-state.d.ts +64 -69
- package/types/router/state/views.d.ts +31 -37
- package/types/router/state-filters.d.ts +7 -7
- package/types/router/state-provider.d.ts +105 -105
- package/types/router/template-factory.d.ts +83 -112
- package/types/router/transition/hook-builder.d.ts +25 -25
- package/types/router/transition/hook-registry.d.ts +68 -83
- package/types/router/transition/interface.d.ts +7 -7
- package/types/router/transition/reject-factory.d.ts +34 -34
- package/types/router/transition/transition-event-type.d.ts +9 -18
- package/types/router/transition/transition-hook.d.ts +77 -82
- package/types/router/transition/transition-service.d.ts +82 -99
- package/types/router/transition/transition.d.ts +369 -377
- package/types/router/url/url-config.d.ts +84 -84
- package/types/router/url/url-matcher.d.ts +115 -119
- package/types/router/url/url-rule.d.ts +114 -124
- package/types/router/url/url-rules.d.ts +217 -217
- package/types/router/url/url-service.d.ts +264 -269
- package/types/router/view/view.d.ts +114 -117
- package/types/router/view-scroll.d.ts +2 -2
- package/types/services/anchor-scroll.d.ts +2 -8
- package/types/services/browser.d.ts +157 -135
- package/types/services/cache-factory.d.ts +25 -25
- package/types/services/cookie-reader.d.ts +2 -2
- package/types/services/document.d.ts +13 -9
- package/types/services/http/http.d.ts +145 -0
- package/types/services/{http-backend.d.ts → http-backend/http-backend.d.ts} +3 -35
- package/types/services/log.d.ts +55 -52
- package/types/services/template-request.d.ts +44 -53
- package/types/shared/common.d.ts +4 -20
- package/types/{constants.d.ts → shared/constants.d.ts} +6 -6
- package/types/shared/hof.d.ts +1 -1
- package/types/{jqLite.d.ts → shared/jqlite/jqlite.d.ts} +16 -17
- package/types/shared/test-utils.d.ts +11 -0
- package/types/shared/utils.d.ts +29 -46
- package/types-back/global.d.ts +3 -1
- package/types-back/index.d.ts +3 -296
- package/types/core/compile.d.ts +0 -206
- package/types/core/controller.d.ts +0 -42
- package/types/core/filter.d.ts +0 -9
- package/types/core/interval-factory.d.ts +0 -21
- package/types/core/location.d.ts +0 -234
- package/types/core/pubsub.d.ts +0 -164
- package/types/core/q.d.ts +0 -33
- package/types/core/root-scope.d.ts +0 -754
- package/types/core/sanitize-uri.d.ts +0 -57
- package/types/core/timeout.d.ts +0 -31
- package/types/directive/controller.d.ts +0 -6
- package/types/directive/events.d.ts +0 -12
- package/types/directive/form.d.ts +0 -230
- package/types/directive/if.d.ts +0 -17
- package/types/directive/include.d.ts +0 -33
- package/types/directive/options.d.ts +0 -16
- package/types/directive/ref.d.ts +0 -11
- package/types/directive/repeat.d.ts +0 -23
- package/types/directive/switch.d.ts +0 -23
- package/types/directive/transclude.d.ts +0 -15
- package/types/services/http.d.ts +0 -157
- /package/src/core/cache/{cache-factor.spec.js → cache-factory.spec.js} +0 -0
- /package/types/directive/{attrs.d.ts → attrs/attrs.d.ts} +0 -0
- /package/types/directive/{change.d.ts → change/change.d.ts} +0 -0
- /package/types/directive/{cloak.d.ts → cloak/cloak.d.ts} +0 -0
- /package/types/directive/{init.d.ts → init/init.d.ts} +0 -0
- /package/types/directive/{list.d.ts → list/list.d.ts} +0 -0
- /package/types/directive/{non-bindable.d.ts → non-bindable/non-bindable.d.ts} +0 -0
- /package/types/directive/{style.d.ts → style/style.d.ts} +0 -0
- /package/types/exts/{aria.d.ts → aria/aria.d.ts} +0 -0
- /package/types/exts/{messages.d.ts → messages/messages.d.ts} +0 -0
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.
|
|
4
|
+
"version": "0.0.40",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/angular-ts.esm.js",
|
|
7
7
|
"browser": "dist/angular-ts.umd.js",
|
|
@@ -37,11 +37,9 @@
|
|
|
37
37
|
"playwright": "^1.44.0",
|
|
38
38
|
"prettier": "latest",
|
|
39
39
|
"rollup": "latest",
|
|
40
|
+
"rollup-plugin-version-injector": "^1.3.3",
|
|
40
41
|
"sinon": "latest",
|
|
41
42
|
"typescript": "latest",
|
|
42
43
|
"vite": "latest"
|
|
43
|
-
},
|
|
44
|
-
"dependencies": {
|
|
45
|
-
|
|
46
44
|
}
|
|
47
45
|
}
|
package/rollup.config.js
CHANGED
|
@@ -2,6 +2,12 @@ import resolve from '@rollup/plugin-node-resolve';
|
|
|
2
2
|
import commonjs from '@rollup/plugin-commonjs';
|
|
3
3
|
import pkg from './package.json' assert { type: 'json' };
|
|
4
4
|
import terser from '@rollup/plugin-terser';
|
|
5
|
+
import versionInjector from 'rollup-plugin-version-injector';
|
|
6
|
+
|
|
7
|
+
const SHARED_PLUGINS = [
|
|
8
|
+
terser(),
|
|
9
|
+
versionInjector()
|
|
10
|
+
]
|
|
5
11
|
|
|
6
12
|
export default [
|
|
7
13
|
// browser-friendly UMD build
|
|
@@ -12,7 +18,10 @@ export default [
|
|
|
12
18
|
file: pkg.browser,
|
|
13
19
|
format: 'umd',
|
|
14
20
|
},
|
|
15
|
-
plugins: [
|
|
21
|
+
plugins: [
|
|
22
|
+
resolve(),
|
|
23
|
+
commonjs()
|
|
24
|
+
].concat(SHARED_PLUGINS)
|
|
16
25
|
},
|
|
17
26
|
|
|
18
27
|
// ES module (for bundlers) build.
|
|
@@ -25,6 +34,6 @@ export default [
|
|
|
25
34
|
input: 'src/index.js',
|
|
26
35
|
external: ['ms'],
|
|
27
36
|
output: { file: pkg.main, format: 'es' },
|
|
28
|
-
plugins:
|
|
37
|
+
plugins: SHARED_PLUGINS,
|
|
29
38
|
},
|
|
30
39
|
];
|
package/src/angular.spec.js
CHANGED
|
@@ -24,7 +24,7 @@ import {
|
|
|
24
24
|
nodeName_,
|
|
25
25
|
snakeCase,
|
|
26
26
|
} from "./shared/utils";
|
|
27
|
-
import { dealoc,
|
|
27
|
+
import { dealoc, JQLite, startingTag } from "./shared/jqlite/jqlite";
|
|
28
28
|
import { Angular, angularInit } from "./loader";
|
|
29
29
|
import { publishExternalAPI } from "./public";
|
|
30
30
|
import { createInjector } from "./injector";
|
|
@@ -48,7 +48,6 @@ describe("angular", () => {
|
|
|
48
48
|
|
|
49
49
|
afterEach(() => {
|
|
50
50
|
dealoc(element);
|
|
51
|
-
jqLite.CACHE.clear();
|
|
52
51
|
});
|
|
53
52
|
|
|
54
53
|
describe("case", () => {
|
|
@@ -784,7 +783,7 @@ describe("angular", () => {
|
|
|
784
783
|
it("should copy elements by reference", () => {
|
|
785
784
|
const src = {
|
|
786
785
|
element: document.createElement("div"),
|
|
787
|
-
jqObject:
|
|
786
|
+
jqObject: JQLite("<p><span>s1</span><span>s2</span></p>").find("span"),
|
|
788
787
|
};
|
|
789
788
|
const dst = {};
|
|
790
789
|
|
|
@@ -1293,7 +1292,7 @@ describe("angular", () => {
|
|
|
1293
1292
|
});
|
|
1294
1293
|
|
|
1295
1294
|
it("should handle JQLite and jQuery objects like arrays", () => {
|
|
1296
|
-
let jqObject =
|
|
1295
|
+
let jqObject = JQLite("<p><span>s1</span><span>s2</span></p>").find(
|
|
1297
1296
|
"span",
|
|
1298
1297
|
);
|
|
1299
1298
|
let log = [];
|
|
@@ -1304,7 +1303,7 @@ describe("angular", () => {
|
|
|
1304
1303
|
expect(log).toEqual(["0:s1", "1:s2"]);
|
|
1305
1304
|
|
|
1306
1305
|
log = [];
|
|
1307
|
-
jqObject =
|
|
1306
|
+
jqObject = JQLite("<pane></pane>");
|
|
1308
1307
|
forEach(jqObject.children(), (value, key) => {
|
|
1309
1308
|
log.push(`${key}:${value.innerHTML}`);
|
|
1310
1309
|
});
|
|
@@ -1312,7 +1311,7 @@ describe("angular", () => {
|
|
|
1312
1311
|
});
|
|
1313
1312
|
|
|
1314
1313
|
it("should handle NodeList objects like arrays", () => {
|
|
1315
|
-
const nodeList =
|
|
1314
|
+
const nodeList = JQLite(
|
|
1316
1315
|
"<p><span>a</span><span>b</span><span>c</span></p>",
|
|
1317
1316
|
)[0].childNodes;
|
|
1318
1317
|
const log = [];
|
|
@@ -1483,20 +1482,20 @@ describe("angular", () => {
|
|
|
1483
1482
|
});
|
|
1484
1483
|
|
|
1485
1484
|
it("should follow the ES spec when called with jQuery/shared/jqlite/jqlite", () => {
|
|
1486
|
-
testForEachSpec(2,
|
|
1485
|
+
testForEachSpec(2, JQLite("<span>a</span><span>b</span>"));
|
|
1487
1486
|
});
|
|
1488
1487
|
|
|
1489
1488
|
it("should follow the ES spec when called with childNodes NodeList", () => {
|
|
1490
1489
|
testForEachSpec(
|
|
1491
1490
|
2,
|
|
1492
|
-
|
|
1491
|
+
JQLite("<p><span>a</span><span>b</span></p>")[0].childNodes,
|
|
1493
1492
|
);
|
|
1494
1493
|
});
|
|
1495
1494
|
|
|
1496
1495
|
it("should follow the ES spec when called with getElementsByTagName HTMLCollection", () => {
|
|
1497
1496
|
testForEachSpec(
|
|
1498
1497
|
2,
|
|
1499
|
-
|
|
1498
|
+
JQLite("<p><span>a</span><span>b</span></p>")[0].getElementsByTagName(
|
|
1500
1499
|
"*",
|
|
1501
1500
|
),
|
|
1502
1501
|
);
|
|
@@ -1505,7 +1504,7 @@ describe("angular", () => {
|
|
|
1505
1504
|
it("should follow the ES spec when called with querySelectorAll HTMLCollection", () => {
|
|
1506
1505
|
testForEachSpec(
|
|
1507
1506
|
2,
|
|
1508
|
-
|
|
1507
|
+
JQLite("<p><span>a</span><span>b</span></p>")[0].querySelectorAll(
|
|
1509
1508
|
"*",
|
|
1510
1509
|
),
|
|
1511
1510
|
);
|
|
@@ -1602,7 +1601,7 @@ describe("angular", () => {
|
|
|
1602
1601
|
|
|
1603
1602
|
it("should look for ngApp directive as attr", () => {
|
|
1604
1603
|
window.angular.module("ABC", []);
|
|
1605
|
-
const appElement =
|
|
1604
|
+
const appElement = JQLite('<div ng-app="ABC"></div>')[0];
|
|
1606
1605
|
|
|
1607
1606
|
angularInit(appElement);
|
|
1608
1607
|
expect(bootstrapSpy).toHaveBeenCalled();
|
|
@@ -1610,34 +1609,34 @@ describe("angular", () => {
|
|
|
1610
1609
|
|
|
1611
1610
|
it("should look for ngApp directive using querySelectorAll", () => {
|
|
1612
1611
|
window.angular.module("ABC", []);
|
|
1613
|
-
const appElement =
|
|
1612
|
+
const appElement = JQLite('<div ng-app="ABC"></div>')[0];
|
|
1614
1613
|
element.querySelector["[ng-app]"] = appElement;
|
|
1615
1614
|
angularInit(element);
|
|
1616
1615
|
expect(bootstrapSpy).toHaveBeenCalled();
|
|
1617
1616
|
});
|
|
1618
1617
|
|
|
1619
1618
|
it("should bootstrap anonymously", () => {
|
|
1620
|
-
const appElement =
|
|
1619
|
+
const appElement = JQLite("<div ng-app></div>")[0];
|
|
1621
1620
|
element.querySelector["[ng-app]"] = appElement;
|
|
1622
1621
|
angularInit(element);
|
|
1623
1622
|
expect(bootstrapSpy).toHaveBeenCalled();
|
|
1624
1623
|
});
|
|
1625
1624
|
|
|
1626
1625
|
it("should bootstrap if the annotation is on the root element", () => {
|
|
1627
|
-
const appElement =
|
|
1626
|
+
const appElement = JQLite('<div ng-app=""></div>')[0];
|
|
1628
1627
|
angularInit(appElement);
|
|
1629
1628
|
expect(bootstrapSpy).toHaveBeenCalled();
|
|
1630
1629
|
});
|
|
1631
1630
|
|
|
1632
1631
|
it("should complain if app module cannot be found", () => {
|
|
1633
|
-
const appElement =
|
|
1632
|
+
const appElement = JQLite('<div ng-app="doesntexist"></div>')[0];
|
|
1634
1633
|
expect(() => {
|
|
1635
1634
|
angularInit(appElement);
|
|
1636
1635
|
}).toThrowError(/modulerr/);
|
|
1637
1636
|
});
|
|
1638
1637
|
|
|
1639
1638
|
it("should complain if an element has already been bootstrapped", () => {
|
|
1640
|
-
const element =
|
|
1639
|
+
const element = JQLite("<div>bootstrap me!</div>");
|
|
1641
1640
|
angular.bootstrap(element);
|
|
1642
1641
|
|
|
1643
1642
|
expect(() => {
|
|
@@ -1657,8 +1656,8 @@ describe("angular", () => {
|
|
|
1657
1656
|
});
|
|
1658
1657
|
|
|
1659
1658
|
it("should bootstrap in strict mode when ng-strict-di attribute is specified", () => {
|
|
1660
|
-
const appElement =
|
|
1661
|
-
angularInit(
|
|
1659
|
+
const appElement = JQLite('<div ng-app="" ng-strict-di></div>');
|
|
1660
|
+
angularInit(JQLite("<div></div>").append(appElement[0])[0]);
|
|
1662
1661
|
expect(bootstrapSpy).toHaveBeenCalled();
|
|
1663
1662
|
expect(bootstrapSpy.calls.mostRecent().args[2].strictDi).toBe(true);
|
|
1664
1663
|
|
|
@@ -1802,7 +1801,7 @@ describe("angular", () => {
|
|
|
1802
1801
|
});
|
|
1803
1802
|
|
|
1804
1803
|
it("should link to new node and given scope", () => {
|
|
1805
|
-
const template =
|
|
1804
|
+
const template = JQLite('<div>{{greeting = "hello world"}}</div>');
|
|
1806
1805
|
|
|
1807
1806
|
const compile = $compile(template);
|
|
1808
1807
|
let templateClone = template[0].cloneNode(true);
|
|
@@ -1819,7 +1818,7 @@ describe("angular", () => {
|
|
|
1819
1818
|
});
|
|
1820
1819
|
|
|
1821
1820
|
it("should link to cloned node and create scope", () => {
|
|
1822
|
-
const template =
|
|
1821
|
+
const template = JQLite('<div>{{greeting = "hello world"}}</div>');
|
|
1823
1822
|
element = $compile(template)($rootScope, () => {});
|
|
1824
1823
|
$rootScope.$digest();
|
|
1825
1824
|
expect(template.text()).toEqual('{{greeting = "hello world"}}');
|
|
@@ -1830,7 +1829,7 @@ describe("angular", () => {
|
|
|
1830
1829
|
|
|
1831
1830
|
describe("nodeName_", () => {
|
|
1832
1831
|
it('should correctly detect node name with "namespace" when xmlns is defined', () => {
|
|
1833
|
-
const div =
|
|
1832
|
+
const div = JQLite(
|
|
1834
1833
|
'<div xmlns:ngtest="http://angularjs.org/">' +
|
|
1835
1834
|
'<ngtest:foo ngtest:attr="bar"></ngtest:foo>' +
|
|
1836
1835
|
"</div>",
|
|
@@ -1840,7 +1839,7 @@ describe("angular", () => {
|
|
|
1840
1839
|
});
|
|
1841
1840
|
|
|
1842
1841
|
it('should correctly detect node name with "namespace" when xmlns is NOT defined', () => {
|
|
1843
|
-
const div =
|
|
1842
|
+
const div = JQLite(
|
|
1844
1843
|
'<div xmlns:ngtest="http://angularjs.org/">' +
|
|
1845
1844
|
'<ngtest:foo ngtest:attr="bar"></ng-test>' +
|
|
1846
1845
|
"</div>",
|
|
@@ -1883,7 +1882,7 @@ describe("angular", () => {
|
|
|
1883
1882
|
});
|
|
1884
1883
|
|
|
1885
1884
|
it("should bootstrap app", () => {
|
|
1886
|
-
const element =
|
|
1885
|
+
const element = JQLite("<div>{{1+2}}</div>");
|
|
1887
1886
|
const injector = angular.bootstrap(element);
|
|
1888
1887
|
expect(injector).toBeDefined();
|
|
1889
1888
|
expect(element.injector()).toBe(injector);
|
|
@@ -1891,7 +1890,7 @@ describe("angular", () => {
|
|
|
1891
1890
|
});
|
|
1892
1891
|
|
|
1893
1892
|
it("should complain if app module can't be found", () => {
|
|
1894
|
-
const element =
|
|
1893
|
+
const element = JQLite("<div>{{1+2}}</div>");
|
|
1895
1894
|
|
|
1896
1895
|
expect(() => {
|
|
1897
1896
|
angular.bootstrap(element, ["doesntexist"]);
|
|
@@ -1907,7 +1906,7 @@ describe("angular", () => {
|
|
|
1907
1906
|
|
|
1908
1907
|
beforeEach(() => {
|
|
1909
1908
|
window.name = "";
|
|
1910
|
-
element =
|
|
1909
|
+
element = JQLite("<div>{{1+2}}</div>");
|
|
1911
1910
|
});
|
|
1912
1911
|
|
|
1913
1912
|
afterEach(() => {
|
|
@@ -1947,7 +1946,7 @@ describe("angular", () => {
|
|
|
1947
1946
|
});
|
|
1948
1947
|
|
|
1949
1948
|
it("should load extra modules", () => {
|
|
1950
|
-
element =
|
|
1949
|
+
element = JQLite("<div>{{1+2}}</div>");
|
|
1951
1950
|
window.name = "NG_DEFER_BOOTSTRAP!";
|
|
1952
1951
|
|
|
1953
1952
|
const bootstrapping = jasmine.createSpy("bootstrapping");
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { JQLite } from "../shared/jqlite/jqlite";
|
|
2
2
|
import { forEach, isString } from "../shared/utils";
|
|
3
3
|
import { concatWithSpace, getDomNode } from "./shared";
|
|
4
4
|
|
|
@@ -33,7 +33,7 @@ export const $$AnimateCssDriverProvider = [
|
|
|
33
33
|
const bodyNode = $document[0].body;
|
|
34
34
|
const rootNode = getDomNode($rootElement);
|
|
35
35
|
|
|
36
|
-
const rootBodyElement =
|
|
36
|
+
const rootBodyElement = JQLite(
|
|
37
37
|
// this is to avoid using something that exists outside of the body
|
|
38
38
|
// we also special case the doc fragment case because our unit test code
|
|
39
39
|
// appends the $rootElement to the body after the app has been bootstrapped
|
|
@@ -65,7 +65,7 @@ export const $$AnimateCssDriverProvider = [
|
|
|
65
65
|
}
|
|
66
66
|
|
|
67
67
|
function prepareAnchoredAnimation(classes, outAnchor, inAnchor) {
|
|
68
|
-
const clone =
|
|
68
|
+
const clone = JQLite(getDomNode(outAnchor).cloneNode(true));
|
|
69
69
|
const startingClasses = filterCssClasses(getClassVal(clone));
|
|
70
70
|
|
|
71
71
|
outAnchor.addClass(NG_ANIMATE_SHIM_CLASS_NAME);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { JQLite } from "../shared/jqlite/jqlite";
|
|
2
2
|
import {
|
|
3
3
|
isUndefined,
|
|
4
4
|
forEach,
|
|
@@ -299,7 +299,7 @@ export const $$AnimateQueueProvider = [
|
|
|
299
299
|
});
|
|
300
300
|
|
|
301
301
|
// Remove the callback when the element is removed from the DOM
|
|
302
|
-
|
|
302
|
+
JQLite(container).on("$destroy", () => {
|
|
303
303
|
const animationDetails = activeAnimationsLookup.get(node);
|
|
304
304
|
|
|
305
305
|
if (!animationDetails) {
|
|
@@ -377,7 +377,7 @@ export const $$AnimateQueueProvider = [
|
|
|
377
377
|
if (!disabledElementsLookup.has(node)) {
|
|
378
378
|
// The element is added to the map for the first time.
|
|
379
379
|
// Create a listener to remove it on `$destroy` (to avoid memory leak).
|
|
380
|
-
|
|
380
|
+
JQLite(element).on(
|
|
381
381
|
"$destroy",
|
|
382
382
|
removeFromDisabledElementsLookup,
|
|
383
383
|
);
|
|
@@ -437,7 +437,7 @@ export const $$AnimateQueueProvider = [
|
|
|
437
437
|
}
|
|
438
438
|
|
|
439
439
|
// If animations are hard-disabled for the whole application there is no need to continue.
|
|
440
|
-
// There are also situations where a directive issues an animation for a
|
|
440
|
+
// There are also situations where a directive issues an animation for a JQLite wrapper that
|
|
441
441
|
// contains only comment nodes. In this case, there is no way we can perform an animation.
|
|
442
442
|
if (
|
|
443
443
|
!animationsEnabled ||
|
|
@@ -757,7 +757,7 @@ export const $$AnimateQueueProvider = [
|
|
|
757
757
|
let elementDisabled = disabledElementsLookup.get(node);
|
|
758
758
|
let animateChildren;
|
|
759
759
|
|
|
760
|
-
let parentHost =
|
|
760
|
+
let parentHost = JQLite.data(node, NG_ANIMATE_PIN_DATA);
|
|
761
761
|
if (parentHost) {
|
|
762
762
|
parentNode = getDomNode(parentHost);
|
|
763
763
|
}
|
|
@@ -794,7 +794,7 @@ export const $$AnimateQueueProvider = [
|
|
|
794
794
|
}
|
|
795
795
|
|
|
796
796
|
if (isUndefined(animateChildren) || animateChildren === true) {
|
|
797
|
-
const value =
|
|
797
|
+
const value = JQLite.data(parentNode, NG_ANIMATE_CHILDREN_DATA);
|
|
798
798
|
if (isDefined(value)) {
|
|
799
799
|
animateChildren = value;
|
|
800
800
|
}
|
|
@@ -817,7 +817,7 @@ export const $$AnimateQueueProvider = [
|
|
|
817
817
|
|
|
818
818
|
if (!rootNodeDetected) {
|
|
819
819
|
// If `rootNode` is not detected, check if `parentNode` is pinned to another element
|
|
820
|
-
parentHost =
|
|
820
|
+
parentHost = JQLite.data(parentNode, NG_ANIMATE_PIN_DATA);
|
|
821
821
|
if (parentHost) {
|
|
822
822
|
// The pin target element becomes the next parent element
|
|
823
823
|
parentNode = getDomNode(parentHost);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { JQLite } from "../shared/jqlite/jqlite";
|
|
2
2
|
import { forEach, mergeClasses } from "../shared/utils";
|
|
3
3
|
import {
|
|
4
4
|
NG_ANIMATE_CLASSNAME,
|
|
@@ -347,7 +347,7 @@ export function $$AnimationProvider() {
|
|
|
347
347
|
refLookup[key] = refLookup[key] || {};
|
|
348
348
|
refLookup[key][direction] = {
|
|
349
349
|
animationID: index,
|
|
350
|
-
element:
|
|
350
|
+
element: JQLite(anchor),
|
|
351
351
|
};
|
|
352
352
|
});
|
|
353
353
|
} else {
|
package/src/animations/shared.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { forEach, isString, minErr, extend } from "../shared/utils";
|
|
2
|
-
import {
|
|
2
|
+
import { JQLite } from "../shared/jqlite/jqlite";
|
|
3
3
|
|
|
4
4
|
export const ADD_CLASS_SUFFIX = "-add";
|
|
5
5
|
export const REMOVE_CLASS_SUFFIX = "-remove";
|
|
@@ -119,14 +119,14 @@ export function removeFromArray(arr, val) {
|
|
|
119
119
|
}
|
|
120
120
|
|
|
121
121
|
export function stripCommentsFromElement(element) {
|
|
122
|
-
if (element instanceof
|
|
122
|
+
if (element instanceof JQLite) {
|
|
123
123
|
switch (element.length) {
|
|
124
124
|
case 0:
|
|
125
125
|
return element;
|
|
126
126
|
|
|
127
127
|
case 1:
|
|
128
128
|
// there is no point of stripping anything if the element
|
|
129
|
-
// is the only element within the
|
|
129
|
+
// is the only element within the JQLite wrapper.
|
|
130
130
|
// (it's important that we retain the element instance.)
|
|
131
131
|
if (element[0].nodeType === Node.ELEMENT_NODE) {
|
|
132
132
|
return element;
|
|
@@ -134,12 +134,12 @@ export function stripCommentsFromElement(element) {
|
|
|
134
134
|
break;
|
|
135
135
|
|
|
136
136
|
default:
|
|
137
|
-
return
|
|
137
|
+
return JQLite(extractElementNode(element));
|
|
138
138
|
}
|
|
139
139
|
}
|
|
140
140
|
|
|
141
141
|
if (element.nodeType === Node.ELEMENT_NODE) {
|
|
142
|
-
return
|
|
142
|
+
return JQLite(element);
|
|
143
143
|
}
|
|
144
144
|
}
|
|
145
145
|
|
|
@@ -303,7 +303,7 @@ export function resolveElementClasses(existing, toAdd, toRemove) {
|
|
|
303
303
|
}
|
|
304
304
|
|
|
305
305
|
export function getDomNode(element) {
|
|
306
|
-
return element instanceof
|
|
306
|
+
return element instanceof JQLite ? element[0] : element;
|
|
307
307
|
}
|
|
308
308
|
|
|
309
309
|
export function applyGeneratedPreparationClasses(element, event, options) {
|
package/src/binding.spec.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { JQLite, dealoc } from "./shared/jqlite/jqlite";
|
|
2
2
|
import { publishExternalAPI } from "./public";
|
|
3
3
|
import { createInjector } from "./injector";
|
|
4
4
|
import { browserTrigger } from "./shared/test-utils";
|
|
@@ -13,7 +13,7 @@ describe("binding", () => {
|
|
|
13
13
|
errors = [];
|
|
14
14
|
|
|
15
15
|
function childNode(element, index) {
|
|
16
|
-
return
|
|
16
|
+
return JQLite(element[0].childNodes[index]);
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
beforeEach(function () {
|
|
@@ -30,7 +30,7 @@ describe("binding", () => {
|
|
|
30
30
|
$document = $injector.get("$document");
|
|
31
31
|
this.compileToHtml = function (content) {
|
|
32
32
|
let html;
|
|
33
|
-
content =
|
|
33
|
+
content = JQLite(content);
|
|
34
34
|
$compile(content)($rootScope);
|
|
35
35
|
html = content[0].outerHTML;
|
|
36
36
|
return html;
|
|
@@ -352,8 +352,8 @@ describe("binding", () => {
|
|
|
352
352
|
)($rootScope);
|
|
353
353
|
$rootScope.$apply();
|
|
354
354
|
|
|
355
|
-
const d1 =
|
|
356
|
-
const d2 =
|
|
355
|
+
const d1 = JQLite(element[0].childNodes[1]);
|
|
356
|
+
const d2 = JQLite(element[0].childNodes[3]);
|
|
357
357
|
expect(d1[0].classList.contains("o")).toBeTruthy();
|
|
358
358
|
expect(d2[0].classList.contains("e")).toBeTruthy();
|
|
359
359
|
// expect(element).toBe(
|
|
@@ -448,8 +448,8 @@ describe("binding", () => {
|
|
|
448
448
|
'<input type="radio" ng-model="sex" value="male">' +
|
|
449
449
|
"</div>",
|
|
450
450
|
)($rootScope);
|
|
451
|
-
const female =
|
|
452
|
-
const male =
|
|
451
|
+
const female = JQLite(element[0].childNodes[0]);
|
|
452
|
+
const male = JQLite(element[0].childNodes[1]);
|
|
453
453
|
|
|
454
454
|
female[0].click();
|
|
455
455
|
browserTrigger(female, "change");
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
minErr,
|
|
7
7
|
extend,
|
|
8
8
|
} from "../../shared/utils";
|
|
9
|
-
import {
|
|
9
|
+
import { JQLite } from "../../shared/jqlite/jqlite";
|
|
10
10
|
|
|
11
11
|
const $animateMinErr = minErr("$animate");
|
|
12
12
|
const NG_ANIMATE_CLASSNAME = "ng-animate";
|
|
@@ -620,8 +620,8 @@ export const AnimateProvider = [
|
|
|
620
620
|
* @return {Runner} the animation runner
|
|
621
621
|
*/
|
|
622
622
|
enter(element, parent, after, options) {
|
|
623
|
-
parent = parent &&
|
|
624
|
-
after = after &&
|
|
623
|
+
parent = parent && JQLite(parent);
|
|
624
|
+
after = after && JQLite(after);
|
|
625
625
|
parent = parent || after.parent();
|
|
626
626
|
domInsert(element, parent, after);
|
|
627
627
|
return $$animateQueue.push(
|
|
@@ -656,8 +656,8 @@ export const AnimateProvider = [
|
|
|
656
656
|
* @return {Runner} the animation runner
|
|
657
657
|
*/
|
|
658
658
|
move(element, parent, after, options) {
|
|
659
|
-
parent = parent &&
|
|
660
|
-
after = after &&
|
|
659
|
+
parent = parent && JQLite(parent);
|
|
660
|
+
after = after && JQLite(after);
|
|
661
661
|
parent = parent || after.parent();
|
|
662
662
|
domInsert(element, parent, after);
|
|
663
663
|
return $$animateQueue.push(
|