@angular-wave/angular.ts 0.8.4 → 0.9.1

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 (213) hide show
  1. package/@types/core/scope/scope.d.ts +1 -4
  2. package/@types/interface.d.ts +17 -3
  3. package/@types/shared/interface.d.ts +17 -0
  4. package/@types/shared/utils.d.ts +4 -19
  5. package/dist/angular-ts.esm.js +42 -160
  6. package/dist/angular-ts.umd.js +42 -160
  7. package/dist/angular-ts.umd.min.js +1 -1
  8. package/docs/layouts/shortcodes/version.html +1 -1
  9. package/docs/static/typedoc/assets/hierarchy.js +1 -1
  10. package/docs/static/typedoc/assets/main.js +2 -2
  11. package/docs/static/typedoc/assets/navigation.js +1 -1
  12. package/docs/static/typedoc/assets/search.js +1 -1
  13. package/docs/static/typedoc/assets/style.css +2 -9
  14. package/docs/static/typedoc/classes/Location.html +20 -20
  15. package/docs/static/typedoc/classes/LocationProvider.html +5 -5
  16. package/docs/static/typedoc/classes/LogProvider.html +3 -3
  17. package/docs/static/typedoc/classes/PubSub.html +21 -21
  18. package/docs/static/typedoc/classes/PubSubProvider.html +1 -1
  19. package/docs/static/typedoc/classes/TemplateCacheProvider.html +2 -2
  20. package/docs/static/typedoc/hierarchy.html +1 -1
  21. package/docs/static/typedoc/index.html +1 -1
  22. package/docs/static/typedoc/interfaces/ChangesObject.html +3 -3
  23. package/docs/static/typedoc/interfaces/ComponentOptions.html +8 -8
  24. package/docs/static/typedoc/interfaces/Controller.html +6 -6
  25. package/docs/static/typedoc/interfaces/DefaultPorts.html +1 -1
  26. package/docs/static/typedoc/interfaces/Directive.html +18 -18
  27. package/docs/static/typedoc/interfaces/DirectivePrePost.html +1 -1
  28. package/docs/static/typedoc/interfaces/Html5Mode.html +1 -1
  29. package/docs/static/typedoc/interfaces/HttpProviderDefaults.html +7 -7
  30. package/docs/static/typedoc/interfaces/HttpService.html +21 -21
  31. package/docs/static/typedoc/interfaces/LogService.html +6 -6
  32. package/docs/static/typedoc/interfaces/NgModelController.html +15 -15
  33. package/docs/static/typedoc/interfaces/NgModelOptions.html +8 -8
  34. package/docs/static/typedoc/interfaces/Provider.html +17 -17
  35. package/docs/static/typedoc/interfaces/RequestConfig.html +15 -15
  36. package/docs/static/typedoc/interfaces/RequestShortcutConfig.html +11 -11
  37. package/docs/static/typedoc/interfaces/ServiceProvider.html +1 -1
  38. package/docs/static/typedoc/interfaces/TemplateCache.html +1 -1
  39. package/docs/static/typedoc/interfaces/TranscludeFunctionObject.html +4 -4
  40. package/docs/static/typedoc/interfaces/UrlParts.html +4 -4
  41. package/docs/static/typedoc/types/AnnotatedFactory.html +1 -1
  42. package/docs/static/typedoc/types/CloneAttachFunction.html +1 -1
  43. package/docs/static/typedoc/types/ControllerConstructor.html +1 -1
  44. package/docs/static/typedoc/types/DirectiveCompileFn.html +1 -1
  45. package/docs/static/typedoc/types/DirectiveController.html +1 -1
  46. package/docs/static/typedoc/types/DirectiveFactoryFn.html +1 -1
  47. package/docs/static/typedoc/types/DirectiveLinkFn.html +1 -1
  48. package/docs/static/typedoc/types/Expression.html +1 -1
  49. package/docs/static/typedoc/types/FilterFactory.html +1 -1
  50. package/docs/static/typedoc/types/FilterFn.html +1 -1
  51. package/docs/static/typedoc/types/Injectable.html +1 -1
  52. package/docs/static/typedoc/types/InjectableFactory.html +1 -1
  53. package/docs/static/typedoc/types/LogCall.html +1 -1
  54. package/docs/static/typedoc/types/LogServiceFactory.html +1 -1
  55. package/docs/static/typedoc/types/OnChangesObject.html +1 -1
  56. package/docs/static/typedoc/types/SwapModeType.html +1 -1
  57. package/docs/static/typedoc/types/TController.html +1 -1
  58. package/docs/static/typedoc/types/UrlChangeListener.html +4 -4
  59. package/docs/static/typedoc/variables/SwapMode.html +10 -10
  60. package/legacy.d.ts +0 -82
  61. package/package.json +2 -2
  62. package/src/animations/animate-js.js +2 -1
  63. package/src/animations/animate-queue.js +7 -6
  64. package/src/core/parse/interpreter.js +11 -6
  65. package/src/core/parse/parse.spec.js +6 -8
  66. package/src/core/scope/scope.js +10 -12
  67. package/src/core/scope/scope.spec.js +4 -4
  68. package/src/directive/http/form-router-test.html +44 -0
  69. package/src/directive/options/options-example.html +7 -3
  70. package/src/directive/options/options.js +1 -0
  71. package/src/directive/options/options.spec.js +117 -170
  72. package/src/interface.ts +20 -3
  73. package/src/router/directives/view-directive.js +0 -1
  74. package/src/router/directives/view-directive.spec.js +10 -9
  75. package/src/router/resolve/resolve-context.js +0 -19
  76. package/src/router/state/state-registry.js +3 -10
  77. package/src/router/state/state-service.js +5 -5
  78. package/src/router/transition/transition.js +1 -86
  79. package/src/router/view-hook.spec.js +1 -1
  80. package/src/shared/interface.ts +19 -0
  81. package/src/shared/utils.js +3 -12
  82. package/tsconfig.types.json +2 -2
  83. package/@types/angular.d.ts +0 -150
  84. package/@types/animations/animate-cache.d.ts +0 -50
  85. package/@types/animations/animate-children-directive.d.ts +0 -10
  86. package/@types/animations/animate-css-driver.d.ts +0 -18
  87. package/@types/animations/animate-css.d.ts +0 -18
  88. package/@types/animations/animate-js-driver.d.ts +0 -14
  89. package/@types/animations/animate-js.d.ts +0 -23
  90. package/@types/animations/animate-queue.d.ts +0 -28
  91. package/@types/animations/animate-runner.d.ts +0 -31
  92. package/@types/animations/animate-swap.d.ts +0 -9
  93. package/@types/animations/animate.d.ts +0 -450
  94. package/@types/animations/animation.d.ts +0 -14
  95. package/@types/animations/interface.d.ts +0 -17
  96. package/@types/animations/raf-scheduler.d.ts +0 -37
  97. package/@types/animations/shared.d.ts +0 -74
  98. package/@types/core/compile/compile.d.ts +0 -201
  99. package/@types/core/controller/controller.d.ts +0 -54
  100. package/@types/core/di/injector.d.ts +0 -22
  101. package/@types/core/filter/filter.d.ts +0 -23
  102. package/@types/core/interpolate/interpolate.d.ts +0 -38
  103. package/@types/core/parse/ast/ast-node.d.ts +0 -56
  104. package/@types/core/parse/ast/ast.d.ts +0 -164
  105. package/@types/core/parse/lexer/lexer.d.ts +0 -119
  106. package/@types/core/parse/lexer/token.d.ts +0 -17
  107. package/@types/core/parse/parse.d.ts +0 -33
  108. package/@types/core/parse/parser/parser.d.ts +0 -41
  109. package/@types/core/sanitize/interface.d.ts +0 -10
  110. package/@types/core/sanitize/sanitize-uri.d.ts +0 -40
  111. package/@types/directive/aria/aria.d.ts +0 -104
  112. package/@types/directive/attrs/attrs.d.ts +0 -8
  113. package/@types/directive/bind/bind.d.ts +0 -18
  114. package/@types/directive/channel/channel.d.ts +0 -10
  115. package/@types/directive/class/class.d.ts +0 -3
  116. package/@types/directive/cloak/cloak.d.ts +0 -4
  117. package/@types/directive/controller/controller.d.ts +0 -4
  118. package/@types/directive/events/events.d.ts +0 -21
  119. package/@types/directive/form/form.d.ts +0 -264
  120. package/@types/directive/http/http.d.ts +0 -46
  121. package/@types/directive/if/if.d.ts +0 -10
  122. package/@types/directive/include/include.d.ts +0 -28
  123. package/@types/directive/init/init.d.ts +0 -4
  124. package/@types/directive/input/input.d.ts +0 -70
  125. package/@types/directive/messages/messages.d.ts +0 -63
  126. package/@types/directive/model/model.d.ts +0 -515
  127. package/@types/directive/model-options/model-options.d.ts +0 -56
  128. package/@types/directive/non-bindable/non-bindable.d.ts +0 -4
  129. package/@types/directive/observe/observe.d.ts +0 -9
  130. package/@types/directive/options/options.d.ts +0 -13
  131. package/@types/directive/ref/ref.d.ts +0 -11
  132. package/@types/directive/repeat/repeat.d.ts +0 -11
  133. package/@types/directive/script/script.d.ts +0 -10
  134. package/@types/directive/select/select.d.ts +0 -15
  135. package/@types/directive/setter/setter.d.ts +0 -12
  136. package/@types/directive/show-hide/show-hide.d.ts +0 -19
  137. package/@types/directive/style/style.d.ts +0 -4
  138. package/@types/directive/switch/switch.d.ts +0 -18
  139. package/@types/directive/transclude/transclude.d.ts +0 -10
  140. package/@types/directive/validators/validators.d.ts +0 -149
  141. package/@types/filters/filter.d.ts +0 -4
  142. package/@types/filters/filters.d.ts +0 -38
  143. package/@types/filters/limit-to.d.ts +0 -4
  144. package/@types/filters/order-by.d.ts +0 -7
  145. package/@types/index.d.ts +0 -2
  146. package/@types/ng.d.ts +0 -8
  147. package/@types/router/common/trace.d.ts +0 -66
  148. package/@types/router/directives/state-directives.d.ts +0 -46
  149. package/@types/router/directives/view-directive.d.ts +0 -138
  150. package/@types/router/glob/glob.d.ts +0 -81
  151. package/@types/router/hooks/core-resolvables.d.ts +0 -2
  152. package/@types/router/hooks/ignored-transition.d.ts +0 -1
  153. package/@types/router/hooks/invalid-transition.d.ts +0 -1
  154. package/@types/router/hooks/lazy-load.d.ts +0 -42
  155. package/@types/router/hooks/on-enter-exit-retain.d.ts +0 -3
  156. package/@types/router/hooks/redirect-to.d.ts +0 -4
  157. package/@types/router/hooks/resolve.d.ts +0 -4
  158. package/@types/router/hooks/update-globals.d.ts +0 -1
  159. package/@types/router/hooks/url.d.ts +0 -5
  160. package/@types/router/hooks/views.d.ts +0 -5
  161. package/@types/router/params/interface.d.ts +0 -606
  162. package/@types/router/params/param-factory.d.ts +0 -16
  163. package/@types/router/params/param-type.d.ts +0 -59
  164. package/@types/router/params/param-types.d.ts +0 -36
  165. package/@types/router/params/param.d.ts +0 -71
  166. package/@types/router/params/state-params.d.ts +0 -12
  167. package/@types/router/path/path-node.d.ts +0 -38
  168. package/@types/router/path/path-utils.d.ts +0 -88
  169. package/@types/router/resolve/interface.d.ts +0 -200
  170. package/@types/router/resolve/resolvable.d.ts +0 -50
  171. package/@types/router/resolve/resolve-context.d.ts +0 -102
  172. package/@types/router/router.d.ts +0 -47
  173. package/@types/router/state/interface.d.ts +0 -983
  174. package/@types/router/state/state-builder.d.ts +0 -95
  175. package/@types/router/state/state-matcher.d.ts +0 -7
  176. package/@types/router/state/state-object.d.ts +0 -83
  177. package/@types/router/state/state-queue-manager.d.ts +0 -29
  178. package/@types/router/state/state-registry.d.ts +0 -134
  179. package/@types/router/state/state-service.d.ts +0 -419
  180. package/@types/router/state/target-state.d.ts +0 -102
  181. package/@types/router/state/views.d.ts +0 -58
  182. package/@types/router/state-filters.d.ts +0 -39
  183. package/@types/router/template-factory.d.ts +0 -117
  184. package/@types/router/transition/hook-builder.d.ts +0 -45
  185. package/@types/router/transition/hook-registry.d.ts +0 -102
  186. package/@types/router/transition/interface.d.ts +0 -880
  187. package/@types/router/transition/reject-factory.d.ts +0 -43
  188. package/@types/router/transition/transition-event-type.d.ts +0 -24
  189. package/@types/router/transition/transition-hook.d.ts +0 -86
  190. package/@types/router/transition/transition-service.d.ts +0 -116
  191. package/@types/router/transition/transition.d.ts +0 -396
  192. package/@types/router/url/url-config.d.ts +0 -99
  193. package/@types/router/url/url-matcher.d.ts +0 -174
  194. package/@types/router/url/url-rule.d.ts +0 -161
  195. package/@types/router/url/url-rules.d.ts +0 -249
  196. package/@types/router/url/url-service.d.ts +0 -254
  197. package/@types/router/view/interface.d.ts +0 -44
  198. package/@types/router/view/view.d.ts +0 -149
  199. package/@types/router/view-scroll.d.ts +0 -10
  200. package/@types/services/anchor-scroll.d.ts +0 -25
  201. package/@types/services/cookie-reader.d.ts +0 -4
  202. package/@types/services/http/http.d.ts +0 -134
  203. package/@types/services/http-backend/http-backend.d.ts +0 -58
  204. package/@types/services/sce/sce.d.ts +0 -238
  205. package/@types/services/template-request.d.ts +0 -55
  206. package/@types/shared/common.d.ts +0 -197
  207. package/@types/shared/hof.d.ts +0 -108
  208. package/@types/shared/predicates.d.ts +0 -17
  209. package/@types/shared/queue.d.ts +0 -64
  210. package/@types/shared/strings.d.ts +0 -58
  211. package/@types/shared/test-utils.d.ts +0 -18
  212. package/docs/static/typedoc/classes/NgModule.html +0 -32
  213. package/src/router/params/README.md +0 -8
@@ -1,31 +0,0 @@
1
- export function AnimateAsyncRunFactoryProvider(): void;
2
- export class AnimateAsyncRunFactoryProvider {
3
- $get: (() => () => (callback: any) => void)[];
4
- }
5
- export function AnimateRunnerFactoryProvider(): void;
6
- export class AnimateRunnerFactoryProvider {
7
- $get: (string | ((animateAsyncRun: any) => typeof AnimateRunner))[];
8
- }
9
- export class AnimateRunner {
10
- static chain(chain: any, callback: any): void;
11
- static all(runners: any, callback: any): void;
12
- constructor(host: any);
13
- _doneCallbacks: any[];
14
- _tick: (fn: any) => void;
15
- _state: number;
16
- setHost(host: any): void;
17
- host: any;
18
- done(fn: any): void;
19
- progress(): void;
20
- getPromise(): Promise<any>;
21
- promise: Promise<any>;
22
- then(resolveHandler: any, rejectHandler: any): Promise<any>;
23
- catch(handler: any): Promise<any>;
24
- finally(handler: any): Promise<any>;
25
- pause(): void;
26
- resume(): void;
27
- end(): void;
28
- cancel(): void;
29
- complete(response: any): void;
30
- _resolve(response: any): void;
31
- }
@@ -1,9 +0,0 @@
1
- /**
2
- * @returns {import('../interface.ts').Directive}
3
- */
4
- export function ngAnimateSwapDirective(
5
- $animate: any,
6
- ): import("../interface.ts").Directive;
7
- export namespace ngAnimateSwapDirective {
8
- let $inject: string[];
9
- }
@@ -1,450 +0,0 @@
1
- /** @param {import('../interface.ts').Provider} $provide */
2
- export function AnimateProvider(
3
- $provide: import("../interface.ts").Provider,
4
- ): void;
5
- export class AnimateProvider {
6
- /** @param {import('../interface.ts').Provider} $provide */
7
- constructor($provide: import("../interface.ts").Provider);
8
- $$registeredAnimations: any;
9
- /**
10
- * Registers a new injectable animation factory function. The factory function produces the
11
- * animation object which contains callback functions for each event that is expected to be
12
- * animated.
13
- *
14
- * * `eventFn`: `function(element, ... , doneFunction, options)`
15
- * The element to animate, the `doneFunction` and the options fed into the animation. Depending
16
- * on the type of animation additional arguments will be injected into the animation function. The
17
- * list below explains the function signatures for the different animation methods:
18
- *
19
- * - setClass: function(element, addedClasses, removedClasses, doneFunction, options)
20
- * - addClass: function(element, addedClasses, doneFunction, options)
21
- * - removeClass: function(element, removedClasses, doneFunction, options)
22
- * - enter, leave, move: function(element, doneFunction, options)
23
- * - animate: function(element, fromStyles, toStyles, doneFunction, options)
24
- *
25
- * Make sure to trigger the `doneFunction` once the animation is fully complete.
26
- *
27
- * ```js
28
- * return {
29
- * //enter, leave, move signature
30
- * eventFn : function(element, done, options) {
31
- * //code to run the animation
32
- * //once complete, then run done()
33
- * return function endFunction(wasCancelled) {
34
- * //code to cancel the animation
35
- * }
36
- * }
37
- * }
38
- * ```
39
- *
40
- * @param {string} name The name of the animation (this is what the class-based CSS value will be compared to).
41
- * @param {import("../interface.ts").Injectable} factory The factory function that will be executed to return the animation
42
- * object.
43
- */
44
- register: (
45
- name: string,
46
- factory: import("../interface.ts").Injectable,
47
- ) => void;
48
- /**
49
- * Sets and/or returns the custom filter function that is used to "filter" animations, i.e.
50
- * determine if an animation is allowed or not. When no filter is specified (the default), no
51
- * animation will be blocked. Setting the `customFilter` value will only allow animations for
52
- * which the filter function's return value is truthy.
53
- *
54
- * This allows to easily create arbitrarily complex rules for filtering animations, such as
55
- * allowing specific events only, or enabling animations on specific subtrees of the DOM, etc.
56
- * Filtering animations can also boost performance for low-powered devices, as well as
57
- * applications containing a lot of structural operations.
58
- *
59
- * <div class="alert alert-success">
60
- * **Best Practice:**
61
- * Keep the filtering function as lean as possible, because it will be called for each DOM
62
- * action (e.g. insertion, removal, class change) performed by "animation-aware" directives.
63
- * See {@link guide/animations#which-directives-support-animations- here} for a list of built-in
64
- * directives that support animations.
65
- * Performing computationally expensive or time-consuming operations on each call of the
66
- * filtering function can make your animations sluggish.
67
- * </div>
68
- *
69
- * **Note:** If present, `customFilter` will be checked before
70
- * {@link $animateProvider#classNameFilter classNameFilter}.
71
- *
72
- * @param {Function=} filterFn - The filter function which will be used to filter all animations.
73
- * If a falsy value is returned, no animation will be performed. The function will be called
74
- * with the following arguments:
75
- * - **node** `{Element}` - The DOM element to be animated.
76
- * - **event** `{String}` - The name of the animation event (e.g. `enter`, `leave`, `addClass`
77
- * etc).
78
- * - **options** `{Object}` - A collection of options/styles used for the animation.
79
- * @return {Function} The current filter function or `null` if there is none set.
80
- */
81
- customFilter: (filterFn?: Function | undefined, ...args: any[]) => Function;
82
- /**
83
- * Sets and/or returns the CSS class regular expression that is checked when performing
84
- * an animation. Upon bootstrap the classNameFilter value is not set at all and will
85
- * therefore enable $animate to attempt to perform an animation on any element that is triggered.
86
- * When setting the `classNameFilter` value, animations will only be performed on elements
87
- * that successfully match the filter expression. This in turn can boost performance
88
- * for low-powered devices as well as applications containing a lot of structural operations.
89
- *
90
- * **Note:** If present, `classNameFilter` will be checked after
91
- * {@link $animateProvider#customFilter customFilter}. If `customFilter` is present and returns
92
- * false, `classNameFilter` will not be checked.
93
- *
94
- * @param {RegExp=} expression The className expression which will be checked against all animations
95
- * @return {RegExp} The current CSS className expression value. If null then there is no expression value
96
- */
97
- classNameFilter: (expression?: RegExp | undefined, ...args: any[]) => RegExp;
98
- $get: (
99
- | string
100
- | (($$animateQueue: any) => {
101
- /**
102
- *
103
- * Sets up an event listener to fire whenever the animation event (enter, leave, move, etc...)
104
- * has fired on the given element or among any of its children. Once the listener is fired, the provided callback
105
- * is fired with the following params:
106
- *
107
- * ```js
108
- * $animate.on('enter', container,
109
- * function callback(element, phase) {
110
- * // cool we detected an enter animation within the container
111
- * }
112
- * );
113
- * ```
114
- *
115
- * <div class="alert alert-warning">
116
- * **Note**: Generally, the events that are fired correspond 1:1 to `$animate` method names,
117
- * e.g. {@link ng.$animate#addClass addClass()} will fire `addClass`, and {@link ng.ngClass}
118
- * will fire `addClass` if classes are added, and `removeClass` if classes are removed.
119
- * However, there are two exceptions:
120
- *
121
- * <ul>
122
- * <li>if both an {@link ng.$animate#addClass addClass()} and a
123
- * {@link ng.$animate#removeClass removeClass()} action are performed during the same
124
- * animation, the event fired will be `setClass`. This is true even for `ngClass`.</li>
125
- * <li>an {@link ng.$animate#animate animate()} call that adds and removes classes will fire
126
- * the `setClass` event, but if it either removes or adds classes,
127
- * it will fire `animate` instead.</li>
128
- * </ul>
129
- *
130
- * </div>
131
- *
132
- * @param {string} event the animation event that will be captured (e.g. enter, leave, move, addClass, removeClass, etc...)
133
- * @param {Element} container the container element that will capture each of the animation events that are fired on itself
134
- * as well as among its children
135
- * @param {Function} callback the callback function that will be fired when the listener is triggered.
136
- *
137
- * The arguments present in the callback function are:
138
- * * `element` - The captured DOM element that the animation was fired on.
139
- * * `phase` - The phase of the animation. The two possible phases are **start** (when the animation starts) and **close** (when it ends).
140
- * * `data` - an object with these properties:
141
- * * addClass - `{string|null}` - space-separated CSS classes to add to the element
142
- * * removeClass - `{string|null}` - space-separated CSS classes to remove from the element
143
- * * from - `{Object|null}` - CSS properties & values at the beginning of the animation
144
- * * to - `{Object|null}` - CSS properties & values at the end of the animation
145
- *
146
- * Note that the callback does not trigger a scope digest. Wrap your call into a
147
- * {@link $rootScope.Scope#$apply scope.$apply} to propagate changes to the scope.
148
- */
149
- on: any;
150
- /**
151
- * Deregisters an event listener based on the event which has been associated with the provided element. This method
152
- * can be used in three different ways depending on the arguments:
153
- *
154
- * ```js
155
- * // remove all the animation event listeners listening for `enter`
156
- * $animate.off('enter');
157
- *
158
- * // remove listeners for all animation events from the container element
159
- * $animate.off(container);
160
- *
161
- * // remove all the animation event listeners listening for `enter` on the given element and its children
162
- * $animate.off('enter', container);
163
- *
164
- * // remove the event listener function provided by `callback` that is set
165
- * // to listen for `enter` on the given `container` as well as its children
166
- * $animate.off('enter', container, callback);
167
- * ```
168
- *
169
- * @param {string|Element} event|container the animation event (e.g. enter, leave, move,
170
- * addClass, removeClass, etc...), or the container element. If it is the element, all other
171
- * arguments are ignored.
172
- * @param {Element=} container the container element the event listener was placed on
173
- * @param {Function=} callback the callback function that was registered as the listener
174
- */
175
- off: any;
176
- /**
177
- * Associates the provided element with a host parent element to allow the element to be animated even if it exists
178
- * outside of the DOM structure of the AngularTS application. By doing so, any animation triggered via `$animate` can be issued on the
179
- * element despite being outside the realm of the application or within another application. Say for example if the application
180
- * was bootstrapped on an element that is somewhere inside of the `<body>` tag, but we wanted to allow for an element to be situated
181
- * as a direct child of `document.body`, then this can be achieved by pinning the element via `$animate.pin(element)`. Keep in mind
182
- * that calling `$animate.pin(element, parentElement)` will not actually insert into the DOM anywhere; it will just create the association.
183
- *
184
- * Note that this feature is only active when the `ngAnimate` module is used.
185
- *
186
- * @param {Element} element the external element that will be pinned
187
- * @param {Element} parentElement the host parent element that will be associated with the external element
188
- */
189
- pin: any;
190
- /**
191
- * Used to get and set whether animations are enabled or not on the entire application or on an element and its children. This
192
- * function can be called in four ways:
193
- *
194
- * ```js
195
- * // returns true or false
196
- * $animate.enabled();
197
- *
198
- * // changes the enabled state for all animations
199
- * $animate.enabled(false);
200
- * $animate.enabled(true);
201
- *
202
- * // returns true or false if animations are enabled for an element
203
- * $animate.enabled(element);
204
- *
205
- * // changes the enabled state for an element and its children
206
- * $animate.enabled(element, true);
207
- * $animate.enabled(element, false);
208
- * ```
209
- *
210
- * @param {Element=} element the element that will be considered for checking/setting the enabled state
211
- * @param {boolean=} enabled whether or not the animations will be enabled for the element
212
- *
213
- * @return {boolean} whether or not animations are enabled
214
- */
215
- enabled: any;
216
- /**
217
- * Cancels the provided animation and applies the end state of the animation.
218
- * Note that this does not cancel the underlying operation, e.g. the setting of classes or
219
- * adding the element to the DOM.
220
- *
221
- * @param {import('./animate-runner.js').AnimateRunner} runner An animation runner returned by an $animate function.
222
- *
223
- * @example
224
- <example module="animationExample" deps="angular-animate.js" animations="true" name="animate-cancel">
225
- <file name="app.js">
226
- angular.module('animationExample', []).component('cancelExample', {
227
- templateUrl: 'template.html',
228
- controller: function($element, $animate) {
229
- this.runner = null;
230
-
231
- this.addClass = function() {
232
- this.runner = $animate.addClass($element.querySelectorAll('div'), 'red');
233
- let ctrl = this;
234
- this.runner.finally(function() {
235
- ctrl.runner = null;
236
- });
237
- };
238
-
239
- this.removeClass = function() {
240
- this.runner = $animate.removeClass($element.querySelectorAll('div'), 'red');
241
- let ctrl = this;
242
- this.runner.finally(function() {
243
- ctrl.runner = null;
244
- });
245
- };
246
-
247
- this.cancel = function() {
248
- $animate.cancel(this.runner);
249
- };
250
- }
251
- });
252
- </file>
253
- <file name="template.html">
254
- <p>
255
- <button id="add" ng-click="$ctrl.addClass()">Add</button>
256
- <button ng-click="$ctrl.removeClass()">Remove</button>
257
- <br>
258
- <button id="cancel" ng-click="$ctrl.cancel()" ng-disabled="!$ctrl.runner">Cancel</button>
259
- <br>
260
- <div id="target">CSS-Animated Text</div>
261
- </p>
262
- </file>
263
- <file name="index.html">
264
- <cancel-example></cancel-example>
265
- </file>
266
- <file name="style.css">
267
- .red-add, .red-remove {
268
- transition: all 4s cubic-bezier(0.250, 0.460, 0.450, 0.940);
269
- }
270
-
271
- .red,
272
- .red-add.red-add-active {
273
- color: #FF0000;
274
- font-size: 40px;
275
- }
276
-
277
- .red-remove.red-remove-active {
278
- font-size: 10px;
279
- color: black;
280
- }
281
-
282
- </file>
283
- </example>
284
- */
285
- cancel(runner: import("./animate-runner.js").AnimateRunner): void;
286
- /**
287
- * Inserts the element into the DOM either after the `after` element (if provided) or
288
- * as the first child within the `parent` element and then triggers an animation.
289
- * A promise is returned that will be resolved during the next digest once the animation
290
- * has completed.
291
- *
292
- * @param {Element} element - the element which will be inserted into the DOM
293
- * @param {Element} parent - the parent element which will append the element as a child (so long as the after element is not present)
294
- * @param {Element} after - after the sibling element after which the element will be appended
295
- * @param {AnimationOptions} [options] - an optional collection of options/styles that will be applied to the element.
296
- * @returns {import('./animate-runner.js').AnimateRunner} the animation runner
297
- */
298
- enter(
299
- element: Element,
300
- parent: Element,
301
- after: Element,
302
- options?: AnimationOptions,
303
- ): import("./animate-runner.js").AnimateRunner;
304
- /**
305
- * Inserts (moves) the element into its new position in the DOM either after
306
- * the `after` element (if provided) or as the first child within the `parent` element
307
- * and then triggers an animation. A promise is returned that will be resolved
308
- * during the next digest once the animation has completed.
309
- *
310
- * @param {Element} element - the element which will be inserted into the DOM
311
- * @param {Element} parent - the parent element which will append the element as a child (so long as the after element is not present)
312
- * @param {Element} after - after the sibling element after which the element will be appended
313
- * @param {AnimationOptions} [options] - an optional collection of options/styles that will be applied to the element.
314
- * @returns {import('./animate-runner.js').AnimateRunner} the animation runner
315
- */
316
- move(
317
- element: Element,
318
- parent: Element,
319
- after: Element,
320
- options?: AnimationOptions,
321
- ): import("./animate-runner.js").AnimateRunner;
322
- /**
323
- * Triggers an animation and then removes the element from the DOM.
324
- * When the function is called a promise is returned that will be resolved during the next
325
- * digest once the animation has completed.
326
- *
327
- * @param {Element} element the element which will be removed from the DOM
328
- * @param {AnimationOptions} [options] an optional collection of options/styles that will be applied to the element.
329
- * @returns {import('./animate-runner.js').AnimateRunner} the animation runner
330
- */
331
- leave(
332
- element: Element,
333
- options?: AnimationOptions,
334
- ): import("./animate-runner.js").AnimateRunner;
335
- /**
336
- * Triggers an addClass animation surrounding the addition of the provided CSS class(es). Upon
337
- * execution, the addClass operation will only be handled after the next digest and it will not trigger an
338
- * animation if element already contains the CSS class or if the class is removed at a later step.
339
- * Note that class-based animations are treated differently compared to structural animations
340
- * (like enter, move and leave) since the CSS classes may be added/removed at different points
341
- * depending if CSS or JavaScript animations are used.
342
- *
343
- * @param {Element} element the element which the CSS classes will be applied to
344
- * @param {string} className the CSS class(es) that will be added (multiple classes are separated via spaces)
345
- * @param {AnimationOptions} [options] an optional collection of options/styles that will be applied to the element.
346
- * @return {import('./animate-runner.js').AnimateRunner}} animationRunner the animation runner
347
- */
348
- addClass(
349
- element: Element,
350
- className: string,
351
- options?: AnimationOptions,
352
- ): import("./animate-runner.js").AnimateRunner;
353
- /**
354
- * Triggers a removeClass animation surrounding the removal of the provided CSS class(es). Upon
355
- * execution, the removeClass operation will only be handled after the next digest and it will not trigger an
356
- * animation if element does not contain the CSS class or if the class is added at a later step.
357
- * Note that class-based animations are treated differently compared to structural animations
358
- * (like enter, move and leave) since the CSS classes may be added/removed at different points
359
- * depending if CSS or JavaScript animations are used.
360
- *
361
- * @param {Element} element the element which the CSS classes will be applied to
362
- * @param {string} className the CSS class(es) that will be removed (multiple classes are separated via spaces)
363
- * @param {AnimationOptions} [options] an optional collection of options/styles that will be applied to the element. *
364
- * @return {import('./animate-runner.js').AnimateRunner} animationRunner the animation runner
365
- */
366
- removeClass(
367
- element: Element,
368
- className: string,
369
- options?: AnimationOptions,
370
- ): import("./animate-runner.js").AnimateRunner;
371
- /**
372
- * Performs both the addition and removal of a CSS classes on an element and (during the process)
373
- * triggers an animation surrounding the class addition/removal. Much like `$animate.addClass` and
374
- * `$animate.removeClass`, `setClass` will only evaluate the classes being added/removed once a digest has
375
- * passed. Note that class-based animations are treated differently compared to structural animations
376
- * (like enter, move and leave) since the CSS classes may be added/removed at different points
377
- * depending if CSS or JavaScript animations are used.
378
- *
379
- * @param {Element} element the element which the CSS classes will be applied to
380
- * @param {string} add the CSS class(es) that will be added (multiple classes are separated via spaces)
381
- * @param {string} remove the CSS class(es) that will be removed (multiple classes are separated via spaces)
382
- * @param {object=} options an optional collection of options/styles that will be applied to the element.
383
- *
384
- * @return {import('./animate-runner.js').AnimateRunner} the animation runner
385
- */
386
- setClass(
387
- element: Element,
388
- add: string,
389
- remove: string,
390
- options?: object | undefined,
391
- ): import("./animate-runner.js").AnimateRunner;
392
- /**
393
- * Performs an inline animation on the element which applies the provided to and from CSS styles to the element.
394
- * If any detected CSS transition, keyframe or JavaScript matches the provided className value, then the animation will take
395
- * on the provided styles. For example, if a transition animation is set for the given className, then the provided `from` and
396
- * `to` styles will be applied alongside the given transition. If the CSS style provided in `from` does not have a corresponding
397
- * style in `to`, the style in `from` is applied immediately, and no animation is run.
398
- * If a JavaScript animation is detected then the provided styles will be given in as function parameters into the `animate`
399
- * method (or as part of the `options` parameter):
400
- *
401
- * ```js
402
- * ngModule.animation('.my-inline-animation', function() {
403
- * return {
404
- * animate : function(element, from, to, done, options) {
405
- * //animation
406
- * done();
407
- * }
408
- * }
409
- * });
410
- * ```
411
- * @return {import('./animate-runner.js').AnimateRunner} the animation runner
412
- */
413
- animate(
414
- element: any,
415
- from: any,
416
- to: any,
417
- className: any,
418
- options: any,
419
- ): import("./animate-runner.js").AnimateRunner;
420
- })
421
- )[];
422
- }
423
- export namespace AnimateProvider {
424
- let $inject: string[];
425
- }
426
- export type AnimationMethod =
427
- | "enter"
428
- | "leave"
429
- | "move"
430
- | "addClass"
431
- | "setClass"
432
- | "removeClass";
433
- export type AnimationOptions = {
434
- /**
435
- * - space-separated CSS classes to add to element
436
- */
437
- addClass: string;
438
- /**
439
- * - CSS properties & values at the beginning of animation. Must have matching `to`
440
- */
441
- from: any;
442
- /**
443
- * - space-separated CSS classes to remove from element
444
- */
445
- removeClass: string;
446
- /**
447
- * - CSS properties & values at end of animation. Must have matching `from`
448
- */
449
- to: string;
450
- };
@@ -1,14 +0,0 @@
1
- export function AnimationProvider(): void;
2
- export class AnimationProvider {
3
- drivers: any[];
4
- $get: (
5
- | string
6
- | ((
7
- $rootScope: any,
8
- $injector: any,
9
- $$AnimateRunner: any,
10
- $$rAFScheduler: any,
11
- $$animateCache: any,
12
- ) => (element: any, event: any, options: any) => any)
13
- )[];
14
- }
@@ -1,17 +0,0 @@
1
- export type RafScheduler = {
2
- /**
3
- * Schedules a list of functions to run on the next animation frame(s).
4
- * @param tasks - The tasks to be scheduled.
5
- */
6
- (tasks: Array<() => void>): void;
7
- /**
8
- * Internal queue of scheduled task arrays.
9
- */
10
- queue: Array<Array<() => void>>;
11
- /**
12
- * Waits until the animation frame is quiet before running the provided function.
13
- * Cancels any previous animation frame requests.
14
- * @param fn - The function to run when the frame is quiet.
15
- */
16
- waitUntilQuiet(fn: () => void): void;
17
- };
@@ -1,37 +0,0 @@
1
- /**
2
- * @typedef {import('./interface.js').RafScheduler} RafScheduler
3
- * @typedef {import('../interface.js').ServiceProvider} ServiceProvider
4
- */
5
- /**
6
- * Service provider that creates a requestAnimationFrame-based scheduler.
7
- * @type {ServiceProvider}
8
- */
9
- export class RafSchedulerProvider {
10
- /**
11
- * Internal task queue, where each item is an array of functions to run.
12
- * @type {Array<Array<() => void>>}
13
- */
14
- queue: Array<Array<() => void>>;
15
- /**
16
- * ID of the currently scheduled animation frame (if any).
17
- * Used for cancellation and tracking.
18
- * @type {number|null}
19
- */
20
- cancelFn: number | null;
21
- /**
22
- * Processes the next batch of tasks in the animation frame.
23
- * Executes the first group of functions in the queue, then
24
- * schedules the next frame if needed.
25
- */
26
- nextTick(): void;
27
- /**
28
- * Returns the scheduler function.
29
- * This function allows tasks to be queued for execution on future animation frames.
30
- * It also has helper methods and state attached.
31
- *
32
- * @returns {RafScheduler} The scheduler function with `queue` and `waitUntilQuiet`.
33
- */
34
- $get(): RafScheduler;
35
- }
36
- export type RafScheduler = import("./interface.js").RafScheduler;
37
- export type ServiceProvider = import("../interface.js").ServiceProvider;
@@ -1,74 +0,0 @@
1
- export function assertArg(arg: any, name: any, reason: any): any;
2
- export function packageStyles(options: any): {
3
- to: any;
4
- from: any;
5
- };
6
- export function pendClasses(classes: any, fix: any, isPrefix: any): string;
7
- export function removeFromArray(arr: any, val: any): void;
8
- /**
9
- *
10
- * @param {NodeList|Node} element
11
- * @returns {Node[]|Node|undefined}
12
- */
13
- export function stripCommentsFromElement(
14
- element: NodeList | Node,
15
- ): Node[] | Node | undefined;
16
- /**
17
- * @param {NodeList|Node} element
18
- * @returns {Node}
19
- */
20
- export function extractElementNode(element: NodeList | Node): Node;
21
- export function applyAnimationClassesFactory(): (
22
- element: any,
23
- options: any,
24
- ) => void;
25
- export function prepareAnimationOptions(options: any): any;
26
- export function applyAnimationStyles(element: any, options: any): void;
27
- export function applyAnimationFromStyles(element: any, options: any): void;
28
- export function applyAnimationToStyles(element: any, options: any): void;
29
- export function mergeAnimationDetails(
30
- element: any,
31
- oldAnimation: any,
32
- newAnimation: any,
33
- ): any;
34
- export function resolveElementClasses(
35
- existing: any,
36
- toAdd: any,
37
- toRemove: any,
38
- ): {
39
- addClass: string;
40
- removeClass: string;
41
- };
42
- export function applyGeneratedPreparationClasses(
43
- element: any,
44
- event: any,
45
- options: any,
46
- ): void;
47
- export function clearGeneratedClasses(element: any, options: any): void;
48
- export function blockKeyframeAnimations(node: any, applyBlock: any): string[];
49
- export function applyInlineStyle(node: any, styleTuple: any): void;
50
- export function concatWithSpace(a: any, b: any): any;
51
- export const ADD_CLASS_SUFFIX: "-add";
52
- export const REMOVE_CLASS_SUFFIX: "-remove";
53
- export const EVENT_CLASS_PREFIX: "ng-";
54
- export const ACTIVE_CLASS_SUFFIX: "-active";
55
- export const PREPARE_CLASS_SUFFIX: "-prepare";
56
- export const NG_ANIMATE_CLASSNAME: "ng-animate";
57
- export const NG_ANIMATE_CHILDREN_DATA: "$$ngAnimateChildren";
58
- export let CSS_PREFIX: string;
59
- export let TRANSITION_PROP: any;
60
- export let TRANSITIONEND_EVENT: any;
61
- export let ANIMATION_PROP: any;
62
- export let ANIMATIONEND_EVENT: any;
63
- export const DURATION_KEY: "Duration";
64
- export const PROPERTY_KEY: number;
65
- export const DELAY_KEY: "Delay";
66
- export const TIMING_KEY: "TimingFunction";
67
- export const ANIMATION_ITERATION_COUNT_KEY: "IterationCount";
68
- export const ANIMATION_PLAYSTATE_KEY: "PlayState";
69
- export const SAFE_FAST_FORWARD_DURATION_VALUE: 9999;
70
- export const ANIMATION_DELAY_PROP: string;
71
- export const ANIMATION_DURATION_PROP: string;
72
- export const TRANSITION_DELAY_PROP: string;
73
- export const TRANSITION_DURATION_PROP: string;
74
- export const ngMinErr: (arg0: string, ...arg1: any[]) => Error;