@angular-wave/angular.ts 0.0.38 → 0.0.39
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Makefile +6 -5
- package/dist/angular-ts.esm.js +2 -1
- package/dist/angular-ts.umd.js +1 -1
- package/package.json +2 -4
- package/rollup.config.js +5 -1
- package/src/core/scope/scope.js +4 -7
- package/src/index.js +307 -1
- package/src/loader.js +13 -6
- package/src/public.js +7 -2
- package/src/src.test.js +10 -0
- package/tsconfig.json +1 -1
- package/tsconfig.types.json +11 -0
- package/types/animations/animate-cache.d.ts +7 -7
- package/types/animations/animate-children-directive.d.ts +3 -6
- package/types/animations/animate-swap.d.ts +7 -16
- package/types/animations/animation.d.ts +2 -11
- package/types/animations/raf-scheduler.d.ts +3 -3
- package/types/animations/shared.d.ts +8 -23
- package/types/core/{animate-css.d.ts → animate/animate-css.d.ts} +2 -8
- package/types/core/{cache.d.ts → cache/cache.d.ts} +5 -5
- package/types/core/compile/compile.d.ts +173 -0
- package/types/core/controller/controller.d.ts +32 -0
- package/types/core/exception-handler.d.ts +1 -1
- package/types/core/filter/filter.d.ts +9 -0
- package/types/core/{interpolate.d.ts → interpolate/interpolate.d.ts} +23 -39
- package/types/core/interval/interval-factory.d.ts +4 -0
- package/types/core/{interval.d.ts → interval/interval.d.ts} +1 -1
- package/types/core/location/location.d.ts +209 -0
- package/types/core/pubsub/pubsub.d.ts +156 -0
- package/types/core/q/q.d.ts +31 -0
- package/types/core/sanitize/sanitize-uri.d.ts +53 -0
- package/types/core/{sce.d.ts → sce/sce.d.ts} +80 -86
- package/types/core/scope/scope.d.ts +727 -0
- package/types/core/task-tracker-factory.d.ts +29 -29
- package/types/core/timeout/timeout.d.ts +20 -0
- package/types/core/{urlUtils.d.ts → url-utils/url-utils.d.ts} +2 -7
- package/types/directive/{bind.d.ts → bind/bind.d.ts} +4 -10
- package/types/directive/{class.d.ts → class/class.d.ts} +12 -21
- package/types/directive/controller/controller.d.ts +6 -0
- package/types/directive/events/events.d.ts +5 -0
- package/types/directive/form/form.d.ts +200 -0
- package/types/directive/if/if.d.ts +8 -0
- package/types/directive/include/include.d.ts +14 -0
- package/types/directive/{input.d.ts → input/input.d.ts} +20 -69
- package/types/directive/{model.d.ts → model/model.d.ts} +256 -279
- package/types/directive/options/options.d.ts +9 -0
- package/types/directive/ref/ref.d.ts +5 -0
- package/types/directive/repeat/repeat.d.ts +8 -0
- package/types/directive/{script.d.ts → script/script.d.ts} +5 -8
- package/types/directive/{show-hide.d.ts → show-hide/show-hide.d.ts} +10 -16
- package/types/directive/switch/switch.d.ts +17 -0
- package/types/directive/transclude/transclude.d.ts +4 -0
- package/types/directive/{validators.d.ts → validators/validators.d.ts} +20 -35
- package/types/filters/filters.d.ts +10 -16
- package/types/filters/order-by.d.ts +2 -4
- package/types/index.d.ts +117 -0
- package/types/injector.d.ts +12 -0
- package/types/public.d.ts +5 -0
- package/types/router/common/coreservices.d.ts +2 -2
- package/types/router/common/glob.d.ts +9 -9
- package/types/router/common/queue.d.ts +13 -13
- package/types/router/common/trace.d.ts +43 -43
- package/types/router/directives/view-directive.d.ts +13 -32
- package/types/router/globals.d.ts +20 -20
- package/types/router/hooks/lazy-load.d.ts +2 -11
- package/types/router/hooks/redirect-to.d.ts +1 -4
- package/types/router/hooks/url.d.ts +1 -5
- package/types/router/hooks/views.d.ts +1 -4
- package/types/router/params/param-factory.d.ts +5 -5
- package/types/router/params/param-type.d.ts +35 -35
- package/types/router/params/param-types.d.ts +11 -11
- package/types/router/params/param.d.ts +38 -38
- package/types/router/params/state-params.d.ts +10 -10
- package/types/router/path/path-node.d.ts +34 -34
- package/types/router/path/path-utils.d.ts +73 -77
- package/types/router/resolve/resolvable.d.ts +32 -32
- package/types/router/resolve/resolve-context.d.ts +84 -84
- package/types/router/services.d.ts +4 -9
- package/types/router/state/state-builder.d.ts +27 -27
- package/types/router/state/state-matcher.d.ts +5 -5
- package/types/router/state/state-object.d.ts +58 -58
- package/types/router/state/state-queue-manager.d.ts +10 -16
- package/types/router/state/state-registry.d.ts +100 -107
- package/types/router/state/state-service.d.ts +411 -411
- package/types/router/state/target-state.d.ts +64 -69
- package/types/router/state/views.d.ts +31 -37
- package/types/router/state-filters.d.ts +7 -7
- package/types/router/state-provider.d.ts +105 -105
- package/types/router/template-factory.d.ts +83 -112
- package/types/router/transition/hook-builder.d.ts +25 -25
- package/types/router/transition/hook-registry.d.ts +68 -83
- package/types/router/transition/interface.d.ts +7 -7
- package/types/router/transition/reject-factory.d.ts +34 -34
- package/types/router/transition/transition-event-type.d.ts +9 -18
- package/types/router/transition/transition-hook.d.ts +77 -82
- package/types/router/transition/transition-service.d.ts +82 -99
- package/types/router/transition/transition.d.ts +369 -377
- package/types/router/url/url-config.d.ts +84 -84
- package/types/router/url/url-matcher.d.ts +115 -119
- package/types/router/url/url-rule.d.ts +114 -124
- package/types/router/url/url-rules.d.ts +217 -217
- package/types/router/url/url-service.d.ts +264 -269
- package/types/router/view/view.d.ts +114 -117
- package/types/router/view-scroll.d.ts +2 -2
- package/types/services/anchor-scroll.d.ts +2 -8
- package/types/services/browser.d.ts +122 -130
- package/types/services/cache-factory.d.ts +25 -25
- package/types/services/cookie-reader.d.ts +2 -2
- package/types/services/document.d.ts +2 -2
- package/types/services/http/http.d.ts +145 -0
- package/types/services/{http-backend.d.ts → http-backend/http-backend.d.ts} +3 -35
- package/types/services/log.d.ts +49 -49
- package/types/services/template-request.d.ts +44 -53
- package/types/shared/common.d.ts +4 -19
- package/types/{constants.d.ts → shared/constants.d.ts} +6 -6
- package/types/shared/hof.d.ts +1 -1
- package/types/{jqLite.d.ts → shared/jqlite/jqlite.d.ts} +11 -11
- package/types/shared/test-utils.d.ts +11 -0
- package/types/shared/utils.d.ts +7 -24
- package/types-back/global.d.ts +3 -1
- package/types-back/index.d.ts +2 -221
- package/types/core/compile.d.ts +0 -206
- package/types/core/controller.d.ts +0 -42
- package/types/core/filter.d.ts +0 -9
- package/types/core/interval-factory.d.ts +0 -21
- package/types/core/location.d.ts +0 -234
- package/types/core/pubsub.d.ts +0 -164
- package/types/core/q.d.ts +0 -33
- package/types/core/root-scope.d.ts +0 -754
- package/types/core/sanitize-uri.d.ts +0 -57
- package/types/core/timeout.d.ts +0 -31
- package/types/directive/controller.d.ts +0 -6
- package/types/directive/events.d.ts +0 -12
- package/types/directive/form.d.ts +0 -230
- package/types/directive/if.d.ts +0 -17
- package/types/directive/include.d.ts +0 -33
- package/types/directive/options.d.ts +0 -16
- package/types/directive/ref.d.ts +0 -11
- package/types/directive/repeat.d.ts +0 -23
- package/types/directive/switch.d.ts +0 -23
- package/types/directive/transclude.d.ts +0 -15
- package/types/services/http.d.ts +0 -157
- /package/types/directive/{attrs.d.ts → attrs/attrs.d.ts} +0 -0
- /package/types/directive/{change.d.ts → change/change.d.ts} +0 -0
- /package/types/directive/{cloak.d.ts → cloak/cloak.d.ts} +0 -0
- /package/types/directive/{init.d.ts → init/init.d.ts} +0 -0
- /package/types/directive/{list.d.ts → list/list.d.ts} +0 -0
- /package/types/directive/{non-bindable.d.ts → non-bindable/non-bindable.d.ts} +0 -0
- /package/types/directive/{style.d.ts → style/style.d.ts} +0 -0
- /package/types/exts/{aria.d.ts → aria/aria.d.ts} +0 -0
- /package/types/exts/{messages.d.ts → messages/messages.d.ts} +0 -0
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@angular-wave/angular.ts",
|
|
3
3
|
"license": "MIT",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.39",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/angular-ts.esm.js",
|
|
7
7
|
"browser": "dist/angular-ts.umd.js",
|
|
@@ -37,11 +37,9 @@
|
|
|
37
37
|
"playwright": "^1.44.0",
|
|
38
38
|
"prettier": "latest",
|
|
39
39
|
"rollup": "latest",
|
|
40
|
+
"rollup-plugin-version-injector": "^1.3.3",
|
|
40
41
|
"sinon": "latest",
|
|
41
42
|
"typescript": "latest",
|
|
42
43
|
"vite": "latest"
|
|
43
|
-
},
|
|
44
|
-
"dependencies": {
|
|
45
|
-
|
|
46
44
|
}
|
|
47
45
|
}
|
package/rollup.config.js
CHANGED
|
@@ -2,6 +2,7 @@ import resolve from '@rollup/plugin-node-resolve';
|
|
|
2
2
|
import commonjs from '@rollup/plugin-commonjs';
|
|
3
3
|
import pkg from './package.json' assert { type: 'json' };
|
|
4
4
|
import terser from '@rollup/plugin-terser';
|
|
5
|
+
import versionInjector from 'rollup-plugin-version-injector';
|
|
5
6
|
|
|
6
7
|
export default [
|
|
7
8
|
// browser-friendly UMD build
|
|
@@ -25,6 +26,9 @@ export default [
|
|
|
25
26
|
input: 'src/index.js',
|
|
26
27
|
external: ['ms'],
|
|
27
28
|
output: { file: pkg.main, format: 'es' },
|
|
28
|
-
plugins: [
|
|
29
|
+
plugins: [
|
|
30
|
+
terser(),
|
|
31
|
+
versionInjector()
|
|
32
|
+
],
|
|
29
33
|
},
|
|
30
34
|
];
|
package/src/core/scope/scope.js
CHANGED
|
@@ -53,7 +53,7 @@ let applyAsyncId = null;
|
|
|
53
53
|
/** Services required by each scope instance */
|
|
54
54
|
/** @type {angular.IParseService} */
|
|
55
55
|
let $parse;
|
|
56
|
-
/** @type {import('
|
|
56
|
+
/** @type {import('../../services/browser').Browser} */
|
|
57
57
|
let $browser;
|
|
58
58
|
/** @type {angular.IExceptionHandlerService} */
|
|
59
59
|
let $exceptionHandler;
|
|
@@ -123,10 +123,7 @@ export class $RootScopeProvider {
|
|
|
123
123
|
* to construct.
|
|
124
124
|
*/
|
|
125
125
|
|
|
126
|
-
|
|
127
|
-
* @type {angular.Scope}
|
|
128
|
-
*/
|
|
129
|
-
class Scope {
|
|
126
|
+
export class Scope {
|
|
130
127
|
constructor() {
|
|
131
128
|
/**
|
|
132
129
|
* @type {number} Unique scope ID (monotonically increasing) useful for debugging.
|
|
@@ -142,7 +139,7 @@ class Scope {
|
|
|
142
139
|
this.$parent = null;
|
|
143
140
|
|
|
144
141
|
/**
|
|
145
|
-
* @type {?
|
|
142
|
+
* @type {?Scope}
|
|
146
143
|
*/
|
|
147
144
|
this.$root = this;
|
|
148
145
|
|
|
@@ -377,7 +374,7 @@ class Scope {
|
|
|
377
374
|
*
|
|
378
375
|
* - `string`: Evaluated as {@link guide/expression expression}
|
|
379
376
|
* - `function(scope)`: called with current `scope` as a parameter.
|
|
380
|
-
* @param {(newVal: any, oldVal: any, scope:
|
|
377
|
+
* @param {(newVal: any, oldVal: any, scope: Scope) => any} listener Callback called whenever the value
|
|
381
378
|
* of `watchExpression` changes.
|
|
382
379
|
*
|
|
383
380
|
* - `newVal` contains the current value of the `watchExpression`
|
package/src/index.js
CHANGED
|
@@ -2,7 +2,313 @@ import { Angular, angularInit } from "./loader";
|
|
|
2
2
|
import { publishExternalAPI } from "./public";
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
|
-
* @
|
|
5
|
+
* @typedef {Object} angular.BootstrapConfig
|
|
6
|
+
* @description Configuration option for AngularTS bootstrap process.
|
|
7
|
+
* @property {boolean} debugInfoEnabled - Indicates whether debug information should be enabled. Setting this to `false` can improve performance but will disable some debugging features.
|
|
8
|
+
* @property {boolean} [strictDi] - Disable automatic function annotation for the application. This is meant to assist in finding bugs which break minified code. Defaults to `false`.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* @typedef {Function|Array<string|Function>} angular.Injectable
|
|
13
|
+
* @description Represents a type that can be injected, either as a function or an array of strings/functions.
|
|
14
|
+
* @template T
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* @typedef {Object} angular.ComponentOptions
|
|
19
|
+
* @description Component definition object (a simplified directive definition object)
|
|
20
|
+
* @property {string | angular.angular.Injectable<angular.ControllerConstructor>> | undefined} [controller]
|
|
21
|
+
* Controller constructor function or name of a registered controller.
|
|
22
|
+
* Use array form for dependencies (necessary with strictDi).
|
|
23
|
+
* @property {string | undefined} [controllerAs]
|
|
24
|
+
* Identifier name for the controller published to its scope (default: '$ctrl').
|
|
25
|
+
* @property {string | angular.angular.Injectable<(...args: any[]) => string> | undefined} [template]
|
|
26
|
+
* HTML template string or function returning an HTML template.
|
|
27
|
+
* If a function, injects $element and $attrs.
|
|
28
|
+
* Use array form for dependencies (necessary with strictDi).
|
|
29
|
+
* @property {string | angular.angular.Injectable<(...args: any[]) => string> | undefined} [templateUrl]
|
|
30
|
+
* Path or function returning a path to an HTML template.
|
|
31
|
+
* If a function, injects $element and $attrs.
|
|
32
|
+
* Use array form for dependencies (necessary with strictDi).
|
|
33
|
+
* @property {{ [boundProperty: string]: string } | undefined} [bindings]
|
|
34
|
+
* DOM attribute bindings to component properties.
|
|
35
|
+
* Component properties are bound to the controller, not the scope.
|
|
36
|
+
* @property {boolean | { [slot: string]: string } | undefined} [transclude]
|
|
37
|
+
* Whether transclusion is enabled. Disabled by default.
|
|
38
|
+
* @property {{ [controller: string]: string } | undefined} [require]
|
|
39
|
+
* Requires controllers of other directives, binding them to this component's controller.
|
|
40
|
+
* Keys specify property names under which required controllers (object values) are bound.
|
|
41
|
+
* Required controllers available before $onInit method execution.
|
|
42
|
+
*/
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* @typedef {Function} angular.ControllerConstructor
|
|
46
|
+
* @description Controller constructor type for AngularJS. Note: Instead of classes, plain functions are often used as controller constructors, especially in examples.
|
|
47
|
+
* @param {...any} args Arguments passed to the controller constructor.
|
|
48
|
+
* @returns {void | angular.Controller} Returns nothing or an instance of IController.
|
|
49
|
+
*/
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* @typedef {Object} angular.OnChangesObject
|
|
53
|
+
* @description Object representing changes in one-way bound properties.
|
|
54
|
+
* Keys are the names of the bound properties that have changed, and values are instances of IChangesObject.
|
|
55
|
+
* @property {angular.ChangesObject<any>} property - Represents a changed property.
|
|
56
|
+
*/
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* @typedef {Object} angular.ChangesObject
|
|
60
|
+
* @description Object representing changes in a property.
|
|
61
|
+
* @property {*} currentValue - Current value of the property.
|
|
62
|
+
* @property {*} previousValue - Previous value of the property.
|
|
63
|
+
* @property {function(): boolean} isFirstChange - Function to check if it's the first change of the property.
|
|
64
|
+
*/
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* @typedef {Object} angular.Controller
|
|
68
|
+
* @description Interface representing the lifecycle hooks for AngularJS directive controllers.
|
|
69
|
+
* @see {@link https://docs.angularjs.org/api/ng/service/$compile#life-cycle-hooks}
|
|
70
|
+
* @see {@link https://docs.angularjs.org/guide/component}
|
|
71
|
+
*
|
|
72
|
+
* @property {function(): void} [$onInit]
|
|
73
|
+
* Called on each controller after all the controllers on an element have been constructed and had their bindings
|
|
74
|
+
* initialized (and before the pre & post linking functions for the directives on this element). This is a good
|
|
75
|
+
* place to put initialization code for your controller.
|
|
76
|
+
*
|
|
77
|
+
* @property {function(): void} [$doCheck]
|
|
78
|
+
* Called on each turn of the digest cycle. Provides an opportunity to detect and act on changes.
|
|
79
|
+
* Any actions that you wish to take in response to the changes that you detect must be invoked from this hook;
|
|
80
|
+
* implementing this has no effect on when `$onChanges` is called. For example, this hook could be useful if you wish
|
|
81
|
+
* to perform a deep equality check, or to check a `Date` object, changes to which would not be detected by Angular's
|
|
82
|
+
* change detector and thus not trigger `$onChanges`. This hook is invoked with no arguments; if detecting changes,
|
|
83
|
+
* you must store the previous value(s) for comparison to the current values.
|
|
84
|
+
*
|
|
85
|
+
* @property {function(angular.OnChangesObject): void} [$onChanges]
|
|
86
|
+
* Called whenever one-way bindings are updated. The onChangesObj is a hash whose keys are the names of the bound
|
|
87
|
+
* properties that have changed, and the values are an {@link IChangesObject} object of the form
|
|
88
|
+
* { currentValue, previousValue, isFirstChange() }. Use this hook to trigger updates within a component such as
|
|
89
|
+
* cloning the bound value to prevent accidental mutation of the outer value.
|
|
90
|
+
*
|
|
91
|
+
* @property {function(): void} [$onDestroy]
|
|
92
|
+
* Called on a controller when its containing scope is destroyed. Use this hook for releasing external resources,
|
|
93
|
+
* watches and event handlers.
|
|
94
|
+
*
|
|
95
|
+
* @property {function(): void} [$postLink]
|
|
96
|
+
* Called after this controller's element and its children have been linked. Similar to the post-link function this
|
|
97
|
+
* hook can be used to set up DOM event handlers and do direct DOM manipulation. Note that child elements that contain
|
|
98
|
+
* templateUrl directives will not have been compiled and linked since they are waiting for their template to load
|
|
99
|
+
* asynchronously and their own compilation and linking has been suspended until that occurs. This hook can be considered
|
|
100
|
+
* analogous to the ngAfterViewInit and ngAfterContentInit hooks in Angular 2. Since the compilation process is rather
|
|
101
|
+
* different in Angular 1 there is no direct mapping and care should be taken when upgrading.
|
|
102
|
+
*
|
|
103
|
+
* @property {*} [s: string]
|
|
104
|
+
* IController implementations frequently do not implement any of its methods.
|
|
105
|
+
* A string indexer indicates to TypeScript not to issue a weak type error in this case.
|
|
106
|
+
*/
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* @typedef {Object.<string, any>} angular.Attributes
|
|
110
|
+
*
|
|
111
|
+
* @property {(name: string) => string} $normalize
|
|
112
|
+
* Converts an attribute name (e.g. dash/colon/underscore-delimited string, optionally prefixed with x- or data-) to its normalized, camelCase form.
|
|
113
|
+
* Also there is special case for Moz prefix starting with upper case letter.
|
|
114
|
+
*
|
|
115
|
+
* @property {(newClasses: string, oldClasses: string) => void} $updateClass
|
|
116
|
+
* Adds and removes the appropriate CSS class values to the element based on the difference between
|
|
117
|
+
* the new and old CSS class values (specified as newClasses and oldClasses).
|
|
118
|
+
*
|
|
119
|
+
* @property {(key: string, value: any) => void} $set
|
|
120
|
+
* Set DOM element attribute value.
|
|
121
|
+
*
|
|
122
|
+
* @property {<T>(name: string, fn: (value?: T) => any) => Function} $observe
|
|
123
|
+
* Observes an interpolated attribute.
|
|
124
|
+
* The observer function will be invoked once during the next $digest
|
|
125
|
+
* following compilation. The observer is then invoked whenever the
|
|
126
|
+
* interpolated value changes.
|
|
127
|
+
*
|
|
128
|
+
* @property {Object.<string, string>} $attr
|
|
129
|
+
* A map of DOM element attribute names to the normalized name. This is needed
|
|
130
|
+
* to do reverse lookup from normalized name back to actual name.
|
|
131
|
+
* @see http://docs.angularjs.org/api/ng/type/$compile.directive.Attributes
|
|
132
|
+
*/
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* @typedef {import('./core/scope/scope').Scope} TScope
|
|
136
|
+
*/
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* @typedef {import('./shared/jqlite/jqlite').JQLite} TElement
|
|
140
|
+
*/
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* @typedef {angular.Attributes} TAttributes
|
|
144
|
+
*/
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* @typedef {angular.Controller | angular.Controller[] | { [key: string]: angular.Controller }} IDirectiveController
|
|
148
|
+
* @description Represents a directive controller, which can be:
|
|
149
|
+
* - A single instance of {@link angular.Controller}
|
|
150
|
+
* - An array of {@link angular.Controller}
|
|
151
|
+
* - An object where keys are string identifiers and values are {@link IController}
|
|
152
|
+
*/
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* Compile function for an AngularJS directive.
|
|
156
|
+
*
|
|
157
|
+
* @template TScope - The type of the directive's scope.
|
|
158
|
+
* @template TElement - The type of the directive's element.
|
|
159
|
+
* @template TAttributes - The type of the directive's attributes.
|
|
160
|
+
* @template TController - The type of the directive's controller.
|
|
161
|
+
*
|
|
162
|
+
* @callback angular.DirectiveCompileFn
|
|
163
|
+
* @param {TElement} templateElement - The template element.
|
|
164
|
+
* @param {TAttributes} templateAttributes - The template attributes.
|
|
165
|
+
* @param {ITranscludeFunction} transclude - @deprecated The transclude function. Note: The transclude function that is passed to the compile function is deprecated,
|
|
166
|
+
* as it e.g. does not know about the right outer scope. Please use the transclude function
|
|
167
|
+
* that is passed to the link function instead.
|
|
168
|
+
* @returns {void | angular.DirectiveLinkFn<TScope, TElement, TAttributes, TController> | angular.DirectivePrePost<TScope, TElement, TAttributes, TController>} Returns void, angular.DirectiveLinkFn, or angular.DirectivePrePost.
|
|
169
|
+
*/
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* Link function for an AngularJS directive.
|
|
173
|
+
*
|
|
174
|
+
* @template TScope - The type of the directive's scope.
|
|
175
|
+
* @template TElement - The type of the directive's element.
|
|
176
|
+
* @template TAttributes - The type of the directive's attributes.
|
|
177
|
+
* @template TController - The type of the directive's controller.
|
|
178
|
+
*
|
|
179
|
+
* @callback angular.DirectiveLinkFn
|
|
180
|
+
* @param {TScope} scope - The scope instance for the directive.
|
|
181
|
+
* @param {TElement} instanceElement - The jqLite-wrapped element that this directive matches.
|
|
182
|
+
* @param {TAttributes} instanceAttributes - The normalized attributes for the element.
|
|
183
|
+
* @param {TController} [controller] - The directive's required controller(s) instance(s) or its name(s).
|
|
184
|
+
* @param {ITranscludeFunction} [transclude] - A transclude linking function pre-bound to the correct transclusion scope.
|
|
185
|
+
* @returns {void}
|
|
186
|
+
*/
|
|
187
|
+
|
|
188
|
+
/**
|
|
189
|
+
* Represents the pre and post linking functions of a directive.
|
|
190
|
+
*
|
|
191
|
+
* @template TScope The type of scope associated with the directive.
|
|
192
|
+
* @template TElement The type of element that the directive matches.
|
|
193
|
+
* @template TAttributes The type of attributes of the directive.
|
|
194
|
+
* @template TController The type of controller associated with the directive.
|
|
195
|
+
*
|
|
196
|
+
* @typedef {Object} angular.DirectivePrePost
|
|
197
|
+
* @property {angular.DirectiveLinkFn<TScope, TElement, TAttributes, TController> | undefined} [pre]
|
|
198
|
+
* The pre-linking function of the directive.
|
|
199
|
+
* @property {angular.DirectiveLinkFn<TScope, TElement, TAttributes, TController> | undefined} [post]
|
|
200
|
+
* The post-linking function of the directive.
|
|
201
|
+
*/
|
|
202
|
+
|
|
203
|
+
/**
|
|
204
|
+
* Directive definition object.
|
|
205
|
+
*
|
|
206
|
+
* @template TScope - The type of the directive's scope.
|
|
207
|
+
* @template TElement - The type of the directive's element.
|
|
208
|
+
* @template TAttributes - The type of the directive's attributes.
|
|
209
|
+
* @template TController - The type of the directive's controller.
|
|
210
|
+
*
|
|
211
|
+
* @typedef {Object} IDirective
|
|
212
|
+
* @property {angular.DirectiveCompileFn<TScope, TElement, TAttributes, TController> | undefined} [compile]
|
|
213
|
+
* Compile function for the directive.
|
|
214
|
+
* @property {string | angular.Injectable<angular.ControllerConstructor> | undefined} [controller]
|
|
215
|
+
* Controller constructor or name.
|
|
216
|
+
* @property {string | undefined} [controllerAs]
|
|
217
|
+
* Controller alias.
|
|
218
|
+
* @property {boolean | { [boundProperty: string]: string } | undefined} [bindToController]
|
|
219
|
+
* Bindings to controller.
|
|
220
|
+
* @property {angular.DirectiveLinkFn<TScope, TElement, TAttributes, TController> | angular.DirectivePrePost<TScope, TElement, TAttributes, TController> | undefined} [link]
|
|
221
|
+
* Link function.
|
|
222
|
+
* @property {boolean | undefined} [multiElement]
|
|
223
|
+
* Multi-element directive flag.
|
|
224
|
+
* @property {number | undefined} [priority]
|
|
225
|
+
* Directive priority.
|
|
226
|
+
* @property {boolean | undefined} [replace]
|
|
227
|
+
* Deprecated: Replace flag.
|
|
228
|
+
* @property {string | string[] | { [controller: string]: string } | undefined} [require]
|
|
229
|
+
* Required controllers.
|
|
230
|
+
* @property {string | undefined} [restrict]
|
|
231
|
+
* Restriction mode.
|
|
232
|
+
* @property {boolean | { [boundProperty: string]: string } | undefined} [scope]
|
|
233
|
+
* Scope options.
|
|
234
|
+
* @property {string | ((tElement: TElement, tAttrs: TAttributes) => string) | undefined} [template]
|
|
235
|
+
* HTML template.
|
|
236
|
+
* @property {string | undefined} [templateNamespace]
|
|
237
|
+
* Template namespace.
|
|
238
|
+
* @property {string | ((tElement: TElement, tAttrs: TAttributes) => string) | undefined} [templateUrl]
|
|
239
|
+
* HTML template URL.
|
|
240
|
+
* @property {boolean | "element" | { [slot: string]: string } | undefined} [transclude]
|
|
241
|
+
* Transclusion options.
|
|
242
|
+
*/
|
|
243
|
+
|
|
244
|
+
/**
|
|
245
|
+
* Factory function for creating directives.
|
|
246
|
+
*
|
|
247
|
+
* @template TScope - The type of the directive's scope.
|
|
248
|
+
* @template TElement - The type of the directive's element.
|
|
249
|
+
* @template TAttributes - The type of the directive's attributes.
|
|
250
|
+
* @template TController - The type of the directive's controller.
|
|
251
|
+
*
|
|
252
|
+
* @typedef {(...args: any[]) => IDirective<TScope, TElement, TAttributes, TController> | angular.DirectiveLinkFn<TScope, TElement, TAttributes, TController>} IDirectiveFactory
|
|
253
|
+
*/
|
|
254
|
+
|
|
255
|
+
/**
|
|
256
|
+
* @typedef {Object} angular.Module
|
|
257
|
+
* @description AngularJS module interface for registering components, services, providers, etc.
|
|
258
|
+
* @property {function(string, angular.ComponentOptions): angular.Module} component
|
|
259
|
+
* Use this method to register a component.
|
|
260
|
+
* @property {function({ [componentName: string]: angular.ComponentOptions }): angular.Module} component
|
|
261
|
+
* Use this method to register multiple components.
|
|
262
|
+
* @property {function(Function): angular.Module} config
|
|
263
|
+
* Use this method to register work which needs to be performed on module loading.
|
|
264
|
+
* @property {function(any[]): angular.Module} config
|
|
265
|
+
* Use this method to register work which needs to be performed on module loading.
|
|
266
|
+
* @property {function<T>(string, T): angular.Module} constant
|
|
267
|
+
* Register a constant service with the $injector.
|
|
268
|
+
* @property {function(Object): angular.Module} constant
|
|
269
|
+
* Register multiple constant services.
|
|
270
|
+
* @property {function(string, angular.Injectable<angular.ControllerConstructor>): angular.Module} controller
|
|
271
|
+
* Register a controller with the $controller service.
|
|
272
|
+
* @property {function({ [name: string]: angular.Injectable<angular.ControllerConstructor>> }): angular.Module} controller
|
|
273
|
+
* Register multiple controllers.
|
|
274
|
+
* @property {function<TScope, TElement, TAttributes, TController>(string, angular.Injectable<IDirectiveFactory<TScope, TElement, TAttributes, TController>>): angular.Module} directive
|
|
275
|
+
* Register a directive with the compiler.
|
|
276
|
+
* @property {function<TScope, TElement, TAttributes, TController>(Object.<string, angular.Injectable<IDirectiveFactory<TScope, TElement, TAttributes, TController>>>): angular.Module} directive
|
|
277
|
+
* Register multiple directives.
|
|
278
|
+
* @property {function(string, angular.Injectable<Function>): angular.Module} factory
|
|
279
|
+
* Register a service factory with the $injector.
|
|
280
|
+
* @property {function(Object.<string, angular.Injectable<Function>>): angular.Module} factory
|
|
281
|
+
* Register multiple service factories.
|
|
282
|
+
* @property {function(string, angular.Injectable<FilterFactory>): angular.Module} filter
|
|
283
|
+
* Register a filter service.
|
|
284
|
+
* @property {function(Object.<string, angular.Injectable<FilterFactory>>): angular.Module} filter
|
|
285
|
+
* Register multiple filter services.
|
|
286
|
+
* @property {function(string, IServiceProviderFactory): angular.Module} provider
|
|
287
|
+
* Register a provider service factory.
|
|
288
|
+
* @property {function(string, IServiceProviderClass): angular.Module} provider
|
|
289
|
+
* Register a provider service constructor.
|
|
290
|
+
* @property {function(string, any[]): angular.Module} provider
|
|
291
|
+
* Register a provider service with inline annotated constructor.
|
|
292
|
+
* @property {function(angular.Injectable<Function>): angular.Module} run
|
|
293
|
+
* Register code to be run during module loading.
|
|
294
|
+
* @property {function(string, angular.Injectable<Function>): angular.Module} service
|
|
295
|
+
* Register a service constructor.
|
|
296
|
+
* @property {function(Object.<string, angular.Injectable<Function>>): angular.Module} service
|
|
297
|
+
* Register multiple service constructors.
|
|
298
|
+
* @property {function<T>(string, T): angular.Module} value
|
|
299
|
+
* Register a value service with the $injector.
|
|
300
|
+
* @property {function(Object): angular.Module} value
|
|
301
|
+
* Register multiple value services.
|
|
302
|
+
* @property {function(string, angular.Injectable<Function>): angular.Module} decorator
|
|
303
|
+
* Register a service decorator with the $injector.
|
|
304
|
+
* @property {string} name
|
|
305
|
+
* The name of the AngularJS module.
|
|
306
|
+
* @property {string[]} requires
|
|
307
|
+
* Array of module names that this module depends on.
|
|
308
|
+
*/
|
|
309
|
+
|
|
310
|
+
/**
|
|
311
|
+
* @type {Angular}
|
|
6
312
|
*/
|
|
7
313
|
window.angular = new Angular();
|
|
8
314
|
|
package/src/loader.js
CHANGED
|
@@ -29,11 +29,19 @@ import { CACHE } from "./core/cache/cache";
|
|
|
29
29
|
|
|
30
30
|
const ngMinErr = minErr("ng");
|
|
31
31
|
|
|
32
|
-
/** @type {Object.<string, angular.
|
|
32
|
+
/** @type {Object.<string, import('./index.js').angular.Module>} */
|
|
33
33
|
const moduleCache = {};
|
|
34
34
|
|
|
35
35
|
/**
|
|
36
|
-
*
|
|
36
|
+
* Configuration option for AngularTS bootstrap process.
|
|
37
|
+
*
|
|
38
|
+
* @typedef {Object} AngularBootstrapConfig
|
|
39
|
+
* @property {boolean} debugInfoEnabled - Indicates whether debug information should be enabled. Setting this to `false` can improve performance but will disable some debugging features.
|
|
40
|
+
* @property {boolean} [strictDi] - Disable automatic function annotation for the application. This is meant to assist in finding bugs which break minified code. Defaults to `false`.
|
|
41
|
+
*/
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* @class
|
|
37
45
|
*/
|
|
38
46
|
export class Angular {
|
|
39
47
|
constructor() {
|
|
@@ -119,7 +127,7 @@ export class Angular {
|
|
|
119
127
|
* Each item in the array should be the name of a predefined module or a (DI annotated)
|
|
120
128
|
* function that will be invoked by the injector as a `config` block.
|
|
121
129
|
* See: {@link angular.module modules}
|
|
122
|
-
* @param {
|
|
130
|
+
* @param {AngularBootstrapConfig} [config] an object for defining configuration options for the application. The
|
|
123
131
|
* following keys are supported:
|
|
124
132
|
*
|
|
125
133
|
* * `strictDi` - disable automatic function annotation for the application. This is meant to
|
|
@@ -129,11 +137,10 @@ export class Angular {
|
|
|
129
137
|
*/
|
|
130
138
|
bootstrap(element, modules, config) {
|
|
131
139
|
// eslint-disable-next-line no-param-reassign
|
|
132
|
-
|
|
133
|
-
|
|
140
|
+
config = config || {
|
|
141
|
+
debugInfoEnabled: false,
|
|
134
142
|
strictDi: false,
|
|
135
143
|
};
|
|
136
|
-
config = extend(defaultConfig, config);
|
|
137
144
|
this.doBootstrap = function () {
|
|
138
145
|
// @ts-ignore
|
|
139
146
|
element = jqLite(element);
|
package/src/public.js
CHANGED
|
@@ -104,6 +104,10 @@ import { initMessageModule } from "./exts/messages/messages";
|
|
|
104
104
|
import { initAriaModule } from "./exts/aria/aria";
|
|
105
105
|
import { initRouter } from "./router/index";
|
|
106
106
|
|
|
107
|
+
/**
|
|
108
|
+
* Initializes `ng`, `animate`, `message`, `aria` and `router` modules.
|
|
109
|
+
* @returns {import('./index').angular.Module} `ng`module
|
|
110
|
+
*/
|
|
107
111
|
export function publishExternalAPI() {
|
|
108
112
|
const module = setupModuleLoader(window);
|
|
109
113
|
const ng = module(
|
|
@@ -207,12 +211,13 @@ export function publishExternalAPI() {
|
|
|
207
211
|
});
|
|
208
212
|
},
|
|
209
213
|
],
|
|
210
|
-
)
|
|
214
|
+
)
|
|
215
|
+
// Gets injected by rollup plugin
|
|
216
|
+
.info({ angularVersion: "[VI]{version}[/VI]" });
|
|
211
217
|
|
|
212
218
|
initAnimateModule();
|
|
213
219
|
initMessageModule();
|
|
214
220
|
initAriaModule();
|
|
215
221
|
initRouter();
|
|
216
|
-
|
|
217
222
|
return ng;
|
|
218
223
|
}
|
package/src/src.test.js
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { test, expect } from "@playwright/test";
|
|
2
|
+
|
|
3
|
+
test("unitstate-directives tests contain no errors", async ({ page }) => {
|
|
4
|
+
await page.goto("src/src.html");
|
|
5
|
+
await page.content();
|
|
6
|
+
await page.waitForTimeout(6000);
|
|
7
|
+
await expect(page.locator(".jasmine-overall-result")).toHaveText(
|
|
8
|
+
/0 failures/,
|
|
9
|
+
);
|
|
10
|
+
});
|
package/tsconfig.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
export function animateCache(): {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
2
|
+
cacheKey(node: any, method: any, addClass: any, removeClass: any): string;
|
|
3
|
+
containsCachedAnimationWithoutDuration(key: any): boolean;
|
|
4
|
+
flush(): void;
|
|
5
|
+
count(key: any): any;
|
|
6
|
+
get(key: any): any;
|
|
7
|
+
put(key: any, value: any, isValid: any): void;
|
|
8
8
|
};
|
|
9
9
|
export function $$AnimateCacheProvider(): void;
|
|
10
10
|
export class $$AnimateCacheProvider {
|
|
11
|
-
|
|
11
|
+
$get: (typeof animateCache)[];
|
|
12
12
|
}
|
|
@@ -76,9 +76,6 @@
|
|
|
76
76
|
</file>
|
|
77
77
|
</example>
|
|
78
78
|
*/
|
|
79
|
-
export const $$AnimateChildrenDirective: (
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
link(scope: any, element: any, attrs: any): void;
|
|
83
|
-
})
|
|
84
|
-
)[];
|
|
79
|
+
export const $$AnimateChildrenDirective: (string | (($interpolate: any) => {
|
|
80
|
+
link(scope: any, element: any, attrs: any): void;
|
|
81
|
+
}))[];
|
|
@@ -85,19 +85,10 @@
|
|
|
85
85
|
* </file>
|
|
86
86
|
* </example>
|
|
87
87
|
*/
|
|
88
|
-
export const ngAnimateSwapDirective: (
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
link(
|
|
96
|
-
scope: any,
|
|
97
|
-
$element: any,
|
|
98
|
-
attrs: any,
|
|
99
|
-
ctrl: any,
|
|
100
|
-
$transclude: any,
|
|
101
|
-
): void;
|
|
102
|
-
})
|
|
103
|
-
)[];
|
|
88
|
+
export const ngAnimateSwapDirective: (string | (($animate: any) => {
|
|
89
|
+
restrict: string;
|
|
90
|
+
transclude: string;
|
|
91
|
+
terminal: boolean;
|
|
92
|
+
priority: number;
|
|
93
|
+
link(scope: any, $element: any, attrs: any, ctrl: any, $transclude: any): void;
|
|
94
|
+
}))[];
|
|
@@ -1,14 +1,5 @@
|
|
|
1
1
|
export function $$AnimationProvider(): void;
|
|
2
2
|
export class $$AnimationProvider {
|
|
3
|
-
|
|
4
|
-
|
|
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
|
-
)[];
|
|
3
|
+
drivers: any[];
|
|
4
|
+
$get: (string | (($rootScope: any, $injector: any, $$AnimateRunner: any, $$rAFScheduler: any, $$animateCache: any) => (element: any, event: any, options: any) => any))[];
|
|
14
5
|
}
|
|
@@ -1,40 +1,25 @@
|
|
|
1
1
|
export function assertArg(arg: any, name: any, reason: any): any;
|
|
2
2
|
export function mergeClasses(a: any, b: any): any;
|
|
3
3
|
export function packageStyles(options: any): {
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
to: any;
|
|
5
|
+
from: any;
|
|
6
6
|
};
|
|
7
7
|
export function pendClasses(classes: any, fix: any, isPrefix: any): string;
|
|
8
8
|
export function removeFromArray(arr: any, val: any): void;
|
|
9
9
|
export function stripCommentsFromElement(element: any): any;
|
|
10
10
|
export function extractElementNode(element: any): any;
|
|
11
|
-
export function applyAnimationClassesFactory(): (
|
|
12
|
-
element: any,
|
|
13
|
-
options: any,
|
|
14
|
-
) => void;
|
|
11
|
+
export function applyAnimationClassesFactory(): (element: any, options: any) => void;
|
|
15
12
|
export function prepareAnimationOptions(options: any): any;
|
|
16
13
|
export function applyAnimationStyles(element: any, options: any): void;
|
|
17
14
|
export function applyAnimationFromStyles(element: any, options: any): void;
|
|
18
15
|
export function applyAnimationToStyles(element: any, options: any): void;
|
|
19
|
-
export function mergeAnimationDetails(
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
): any;
|
|
24
|
-
export function resolveElementClasses(
|
|
25
|
-
existing: any,
|
|
26
|
-
toAdd: any,
|
|
27
|
-
toRemove: any,
|
|
28
|
-
): {
|
|
29
|
-
addClass: string;
|
|
30
|
-
removeClass: string;
|
|
16
|
+
export function mergeAnimationDetails(element: any, oldAnimation: any, newAnimation: any): any;
|
|
17
|
+
export function resolveElementClasses(existing: any, toAdd: any, toRemove: any): {
|
|
18
|
+
addClass: string;
|
|
19
|
+
removeClass: string;
|
|
31
20
|
};
|
|
32
21
|
export function getDomNode(element: any): any;
|
|
33
|
-
export function applyGeneratedPreparationClasses(
|
|
34
|
-
element: any,
|
|
35
|
-
event: any,
|
|
36
|
-
options: any,
|
|
37
|
-
): void;
|
|
22
|
+
export function applyGeneratedPreparationClasses(element: any, event: any, options: any): void;
|
|
38
23
|
export function clearGeneratedClasses(element: any, options: any): void;
|
|
39
24
|
export function blockKeyframeAnimations(node: any, applyBlock: any): string[];
|
|
40
25
|
export function applyInlineStyle(node: any, styleTuple: any): void;
|
|
@@ -12,14 +12,8 @@
|
|
|
12
12
|
*/
|
|
13
13
|
export function CoreAnimateCssProvider(): void;
|
|
14
14
|
export class CoreAnimateCssProvider {
|
|
15
|
-
|
|
16
|
-
| string
|
|
17
|
-
| (($$AnimateRunner: any) => (
|
|
18
|
-
element: any,
|
|
19
|
-
initialOptions: any,
|
|
20
|
-
) => {
|
|
15
|
+
$get: (string | (($$AnimateRunner: any) => (element: any, initialOptions: any) => {
|
|
21
16
|
start: () => any;
|
|
22
17
|
end: () => any;
|
|
23
|
-
|
|
24
|
-
)[];
|
|
18
|
+
}))[];
|
|
25
19
|
}
|