@angular-wave/angular.ts 0.0.71 → 0.0.73

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 (90) 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 +5 -2
  8. package/src/animations/animate-queue.js +5 -5
  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 -138
  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/attributes.js +8 -1
  17. package/src/core/compile/compile.spec.js +44 -28
  18. package/src/core/controller/controller.js +9 -3
  19. package/src/core/di/injector.md +1 -1
  20. package/src/core/di/ng-module.js +46 -3
  21. package/src/core/prop.spec.js +15 -11
  22. package/src/core/q/q.js +2 -1
  23. package/src/directive/bind/bind.spec.js +80 -44
  24. package/src/directive/change/change.js +3 -1
  25. package/src/directive/class/class.js +43 -14
  26. package/src/directive/class/class.spec.js +7 -4
  27. package/src/directive/form/form.js +5 -4
  28. package/src/directive/form/form.spec.js +3 -4
  29. package/src/directive/if/if-animate-css.html +5 -7
  30. package/src/directive/if/if.js +1 -1
  31. package/src/directive/if/if.spec.js +3 -2
  32. package/src/directive/include/include.js +1 -1
  33. package/src/directive/input/input.spec.js +6 -4
  34. package/src/directive/list/list.js +3 -3
  35. package/src/directive/list/list.spec.js +4 -2
  36. package/src/directive/messages/messages.js +177 -172
  37. package/src/directive/messages/messages.spec.js +4 -4
  38. package/src/directive/model/model.js +261 -471
  39. package/src/directive/model/model.spec.js +4 -3
  40. package/src/directive/model-options/model-options.spec.js +3 -1
  41. package/src/directive/repeat/repeat.md +1 -1
  42. package/src/directive/repeat/repeat.spec.js +1 -1
  43. package/src/directive/select/select.spec.js +3 -3
  44. package/src/directive/show-hide/show-hide.js +36 -6
  45. package/src/directive/switch/switch.js +4 -4
  46. package/src/directive/switch/switch.spec.js +5 -2
  47. package/src/directive/validators/validators.spec.js +6 -4
  48. package/src/loader.js +1 -2
  49. package/src/public.js +22 -10
  50. package/src/router/directives/state-directives.js +2 -9
  51. package/src/router/hooks/core-resolvables.js +5 -3
  52. package/src/router/path/path-utils.js +1 -2
  53. package/src/router/resolve/resolve-context.js +14 -29
  54. package/src/router/state/state-queue-manager.js +1 -2
  55. package/src/router/state/state-service.js +2 -3
  56. package/src/router/transition/transition.js +2 -2
  57. package/src/router/view/view.js +2 -8
  58. package/src/services/anchor-scroll.html +1 -1
  59. package/src/shared/common.js +3 -8
  60. package/src/shared/common.spec.js +1 -19
  61. package/src/shared/hof.js +1 -8
  62. package/src/shared/jqlite/jqlite.js +2 -2
  63. package/src/shared/predicates.js +3 -2
  64. package/src/types.js +2 -3
  65. package/types/animations/animate-css-driver.d.ts +1 -1
  66. package/types/animations/animate-queue.d.ts +1 -2
  67. package/types/{core/animate → animations}/animate.d.ts +2 -12
  68. package/types/animations/raf-scheduler.d.ts +7 -2
  69. package/types/core/compile/attributes.d.ts +10 -1
  70. package/types/core/di/ng-module.d.ts +55 -12
  71. package/types/core/q/q.d.ts +4 -2
  72. package/types/directive/form/form.d.ts +3 -1
  73. package/types/directive/messages/messages.d.ts +76 -0
  74. package/types/directive/model/model.d.ts +101 -239
  75. package/types/router/resolve/resolve-context.d.ts +0 -2
  76. package/types/router/transition/transition.d.ts +0 -1
  77. package/types/shared/common.d.ts +0 -3
  78. package/types/shared/hof.d.ts +0 -1
  79. package/types/shared/jqlite/jqlite.d.ts +4 -4
  80. package/types/types.d.ts +4 -2
  81. package/src/animations/module.js +0 -25
  82. package/src/core/animate/animate-css.js +0 -88
  83. package/src/core/animate/anomate.md +0 -13
  84. package/types/animations/module.d.ts +0 -1
  85. package/types/core/animate/animate-css.d.ts +0 -19
  86. /package/src/{core/animate → animations}/animate-runner.js +0 -0
  87. /package/src/{core/animate → animations}/animate.spec.js +0 -0
  88. /package/src/{core/animate → animations}/helpers.js +0 -0
  89. /package/types/{core/animate → animations}/animate-runner.d.ts +0 -0
  90. /package/types/{core/animate → animations}/helpers.d.ts +0 -0
@@ -1,32 +1,69 @@
1
+ export function ngModelDirective($rootScope: any): {
2
+ restrict: string;
3
+ require: string[];
4
+ controller: typeof NgModelController;
5
+ priority: number;
6
+ compile: (element: any) => {
7
+ pre: (scope: any, element: any, attr: any, ctrls: any) => void;
8
+ post: (scope: any, element: any, attr: any, ctrls: any) => void;
9
+ };
10
+ };
11
+ export const ngModelMinErr: (arg0: string, ...arg1: any[]) => Error;
1
12
  /**
2
13
  *
3
- * @param {*} $scope
4
- * @param {import('../../core/exception-handler').ErrorHandler} $exceptionHandler
5
- * @param {*} $attr
6
- * @param {*} $element
7
- * @param {*} $parse
8
- * @param {*} $animate
9
- * @param {*} $timeout
10
- * @param {*} $q
11
- * @param {*} $interpolate
14
+ * @property {*} $viewValue The actual value from the control's view.
15
+ *
16
+ * @property {*} $modelValue The value in the model that the control is bound to.
17
+ * @property {Array.<Function>} $parsers Array of functions to execute, as a pipeline, whenever
18
+ * the control updates the ngModelController with a new `$viewValue` from the DOM, usually via user input.
19
+ *
20
+ * @property {Array.<Function>} $formatters Array of functions to execute, as a pipeline, whenever
21
+ the bound ngModel expression changes programmatically. The `$formatters` are not called when the
22
+ value of the control is changed by user interaction.
23
+ *
24
+ * @property {Object.<string, (string, string) => boolean>} $validators A collection of validators that are applied whenever the model value changes.
25
+ * The key value within the object refers to the name of the validator while the function refers to the validation operation.
26
+ * The validation operation is provided with the model value as an argument and must return a true or false value depending on the response of that validation.
27
+ *
28
+ * @property {Object.<string, function(string, string) => QPromise>} $asyncValidators A collection of validations that are expected to perform an asynchronous validation (e.g. a HTTP request).
29
+ * The validation function that is provided is expected to return a promise when it is run during the model validation process
30
+ *
31
+ * @property {Array.<Function>} $viewChangeListeners Array of functions to execute whenever
32
+ * a change to {@link ngModel.NgModelController#$viewValue `$viewValue`} has caused a change
33
+ * to {@link ngModel.NgModelController#$modelValue `$modelValue`}.
34
+ * It is called with no arguments, and its return value is ignored.
35
+ * This can be used in place of additional $watches against the model value.
36
+ *
37
+ * @property {Object} $error An object hash with all failing validator ids as keys.
38
+ * @property {Object} $pending An object hash with all pending validator ids as keys.
39
+ *
40
+ * @property {boolean} $untouched True if control has not lost focus yet.
41
+ * @property {boolean} $touched True if control has lost focus.
42
+ * @property {boolean} $pristine True if user has not interacted with the control yet.
43
+ * @property {boolean} $dirty True if user has already interacted with the control.
44
+ * @property {boolean} $valid True if there is no error.
45
+ * @property {boolean} $invalid True if at least one error on the control.
46
+ * @property {string} $name The name attribute of the control.
12
47
  */
13
- export function NgModelController($scope: any, $exceptionHandler: import("../../core/exception-handler").ErrorHandler, $attr: any, $element: any, $parse: any, $animate: any, $timeout: any, $q: any, $interpolate: any): void;
14
48
  export class NgModelController {
49
+ static $inject: string[];
15
50
  /**
16
- *
17
- * @param {*} $scope
51
+ * @param {import('../../core/scope/scope').Scope} $scope
18
52
  * @param {import('../../core/exception-handler').ErrorHandler} $exceptionHandler
19
- * @param {*} $attr
20
- * @param {*} $element
21
- * @param {*} $parse
53
+ * @param {import('../../core/compile/attributes').Attributes} $attr
54
+ * @param {import('../../shared/jqlite/jqlite').JQLite} $element
55
+ * @param {import("../../core/parser/parse").ParseService} $parse
22
56
  * @param {*} $animate
23
57
  * @param {*} $timeout
24
- * @param {*} $q
58
+ * @param {import("../../core/q/q").QPromise<any>} $q
25
59
  * @param {*} $interpolate
26
60
  */
27
- constructor($scope: any, $exceptionHandler: import("../../core/exception-handler").ErrorHandler, $attr: any, $element: any, $parse: any, $animate: any, $timeout: any, $q: any, $interpolate: any);
28
- $viewValue: number;
29
- $modelValue: number;
61
+ constructor($scope: import("../../core/scope/scope").Scope, $exceptionHandler: import("../../core/exception-handler").ErrorHandler, $attr: import("../../core/compile/attributes").Attributes, $element: import("../../shared/jqlite/jqlite").JQLite, $parse: import("../../core/parser/parse").ParseService, $animate: any, $timeout: any, $q: import("../../core/q/q").QPromise<any>, $interpolate: any);
62
+ /** @type {any} The actual value from the control's view */
63
+ $viewValue: any;
64
+ /** @type {any} The value in the model that the control is bound to. */
65
+ $modelValue: any;
66
+ /** @type {any} */
30
67
  $$rawModelValue: any;
31
68
  $validators: {};
32
69
  $asyncValidators: {};
@@ -34,10 +71,15 @@ export class NgModelController {
34
71
  $formatters: any[];
35
72
  $viewChangeListeners: any[];
36
73
  $untouched: boolean;
74
+ /** @type {boolean} */
37
75
  $touched: boolean;
76
+ /** @type {boolean} */
38
77
  $pristine: boolean;
78
+ /** @type {boolean} */
39
79
  $dirty: boolean;
80
+ /** @type {boolean} */
40
81
  $valid: boolean;
82
+ /** @type {boolean} */
41
83
  $invalid: boolean;
42
84
  $error: {};
43
85
  $$success: {};
@@ -48,7 +90,7 @@ export class NgModelController {
48
90
  $getControls: () => any;
49
91
  $$renameControl: (control: any, name: any) => void;
50
92
  $removeControl: () => void;
51
- $setValidity: () => void;
93
+ $setValidity: (...any: any) => any;
52
94
  $setDirty: () => void;
53
95
  $setPristine: () => void;
54
96
  $setSubmitted: () => void;
@@ -62,26 +104,52 @@ export class NgModelController {
62
104
  createChild(options: ModelOptionsConfig): any;
63
105
  };
64
106
  $$updateEvents: string;
65
- $$updateEventHandler: any;
66
- $$parsedNgModel: any;
67
- $$parsedNgModelAssign: any;
68
- $$ngModelGet: any;
69
- $$ngModelSet: any;
107
+ $$updateEventHandler(ev: any): void;
108
+ $$parsedNgModel: import("../../core/parser/parse").CompiledExpression;
109
+ $$parsedNgModelAssign: (arg0: any, arg1: any) => any;
110
+ /** @type {import("../../core/parser/parse").CompiledExpression|((Scope) => any)} */
111
+ $$ngModelGet: import("../../core/parser/parse").CompiledExpression | ((Scope: any) => any);
112
+ $$ngModelSet: (arg0: any, arg1: any) => any;
70
113
  $$pendingDebounce: any;
71
114
  $$parserValid: boolean;
72
115
  $$parserName: string;
116
+ /** @type {number} */
73
117
  $$currentValidationRunId: number;
74
- $$scope: any;
75
- $$rootScope: any;
76
- $$attr: any;
77
- $$element: any;
118
+ $$scope: import("../../core/scope/scope").Scope;
119
+ $$rootScope: import("../../core/scope/scope").Scope;
120
+ $$attr: import("../../core/compile/attributes").Attributes;
121
+ $$element: import("../../shared/jqlite/jqlite").JQLite;
78
122
  $$animate: any;
79
123
  $$timeout: any;
80
- $$parse: any;
81
- $$q: any;
124
+ $$parse: import("../../core/parser/parse").ParseService;
125
+ $$q: import("../../core/q/q").QPromise<any>;
82
126
  $$exceptionHandler: import("../../core/exception-handler").ErrorHandler;
127
+ $$hasNativeValidators: boolean;
128
+ set(object: any, property: any): void;
129
+ unset(object: any, property: any): void;
130
+ $setValidity(validationErrorKey: any, state: any): void;
83
131
  $$initGetterSetters(): void;
84
- $render: () => void;
132
+ /**
133
+ * @ngdoc method
134
+ * @name ngModel.NgModelController#$render
135
+ *
136
+ * @description
137
+ * Called when the view needs to be updated. It is expected that the user of the ng-model
138
+ * directive will implement this method.
139
+ *
140
+ * The `$render()` method is invoked in the following situations:
141
+ *
142
+ * * `$rollbackViewValue()` is called. If we are rolling back the view value to the last
143
+ * committed value then `$render()` is called to update the input control.
144
+ * * The value referenced by `ng-model` is changed programmatically and both the `$modelValue` and
145
+ * the `$viewValue` are different from last time.
146
+ *
147
+ * Since `ng-model` does not do a deep watch, `$render()` is only invoked if the values of
148
+ * `$modelValue` and `$viewValue` are actually different from their previous values. If `$modelValue`
149
+ * or `$viewValue` are objects (rather than a string or number) then `$render()` will not be
150
+ * invoked if you only change a property on the objects.
151
+ */
152
+ $render(): void;
85
153
  /**
86
154
  * @ngdoc method
87
155
  * @name ngModel.NgModelController#$isEmpty
@@ -256,10 +324,6 @@ export class NgModelController {
256
324
  $validate(): void;
257
325
  $$runValidators(modelValue: any, viewValue: any, doneCallback: any): void;
258
326
  /**
259
- * @ngdoc method
260
- * @name ngModel.NgModelController#$commitViewValue
261
- *
262
- * @description
263
327
  * Commit a pending update to the `$modelValue`.
264
328
  *
265
329
  * Updates may be pending by a debounced event or because the input is waiting for a some future
@@ -468,212 +532,10 @@ export class NgModelController {
468
532
  /**
469
533
  * This method is called internally to run the $formatters on the $modelValue
470
534
  */
471
- $$format(): number;
535
+ $$format(): any;
472
536
  /**
473
537
  * This method is called internally when the bound scope value changes.
474
538
  */
475
539
  $$setModelValue(modelValue: any): void;
476
540
  $$setUpdateOnEvents(): void;
477
541
  }
478
- export namespace NgModelController {
479
- let $inject: string[];
480
- }
481
- export const ngModelMinErr: (arg0: string, ...arg1: any[]) => Error;
482
- /**
483
- * @ngdoc directive
484
- * @name ngModel
485
- * @restrict A
486
- * @priority 1
487
- * @param {string} ngModel assignable {@link guide/expression Expression} to bind to.
488
- *
489
- * @description
490
- * The `ngModel` directive binds an `input`,`select`, `textarea` (or custom form control) to a
491
- * property on the scope using {@link ngModel.NgModelController NgModelController},
492
- * which is created and exposed by this directive.
493
- *
494
- * `ngModel` is responsible for:
495
- *
496
- * - Binding the view into the model, which other directives such as `input`, `textarea` or `select`
497
- * require.
498
- * - Providing validation behavior (i.e. required, number, email, url).
499
- * - Keeping the state of the control (valid/invalid, dirty/pristine, touched/untouched, validation errors).
500
- * - Setting related css classes on the element (`ng-valid`, `ng-invalid`, `ng-dirty`, `ng-pristine`, `ng-touched`,
501
- * `ng-untouched`, `ng-empty`, `ng-not-empty`) including animations.
502
- * - Registering the control with its parent {@link ng.directive:form form}.
503
- *
504
- * Note: `ngModel` will try to bind to the property given by evaluating the expression on the
505
- * current scope. If the property doesn't already exist on this scope, it will be created
506
- * implicitly and added to the scope.
507
- *
508
- * For best practices on using `ngModel`, see:
509
- *
510
- * - [Understanding Scopes](https://github.com/angular/angular.js/wiki/Understanding-Scopes)
511
- *
512
- * For basic examples, how to use `ngModel`, see:
513
- *
514
- * - {@link ng.directive:input input}
515
- * - {@link input[text] text}
516
- * - {@link input[checkbox] checkbox}
517
- * - {@link input[radio] radio}
518
- * - {@link input[number] number}
519
- * - {@link input[email] email}
520
- * - {@link input[url] url}
521
- * - {@link input[date] date}
522
- * - {@link input[datetime-local] datetime-local}
523
- * - {@link input[time] time}
524
- * - {@link input[month] month}
525
- * - {@link input[week] week}
526
- * - {@link ng.directive:select select}
527
- * - {@link ng.directive:textarea textarea}
528
- *
529
- * ## Complex Models (objects or collections)
530
- *
531
- * By default, `ngModel` watches the model by reference, not value. This is important to know when
532
- * binding inputs to models that are objects (e.g. `Date`) or collections (e.g. arrays). If only properties of the
533
- * object or collection change, `ngModel` will not be notified and so the input will not be re-rendered.
534
- *
535
- * The model must be assigned an entirely new object or collection before a re-rendering will occur.
536
- *
537
- * Some directives have options that will cause them to use a custom `$watchCollection` on the model expression
538
- * - for example, `ngOptions` will do so when a `track by` clause is included in the comprehension expression or
539
- * if the select is given the `multiple` attribute.
540
- *
541
- * The `$watchCollection()` method only does a shallow comparison, meaning that changing properties deeper than the
542
- * first level of the object (or only changing the properties of an item in the collection if it's an array) will still
543
- * not trigger a re-rendering of the model.
544
- *
545
- * ## CSS classes
546
- * The following CSS classes are added and removed on the associated input/select/textarea element
547
- * depending on the validity of the model.
548
- *
549
- * - `ng-valid`: the model is valid
550
- * - `ng-invalid`: the model is invalid
551
- * - `ng-valid-[key]`: for each valid key added by `$setValidity`
552
- * - `ng-invalid-[key]`: for each invalid key added by `$setValidity`
553
- * - `ng-pristine`: the control hasn't been interacted with yet
554
- * - `ng-dirty`: the control has been interacted with
555
- * - `ng-touched`: the control has been blurred
556
- * - `ng-untouched`: the control hasn't been blurred
557
- * - `ng-pending`: any `$asyncValidators` are unfulfilled
558
- * - `ng-empty`: the view does not contain a value or the value is deemed "empty", as defined
559
- * by the {@link ngModel.NgModelController#$isEmpty} method
560
- * - `ng-not-empty`: the view contains a non-empty value
561
- *
562
- * Keep in mind that ngAnimate can detect each of these classes when added and removed.
563
- *
564
- * @animations
565
- * Animations within models are triggered when any of the associated CSS classes are added and removed
566
- * on the input element which is attached to the model. These classes include: `.ng-pristine`, `.ng-dirty`,
567
- * `.ng-invalid` and `.ng-valid` as well as any other validations that are performed on the model itself.
568
- * The animations that are triggered within ngModel are similar to how they work in ngClass and
569
- * animations can be hooked into using CSS transitions, keyframes as well as JS animations.
570
- *
571
- * The following example shows a simple way to utilize CSS transitions to style an input element
572
- * that has been rendered as invalid after it has been validated:
573
- *
574
- * <pre>
575
- * //be sure to include ngAnimate as a module to hook into more
576
- * //advanced animations
577
- * .my-input {
578
- * transition:0.5s linear all;
579
- * background: white;
580
- * }
581
- * .my-input.ng-invalid {
582
- * background: red;
583
- * color:white;
584
- * }
585
- * </pre>
586
- *
587
- * @example
588
- * ### Basic Usage
589
- * <example deps="angular-animate.js" animations="true" fixBase="true" module="inputExample" name="ng-model">
590
- <file name="index.html">
591
- <script>
592
- angular.module('inputExample', [])
593
- .controller('ExampleController', ['$scope', function($scope) {
594
- $scope.val = '1';
595
- }]);
596
- </script>
597
- <style>
598
- .my-input {
599
- transition:all linear 0.5s;
600
- background: transparent;
601
- }
602
- .my-input.ng-invalid {
603
- color:white;
604
- background: red;
605
- }
606
- </style>
607
- <p id="inputDescription">
608
- Update input to see transitions when valid/invalid.
609
- Integer is a valid value.
610
- </p>
611
- <form name="testForm" ng-controller="ExampleController">
612
- <input ng-model="val" ng-pattern="/^\d+$/" name="anim" class="my-input"
613
- aria-describedby="inputDescription" />
614
- </form>
615
- </file>
616
- * </example>
617
- *
618
- * @example
619
- * ### Binding to a getter/setter
620
- *
621
- * Sometimes it's helpful to bind `ngModel` to a getter/setter function. A getter/setter is a
622
- * function that returns a representation of the model when called with zero arguments, and sets
623
- * the internal state of a model when called with an argument. It's sometimes useful to use this
624
- * for models that have an internal representation that's different from what the model exposes
625
- * to the view.
626
- *
627
- * <div class="alert alert-success">
628
- * **Best Practice:** It's best to keep getters fast because AngularJS is likely to call them more
629
- * frequently than other parts of your code.
630
- * </div>
631
- *
632
- * You use this behavior by adding `ng-model-options="{ getterSetter: true }"` to an element that
633
- * has `ng-model` attached to it. You can also add `ng-model-options="{ getterSetter: true }"` to
634
- * a `<form>`, which will enable this behavior for all `<input>`s within it. See
635
- * {@link ng.directive:ngModelOptions `ngModelOptions`} for more.
636
- *
637
- * The following example shows how to use `ngModel` with a getter/setter:
638
- *
639
- * @example
640
- * <example name="ngModel-getter-setter" module="getterSetterExample">
641
- <file name="index.html">
642
- <div ng-controller="ExampleController">
643
- <form name="userForm">
644
- <label>Name:
645
- <input type="text" name="userName"
646
- ng-model="user.name"
647
- ng-model-options="{ getterSetter: true }" />
648
- </label>
649
- </form>
650
- <pre>user.name = <span ng-bind="user.name()"></span></pre>
651
- </div>
652
- </file>
653
- <file name="app.js">
654
- angular.module('getterSetterExample', [])
655
- .controller('ExampleController', ['$scope', function($scope) {
656
- let _name = 'Brian';
657
- $scope.user = {
658
- name: function(newName) {
659
- // Note that newName can be undefined for two reasons:
660
- // 1. Because it is called as a getter and thus called with no arguments
661
- // 2. Because the property should actually be set to undefined. This happens e.g. if the
662
- // input is invalid
663
- return arguments.length ? (_name = newName) : _name;
664
- }
665
- };
666
- }]);
667
- </file>
668
- * </example>
669
- */
670
- export const ngModelDirective: (string | (($rootScope: any) => {
671
- restrict: string;
672
- require: string[];
673
- controller: typeof NgModelController;
674
- priority: number;
675
- compile: (element: any) => {
676
- pre: (scope: any, element: any, attr: any, ctrls: any) => void;
677
- post: (scope: any, element: any, attr: any, ctrls: any) => void;
678
- };
679
- }))[];
@@ -92,8 +92,6 @@ export class ResolveContext {
92
92
  getDependencies(resolvable: any): any;
93
93
  }
94
94
  declare class UIInjectorImpl {
95
- constructor(context: any);
96
- context: any;
97
95
  native: any;
98
96
  get(token: any): any;
99
97
  getAsync(token: any): any;
@@ -151,7 +151,6 @@ export class Transition {
151
151
  * @returns a [[UIInjector]]
152
152
  */
153
153
  injector(state: any, pathName?: string): {
154
- context: any;
155
154
  native: any;
156
155
  get(token: any): any;
157
156
  getAsync(token: any): any;
@@ -68,7 +68,6 @@ export function createProxyFunctions(source: any, target: any, bind: any, fnName
68
68
  * @returns {Object} - A new object with `parent` as its prototype and properties from `extra`.
69
69
  */
70
70
  export function inherit(parent: any, extra?: any): any;
71
- export function _inArray(array: any, obj: any): any;
72
71
  export function _removeFrom(array: any, obj: any): any;
73
72
  /**
74
73
  * Applies a set of defaults to an options object. The options object is filtered
@@ -172,8 +171,6 @@ export const toJson: any;
172
171
  /** Naive forEach implementation works with Objects or Arrays */
173
172
  export function forEach(obj: any, cb: any, _this: any): void;
174
173
  export function equals(o1: any, o2: any): any;
175
- /** Given an array, returns true if the object is found in the array, (using includes) */
176
- export const inArray: any;
177
174
  /**
178
175
  * Given an array, and an item, if the item is found in the array, it removes it (in-place).
179
176
  * The same array is returned
@@ -123,7 +123,6 @@ export function prop(name: any): (obj: any) => any;
123
123
  */
124
124
  export const propEq: any;
125
125
  export function parse(name: any): any;
126
- export function not(fn: any): (...args: any[]) => boolean;
127
126
  export function all(fn1: any): (arr: any) => any;
128
127
  export function any(fn1: any): (arr: any) => any;
129
128
  export function is(ctor: any): (obj: any) => boolean;
@@ -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
@@ -191,10 +191,10 @@ export function getOrSetCacheData(element: Element, key: string | any, value?: a
191
191
  */
192
192
  export function removeElement(element: Element, keepData?: boolean): void;
193
193
  /**
194
- * @param {string} elementStr
194
+ * @param {string|JQLite} elementStr
195
195
  * @returns {string} Returns the string representation of the element.
196
196
  */
197
- export function startingTag(elementStr: string): string;
197
+ export function startingTag(elementStr: string | JQLite): string;
198
198
  /**
199
199
  * Return the DOM siblings between the first and last node in the given array.
200
200
  * @param {JQLite|Array} nodes An array-like object
package/types/types.d.ts CHANGED
@@ -8,14 +8,16 @@ export type ComponentOptions = any;
8
8
  export type ControllerConstructor = Function;
9
9
  export type OnChangesObject = any;
10
10
  export type ChangesObject = any;
11
- export type Controller = any;
11
+ export type Controller = {
12
+ name: string;
13
+ };
12
14
  export type Attributes = {
13
15
  [x: string]: any;
14
16
  };
15
17
  export type TScope = import("./core/scope/scope").Scope;
16
18
  export type TElement = import("./shared/jqlite/jqlite").JQLite;
17
19
  export type TAttributes = Attributes;
18
- export type TController = DirectiveController;
20
+ export type TController = DirectiveController | NgModelController;
19
21
  export type DirectiveController = Controller | Controller[] | {
20
22
  [key: string]: Controller;
21
23
  };
@@ -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