@angular-wave/angular.ts 0.0.71 → 0.0.72

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 (59) hide show
  1. package/dist/angular-ts.esm.js +2 -2
  2. package/dist/angular-ts.umd.js +2 -2
  3. package/package.json +1 -1
  4. package/src/animations/animate-children-directive.md +1 -1
  5. package/src/animations/animate-css-driver.js +1 -1
  6. package/src/animations/animate-css.html +2 -2
  7. package/src/animations/animate-js.html +1 -1
  8. package/src/animations/animate-queue.js +4 -4
  9. package/src/animations/animate-swap.md +1 -1
  10. package/src/{core/animate → animations}/animate.html +1 -1
  11. package/src/{core/animate → animations}/animate.js +4 -120
  12. package/src/animations/raf-scheduler.js +7 -3
  13. package/src/animations/raf-scheduler.spec.js +3 -3
  14. package/src/animations/shared.js +2 -2
  15. package/src/binding.spec.js +4 -3
  16. package/src/core/compile/compile.spec.js +45 -28
  17. package/src/core/di/injector.md +1 -1
  18. package/src/core/di/ng-module.js +46 -3
  19. package/src/core/prop.spec.js +15 -11
  20. package/src/directive/bind/bind.spec.js +80 -44
  21. package/src/directive/class/class.js +43 -14
  22. package/src/directive/class/class.spec.js +7 -4
  23. package/src/directive/form/form.js +1 -1
  24. package/src/directive/form/form.spec.js +3 -4
  25. package/src/directive/if/if-animate-css.html +5 -7
  26. package/src/directive/if/if.js +1 -1
  27. package/src/directive/if/if.spec.js +3 -2
  28. package/src/directive/include/include.js +1 -1
  29. package/src/directive/input/input.spec.js +6 -4
  30. package/src/directive/list/list.spec.js +4 -2
  31. package/src/directive/messages/messages.spec.js +4 -4
  32. package/src/directive/model/model.spec.js +4 -3
  33. package/src/directive/model-options/model-options.spec.js +3 -1
  34. package/src/directive/repeat/repeat.md +1 -1
  35. package/src/directive/repeat/repeat.spec.js +1 -1
  36. package/src/directive/select/select.spec.js +3 -3
  37. package/src/directive/show-hide/show-hide.js +36 -6
  38. package/src/directive/switch/switch.spec.js +5 -2
  39. package/src/directive/validators/validators.spec.js +6 -4
  40. package/src/loader.js +1 -2
  41. package/src/public.js +22 -10
  42. package/src/services/anchor-scroll.html +1 -1
  43. package/src/shared/jqlite/jqlite.js +1 -1
  44. package/types/animations/animate-css-driver.d.ts +1 -1
  45. package/types/animations/animate-queue.d.ts +1 -2
  46. package/types/{core/animate → animations}/animate.d.ts +2 -12
  47. package/types/animations/raf-scheduler.d.ts +7 -2
  48. package/types/core/di/ng-module.d.ts +55 -12
  49. package/types/shared/jqlite/jqlite.d.ts +2 -2
  50. package/src/animations/module.js +0 -25
  51. package/src/core/animate/animate-css.js +0 -88
  52. package/src/core/animate/anomate.md +0 -13
  53. package/types/animations/module.d.ts +0 -1
  54. package/types/core/animate/animate-css.d.ts +0 -19
  55. /package/src/{core/animate → animations}/animate-runner.js +0 -0
  56. /package/src/{core/animate → animations}/animate.spec.js +0 -0
  57. /package/src/{core/animate → animations}/helpers.js +0 -0
  58. /package/types/{core/animate → animations}/animate-runner.d.ts +0 -0
  59. /package/types/{core/animate → animations}/helpers.d.ts +0 -0
package/src/public.js CHANGED
@@ -53,16 +53,12 @@ import { ngModelOptionsDirective } from "./directive/model-options/model-options
53
53
  import { ngAttributeAliasDirectives } from "./directive/attrs/attrs";
54
54
  import { ngEventDirectives } from "./directive/events/events";
55
55
  import { AnchorScrollProvider } from "./services/anchor-scroll";
56
- import {
57
- AnimateProvider,
58
- CoreAnimateQueueProvider,
59
- } from "./core/animate/animate";
56
+ import { AnimateProvider } from "./animations/animate";
60
57
  import { BrowserProvider } from "./services/browser";
61
- import { CoreAnimateCssProvider } from "./core/animate/animate-css";
62
58
  import {
63
59
  AnimateAsyncRunFactoryProvider,
64
60
  AnimateRunnerFactoryProvider,
65
- } from "./core/animate/animate-runner";
61
+ } from "./animations/animate-runner";
66
62
  import {
67
63
  CacheFactoryProvider,
68
64
  TemplateCacheProvider,
@@ -89,7 +85,6 @@ import { $$TaskTrackerFactoryProvider } from "./core/task-tracker-factory";
89
85
  import { TemplateRequestProvider } from "./services/template-request";
90
86
  import { $TimeoutProvider } from "./core/timeout/timeout";
91
87
  import { SanitizeUriProvider } from "./core/sanitize/sanitize-uri";
92
- import { initAnimateModule } from "./animations/module";
93
88
  import {
94
89
  ngMessageDefaultDirective,
95
90
  ngMessageDirective,
@@ -112,6 +107,16 @@ import {
112
107
  ngShowAriaDirective,
113
108
  ngValueAriaDirective,
114
109
  } from "./directive/aria/aria";
110
+ import { $AnimateCssProvider } from "./animations/animate-css";
111
+ import { $$AnimateQueueProvider } from "./animations/animate-queue";
112
+ import { $$AnimateJsProvider } from "./animations/animate-js";
113
+ import { $$AnimationProvider } from "./animations/animation";
114
+ import { RafSchedulerProvider } from "./animations/raf-scheduler";
115
+ import { $$AnimateCacheProvider } from "./animations/animate-cache";
116
+ import { $$AnimateCssDriverProvider } from "./animations/animate-css-driver";
117
+ import { $$AnimateJsDriverProvider } from "./animations/animate-js-driver";
118
+ import { ngAnimateSwapDirective } from "./animations/animate-swap";
119
+ import { $$AnimateChildrenDirective } from "./animations/animate-children-directive";
115
120
 
116
121
  /**
117
122
  * @type {string} `version` from `package.json`, injected by Rollup plugin
@@ -190,6 +195,8 @@ export function publishExternalAPI(angular) {
190
195
  })
191
196
  .directive({
192
197
  input: hiddenInputBrowserCacheDirective,
198
+ ngAnimateSwap: ngAnimateSwapDirective,
199
+ ngAnimateChildren: $$AnimateChildrenDirective,
193
200
  ngChecked: ngCheckedAriaDirective,
194
201
  ngClick: ngClickAriaDirective,
195
202
  ngDblclick: ngDblclickAriaDirective,
@@ -208,8 +215,13 @@ export function publishExternalAPI(angular) {
208
215
  $aria: AriaProvider,
209
216
  $anchorScroll: AnchorScrollProvider,
210
217
  $animate: AnimateProvider,
211
- $animateCss: CoreAnimateCssProvider,
212
- $$animateQueue: CoreAnimateQueueProvider,
218
+ $$animation: $$AnimationProvider,
219
+ $animateCss: $AnimateCssProvider,
220
+ $$animateCssDriver: $$AnimateCssDriverProvider,
221
+ $$animateJs: $$AnimateJsProvider,
222
+ $$animateJsDriver: $$AnimateJsDriverProvider,
223
+ $$animateCache: $$AnimateCacheProvider,
224
+ $$animateQueue: $$AnimateQueueProvider,
213
225
  $$AnimateRunner: AnimateRunnerFactoryProvider,
214
226
  $$animateAsyncRun: AnimateAsyncRunFactoryProvider,
215
227
  $browser: BrowserProvider,
@@ -227,6 +239,7 @@ export function publishExternalAPI(angular) {
227
239
  $location: $LocationProvider,
228
240
  $log: $LogProvider,
229
241
  $parse: $ParseProvider,
242
+ $$rAFScheduler: RafSchedulerProvider,
230
243
  $rootScope: $RootScopeProvider,
231
244
  $q: $QProvider,
232
245
  $$q: $$QProvider,
@@ -242,7 +255,6 @@ export function publishExternalAPI(angular) {
242
255
  )
243
256
  .info({ version: VERSION });
244
257
 
245
- initAnimateModule(angular);
246
258
  initRouter(angular);
247
259
  return ng;
248
260
  }
@@ -9,7 +9,7 @@
9
9
  <!--
10
10
  <script src="https://cdn.jsdelivr.net/npm/angular@1.8.3/angular.js"></script>
11
11
  <script src="https://cdn.jsdelivr.net/npm/angular-animate@1.8.3/angular-animate.js"></script>
12
- <script>window.angular.module("test", ["ngAnimate"])</script> -->
12
+ <script>window.angular.module("test", [])</script> -->
13
13
 
14
14
  <script type="module" src="/src/index.js"></script>
15
15
  <script>
@@ -245,7 +245,7 @@ JQLite.prototype.on = function (type, fn) {
245
245
  * Removes an event listener to each element in JQLite collection.
246
246
  *
247
247
  * @param {string} type - The event type(s) to remove listener from
248
- * @param {Function} fn - The function to remove from event type.
248
+ * @param {Function} [fn] - The function to remove from event type.
249
249
  * @returns {JQLite}
250
250
  */
251
251
  JQLite.prototype.off = function (type, fn) {
@@ -4,7 +4,7 @@ export class $$AnimateCssDriverProvider {
4
4
  /**
5
5
  * @returns {Function}
6
6
  */
7
- $get: (string | (($animateCss: any, $$AnimateRunner: typeof import("../core/animate/animate-runner").AnimateRunner, $rootElement: JQLite) => (animationDetails: any) => any))[];
7
+ $get: (string | (($animateCss: any, $$AnimateRunner: typeof import("./animate-runner").AnimateRunner, $rootElement: JQLite) => (animationDetails: any) => any))[];
8
8
  }
9
9
  export namespace $$AnimateCssDriverProvider {
10
10
  let $inject: string[];
@@ -6,7 +6,7 @@ export class $$AnimateQueueProvider {
6
6
  cancel: any[];
7
7
  join: any[];
8
8
  };
9
- $get: (string | (($rootScope: any, $rootElement: JQLite, $$animation: any, $$AnimateRunner: any, $templateRequest: any) => {
9
+ $get: (string | (($rootScope: any, $injector: any, $$animation: any, $$AnimateRunner: any, $templateRequest: any) => {
10
10
  on(event: any, container: any, callback: any): void;
11
11
  off(event: any, container: any, callback: any, ...args: any[]): void;
12
12
  pin(element: any, parentElement: any): void;
@@ -17,4 +17,3 @@ export class $$AnimateQueueProvider {
17
17
  export namespace $$AnimateQueueProvider {
18
18
  let $inject: string[];
19
19
  }
20
- import { JQLite } from "../shared/jqlite/jqlite";
@@ -1,13 +1,3 @@
1
- export function CoreAnimateQueueProvider(): void;
2
- export class CoreAnimateQueueProvider {
3
- $get: (string | (($$AnimateRunner: any, $rootScope: any) => {
4
- enabled: () => void;
5
- on: () => void;
6
- off: () => void;
7
- pin: () => void;
8
- push(element: any, event: any, options: any, domOperation: any): any;
9
- }))[];
10
- }
11
1
  export function domInsert(element: any, parentElement: any, afterElement: any): void;
12
2
  export function AnimateProvider($provide: any): void;
13
3
  export class AnimateProvider {
@@ -241,7 +231,7 @@ export class AnimateProvider {
241
231
  * @example
242
232
  <example module="animationExample" deps="angular-animate.js" animations="true" name="animate-cancel">
243
233
  <file name="app.js">
244
- angular.module('animationExample', ['ngAnimate']).component('cancelExample', {
234
+ angular.module('animationExample', []).component('cancelExample', {
245
235
  templateUrl: 'template.html',
246
236
  controller: function($element, $animate) {
247
237
  this.runner = null;
@@ -427,4 +417,4 @@ export type AnimationOptions = {
427
417
  */
428
418
  to: string;
429
419
  };
430
- import { JQLite } from "../../shared/jqlite/jqlite";
420
+ import { JQLite } from "../shared/jqlite/jqlite";
@@ -6,9 +6,14 @@
6
6
  */
7
7
  /**
8
8
  * Creates a requestAnimationFrame scheduler.
9
- * @returns {RafScheduler} The scheduler object.
10
9
  */
11
- export function $$rAFSchedulerFactory(): RafScheduler;
10
+ export function RafSchedulerProvider(): void;
11
+ export class RafSchedulerProvider {
12
+ /**
13
+ * @returns {RafScheduler} The scheduler object.
14
+ */
15
+ $get: () => RafScheduler;
16
+ }
12
17
  export type RafSchedulerFunction = Function;
13
18
  export type RafSchedulerObject = {
14
19
  /**
@@ -16,7 +16,6 @@ export const CONTROLLER_LITERAL: "$controllerProvider";
16
16
  */
17
17
  export class NgModule {
18
18
  /**
19
- *
20
19
  * @param {String} name - Name of the module
21
20
  * @param {Array<String>} requires - List of modules which the injector will load before the current module
22
21
  * @param {Function} [configFn]
@@ -49,13 +48,13 @@ export class NgModule {
49
48
  */
50
49
  info(value: any): any;
51
50
  /**
52
- * @param {String} name
51
+ * @param {string} name
53
52
  * @param {any} object
54
53
  * @returns {NgModule}
55
54
  */
56
55
  value(name: string, object: any): NgModule;
57
56
  /**
58
- * @param {String} name
57
+ * @param {string} name
59
58
  * @param {any} object
60
59
  * @returns {NgModule}
61
60
  */
@@ -66,14 +65,58 @@ export class NgModule {
66
65
  * @returns {NgModule}
67
66
  */
68
67
  config(configFn: Function): NgModule;
69
- run(block: any): this;
70
- component(name: any, options: any): this;
71
- factory(name: any, providerFunction: any): this;
72
- service(name: any, serviceFunction: any): this;
73
- provider(name: any, providerType: any): this;
74
- decorator(name: any, decorFn: any): this;
75
- directive(name: any, directiveFactory: any): this;
76
- animation(name: any, animationFactory: any): this;
68
+ /**
69
+ * @param {Function} block
70
+ * @returns {NgModule}
71
+ */
72
+ run(block: Function): NgModule;
73
+ /**
74
+ * @param {string} name
75
+ * @param {*} options
76
+ * @returns {NgModule}
77
+ */
78
+ component(name: string, options: any): NgModule;
79
+ /**
80
+ * @param {string} name
81
+ * @param {*} providerFunction
82
+ * @returns {NgModule}
83
+ */
84
+ factory(name: string, providerFunction: any): NgModule;
85
+ /**
86
+ * @param {string} name
87
+ * @param {*} serviceFunction
88
+ * @returns {NgModule}
89
+ */
90
+ service(name: string, serviceFunction: any): NgModule;
91
+ /**
92
+ * @param {string} name
93
+ * @param {*} providerType
94
+ * @returns {NgModule}
95
+ */
96
+ provider(name: string, providerType: any): NgModule;
97
+ /**
98
+ * @param {string} name
99
+ * @param {*} decorFn
100
+ * @returns {NgModule}
101
+ */
102
+ decorator(name: string, decorFn: any): NgModule;
103
+ /**
104
+ * @param {string} name
105
+ * @param {*} directiveFactory
106
+ * @returns {NgModule}
107
+ */
108
+ directive(name: string, directiveFactory: any): NgModule;
109
+ /**
110
+ * @param {string} name
111
+ * @param {*} animationFactory
112
+ * @returns {NgModule}
113
+ */
114
+ animation(name: string, animationFactory: any): NgModule;
77
115
  filter(name: any, filterFn: any): this;
78
- controller(name: any, ctlFn: any): this;
116
+ /**
117
+ * @param {string} name
118
+ * @param {*} ctlFn
119
+ * @returns {NgModule}
120
+ */
121
+ controller(name: string, ctlFn: any): NgModule;
79
122
  }
@@ -57,10 +57,10 @@ export class JQLite {
57
57
  * Removes an event listener to each element in JQLite collection.
58
58
  *
59
59
  * @param {string} type - The event type(s) to remove listener from
60
- * @param {Function} fn - The function to remove from event type.
60
+ * @param {Function} [fn] - The function to remove from event type.
61
61
  * @returns {JQLite}
62
62
  */
63
- off(type: string, fn: Function): JQLite;
63
+ off(type: string, fn?: Function): JQLite;
64
64
  /**
65
65
  * Remove data by name from cache associated with each element in JQLite collection.
66
66
  * @param {string} name - The key of the data associated with element
@@ -1,25 +0,0 @@
1
- import { $$AnimateChildrenDirective } from "./animate-children-directive";
2
- import { $$AnimationProvider } from "./animation";
3
- import { $$rAFSchedulerFactory } from "./raf-scheduler";
4
- import { ngAnimateSwapDirective } from "./animate-swap";
5
- import { $$AnimateQueueProvider } from "./animate-queue";
6
- import { $$AnimateCacheProvider } from "./animate-cache";
7
- import { $AnimateCssProvider } from "./animate-css";
8
- import { $$AnimateCssDriverProvider } from "./animate-css-driver";
9
- import { $$AnimateJsProvider } from "./animate-js";
10
- import { $$AnimateJsDriverProvider } from "./animate-js-driver";
11
-
12
- export function initAnimateModule(angular) {
13
- angular
14
- .module("ngAnimate", [])
15
- .directive("ngAnimateSwap", ngAnimateSwapDirective)
16
- .directive("ngAnimateChildren", $$AnimateChildrenDirective)
17
- .factory("$$rAFScheduler", $$rAFSchedulerFactory)
18
- .provider("$$animateQueue", $$AnimateQueueProvider)
19
- .provider("$$animateCache", $$AnimateCacheProvider)
20
- .provider("$$animation", $$AnimationProvider)
21
- .provider("$animateCss", $AnimateCssProvider)
22
- .provider("$$animateCssDriver", $$AnimateCssDriverProvider)
23
- .provider("$$animateJs", $$AnimateJsProvider)
24
- .provider("$$animateJsDriver", $$AnimateJsDriverProvider);
25
- }
@@ -1,88 +0,0 @@
1
- import { addInlineStyles } from "./helpers";
2
-
3
- /**
4
- * @ngdoc service
5
- * @name $animateCss
6
- * @kind object
7
- *
8
- *
9
- * @description
10
- * This is the core version of `$animateCss`. By default, only when the `ngAnimate` is included,
11
- * then the `$animateCss` service will actually perform animations.
12
- *
13
- * Click here {@link ngAnimate.$animateCss to read the documentation for $animateCss}.
14
- */
15
- export function CoreAnimateCssProvider() {
16
- this.$get = [
17
- "$$AnimateRunner",
18
- ($$AnimateRunner) =>
19
- /**
20
- *
21
- * @param {import("../../shared/jqlite/jqlite").JQLite} element
22
- * @param {*} initialOptions
23
- * @returns
24
- */
25
- function (element, initialOptions) {
26
- // all of the animation functions should create
27
- // a copy of the options data, however, if a
28
- // parent service has already created a copy then
29
- // we should stick to using that
30
- let options = initialOptions || {};
31
- if (!options.$$prepared) {
32
- options = structuredClone(options);
33
- }
34
-
35
- // there is no point in applying the styles since
36
- // there is no animation that goes on at all in
37
- // this version of $animateCss.
38
- if (options.cleanupStyles) {
39
- options.from = options.to = null;
40
- }
41
-
42
- if (options.from) {
43
- addInlineStyles(element[0], options.from);
44
- options.from = null;
45
- }
46
-
47
- let closed;
48
- const runner = new $$AnimateRunner();
49
-
50
- /**
51
- * @returns {$$AnimateRunner}
52
- */
53
- function run() {
54
- requestAnimationFrame(() => {
55
- applyAnimationContents();
56
- if (!closed) {
57
- runner.complete();
58
- }
59
- closed = true;
60
- });
61
- return runner;
62
- }
63
-
64
- /**
65
- * @returns {void}
66
- */
67
- function applyAnimationContents() {
68
- if (options.addClass) {
69
- element[0].classList.add(options.addClass);
70
- options.addClass = null;
71
- }
72
- if (options.removeClass) {
73
- element[0].classList.remove(options.removeClass);
74
- options.removeClass = null;
75
- }
76
- if (options.to) {
77
- addInlineStyles(element[0], options.to);
78
- options.to = null;
79
- }
80
- }
81
-
82
- return {
83
- start: run,
84
- end: run,
85
- };
86
- },
87
- ];
88
- }
@@ -1,13 +0,0 @@
1
- /\*\*
2
-
3
- - @ngdoc provider
4
- - @name $animateProvider
5
- -
6
- - @description
7
- - Default implementation of $animate that doesn't perform any animations, instead just
8
- - synchronously performs DOM updates and resolves the returned runner promise.
9
- -
10
- - In order to enable animations the `ngAnimate` module has to be loaded.
11
- -
12
- - To see the functional implementation check out `src/ngAnimate/animate.js`.
13
- \*/
@@ -1 +0,0 @@
1
- export function initAnimateModule(angular: any): void;
@@ -1,19 +0,0 @@
1
- /**
2
- * @ngdoc service
3
- * @name $animateCss
4
- * @kind object
5
- *
6
- *
7
- * @description
8
- * This is the core version of `$animateCss`. By default, only when the `ngAnimate` is included,
9
- * then the `$animateCss` service will actually perform animations.
10
- *
11
- * Click here {@link ngAnimate.$animateCss to read the documentation for $animateCss}.
12
- */
13
- export function CoreAnimateCssProvider(): void;
14
- export class CoreAnimateCssProvider {
15
- $get: (string | (($$AnimateRunner: any) => (element: import("../../shared/jqlite/jqlite").JQLite, initialOptions: any) => {
16
- start: () => any;
17
- end: () => any;
18
- }))[];
19
- }
File without changes
File without changes