@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.
Files changed (134) hide show
  1. package/Makefile +1 -1
  2. package/TODO.md +14 -0
  3. package/dist/angular-ts.esm.js +1 -1
  4. package/dist/angular-ts.umd.js +1 -1
  5. package/index.html +8 -2
  6. package/package.json +1 -1
  7. package/src/animations/animate-css-driver.js +2 -2
  8. package/src/animations/animate-css.js +15 -6
  9. package/src/animations/animate-js.js +1 -1
  10. package/src/animations/animate-queue.js +1 -1
  11. package/src/animations/shared.js +0 -14
  12. package/src/core/compile.js +6 -3
  13. package/src/directive/if.js +0 -79
  14. package/src/directive/if.md +80 -0
  15. package/src/directive/include.js +0 -82
  16. package/src/directive/include.md +86 -0
  17. package/src/directive/repeat.js +0 -1
  18. package/src/filters/order-by.js +8 -8
  19. package/src/loader.js +0 -1
  20. package/src/router/common/trace.js +1 -1
  21. package/src/router/directives/stateDirectives.js +16 -14
  22. package/src/router/directives/viewDirective.js +5 -13
  23. package/src/router/hooks/resolve.js +3 -4
  24. package/src/router/hooks/views.js +3 -2
  25. package/src/router/state/stateService.js +1 -2
  26. package/src/router/stateProvider.js +8 -0
  27. package/src/router/templateFactory.js +13 -7
  28. package/src/router/transition/interface.js +14 -14
  29. package/src/router/transition/rejectFactory.js +29 -20
  30. package/src/router/transition/transition.js +5 -1
  31. package/src/router/transition/transitionHook.js +5 -5
  32. package/src/router/url/urlMatcher.js +1 -2
  33. package/src/router/url/urlRule.js +10 -2
  34. package/src/router/url/urlRules.js +1 -1
  35. package/src/services/browser.js +3 -18
  36. package/src/shared/common.js +0 -1
  37. package/test/module-test.html +44 -12
  38. package/test/router/ng-state-builder.spec.js +81 -0
  39. package/test/router/services.spec.js +70 -0
  40. package/test/router/state-directives.spec.js +1182 -0
  41. package/test/router/template-factory.spec.js +146 -0
  42. package/test/router/url-matcher-factory.spec.js +1313 -0
  43. package/test/router/view-directive.spec.js +2013 -0
  44. package/test/router/view-hook.spec.js +217 -0
  45. package/test/router/view-scroll.spec.js +77 -0
  46. package/test/router/view.spec.js +117 -0
  47. package/types/angular.d.ts +132 -124
  48. package/types/index.d.ts +2350 -2187
  49. package/types/jqlite.d.ts +463 -418
  50. package/types/router/core/common/common.d.ts +70 -24
  51. package/types/router/core/common/coreservices.d.ts +30 -32
  52. package/types/router/core/common/glob.d.ts +9 -9
  53. package/types/router/core/common/hof.d.ts +12 -4
  54. package/types/router/core/common/index.d.ts +8 -8
  55. package/types/router/core/common/predicates.d.ts +1 -1
  56. package/types/router/core/common/queue.d.ts +13 -13
  57. package/types/router/core/common/safeConsole.d.ts +3 -3
  58. package/types/router/core/common/strings.d.ts +4 -2
  59. package/types/router/core/common/trace.d.ts +94 -82
  60. package/types/router/core/globals.d.ts +37 -37
  61. package/types/router/core/hooks/coreResolvables.d.ts +5 -3
  62. package/types/router/core/hooks/ignoredTransition.d.ts +4 -2
  63. package/types/router/core/hooks/invalidTransition.d.ts +4 -2
  64. package/types/router/core/hooks/lazyLoad.d.ts +10 -5
  65. package/types/router/core/hooks/onEnterExitRetain.d.ts +10 -4
  66. package/types/router/core/hooks/redirectTo.d.ts +4 -2
  67. package/types/router/core/hooks/resolve.d.ts +10 -4
  68. package/types/router/core/hooks/updateGlobals.d.ts +4 -2
  69. package/types/router/core/hooks/url.d.ts +4 -2
  70. package/types/router/core/hooks/views.d.ts +7 -3
  71. package/types/router/core/index.d.ts +11 -12
  72. package/types/router/core/interface.d.ts +83 -81
  73. package/types/router/core/params/index.d.ts +5 -5
  74. package/types/router/core/params/interface.d.ts +439 -439
  75. package/types/router/core/params/param.d.ts +72 -60
  76. package/types/router/core/params/paramType.d.ts +40 -40
  77. package/types/router/core/params/paramTypes.d.ts +169 -165
  78. package/types/router/core/params/stateParams.d.ts +13 -13
  79. package/types/router/core/path/index.d.ts +2 -2
  80. package/types/router/core/path/pathNode.d.ts +49 -49
  81. package/types/router/core/path/pathUtils.d.ts +100 -74
  82. package/types/router/core/resolve/index.d.ts +3 -3
  83. package/types/router/core/resolve/interface.d.ts +137 -137
  84. package/types/router/core/resolve/resolvable.d.ts +60 -54
  85. package/types/router/core/resolve/resolveContext.d.ts +84 -79
  86. package/types/router/core/router.d.ts +95 -86
  87. package/types/router/core/state/index.d.ts +8 -8
  88. package/types/router/core/state/interface.d.ts +667 -643
  89. package/types/router/core/state/stateBuilder.d.ts +41 -38
  90. package/types/router/core/state/stateMatcher.d.ts +11 -9
  91. package/types/router/core/state/stateObject.d.ts +154 -139
  92. package/types/router/core/state/stateQueueManager.d.ts +26 -21
  93. package/types/router/core/state/stateRegistry.d.ts +124 -121
  94. package/types/router/core/state/stateService.d.ts +380 -343
  95. package/types/router/core/state/targetState.d.ts +74 -69
  96. package/types/router/core/transition/hookBuilder.d.ts +34 -30
  97. package/types/router/core/transition/hookRegistry.d.ts +96 -74
  98. package/types/router/core/transition/index.d.ts +8 -8
  99. package/types/router/core/transition/interface.d.ts +652 -609
  100. package/types/router/core/transition/rejectFactory.d.ts +97 -97
  101. package/types/router/core/transition/transition.d.ts +565 -517
  102. package/types/router/core/transition/transitionEventType.d.ts +20 -11
  103. package/types/router/core/transition/transitionHook.d.ts +90 -82
  104. package/types/router/core/transition/transitionService.d.ts +228 -161
  105. package/types/router/core/url/index.d.ts +8 -8
  106. package/types/router/core/url/interface.d.ts +100 -87
  107. package/types/router/core/url/urlConfig.d.ts +130 -126
  108. package/types/router/core/url/urlMatcher.d.ts +132 -127
  109. package/types/router/core/url/urlMatcherFactory.d.ts +46 -42
  110. package/types/router/core/url/urlRouter.d.ts +91 -75
  111. package/types/router/core/url/urlRule.d.ts +123 -100
  112. package/types/router/core/url/urlRules.d.ts +240 -232
  113. package/types/router/core/url/urlService.d.ts +201 -201
  114. package/types/router/core/view/index.d.ts +2 -2
  115. package/types/router/core/view/interface.d.ts +26 -26
  116. package/types/router/core/view/view.d.ts +152 -143
  117. package/types/router/directives/viewDirective.d.ts +12 -11
  118. package/types/router/index.d.ts +11 -12
  119. package/types/router/interface.d.ts +361 -351
  120. package/types/router/legacy/resolveService.d.ts +44 -40
  121. package/types/router/legacy/stateEvents.d.ts +1 -1
  122. package/types/router/locationServices.d.ts +45 -37
  123. package/types/router/services.d.ts +9 -9
  124. package/types/router/stateFilters.d.ts +3 -3
  125. package/types/router/stateProvider.d.ts +240 -235
  126. package/types/router/statebuilders/onEnterExitRetain.d.ts +4 -2
  127. package/types/router/statebuilders/views.d.ts +35 -22
  128. package/types/router/templateFactory.d.ts +99 -79
  129. package/types/router/viewScroll.d.ts +7 -7
  130. package/src/directive/a.js +0 -37
  131. package/types/router/angular.d.ts +0 -1
  132. package/types/router/core/vanilla.d.ts +0 -1
  133. package/types/router/directives/stateDirectives.d.ts +0 -3
  134. package/types/router/injectables.d.ts +0 -1
@@ -1,84 +1,104 @@
1
- import { IAugmentedJQuery } from '../';
2
- import { IInjectable, ResolveContext, RawParams } from './core';
3
- import { Ng1ViewDeclaration, TemplateFactoryProvider } from './interface';
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
- /** @hidden */ private _useHttp;
9
- /** @hidden */ private $templateRequest;
10
- /** @hidden */ private $templateCache;
11
- /** @hidden */ private $http;
12
- /** @hidden */ $get: (string | (($http: any, $templateCache: any, $injector: any) => this))[];
13
- /** @hidden */
14
- useHttpService(value: boolean): void;
15
- /**
16
- * Creates a template from a configuration object.
17
- *
18
- * @param config Configuration object for which to load a template.
19
- * The following properties are search in the specified order, and the first one
20
- * that is defined is used to create the template:
21
- *
22
- * @param params Parameters to pass to the template function.
23
- * @param context The resolve context associated with the template's view
24
- *
25
- * @return {string|object} The template html as a string, or a promise for
26
- * that string,or `null` if no template is configured.
27
- */
28
- fromConfig(config: Ng1ViewDeclaration, params: any, context: ResolveContext): Promise<{
29
- template?: string;
30
- component?: string;
31
- }>;
32
- /**
33
- * Creates a template from a string or a function returning a string.
34
- *
35
- * @param template html template as a string or function that returns an html template as a string.
36
- * @param params Parameters to pass to the template function.
37
- *
38
- * @return {string|object} The template html as a string, or a promise for that
39
- * string.
40
- */
41
- fromString(template: string | Function, params?: RawParams): any;
42
- /**
43
- * Loads a template from the a URL via `$http` and `$templateCache`.
44
- *
45
- * @param {string|Function} url url of the template to load, or a function
46
- * that returns a url.
47
- * @param {Object} params Parameters to pass to the url function.
48
- * @return {string|Promise.<string>} The template html as a string, or a promise
49
- * for that string.
50
- */
51
- fromUrl(url: string | Function, params: any): any;
52
- /**
53
- * Creates a template by invoking an injectable provider function.
54
- *
55
- * @param provider Function to invoke via `locals`
56
- * @param {Function} injectFn a function used to invoke the template provider
57
- * @return {string|Promise.<string>} The template html as a string, or a promise
58
- * for that string.
59
- */
60
- fromProvider(provider: IInjectable, params: any, context: ResolveContext): Promise<any>;
61
- /**
62
- * Creates a component's template by invoking an injectable provider function.
63
- *
64
- * @param provider Function to invoke via `locals`
65
- * @param {Function} injectFn a function used to invoke the template provider
66
- * @return {string} The template html as a string: "<component-name input1='::$resolve.foo'></component-name>".
67
- */
68
- fromComponentProvider(provider: IInjectable, params: any, context: ResolveContext): Promise<any>;
69
- /**
70
- * Creates a template from a component's name
71
- *
72
- * This implements route-to-component.
73
- * It works by retrieving the component (directive) metadata from the injector.
74
- * It analyses the component's bindings, then constructs a template that instantiates the component.
75
- * The template wires input and output bindings to resolves or from the parent component.
76
- *
77
- * @param uiView {object} The parent ui-view (for binding outputs to callbacks)
78
- * @param context The ResolveContext (for binding outputs to callbacks returned from resolves)
79
- * @param component {string} Component's name in camel case.
80
- * @param bindings An object defining the component's bindings: {foo: '<'}
81
- * @return {string} The template as a string: "<component-name input1='::$resolve.foo'></component-name>".
82
- */
83
- makeComponentTemplate(uiView: IAugmentedJQuery, context: ResolveContext, component: string, bindings?: any): string;
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
- * 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;
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
  }
@@ -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,3 +0,0 @@
1
- /** @hidden Used for typedoc */
2
- export interface ng1_directive {
3
- }
@@ -1 +0,0 @@
1
- export {};