@angular-wave/angular.ts 0.0.21 → 0.0.23
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 +1 -1
- package/TODO.md +14 -0
- package/dist/angular-ts.esm.js +1 -1
- package/dist/angular-ts.umd.js +1 -1
- package/index.html +8 -2
- package/package.json +1 -1
- package/src/animations/animate-css-driver.js +2 -2
- package/src/animations/animate-css.js +15 -6
- package/src/animations/animate-js.js +1 -1
- package/src/animations/animate-queue.js +1 -1
- package/src/animations/shared.js +0 -14
- package/src/core/compile.js +6 -3
- package/src/directive/if.js +0 -79
- package/src/directive/if.md +80 -0
- package/src/directive/include.js +0 -82
- package/src/directive/include.md +86 -0
- package/src/directive/repeat.js +0 -1
- package/src/filters/order-by.js +8 -8
- package/src/loader.js +0 -1
- package/src/router/common/trace.js +1 -1
- package/src/router/directives/stateDirectives.js +16 -14
- package/src/router/directives/viewDirective.js +5 -13
- package/src/router/hooks/resolve.js +3 -4
- package/src/router/hooks/views.js +3 -2
- package/src/router/state/stateService.js +1 -2
- package/src/router/stateProvider.js +8 -0
- package/src/router/templateFactory.js +13 -7
- package/src/router/transition/interface.js +14 -14
- package/src/router/transition/rejectFactory.js +29 -20
- package/src/router/transition/transition.js +5 -1
- package/src/router/transition/transitionHook.js +5 -5
- package/src/router/url/urlMatcher.js +1 -2
- package/src/router/url/urlRule.js +10 -2
- package/src/router/url/urlRules.js +1 -1
- package/src/services/browser.js +3 -18
- package/src/shared/common.js +0 -1
- package/test/module-test.html +44 -12
- package/test/router/ng-state-builder.spec.js +81 -0
- package/test/router/services.spec.js +70 -0
- package/test/router/state-directives.spec.js +1182 -0
- package/test/router/template-factory.spec.js +146 -0
- package/test/router/url-matcher-factory.spec.js +1313 -0
- package/test/router/view-directive.spec.js +2013 -0
- package/test/router/view-hook.spec.js +217 -0
- package/test/router/view-scroll.spec.js +77 -0
- package/test/router/view.spec.js +117 -0
- package/types/angular.d.ts +132 -124
- package/types/index.d.ts +2350 -2187
- package/types/jqlite.d.ts +463 -418
- package/types/router/core/common/common.d.ts +70 -24
- package/types/router/core/common/coreservices.d.ts +30 -32
- package/types/router/core/common/glob.d.ts +9 -9
- package/types/router/core/common/hof.d.ts +12 -4
- package/types/router/core/common/index.d.ts +8 -8
- package/types/router/core/common/predicates.d.ts +1 -1
- package/types/router/core/common/queue.d.ts +13 -13
- package/types/router/core/common/safeConsole.d.ts +3 -3
- package/types/router/core/common/strings.d.ts +4 -2
- package/types/router/core/common/trace.d.ts +94 -82
- package/types/router/core/globals.d.ts +37 -37
- package/types/router/core/hooks/coreResolvables.d.ts +5 -3
- package/types/router/core/hooks/ignoredTransition.d.ts +4 -2
- package/types/router/core/hooks/invalidTransition.d.ts +4 -2
- package/types/router/core/hooks/lazyLoad.d.ts +10 -5
- package/types/router/core/hooks/onEnterExitRetain.d.ts +10 -4
- package/types/router/core/hooks/redirectTo.d.ts +4 -2
- package/types/router/core/hooks/resolve.d.ts +10 -4
- package/types/router/core/hooks/updateGlobals.d.ts +4 -2
- package/types/router/core/hooks/url.d.ts +4 -2
- package/types/router/core/hooks/views.d.ts +7 -3
- package/types/router/core/index.d.ts +11 -12
- package/types/router/core/interface.d.ts +83 -81
- package/types/router/core/params/index.d.ts +5 -5
- package/types/router/core/params/interface.d.ts +439 -439
- package/types/router/core/params/param.d.ts +72 -60
- package/types/router/core/params/paramType.d.ts +40 -40
- package/types/router/core/params/paramTypes.d.ts +169 -165
- package/types/router/core/params/stateParams.d.ts +13 -13
- package/types/router/core/path/index.d.ts +2 -2
- package/types/router/core/path/pathNode.d.ts +49 -49
- package/types/router/core/path/pathUtils.d.ts +100 -74
- package/types/router/core/resolve/index.d.ts +3 -3
- package/types/router/core/resolve/interface.d.ts +137 -137
- package/types/router/core/resolve/resolvable.d.ts +60 -54
- package/types/router/core/resolve/resolveContext.d.ts +84 -79
- package/types/router/core/router.d.ts +95 -86
- package/types/router/core/state/index.d.ts +8 -8
- package/types/router/core/state/interface.d.ts +667 -643
- package/types/router/core/state/stateBuilder.d.ts +41 -38
- package/types/router/core/state/stateMatcher.d.ts +11 -9
- package/types/router/core/state/stateObject.d.ts +154 -139
- package/types/router/core/state/stateQueueManager.d.ts +26 -21
- package/types/router/core/state/stateRegistry.d.ts +124 -121
- package/types/router/core/state/stateService.d.ts +380 -343
- package/types/router/core/state/targetState.d.ts +74 -69
- package/types/router/core/transition/hookBuilder.d.ts +34 -30
- package/types/router/core/transition/hookRegistry.d.ts +96 -74
- package/types/router/core/transition/index.d.ts +8 -8
- package/types/router/core/transition/interface.d.ts +652 -609
- package/types/router/core/transition/rejectFactory.d.ts +97 -97
- package/types/router/core/transition/transition.d.ts +565 -517
- package/types/router/core/transition/transitionEventType.d.ts +20 -11
- package/types/router/core/transition/transitionHook.d.ts +90 -82
- package/types/router/core/transition/transitionService.d.ts +228 -161
- package/types/router/core/url/index.d.ts +8 -8
- package/types/router/core/url/interface.d.ts +100 -87
- package/types/router/core/url/urlConfig.d.ts +130 -126
- package/types/router/core/url/urlMatcher.d.ts +132 -127
- package/types/router/core/url/urlMatcherFactory.d.ts +46 -42
- package/types/router/core/url/urlRouter.d.ts +91 -75
- package/types/router/core/url/urlRule.d.ts +123 -100
- package/types/router/core/url/urlRules.d.ts +240 -232
- package/types/router/core/url/urlService.d.ts +201 -201
- package/types/router/core/view/index.d.ts +2 -2
- package/types/router/core/view/interface.d.ts +26 -26
- package/types/router/core/view/view.d.ts +152 -143
- package/types/router/directives/viewDirective.d.ts +12 -11
- package/types/router/index.d.ts +11 -12
- package/types/router/interface.d.ts +361 -351
- package/types/router/legacy/resolveService.d.ts +44 -40
- package/types/router/legacy/stateEvents.d.ts +1 -1
- package/types/router/locationServices.d.ts +45 -37
- package/types/router/services.d.ts +9 -9
- package/types/router/stateFilters.d.ts +3 -3
- package/types/router/stateProvider.d.ts +240 -235
- package/types/router/statebuilders/onEnterExitRetain.d.ts +4 -2
- package/types/router/statebuilders/views.d.ts +35 -22
- package/types/router/templateFactory.d.ts +99 -79
- package/types/router/viewScroll.d.ts +7 -7
- package/src/directive/a.js +0 -37
- package/types/router/angular.d.ts +0 -1
- package/types/router/core/vanilla.d.ts +0 -1
- package/types/router/directives/stateDirectives.d.ts +0 -3
- package/types/router/injectables.d.ts +0 -1
|
@@ -1,84 +1,104 @@
|
|
|
1
|
-
import { IAugmentedJQuery } from
|
|
2
|
-
import { IInjectable, ResolveContext, RawParams } from
|
|
3
|
-
import { Ng1ViewDeclaration, TemplateFactoryProvider } from
|
|
1
|
+
import { IAugmentedJQuery } from "../";
|
|
2
|
+
import { IInjectable, ResolveContext, RawParams } from "./core";
|
|
3
|
+
import { Ng1ViewDeclaration, TemplateFactoryProvider } from "./interface";
|
|
4
4
|
/**
|
|
5
5
|
* Service which manages loading of templates from a ViewConfig.
|
|
6
6
|
*/
|
|
7
7
|
export declare class TemplateFactory implements TemplateFactoryProvider {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
8
|
+
/** @hidden */ private _useHttp;
|
|
9
|
+
/** @hidden */ private $templateRequest;
|
|
10
|
+
/** @hidden */ private $templateCache;
|
|
11
|
+
/** @hidden */ private $http;
|
|
12
|
+
/** @hidden */ $get: (
|
|
13
|
+
| string
|
|
14
|
+
| (($http: any, $templateCache: any, $injector: any) => this)
|
|
15
|
+
)[];
|
|
16
|
+
/** @hidden */
|
|
17
|
+
useHttpService(value: boolean): void;
|
|
18
|
+
/**
|
|
19
|
+
* Creates a template from a configuration object.
|
|
20
|
+
*
|
|
21
|
+
* @param config Configuration object for which to load a template.
|
|
22
|
+
* The following properties are search in the specified order, and the first one
|
|
23
|
+
* that is defined is used to create the template:
|
|
24
|
+
*
|
|
25
|
+
* @param params Parameters to pass to the template function.
|
|
26
|
+
* @param context The resolve context associated with the template's view
|
|
27
|
+
*
|
|
28
|
+
* @return {string|object} The template html as a string, or a promise for
|
|
29
|
+
* that string,or `null` if no template is configured.
|
|
30
|
+
*/
|
|
31
|
+
fromConfig(
|
|
32
|
+
config: Ng1ViewDeclaration,
|
|
33
|
+
params: any,
|
|
34
|
+
context: ResolveContext,
|
|
35
|
+
): Promise<{
|
|
36
|
+
template?: string;
|
|
37
|
+
component?: string;
|
|
38
|
+
}>;
|
|
39
|
+
/**
|
|
40
|
+
* Creates a template from a string or a function returning a string.
|
|
41
|
+
*
|
|
42
|
+
* @param template html template as a string or function that returns an html template as a string.
|
|
43
|
+
* @param params Parameters to pass to the template function.
|
|
44
|
+
*
|
|
45
|
+
* @return {string|object} The template html as a string, or a promise for that
|
|
46
|
+
* string.
|
|
47
|
+
*/
|
|
48
|
+
fromString(template: string | Function, params?: RawParams): any;
|
|
49
|
+
/**
|
|
50
|
+
* Loads a template from the a URL via `$http` and `$templateCache`.
|
|
51
|
+
*
|
|
52
|
+
* @param {string|Function} url url of the template to load, or a function
|
|
53
|
+
* that returns a url.
|
|
54
|
+
* @param {Object} params Parameters to pass to the url function.
|
|
55
|
+
* @return {string|Promise.<string>} The template html as a string, or a promise
|
|
56
|
+
* for that string.
|
|
57
|
+
*/
|
|
58
|
+
fromUrl(url: string | Function, params: any): any;
|
|
59
|
+
/**
|
|
60
|
+
* Creates a template by invoking an injectable provider function.
|
|
61
|
+
*
|
|
62
|
+
* @param provider Function to invoke via `locals`
|
|
63
|
+
* @param {Function} injectFn a function used to invoke the template provider
|
|
64
|
+
* @return {string|Promise.<string>} The template html as a string, or a promise
|
|
65
|
+
* for that string.
|
|
66
|
+
*/
|
|
67
|
+
fromProvider(
|
|
68
|
+
provider: IInjectable,
|
|
69
|
+
params: any,
|
|
70
|
+
context: ResolveContext,
|
|
71
|
+
): Promise<any>;
|
|
72
|
+
/**
|
|
73
|
+
* Creates a component's template by invoking an injectable provider function.
|
|
74
|
+
*
|
|
75
|
+
* @param provider Function to invoke via `locals`
|
|
76
|
+
* @param {Function} injectFn a function used to invoke the template provider
|
|
77
|
+
* @return {string} The template html as a string: "<component-name input1='::$resolve.foo'></component-name>".
|
|
78
|
+
*/
|
|
79
|
+
fromComponentProvider(
|
|
80
|
+
provider: IInjectable,
|
|
81
|
+
params: any,
|
|
82
|
+
context: ResolveContext,
|
|
83
|
+
): Promise<any>;
|
|
84
|
+
/**
|
|
85
|
+
* Creates a template from a component's name
|
|
86
|
+
*
|
|
87
|
+
* This implements route-to-component.
|
|
88
|
+
* It works by retrieving the component (directive) metadata from the injector.
|
|
89
|
+
* It analyses the component's bindings, then constructs a template that instantiates the component.
|
|
90
|
+
* The template wires input and output bindings to resolves or from the parent component.
|
|
91
|
+
*
|
|
92
|
+
* @param uiView {object} The parent ui-view (for binding outputs to callbacks)
|
|
93
|
+
* @param context The ResolveContext (for binding outputs to callbacks returned from resolves)
|
|
94
|
+
* @param component {string} Component's name in camel case.
|
|
95
|
+
* @param bindings An object defining the component's bindings: {foo: '<'}
|
|
96
|
+
* @return {string} The template as a string: "<component-name input1='::$resolve.foo'></component-name>".
|
|
97
|
+
*/
|
|
98
|
+
makeComponentTemplate(
|
|
99
|
+
uiView: IAugmentedJQuery,
|
|
100
|
+
context: ResolveContext,
|
|
101
|
+
component: string,
|
|
102
|
+
bindings?: any,
|
|
103
|
+
): string;
|
|
84
104
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
export interface UIViewScrollProvider {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
2
|
+
/**
|
|
3
|
+
* Uses standard anchorScroll behavior
|
|
4
|
+
*
|
|
5
|
+
* Reverts [[$uiViewScroll]] back to using the core [`$anchorScroll`](http://docs.angularjs.org/api/ng.$anchorScroll)
|
|
6
|
+
* service for scrolling based on the url anchor.
|
|
7
|
+
*/
|
|
8
|
+
useAnchorScroll(): void;
|
|
9
9
|
}
|
package/src/directive/a.js
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @ngdoc directive
|
|
3
|
-
* @name a
|
|
4
|
-
* @restrict E
|
|
5
|
-
*
|
|
6
|
-
* @description
|
|
7
|
-
* Modifies the default behavior of the html a tag so that the default action is prevented when
|
|
8
|
-
* the href attribute is empty.
|
|
9
|
-
*
|
|
10
|
-
* For dynamically creating `href` attributes for a tags, see the {@link ng.ngHref `ngHref`} directive.
|
|
11
|
-
*/
|
|
12
|
-
export function htmlAnchorDirective() {
|
|
13
|
-
return {
|
|
14
|
-
restrict: "E",
|
|
15
|
-
compile: (_element, attr) => {
|
|
16
|
-
if (!attr.href && !attr.xlinkHref) {
|
|
17
|
-
return (_scope, element) => {
|
|
18
|
-
// If the linked element is not an anchor tag anymore, do nothing
|
|
19
|
-
if (element[0].nodeName.toLowerCase() !== "a") return;
|
|
20
|
-
|
|
21
|
-
// SVGAElement does not use the href attribute, but rather the 'xlinkHref' attribute.
|
|
22
|
-
const href =
|
|
23
|
-
toString.call(element[0].href) === "[object SVGAnimatedString]"
|
|
24
|
-
? "xlink:href"
|
|
25
|
-
: "href";
|
|
26
|
-
element.on("click", (event) => {
|
|
27
|
-
// if we have no href url, then don't navigate anywhere.
|
|
28
|
-
if (!element.attr(href)) {
|
|
29
|
-
event.preventDefault();
|
|
30
|
-
}
|
|
31
|
-
});
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
|
-
return () => {};
|
|
35
|
-
},
|
|
36
|
-
};
|
|
37
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
/** @hidden */ export declare const ng: any;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './vanilla/index';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|