@angular-wave/angular.ts 0.6.3 → 0.6.5
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/dist/angular-ts.esm.js +2 -2
- package/dist/angular-ts.umd.js +2 -2
- package/package.json +1 -1
- package/src/angular.spec.js +2 -2
- package/src/animations/animate-children-directive.js +1 -1
- package/src/animations/animate-css-driver.js +2 -2
- package/src/animations/animate-css.js +1 -1
- package/src/animations/animate-js.js +2 -2
- package/src/animations/animate-queue.js +2 -2
- package/src/animations/animate.js +2 -2
- package/src/animations/animate.spec.js +3 -3
- package/src/animations/animation.js +3 -3
- package/src/binding.spec.js +1 -1
- package/src/core/cache/cache.js +1 -1
- package/src/core/compile/attributes.js +24 -7
- package/src/core/compile/compile.js +79 -249
- package/src/core/compile/compile.md +0 -8
- package/src/core/compile/compile.spec.js +38 -640
- package/src/core/controller/controller.js +2 -2
- package/src/core/di/injector.js +1 -1
- package/src/core/di/injector.spec.js +1 -1
- package/src/core/di/internal-injector.js +2 -2
- package/src/core/di/ng-module.js +1 -1
- package/src/core/filter/filter.js +2 -2
- package/src/core/interpolate/interpolate.js +1 -1
- package/src/core/interval/interval-factory.js +1 -1
- package/src/core/interval/interval.js +1 -1
- package/src/core/location/location.js +3 -3
- package/src/core/on.spec.js +1 -1
- package/src/core/parse/interpreter.js +1 -1
- package/src/core/prop.spec.js +2 -2
- package/src/core/q/q.js +2 -2
- package/src/core/root-element.spec.js +1 -1
- package/src/core/sanitize/sanitize-uri.js +1 -1
- package/src/core/sce/sce.js +3 -3
- package/src/core/sce/sce.spec.js +1 -1
- package/src/core/scope/scope.js +3 -3
- package/src/core/scope/scope.spec.js +1 -1
- package/src/core/timeout/timeout.js +2 -2
- package/src/core/url-utils/url-utils.js +1 -1
- package/src/directive/aria/aria.js +1 -1
- package/src/directive/aria/aria.spec.js +1 -1
- package/src/directive/attrs/attrs.js +3 -3
- package/src/directive/attrs/attrs.spec.js +1 -1
- package/src/directive/attrs/boolean.spec.js +1 -1
- package/src/directive/attrs/element-style.spec.js +1 -1
- package/src/directive/attrs/src.spec.js +1 -1
- package/src/directive/bind/bind.js +1 -1
- package/src/directive/bind/bind.spec.js +1 -1
- package/src/directive/bind/bing-html.spec.js +1 -1
- package/src/directive/change/change.spec.js +1 -1
- package/src/directive/channel/channel.js +25 -7
- package/src/directive/channel/channel.spec.js +17 -0
- package/src/directive/class/class.js +1 -1
- package/src/directive/class/class.spec.js +2 -2
- package/src/directive/cloak/cloak.spec.js +1 -1
- package/src/directive/controller/controller.spec.js +2 -2
- package/src/directive/events/click.spec.js +1 -1
- package/src/directive/events/event.spec.js +1 -1
- package/src/directive/events/events.js +3 -3
- package/src/directive/form/form.js +2 -2
- package/src/directive/form/form.spec.js +1 -1
- package/src/directive/if/if.js +2 -3
- package/src/directive/if/if.md +0 -1
- package/src/directive/if/if.spec.js +2 -2
- package/src/directive/include/include.js +3 -3
- package/src/directive/include/include.spec.js +2 -2
- package/src/directive/init/init.spec.js +1 -1
- package/src/directive/input/input.js +1 -1
- package/src/directive/input/input.spec.js +1 -1
- package/src/directive/messages/messages.js +1 -1
- package/src/directive/messages/messages.spec.js +3 -3
- package/src/directive/model/model.js +7 -7
- package/src/directive/model/model.spec.js +2 -2
- package/src/directive/model-options/model-options.js +1 -1
- package/src/directive/model-options/model-options.spec.js +2 -2
- package/src/directive/non-bindable/non-bindable.spec.js +1 -1
- package/src/directive/observe/observe.spec.js +1 -1
- package/src/directive/options/options.js +6 -2
- package/src/directive/options/options.spec.js +2 -2
- package/src/directive/ref/href.spec.js +2 -2
- package/src/directive/ref/ref.js +1 -1
- package/src/directive/repeat/repeat.js +263 -255
- package/src/directive/repeat/repeat.md +0 -22
- package/src/directive/repeat/repeat.spec.js +2 -115
- package/src/directive/script/script.spec.js +1 -1
- package/src/directive/select/select.js +2 -2
- package/src/directive/select/select.spec.js +2 -2
- package/src/directive/show-hide/show-hide.js +1 -3
- package/src/directive/show-hide/show-hide.md +0 -2
- package/src/directive/show-hide/show-hide.spec.js +1 -1
- package/src/directive/style/style.spec.js +1 -1
- package/src/directive/switch/switch.js +2 -4
- package/src/directive/switch/switch.spec.js +1 -51
- package/src/directive/transclude/transclude.js +2 -2
- package/src/directive/validators/validators.js +2 -2
- package/src/directive/validators/validators.spec.js +1 -1
- package/src/filters/filter.js +1 -1
- package/src/filters/filter.spec.js +2 -2
- package/src/filters/filters.js +1 -1
- package/src/filters/filters.spec.js +1 -1
- package/src/filters/limit-to.js +1 -1
- package/src/filters/limit-to.spec.js +1 -1
- package/src/filters/order-by.js +1 -1
- package/src/index.js +3 -9
- package/src/loader.js +12 -16
- package/src/router/common/coreservices.js +1 -1
- package/src/router/common/trace.js +1 -1
- package/src/router/directives/state-directives.js +1 -1
- package/src/router/directives/state-directives.spec.js +1 -1
- package/src/router/directives/view-directive.js +2 -2
- package/src/router/directives/view-directive.spec.js +1 -1
- package/src/router/hooks/redirect-to.js +1 -1
- package/src/router/params/param-type.js +1 -1
- package/src/router/params/param-types.js +1 -1
- package/src/router/params/param.js +1 -1
- package/src/router/resolve/resolvable.js +1 -1
- package/src/router/resolve/resolve-context.js +1 -1
- package/src/router/state/state-builder.js +1 -1
- package/src/router/state/state-matcher.js +1 -1
- package/src/router/state/state-object.js +1 -1
- package/src/router/state/state-queue-manager.js +1 -1
- package/src/router/state/state-registry.js +2 -2
- package/src/router/state/state-service.js +1 -1
- package/src/router/state/state.spec.js +2 -2
- package/src/router/state/target-state.js +1 -1
- package/src/router/state/views.js +1 -1
- package/src/router/state-provider.js +1 -1
- package/src/router/template-factory.js +9 -8
- package/src/router/template-factory.spec.js +1 -1
- package/src/router/transition/hook-registry.js +1 -1
- package/src/router/transition/transition-service.js +1 -1
- package/src/router/transition/transition.js +1 -1
- package/src/router/url/url-config.js +1 -1
- package/src/router/url/url-matcher.js +2 -2
- package/src/router/url/url-rule.js +1 -1
- package/src/router/url/url-rules.js +1 -1
- package/src/router/url/url-service.js +6 -1
- package/src/router/url/url-service.spec.js +1 -1
- package/src/router/view/view.spec.js +1 -1
- package/src/router/view-hook.spec.js +1 -1
- package/src/router/view-scroll.spec.js +1 -1
- package/src/services/anchor-scroll.js +1 -1
- package/src/services/browser.js +2 -2
- package/src/services/cookie-reader.js +1 -1
- package/src/services/http/http.js +3 -3
- package/src/services/http/http.spec.js +1 -1
- package/src/services/http-backend/http-backend.js +1 -1
- package/src/services/log.js +1 -1
- package/src/services/template-request.js +2 -2
- package/src/shared/common.js +1 -1
- package/src/shared/jqlite/jqlite.js +9 -9
- package/src/shared/jqlite/jqlite.spec.js +11 -11
- package/src/shared/min-err.spec.js +6 -1
- package/src/shared/predicates.js +1 -1
- package/src/shared/strings.js +1 -1
- package/src/shared/test-utils.js +1 -1
- package/src/shared/utils.js +1 -1
- package/src/shared/utils.spec.js +1 -1
- package/src/types.js +0 -2
- package/types/animations/animate-css-driver.d.ts +1 -1
- package/types/animations/animate-js.d.ts +1 -1
- package/types/animations/animate.d.ts +1 -1
- package/types/animations/animation.d.ts +1 -1
- package/types/core/cache/cache.d.ts +1 -1
- package/types/core/compile/attributes.d.ts +2 -2
- package/types/core/compile/compile.d.ts +3 -2
- package/types/core/controller/controller.d.ts +1 -1
- package/types/core/filter/filter.d.ts +1 -1
- package/types/core/location/location.d.ts +1 -1
- package/types/core/q/q.d.ts +1 -1
- package/types/core/sce/sce.d.ts +1 -1
- package/types/core/scope/scope.d.ts +1 -1
- package/types/core/timeout/timeout.d.ts +1 -1
- package/types/directive/channel/channel.d.ts +13 -4
- package/types/directive/model/model.d.ts +9 -9
- package/types/directive/repeat/repeat.d.ts +10 -8
- package/types/loader.d.ts +5 -6
- package/types/router/common/coreservices.d.ts +1 -1
- package/types/router/state/state-registry.d.ts +2 -2
- package/types/router/template-factory.d.ts +2 -2
- package/types/services/browser.d.ts +1 -1
- package/types/services/http/http.d.ts +1 -1
- package/types/services/template-request.d.ts +1 -1
- package/types/shared/jqlite/jqlite.d.ts +1 -1
- package/types/shared/test-utils.d.ts +1 -1
- package/types/types.d.ts +1 -5
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { defaults, find } from "../../shared/common";
|
|
2
2
|
import { propEq } from "../../shared/hof";
|
|
3
3
|
import { Glob } from "../common/glob";
|
|
4
|
-
import { isFunction, isObject } from "../../shared/utils";
|
|
4
|
+
import { isFunction, isObject } from "../../shared/utils.js";
|
|
5
5
|
/**
|
|
6
6
|
* Internal representation of a ng-router state.
|
|
7
7
|
*
|
|
@@ -5,7 +5,7 @@ import { applyPairs, removeFrom } from "../../shared/common";
|
|
|
5
5
|
import { propEq } from "../../shared/hof";
|
|
6
6
|
import { ResolveContext } from "../resolve/resolve-context";
|
|
7
7
|
import { ng1ViewsBuilder } from "./views";
|
|
8
|
-
import { isString } from "../../shared/utils";
|
|
8
|
+
import { isString } from "../../shared/utils.js";
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* A registry for all of the application's [[StateDeclaration]]s
|
|
@@ -54,7 +54,7 @@ export class StateRegistryProvider {
|
|
|
54
54
|
"$injector",
|
|
55
55
|
/**
|
|
56
56
|
*
|
|
57
|
-
* @param {import("../../core/di/internal-injector").InjectorService} $injector
|
|
57
|
+
* @param {import("../../core/di/internal-injector.js").InjectorService} $injector
|
|
58
58
|
* @returns
|
|
59
59
|
*/
|
|
60
60
|
($injector) => {
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
silenceUncaughtInPromise,
|
|
6
6
|
silentRejection,
|
|
7
7
|
} from "../../shared/common";
|
|
8
|
-
import { isDefined, isObject, isString, minErr } from "../../shared/utils";
|
|
8
|
+
import { isDefined, isObject, isString, minErr } from "../../shared/utils.js";
|
|
9
9
|
import { Queue } from "../common/queue";
|
|
10
10
|
import { services } from "../common/coreservices";
|
|
11
11
|
import { makeTargetState } from "../path/path-utils";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { dealoc } from "../../shared/jqlite/jqlite";
|
|
1
|
+
import { dealoc } from "../../shared/jqlite/jqlite.js";
|
|
2
2
|
import { Angular } from "../../loader";
|
|
3
|
-
import { isFunction } from "../../shared/utils";
|
|
3
|
+
import { isFunction } from "../../shared/utils.js";
|
|
4
4
|
import { wait } from "../../shared/test-utils";
|
|
5
5
|
|
|
6
6
|
describe("$state", () => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { pick, tail } from "../../shared/common";
|
|
2
|
-
import { isDefined, isString } from "../../shared/utils";
|
|
2
|
+
import { isDefined, isString } from "../../shared/utils.js";
|
|
3
3
|
import { isInjectable } from "../../shared/predicates";
|
|
4
4
|
import { services } from "../common/coreservices";
|
|
5
5
|
import { trace } from "../common/trace";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { val } from "../shared/hof";
|
|
2
2
|
import { createProxyFunctions } from "../shared/common";
|
|
3
|
-
import { minErr } from "../shared/utils";
|
|
3
|
+
import { minErr } from "../shared/utils.js";
|
|
4
4
|
|
|
5
5
|
const err = minErr("$stateProvider");
|
|
6
6
|
// Right now this is a collection of all the properties we encounter in tests
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { isDefined, isFunction, isObject } from "../shared/utils";
|
|
2
|
-
import { services } from "./common/coreservices";
|
|
3
|
-
import { tail, unnestR } from "../shared/common";
|
|
4
|
-
import { Resolvable } from "./resolve/resolvable";
|
|
5
|
-
import { kebobString } from "../shared/strings";
|
|
6
|
-
import { annotate } from "../core/di/injector";
|
|
1
|
+
import { isDefined, isFunction, isObject } from "../shared/utils.js";
|
|
2
|
+
import { services } from "./common/coreservices.js";
|
|
3
|
+
import { tail, unnestR } from "../shared/common.js";
|
|
4
|
+
import { Resolvable } from "./resolve/resolvable.js";
|
|
5
|
+
import { kebobString } from "../shared/strings.js";
|
|
6
|
+
import { annotate } from "../core/di/injector.js";
|
|
7
|
+
import { DIRECTIVE_SUFFIX } from "../core/compile/compile.js";
|
|
7
8
|
|
|
8
9
|
/**
|
|
9
10
|
* @typedef BindingTuple
|
|
@@ -31,7 +32,7 @@ export class TemplateFactoryProvider {
|
|
|
31
32
|
* @param {import("../core/cache/cache-factory").TemplateCache} $templateCache
|
|
32
33
|
* @param {any} $templateRequest
|
|
33
34
|
* @param {any} $q
|
|
34
|
-
* @param {import("../core/di/internal-injector").InjectorService} $injector
|
|
35
|
+
* @param {import("../core/di/internal-injector.js").InjectorService} $injector
|
|
35
36
|
* @returns
|
|
36
37
|
*/
|
|
37
38
|
($http, $templateCache, $templateRequest, $q, $injector) => {
|
|
@@ -230,7 +231,7 @@ export class TemplateFactoryProvider {
|
|
|
230
231
|
* @returns
|
|
231
232
|
*/
|
|
232
233
|
function getComponentBindings(name) {
|
|
233
|
-
const cmpDefs = services.$injector.get(name +
|
|
234
|
+
const cmpDefs = services.$injector.get(name + DIRECTIVE_SUFFIX); // could be multiple
|
|
234
235
|
if (!cmpDefs || !cmpDefs.length)
|
|
235
236
|
throw new Error(`Unable to find component named '${name}'`);
|
|
236
237
|
return cmpDefs.map(getBindings).reduce(unnestR, []);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { removeFrom, tail, map } from "../../shared/common";
|
|
2
|
-
import { isString, isFunction } from "../../shared/utils";
|
|
2
|
+
import { isString, isFunction } from "../../shared/utils.js";
|
|
3
3
|
import { Glob } from "../common/glob";
|
|
4
4
|
import { TransitionHookScope } from "./interface";
|
|
5
5
|
/**
|
|
@@ -24,7 +24,7 @@ import { registerUpdateGlobalState } from "../hooks/update-globals";
|
|
|
24
24
|
import { registerLazyLoadHook } from "../hooks/lazy-load";
|
|
25
25
|
import { TransitionEventType } from "./transition-event-type";
|
|
26
26
|
import { TransitionHook } from "./transition-hook";
|
|
27
|
-
import { isDefined } from "../../shared/utils";
|
|
27
|
+
import { isDefined } from "../../shared/utils.js";
|
|
28
28
|
import { createProxyFunctions } from "../../shared/common";
|
|
29
29
|
import { val } from "../../shared/hof";
|
|
30
30
|
import { registerIgnoredTransitionHook } from "../hooks/ignored-transition";
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
flattenR,
|
|
13
13
|
uniqR,
|
|
14
14
|
} from "../../shared/common";
|
|
15
|
-
import { isUndefined, isObject, assert } from "../../shared/utils";
|
|
15
|
+
import { isUndefined, isObject, assert } from "../../shared/utils.js";
|
|
16
16
|
import { propEq, val, is } from "../../shared/hof";
|
|
17
17
|
import { TransitionHookPhase } from "./interface"; // has or is using
|
|
18
18
|
import { TransitionHook } from "./transition-hook";
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
defaults,
|
|
11
11
|
} from "../../shared/common";
|
|
12
12
|
import { propEq } from "../../shared/hof";
|
|
13
|
-
import { isDefined, isString } from "../../shared/utils";
|
|
13
|
+
import { isDefined, isString } from "../../shared/utils.js";
|
|
14
14
|
import { Param, DefType } from "../params/param";
|
|
15
15
|
import { joinNeighborsR, splitOnDelim } from "../../shared/strings";
|
|
16
16
|
function quoteRegExp(str, param) {
|
|
@@ -209,7 +209,7 @@ export class UrlMatcher {
|
|
|
209
209
|
const placeholder =
|
|
210
210
|
/([:*])([\w[\]]+)|\{([\w[\]]+)(?::\s*((?:[^{}\\]+|\\.|\{(?:[^{}\\]+|\\.)*\})+))?\}/g;
|
|
211
211
|
const searchPlaceholder =
|
|
212
|
-
/([:]?)([\w[\].-]+)|\{([\w[\].-]+)(?::\s*((?:[^{}
|
|
212
|
+
/([:]?)([\w[\].-]+)|\{([\w[\].-]+)(?::\s*((?:[^{\\}]+|\\.|{(?:[^{\\}]+|\\.)*})+))?\}/g;
|
|
213
213
|
const patterns = [];
|
|
214
214
|
let last = 0;
|
|
215
215
|
let matchArray;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { TargetState } from "../state/target-state";
|
|
2
2
|
import { UrlMatcher } from "./url-matcher";
|
|
3
3
|
import { is, val } from "../../shared/hof";
|
|
4
|
-
import { isDefined, isFunction, isString } from "../../shared/utils";
|
|
4
|
+
import { isDefined, isFunction, isString } from "../../shared/utils.js";
|
|
5
5
|
import { removeFrom } from "../../shared/common";
|
|
6
6
|
import { UrlRuleFactory } from "./url-rule";
|
|
7
7
|
const prioritySort = (a, b) => (b.priority || 0) - (a.priority || 0);
|
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
isFunction,
|
|
3
|
+
isDefined,
|
|
4
|
+
isObject,
|
|
5
|
+
isString,
|
|
6
|
+
} from "../../shared/utils.js";
|
|
2
7
|
import { is, pattern } from "../../shared/hof";
|
|
3
8
|
import { UrlRules } from "./url-rules";
|
|
4
9
|
import { TargetState } from "../state/target-state";
|
package/src/services/browser.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { JQLite } from "../shared/jqlite/jqlite";
|
|
1
|
+
import { JQLite } from "../shared/jqlite/jqlite.js";
|
|
2
2
|
import { urlResolve } from "../core/url-utils/url-utils";
|
|
3
|
-
import { equals } from "../shared/utils";
|
|
3
|
+
import { equals } from "../shared/utils.js";
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Removes a trailing hash ('#') from the given URL if it exists.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ScopePhase } from "../../core/scope/scope";
|
|
1
|
+
import { ScopePhase } from "../../core/scope/scope.js";
|
|
2
2
|
import { urlIsAllowedOriginFactory } from "../../core/url-utils/url-utils";
|
|
3
3
|
import {
|
|
4
4
|
minErr,
|
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
extend,
|
|
21
21
|
uppercase,
|
|
22
22
|
isPromiseLike,
|
|
23
|
-
} from "../../shared/utils";
|
|
23
|
+
} from "../../shared/utils.js";
|
|
24
24
|
import { getCookies } from "../cookie-reader";
|
|
25
25
|
|
|
26
26
|
const APPLICATION_JSON = "application/json";
|
|
@@ -390,7 +390,7 @@ export function HttpProvider() {
|
|
|
390
390
|
* @param {*} $httpBackend
|
|
391
391
|
* @param {*} $rootScope
|
|
392
392
|
* @param {*} $q
|
|
393
|
-
* @param {import("../../core/di/internal-injector").InjectorService} $injector
|
|
393
|
+
* @param {import("../../core/di/internal-injector.js").InjectorService} $injector
|
|
394
394
|
* @param {*} $sce
|
|
395
395
|
* @returns
|
|
396
396
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { urlResolve } from "../../core/url-utils/url-utils";
|
|
2
|
-
import { isDefined, isPromiseLike, isUndefined } from "../../shared/utils";
|
|
2
|
+
import { isDefined, isPromiseLike, isUndefined } from "../../shared/utils.js";
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* HTTP backend used by the {@link ng.$http service} that delegates to
|
package/src/services/log.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defaultHttpResponseTransform } from "./http/http";
|
|
2
|
-
import { extend, isString, minErr } from "../shared/utils";
|
|
2
|
+
import { extend, isString, minErr } from "../shared/utils.js";
|
|
3
3
|
|
|
4
4
|
var $templateRequestMinErr = minErr("$templateRequest");
|
|
5
5
|
|
|
@@ -61,7 +61,7 @@ export function TemplateRequestProvider() {
|
|
|
61
61
|
"$sce",
|
|
62
62
|
/**
|
|
63
63
|
*
|
|
64
|
-
* @param {import('../core/exception-handler').ErrorHandler} $exceptionHandler
|
|
64
|
+
* @param {import('../core/exception-handler.js').ErrorHandler} $exceptionHandler
|
|
65
65
|
* @param {import('../core/cache/cache-factory').TemplateCache} $templateCache
|
|
66
66
|
* @param {*} $http
|
|
67
67
|
* @param {*} $q
|
package/src/shared/common.js
CHANGED
|
@@ -11,8 +11,8 @@ import {
|
|
|
11
11
|
lowercase,
|
|
12
12
|
getNodeName,
|
|
13
13
|
shallowCopy,
|
|
14
|
-
} from "../utils";
|
|
15
|
-
import {
|
|
14
|
+
} from "../utils.js";
|
|
15
|
+
import { Cache, EXPANDO } from "../../core/cache/cache.js";
|
|
16
16
|
|
|
17
17
|
/** @type {number} */
|
|
18
18
|
let jqId = 1;
|
|
@@ -128,7 +128,7 @@ JQLite.prototype.elements = function () {
|
|
|
128
128
|
};
|
|
129
129
|
|
|
130
130
|
/**
|
|
131
|
-
* Remove all child nodes of the set of matched elements from the DOM and clears
|
|
131
|
+
* Remove all child nodes of the set of matched elements from the DOM and clears Cache data, associated with the node.
|
|
132
132
|
* @returns {JQLite} The current instance of JQLite.
|
|
133
133
|
*/
|
|
134
134
|
JQLite.prototype.empty = function () {
|
|
@@ -750,7 +750,7 @@ export function snakeToCamel(name) {
|
|
|
750
750
|
*/
|
|
751
751
|
export function removeElementData(element, name) {
|
|
752
752
|
const expandoId = element[EXPANDO];
|
|
753
|
-
const expandoStore = expandoId &&
|
|
753
|
+
const expandoStore = expandoId && Cache.get(expandoId);
|
|
754
754
|
|
|
755
755
|
if (expandoStore) {
|
|
756
756
|
if (name) {
|
|
@@ -774,7 +774,7 @@ export function removeElementData(element, name) {
|
|
|
774
774
|
*/
|
|
775
775
|
function getExpando(element, createIfNecessary = false) {
|
|
776
776
|
let expandoId = element[EXPANDO];
|
|
777
|
-
let expandoStore = expandoId &&
|
|
777
|
+
let expandoStore = expandoId && Cache.get(expandoId);
|
|
778
778
|
|
|
779
779
|
if (createIfNecessary && !expandoStore) {
|
|
780
780
|
element[EXPANDO] = expandoId = jqNextId();
|
|
@@ -783,7 +783,7 @@ function getExpando(element, createIfNecessary = false) {
|
|
|
783
783
|
data: {},
|
|
784
784
|
handle: null,
|
|
785
785
|
};
|
|
786
|
-
|
|
786
|
+
Cache.set(expandoId, expandoStore);
|
|
787
787
|
}
|
|
788
788
|
|
|
789
789
|
return expandoStore;
|
|
@@ -899,13 +899,13 @@ export function dealoc(element, onlyDescendants) {
|
|
|
899
899
|
*/
|
|
900
900
|
function removeIfEmptyData(element) {
|
|
901
901
|
const expandoId = element[EXPANDO];
|
|
902
|
-
const { events, data } =
|
|
902
|
+
const { events, data } = Cache.get(expandoId);
|
|
903
903
|
|
|
904
904
|
if (
|
|
905
905
|
(!data || !Object.keys(data).length) &&
|
|
906
906
|
(!events || !Object.keys(events).length)
|
|
907
907
|
) {
|
|
908
|
-
|
|
908
|
+
Cache.delete(expandoId);
|
|
909
909
|
element[EXPANDO] = undefined; // don't delete DOM expandos. Chrome don't like it
|
|
910
910
|
}
|
|
911
911
|
}
|
|
@@ -1179,7 +1179,7 @@ export function getBooleanAttrName(element, name) {
|
|
|
1179
1179
|
*/
|
|
1180
1180
|
export function cleanElementData(nodes) {
|
|
1181
1181
|
for (let i = 0, ii = nodes.length; i < ii; i++) {
|
|
1182
|
-
const events = (
|
|
1182
|
+
const events = (Cache.get(nodes[i][EXPANDO]) || {}).events;
|
|
1183
1183
|
if (events && events.$destroy) {
|
|
1184
1184
|
JQLite(nodes[i]).triggerHandler("$destroy");
|
|
1185
1185
|
}
|
|
@@ -8,9 +8,9 @@ import {
|
|
|
8
8
|
} from "./jqlite";
|
|
9
9
|
import { Angular } from "../../loader";
|
|
10
10
|
import { createInjector } from "../../core/di/injector";
|
|
11
|
-
import { equals } from "../utils";
|
|
11
|
+
import { equals } from "../utils.js";
|
|
12
12
|
import { browserTrigger } from "../test-utils";
|
|
13
|
-
import {
|
|
13
|
+
import { Cache, EXPANDO } from "../../core/cache/cache.js";
|
|
14
14
|
|
|
15
15
|
describe("jqLite", () => {
|
|
16
16
|
let scope;
|
|
@@ -532,7 +532,7 @@ describe("jqLite", () => {
|
|
|
532
532
|
|
|
533
533
|
it("should not break on cleanElementData(), if element has no data", () => {
|
|
534
534
|
const selected = JQLite([a, b, c]);
|
|
535
|
-
spyOn(
|
|
535
|
+
spyOn(Cache, "get").and.returnValue(undefined);
|
|
536
536
|
expect(() => {
|
|
537
537
|
cleanElementData(selected);
|
|
538
538
|
}).not.toThrow();
|
|
@@ -552,13 +552,13 @@ describe("jqLite", () => {
|
|
|
552
552
|
});
|
|
553
553
|
|
|
554
554
|
it("should not add to the cache if the node is a comment or text node", () => {
|
|
555
|
-
const initial =
|
|
555
|
+
const initial = Cache.size;
|
|
556
556
|
const nodes = JQLite("<!-- some comment --> and some text");
|
|
557
|
-
expect(
|
|
557
|
+
expect(Cache.size).toEqual(initial);
|
|
558
558
|
nodes.data("someKey");
|
|
559
|
-
expect(
|
|
559
|
+
expect(Cache.size).toEqual(initial);
|
|
560
560
|
nodes.data("someKey", "someValue");
|
|
561
|
-
expect(
|
|
561
|
+
expect(Cache.size).toEqual(initial);
|
|
562
562
|
});
|
|
563
563
|
|
|
564
564
|
describe("removeElementData/getOrSetCacheData helpers", () => {
|
|
@@ -566,13 +566,13 @@ describe("jqLite", () => {
|
|
|
566
566
|
const node = document.createElement("div");
|
|
567
567
|
document.body.appendChild(node);
|
|
568
568
|
|
|
569
|
-
expect(
|
|
569
|
+
expect(Cache.has(node[EXPANDO])).toBe(false);
|
|
570
570
|
expect(getOrSetCacheData(node, "foo")).toBeUndefined();
|
|
571
|
-
expect(
|
|
571
|
+
expect(Cache.has(node[EXPANDO])).toBe(false);
|
|
572
572
|
|
|
573
573
|
getOrSetCacheData(node, "foo", "bar");
|
|
574
574
|
|
|
575
|
-
expect(
|
|
575
|
+
expect(Cache.has(node[EXPANDO])).toBe(true);
|
|
576
576
|
expect(getOrSetCacheData(node, "foo")).toBe("bar");
|
|
577
577
|
expect(JQLite(node).data("foo")).toBe("bar");
|
|
578
578
|
|
|
@@ -587,7 +587,7 @@ describe("jqLite", () => {
|
|
|
587
587
|
expect(getOrSetCacheData(node, "bar")).toBeUndefined();
|
|
588
588
|
|
|
589
589
|
JQLite(node).remove();
|
|
590
|
-
expect(
|
|
590
|
+
expect(Cache.has(node[EXPANDO])).toBe(false);
|
|
591
591
|
});
|
|
592
592
|
});
|
|
593
593
|
|
package/src/shared/predicates.js
CHANGED
package/src/shared/strings.js
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* @packageDocumentation
|
|
7
7
|
*/
|
|
8
8
|
import { isInjectable, isNull, isPromise } from "./predicates";
|
|
9
|
-
import { isUndefined, isFunction, isString, isObject } from "./utils";
|
|
9
|
+
import { isUndefined, isFunction, isString, isObject } from "./utils.js";
|
|
10
10
|
import { pushR, tail } from "./common";
|
|
11
11
|
import { pattern, val } from "./hof";
|
|
12
12
|
/**
|
package/src/shared/test-utils.js
CHANGED
package/src/shared/utils.js
CHANGED
package/src/shared/utils.spec.js
CHANGED
package/src/types.js
CHANGED
|
@@ -231,8 +231,6 @@
|
|
|
231
231
|
* @property {boolean | { [boundProperty: string]: string } | undefined} [bindToController]
|
|
232
232
|
* Bindings to controller.
|
|
233
233
|
* @property {DirectiveLinkFn | DirectivePrePost | undefined} [link]
|
|
234
|
-
* Link function.
|
|
235
|
-
* @property {boolean | undefined} [multiElement]
|
|
236
234
|
* Multi-element directive flag.
|
|
237
235
|
* @property {number | undefined} [priority]
|
|
238
236
|
* Skip all directives on element
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export function AnimateJsProvider($animateProvider: any): void;
|
|
2
2
|
export class AnimateJsProvider {
|
|
3
3
|
constructor($animateProvider: any);
|
|
4
|
-
$get: (string | (($injector: import("../core/di/internal-injector").InjectorService, $$AnimateRunner: any) => (element: any, event: any, classes: any, options: any, ...args: any[]) => {
|
|
4
|
+
$get: (string | (($injector: import("../core/di/internal-injector.js").InjectorService, $$AnimateRunner: any) => (element: any, event: any, classes: any, options: any, ...args: any[]) => {
|
|
5
5
|
$$willAnimate: boolean;
|
|
6
6
|
end(): any;
|
|
7
7
|
start(): any;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export function AnimationProvider(): void;
|
|
2
2
|
export class AnimationProvider {
|
|
3
3
|
drivers: any[];
|
|
4
|
-
$get: (string | (($rootScope: any, $injector: import("../core/di/internal-injector").InjectorService, $$AnimateRunner: any, $$rAFScheduler: import("./raf-scheduler").RafScheduler, $$animateCache: any) => (element: any, event: any, options: any) => any))[];
|
|
4
|
+
$get: (string | (($rootScope: any, $injector: import("../core/di/internal-injector.js").InjectorService, $$AnimateRunner: any, $$rAFScheduler: import("./raf-scheduler").RafScheduler, $$animateCache: any) => (element: any, event: any, options: any) => any))[];
|
|
5
5
|
}
|
|
@@ -20,7 +20,7 @@ export class Attributes {
|
|
|
20
20
|
$exceptionHandler: import("../exception-handler").ErrorHandler;
|
|
21
21
|
$sce: any;
|
|
22
22
|
$attr: {};
|
|
23
|
-
$$element: import("../../shared/jqlite/jqlite").JQLite;
|
|
23
|
+
$$element: import("../../shared/jqlite/jqlite.js").JQLite;
|
|
24
24
|
/**
|
|
25
25
|
* Converts an attribute name (e.g. dash/colon/underscore-delimited string, optionally prefixed with `x-` or
|
|
26
26
|
* `data-`) to its normalized, camelCase form.
|
|
@@ -87,4 +87,4 @@ export class Attributes {
|
|
|
87
87
|
export type AttributeLike = {
|
|
88
88
|
$attr: any;
|
|
89
89
|
};
|
|
90
|
-
import { directiveNormalize } from "../../shared/utils";
|
|
90
|
+
import { directiveNormalize } from "../../shared/utils.js";
|
|
@@ -99,13 +99,14 @@ export class CompileProvider {
|
|
|
99
99
|
* @returns {object} `this` for chaining
|
|
100
100
|
*/
|
|
101
101
|
addPropertySecurityContext: (elementName: string, propertyName: string, ctx: string) => object;
|
|
102
|
-
$get: (string | (($injector: import("../../core/di/internal-injector").InjectorService, $interpolate: any, $exceptionHandler: import("../exception-handler").ErrorHandler, $templateRequest: any, $parse: import("../parse/parse").ParseService, $controller: any, $rootScope: import("../scope/scope").Scope, $sce: any, $animate: any) => ($compileNodes: string | NodeList, transcludeFn: any, maxPriority: any, ignoreDirective: any, previousCompileContext: any) => (scope: any, cloneConnectFn: any, options: any) => JQLite))[];
|
|
102
|
+
$get: (string | (($injector: import("../../core/di/internal-injector.js").InjectorService, $interpolate: any, $exceptionHandler: import("../exception-handler").ErrorHandler, $templateRequest: any, $parse: import("../parse/parse").ParseService, $controller: any, $rootScope: import("../scope/scope").Scope, $sce: any, $animate: any) => ($compileNodes: string | NodeList, transcludeFn: any, maxPriority: any, ignoreDirective: any, previousCompileContext: any) => (scope: any, cloneConnectFn: any, options: any) => JQLite))[];
|
|
103
103
|
}
|
|
104
104
|
export namespace CompileProvider {
|
|
105
105
|
let $inject: string[];
|
|
106
106
|
}
|
|
107
|
+
export const DIRECTIVE_SUFFIX: "Directive";
|
|
107
108
|
/**
|
|
108
109
|
* Function that aggregates all linking fns for a compilation root (nodeList)
|
|
109
110
|
*/
|
|
110
111
|
export type CompositeLinkFn = Function;
|
|
111
|
-
import { JQLite } from "../../shared/jqlite/jqlite";
|
|
112
|
+
import { JQLite } from "../../shared/jqlite/jqlite.js";
|
|
@@ -31,7 +31,7 @@ export class ControllerProvider {
|
|
|
31
31
|
/**
|
|
32
32
|
* $get method for dependency injection.
|
|
33
33
|
*
|
|
34
|
-
* @param {import("../../core/di/internal-injector").InjectorService} $injector
|
|
34
|
+
* @param {import("../../core/di/internal-injector.js").InjectorService} $injector
|
|
35
35
|
* @returns {Function} A service function that creates controllers.
|
|
36
36
|
*/
|
|
37
37
|
$get: (string | (($injector: any) => (expression: any, locals: any, later: any, ident: any) => any))[];
|