@angular-wave/angular.ts 0.0.20 → 0.0.22
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/README.md +3 -3
- package/TODO.md +14 -0
- package/dist/angular-ts.esm.js +1 -1
- package/dist/angular-ts.umd.js +1 -1
- package/index.html +2 -1
- 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/core/q.js +9 -9
- package/src/core/sanitize-uri.js +1 -1
- package/src/core/sce.js +1 -1
- 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/loader.js +0 -1
- package/src/public.js +0 -2
- package/src/router/common/trace.js +1 -1
- package/src/router/directives/stateDirectives.js +16 -14
- package/src/router/directives/viewDirective.js +2 -2
- 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/transition/interface.js +14 -14
- package/src/router/transition/rejectFactory.js +29 -20
- package/src/router/transition/transitionHook.js +5 -5
- package/src/router/url/urlMatcher.js +1 -2
- package/src/router/url/urlRule.js +1 -1
- package/src/router/url/urlRules.js +1 -1
- package/src/shared/common.js +0 -1
- package/test/module-test.html +44 -12
- package/test/router/services.spec.js +71 -0
- package/test/router/state-directives.spec.js +1208 -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/test/directive/a.spec.js +0 -192
- 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,24 +1,27 @@
|
|
|
1
|
-
import { TypedMap } from
|
|
2
|
-
import { PathNode } from
|
|
3
|
-
import { ActiveUIView, ViewContext, ViewConfig } from
|
|
4
|
-
import { _ViewDeclaration } from
|
|
5
|
-
import { UIRouter } from
|
|
6
|
-
export declare type ViewConfigFactory = (
|
|
1
|
+
import { TypedMap } from "../common/common";
|
|
2
|
+
import { PathNode } from "../path/pathNode";
|
|
3
|
+
import { ActiveUIView, ViewContext, ViewConfig } from "./interface";
|
|
4
|
+
import { _ViewDeclaration } from "../state/interface";
|
|
5
|
+
import { UIRouter } from "../router";
|
|
6
|
+
export declare type ViewConfigFactory = (
|
|
7
|
+
path: PathNode[],
|
|
8
|
+
decl: _ViewDeclaration,
|
|
9
|
+
) => ViewConfig | ViewConfig[];
|
|
7
10
|
export interface ViewServicePluginAPI {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
_rootViewContext(context?: ViewContext): ViewContext;
|
|
12
|
+
_viewConfigFactory(viewType: string, factory: ViewConfigFactory): any;
|
|
13
|
+
/** @param id router.$id + "." + uiView.id */
|
|
14
|
+
_registeredUIView(id: string): ActiveUIView;
|
|
15
|
+
_registeredUIViews(): ActiveUIView[];
|
|
16
|
+
_activeViewConfigs(): ViewConfig[];
|
|
17
|
+
_onSync(listener: ViewSyncListener): Function;
|
|
15
18
|
}
|
|
16
19
|
export interface ViewTuple {
|
|
17
|
-
|
|
18
|
-
|
|
20
|
+
uiView: ActiveUIView;
|
|
21
|
+
viewConfig: ViewConfig;
|
|
19
22
|
}
|
|
20
23
|
export interface ViewSyncListener {
|
|
21
|
-
|
|
24
|
+
(viewTuples: ViewTuple[]): void;
|
|
22
25
|
}
|
|
23
26
|
/**
|
|
24
27
|
* The View service
|
|
@@ -37,131 +40,137 @@ export interface ViewSyncListener {
|
|
|
37
40
|
*
|
|
38
41
|
*/
|
|
39
42
|
export declare class ViewService {
|
|
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
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
43
|
+
private router;
|
|
44
|
+
/** @internal */ private _uiViews;
|
|
45
|
+
/** @internal */ private _viewConfigs;
|
|
46
|
+
/** @internal */ private _rootContext;
|
|
47
|
+
/** @internal */ private _viewConfigFactories;
|
|
48
|
+
/** @internal */ private _listeners;
|
|
49
|
+
/** @internal */
|
|
50
|
+
_pluginapi: ViewServicePluginAPI;
|
|
51
|
+
/**
|
|
52
|
+
* Given a ui-view and a ViewConfig, determines if they "match".
|
|
53
|
+
*
|
|
54
|
+
* A ui-view has a fully qualified name (fqn) and a context object. The fqn is built from its overall location in
|
|
55
|
+
* the DOM, describing its nesting relationship to any parent ui-view tags it is nested inside of.
|
|
56
|
+
*
|
|
57
|
+
* A ViewConfig has a target ui-view name and a context anchor. The ui-view name can be a simple name, or
|
|
58
|
+
* can be a segmented ui-view path, describing a portion of a ui-view fqn.
|
|
59
|
+
*
|
|
60
|
+
* In order for a ui-view to match ViewConfig, ui-view's $type must match the ViewConfig's $type
|
|
61
|
+
*
|
|
62
|
+
* If the ViewConfig's target ui-view name is a simple name (no dots), then a ui-view matches if:
|
|
63
|
+
* - the ui-view's name matches the ViewConfig's target name
|
|
64
|
+
* - the ui-view's context matches the ViewConfig's anchor
|
|
65
|
+
*
|
|
66
|
+
* If the ViewConfig's target ui-view name is a segmented name (with dots), then a ui-view matches if:
|
|
67
|
+
* - There exists a parent ui-view where:
|
|
68
|
+
* - the parent ui-view's name matches the first segment (index 0) of the ViewConfig's target name
|
|
69
|
+
* - the parent ui-view's context matches the ViewConfig's anchor
|
|
70
|
+
* - And the remaining segments (index 1..n) of the ViewConfig's target name match the tail of the ui-view's fqn
|
|
71
|
+
*
|
|
72
|
+
* Example:
|
|
73
|
+
*
|
|
74
|
+
* DOM:
|
|
75
|
+
* <ui-view> <!-- created in the root context (name: "") -->
|
|
76
|
+
* <ui-view name="foo"> <!-- created in the context named: "A" -->
|
|
77
|
+
* <ui-view> <!-- created in the context named: "A.B" -->
|
|
78
|
+
* <ui-view name="bar"> <!-- created in the context named: "A.B.C" -->
|
|
79
|
+
* </ui-view>
|
|
80
|
+
* </ui-view>
|
|
81
|
+
* </ui-view>
|
|
82
|
+
* </ui-view>
|
|
83
|
+
*
|
|
84
|
+
* uiViews: [
|
|
85
|
+
* { fqn: "$default", creationContext: { name: "" } },
|
|
86
|
+
* { fqn: "$default.foo", creationContext: { name: "A" } },
|
|
87
|
+
* { fqn: "$default.foo.$default", creationContext: { name: "A.B" } }
|
|
88
|
+
* { fqn: "$default.foo.$default.bar", creationContext: { name: "A.B.C" } }
|
|
89
|
+
* ]
|
|
90
|
+
*
|
|
91
|
+
* These four view configs all match the ui-view with the fqn: "$default.foo.$default.bar":
|
|
92
|
+
*
|
|
93
|
+
* - ViewConfig1: { uiViewName: "bar", uiViewContextAnchor: "A.B.C" }
|
|
94
|
+
* - ViewConfig2: { uiViewName: "$default.bar", uiViewContextAnchor: "A.B" }
|
|
95
|
+
* - ViewConfig3: { uiViewName: "foo.$default.bar", uiViewContextAnchor: "A" }
|
|
96
|
+
* - ViewConfig4: { uiViewName: "$default.foo.$default.bar", uiViewContextAnchor: "" }
|
|
97
|
+
*
|
|
98
|
+
* Using ViewConfig3 as an example, it matches the ui-view with fqn "$default.foo.$default.bar" because:
|
|
99
|
+
* - The ViewConfig's segmented target name is: [ "foo", "$default", "bar" ]
|
|
100
|
+
* - There exists a parent ui-view (which has fqn: "$default.foo") where:
|
|
101
|
+
* - the parent ui-view's name "foo" matches the first segment "foo" of the ViewConfig's target name
|
|
102
|
+
* - the parent ui-view's context "A" matches the ViewConfig's anchor context "A"
|
|
103
|
+
* - And the remaining segments [ "$default", "bar" ].join("."_ of the ViewConfig's target name match
|
|
104
|
+
* the tail of the ui-view's fqn "default.bar"
|
|
105
|
+
*
|
|
106
|
+
* @internal
|
|
107
|
+
*/
|
|
108
|
+
static matches: (
|
|
109
|
+
uiViewsByFqn: TypedMap<ActiveUIView>,
|
|
110
|
+
uiView: ActiveUIView,
|
|
111
|
+
) => (viewConfig: ViewConfig) => boolean;
|
|
112
|
+
/**
|
|
113
|
+
* Normalizes a view's name from a state.views configuration block.
|
|
114
|
+
*
|
|
115
|
+
* This should be used by a framework implementation to calculate the values for
|
|
116
|
+
* [[_ViewDeclaration.$uiViewName]] and [[_ViewDeclaration.$uiViewContextAnchor]].
|
|
117
|
+
*
|
|
118
|
+
* @param context the context object (state declaration) that the view belongs to
|
|
119
|
+
* @param rawViewName the name of the view, as declared in the [[StateDeclaration.views]]
|
|
120
|
+
*
|
|
121
|
+
* @returns the normalized uiViewName and uiViewContextAnchor that the view targets
|
|
122
|
+
*/
|
|
123
|
+
static normalizeUIViewTarget(
|
|
124
|
+
context: ViewContext,
|
|
125
|
+
rawViewName?: string,
|
|
126
|
+
): {
|
|
127
|
+
uiViewName: string;
|
|
128
|
+
uiViewContextAnchor: string;
|
|
129
|
+
};
|
|
130
|
+
/** @internal */
|
|
131
|
+
constructor(/** @internal */ router: UIRouter);
|
|
132
|
+
/** @internal */
|
|
133
|
+
private _rootViewContext;
|
|
134
|
+
/** @internal */
|
|
135
|
+
private _viewConfigFactory;
|
|
136
|
+
createViewConfig(path: PathNode[], decl: _ViewDeclaration): ViewConfig[];
|
|
137
|
+
/**
|
|
138
|
+
* Deactivates a ViewConfig.
|
|
139
|
+
*
|
|
140
|
+
* This function deactivates a `ViewConfig`.
|
|
141
|
+
* After calling [[sync]], it will un-pair from any `ui-view` with which it is currently paired.
|
|
142
|
+
*
|
|
143
|
+
* @param viewConfig The ViewConfig view to deregister.
|
|
144
|
+
*/
|
|
145
|
+
deactivateViewConfig(viewConfig: ViewConfig): void;
|
|
146
|
+
activateViewConfig(viewConfig: ViewConfig): void;
|
|
147
|
+
sync(): void;
|
|
148
|
+
/**
|
|
149
|
+
* Registers a `ui-view` component
|
|
150
|
+
*
|
|
151
|
+
* When a `ui-view` component is created, it uses this method to register itself.
|
|
152
|
+
* After registration the [[sync]] method is used to ensure all `ui-view` are configured with the proper [[ViewConfig]].
|
|
153
|
+
*
|
|
154
|
+
* Note: the `ui-view` component uses the `ViewConfig` to determine what view should be loaded inside the `ui-view`,
|
|
155
|
+
* and what the view's state context is.
|
|
156
|
+
*
|
|
157
|
+
* Note: There is no corresponding `deregisterUIView`.
|
|
158
|
+
* A `ui-view` should hang on to the return value of `registerUIView` and invoke it to deregister itself.
|
|
159
|
+
*
|
|
160
|
+
* @param uiView The metadata for a UIView
|
|
161
|
+
* @return a de-registration function used when the view is destroyed.
|
|
162
|
+
*/
|
|
163
|
+
registerUIView(uiView: ActiveUIView): () => void;
|
|
164
|
+
/**
|
|
165
|
+
* Returns the list of views currently available on the page, by fully-qualified name.
|
|
166
|
+
*
|
|
167
|
+
* @return {Array} Returns an array of fully-qualified view names.
|
|
168
|
+
*/
|
|
169
|
+
available(): any[];
|
|
170
|
+
/**
|
|
171
|
+
* Returns the list of views on the page containing loaded content.
|
|
172
|
+
*
|
|
173
|
+
* @return {Array} Returns an array of fully-qualified view names.
|
|
174
|
+
*/
|
|
175
|
+
active(): any[];
|
|
167
176
|
}
|
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
/** @publicapi @module directives */ /** */
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { IDirective } from "../..";
|
|
3
|
+
import { ActiveUIView } from "../core";
|
|
4
|
+
import { Ng1ViewConfig } from "../statebuilders/views";
|
|
5
|
+
|
|
5
6
|
/** @hidden */
|
|
6
7
|
export declare type UIViewData = {
|
|
7
|
-
|
|
8
|
-
|
|
8
|
+
$cfg: Ng1ViewConfig;
|
|
9
|
+
$uiView: ActiveUIView;
|
|
9
10
|
};
|
|
10
11
|
/** @hidden */
|
|
11
12
|
export declare type UIViewAnimData = {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
$animEnter: Promise<any>;
|
|
14
|
+
$animLeave: Promise<any>;
|
|
15
|
+
$$animLeave: {
|
|
16
|
+
resolve: () => any;
|
|
17
|
+
};
|
|
17
18
|
};
|
|
18
19
|
/**
|
|
19
20
|
* `ui-view`: A viewport directive which is filled in by a view from the active state.
|
|
@@ -140,4 +141,4 @@ export declare type UIViewAnimData = {
|
|
|
140
141
|
* });
|
|
141
142
|
* ```
|
|
142
143
|
*/
|
|
143
|
-
export declare let uiView:
|
|
144
|
+
export declare let uiView: IDirective;
|
package/types/router/index.d.ts
CHANGED
|
@@ -2,18 +2,17 @@
|
|
|
2
2
|
* Main entry point for angular 1.x build
|
|
3
3
|
* @publicapi @module ng1
|
|
4
4
|
*/ /** */
|
|
5
|
-
export * from
|
|
6
|
-
export * from
|
|
7
|
-
export * from
|
|
8
|
-
export * from
|
|
9
|
-
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import './viewScroll';
|
|
5
|
+
export * from "./interface";
|
|
6
|
+
export * from "./services";
|
|
7
|
+
export * from "./statebuilders/views";
|
|
8
|
+
export * from "./stateProvider";
|
|
9
|
+
import "./injectables";
|
|
10
|
+
import "./directives/stateDirectives";
|
|
11
|
+
import "./stateFilters";
|
|
12
|
+
import "./directives/viewDirective";
|
|
13
|
+
import "./viewScroll";
|
|
15
14
|
declare const _default: "router";
|
|
16
15
|
export default _default;
|
|
17
|
-
import * as core from
|
|
16
|
+
import * as core from "./core/index";
|
|
18
17
|
export { core };
|
|
19
|
-
export * from
|
|
18
|
+
export * from "./core/index";
|