@angular-wave/angular.ts 0.0.69 → 0.0.71
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/dist/angular-ts.esm.js +2 -2
- package/dist/angular-ts.umd.js +2 -2
- package/package.json +1 -1
- package/src/animations/shared.js +14 -5
- package/src/core/compile/attributes.js +326 -0
- package/src/core/compile/compile.js +76 -434
- package/src/core/compile/compile.spec.js +2 -2
- package/src/core/interpolate/interpolate.js +1 -12
- package/src/core/location/location.js +26 -4
- package/src/core/parser/parse.js +50 -47
- package/src/core/scope/scope.js +4 -8
- package/src/{exts → directive}/aria/aria.html +1 -1
- package/src/directive/aria/aria.js +382 -0
- package/src/{exts → directive}/aria/aria.spec.js +12 -12
- package/src/{exts → directive}/aria/aria.test.js +1 -1
- package/src/directive/form/form.js +3 -1
- package/src/directive/messages/messages.js +268 -274
- package/src/filters/filter.js +0 -3
- package/src/filters/limit-to.js +0 -1
- package/src/public.js +27 -3
- package/src/router/state/state-object.js +4 -9
- package/src/router/url/url-matcher.js +1 -1
- package/src/router/url/url-rule.js +5 -1
- package/src/router/url/url-service.js +1 -1
- package/src/shared/jqlite/jqlite.js +13 -1
- package/src/shared/utils.js +0 -2
- package/src/types.js +1 -1
- package/types/animations/shared.d.ts +11 -6
- package/types/core/compile/attributes.d.ts +101 -0
- package/types/core/compile/compile.d.ts +10 -67
- package/types/core/interpolate/interpolate.d.ts +1 -12
- package/types/core/location/location.d.ts +12 -2
- package/types/core/parser/parse.d.ts +10 -10
- package/types/core/scope/scope.d.ts +21 -22
- package/types/directive/aria/aria.d.ts +94 -0
- package/types/directive/form/form.d.ts +2 -11
- package/types/router/state/state-object.d.ts +0 -2
- package/types/router/url/url-matcher.d.ts +2 -2
- package/types/router/url/url-rule.d.ts +2 -1
- package/types/shared/jqlite/jqlite.d.ts +8 -4
- package/types/shared/utils.d.ts +0 -2
- package/types/types.d.ts +1 -1
- package/src/exts/aria/aria.js +0 -415
- package/types/exts/aria/aria.d.ts +0 -1
- /package/src/{exts → directive}/aria/aria.md +0 -0
|
@@ -7753,7 +7753,7 @@ describe("$compile", () => {
|
|
|
7753
7753
|
expect(
|
|
7754
7754
|
element[0].outerHTML.replace(' selected="selected"', ""),
|
|
7755
7755
|
).toEqual(
|
|
7756
|
-
'<select ng-model="x" class="ng-pristine ng-untouched ng-valid ng-empty">' +
|
|
7756
|
+
'<select ng-model="x" class="ng-pristine ng-untouched ng-valid ng-empty" aria-invalid="false">' +
|
|
7757
7757
|
'<option value="">Greet !</option>' +
|
|
7758
7758
|
"</select>",
|
|
7759
7759
|
);
|
|
@@ -7762,7 +7762,7 @@ describe("$compile", () => {
|
|
|
7762
7762
|
expect(
|
|
7763
7763
|
element[0].outerHTML.replace(' selected="selected"', ""),
|
|
7764
7764
|
).toEqual(
|
|
7765
|
-
'<select ng-model="x" class="ng-pristine ng-untouched ng-valid ng-empty">' +
|
|
7765
|
+
'<select ng-model="x" class="ng-pristine ng-untouched ng-valid ng-empty" aria-invalid="false">' +
|
|
7766
7766
|
'<option value="">Greet Misko!</option>' +
|
|
7767
7767
|
"</select>",
|
|
7768
7768
|
);
|
|
@@ -29,11 +29,6 @@ $interpolateMinErr.interr = function (text, err) {
|
|
|
29
29
|
};
|
|
30
30
|
|
|
31
31
|
/**
|
|
32
|
-
* @ngdoc provider
|
|
33
|
-
* @name $interpolateProvider
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
* @description
|
|
37
32
|
*
|
|
38
33
|
* Used for configuring the interpolation markup. Defaults to `{{` and `}}`.
|
|
39
34
|
*
|
|
@@ -50,9 +45,6 @@ export function $InterpolateProvider() {
|
|
|
50
45
|
let endSymbol = "}}";
|
|
51
46
|
|
|
52
47
|
/**
|
|
53
|
-
* @ngdoc method
|
|
54
|
-
* @name $interpolateProvider#startSymbol
|
|
55
|
-
* @description
|
|
56
48
|
* Symbol to denote start of expression in the interpolated string. Defaults to `{{`.
|
|
57
49
|
*
|
|
58
50
|
* @param {string=} value new value to set the starting symbol to.
|
|
@@ -67,9 +59,6 @@ export function $InterpolateProvider() {
|
|
|
67
59
|
};
|
|
68
60
|
|
|
69
61
|
/**
|
|
70
|
-
* @ngdoc method
|
|
71
|
-
* @name $interpolateProvider#endSymbol
|
|
72
|
-
* @description
|
|
73
62
|
* Symbol to denote the end of expression in the interpolated string. Defaults to `}}`.
|
|
74
63
|
*
|
|
75
64
|
* @param {string=} value new value to set the ending symbol to.
|
|
@@ -89,7 +78,7 @@ export function $InterpolateProvider() {
|
|
|
89
78
|
"$sce",
|
|
90
79
|
/**
|
|
91
80
|
*
|
|
92
|
-
* @param {
|
|
81
|
+
* @param {import("../parser/parse").ParseService} $parse
|
|
93
82
|
* @param {import('../exception-handler').ErrorHandler} $exceptionHandler
|
|
94
83
|
* @param {*} $sce
|
|
95
84
|
* @returns
|
|
@@ -333,6 +333,19 @@ export class Location {
|
|
|
333
333
|
|
|
334
334
|
return this;
|
|
335
335
|
}
|
|
336
|
+
|
|
337
|
+
/**
|
|
338
|
+
* @param {string} _url
|
|
339
|
+
* @param {string} _url2
|
|
340
|
+
* @returns {boolean}
|
|
341
|
+
*/
|
|
342
|
+
$$parseLinkUrl(_url, _url2) {
|
|
343
|
+
throw new Error(`Method not implemented ${_url} ${_url2}`);
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
$$parse(_url) {
|
|
347
|
+
throw new Error(`Method not implemented ${_url}`);
|
|
348
|
+
}
|
|
336
349
|
}
|
|
337
350
|
|
|
338
351
|
/**
|
|
@@ -379,7 +392,12 @@ export class LocationHtml5Url extends Location {
|
|
|
379
392
|
return this.appBaseNoFile + url.substr(1); // first char is always '/'
|
|
380
393
|
}
|
|
381
394
|
|
|
382
|
-
|
|
395
|
+
/**
|
|
396
|
+
* @param {string} url
|
|
397
|
+
* @param {string} relHref
|
|
398
|
+
* @returns {boolean}
|
|
399
|
+
*/
|
|
400
|
+
$$parseLinkUrl(url, relHref) {
|
|
383
401
|
if (relHref && relHref[0] === "#") {
|
|
384
402
|
// special case for links to hash fragments:
|
|
385
403
|
// keep the old url and only replace the hash fragment
|
|
@@ -410,7 +428,7 @@ export class LocationHtml5Url extends Location {
|
|
|
410
428
|
this.$$parse(rewrittenUrl);
|
|
411
429
|
}
|
|
412
430
|
return !!rewrittenUrl;
|
|
413
|
-
}
|
|
431
|
+
}
|
|
414
432
|
}
|
|
415
433
|
|
|
416
434
|
/**
|
|
@@ -513,6 +531,10 @@ export class LocationHashbangUrl extends Location {
|
|
|
513
531
|
return this.appBase + (url ? this.hashPrefix + url : "");
|
|
514
532
|
}
|
|
515
533
|
|
|
534
|
+
/**
|
|
535
|
+
* @param {string} url
|
|
536
|
+
* @returns {boolean}
|
|
537
|
+
*/
|
|
516
538
|
$$parseLinkUrl(url) {
|
|
517
539
|
if (stripHash(this.appBase) === stripHash(url)) {
|
|
518
540
|
this.$$parse(url);
|
|
@@ -602,7 +624,7 @@ export function $LocationProvider() {
|
|
|
602
624
|
let $location;
|
|
603
625
|
let LocationMode;
|
|
604
626
|
const baseHref = $browser.baseHref(); // if base[href] is undefined, it defaults to ''
|
|
605
|
-
const initialUrl = $browser.url();
|
|
627
|
+
const initialUrl = /** @type {string} */ ($browser.url());
|
|
606
628
|
let appBase;
|
|
607
629
|
|
|
608
630
|
if (html5Mode.enabled) {
|
|
@@ -639,7 +661,7 @@ export function $LocationProvider() {
|
|
|
639
661
|
$location.$$state = $browser.state();
|
|
640
662
|
} catch (e) {
|
|
641
663
|
// Restore old values if pushState fails
|
|
642
|
-
$location.url(oldUrl);
|
|
664
|
+
$location.url(/** @type {string} */ (oldUrl));
|
|
643
665
|
$location.$$state = oldState;
|
|
644
666
|
|
|
645
667
|
throw e;
|
package/src/core/parser/parse.js
CHANGED
|
@@ -7,11 +7,11 @@ import { Parser } from "./parser";
|
|
|
7
7
|
* @typedef {Object} CompiledExpressionProps
|
|
8
8
|
* @property {boolean} literal - Indicates if the expression is a literal.
|
|
9
9
|
* @property {boolean} constant - Indicates if the expression is constant.
|
|
10
|
-
* @property {boolean} isPure
|
|
10
|
+
* @property {boolean} [isPure]
|
|
11
11
|
* @property {boolean} oneTime
|
|
12
|
-
* @property {function(import('../scope/scope').Scope, import('../scope/scope').WatchListener, boolean, CompiledExpression, string | ((scope: import('../scope/scope').Scope) => any)): any} $$watchDelegate
|
|
13
|
-
* @property {any[]} inputs
|
|
14
|
-
* @property {function(any, any): any} assign - Assigns a value to a context. If value is not provided,
|
|
12
|
+
* @property {function(import('../scope/scope').Scope, import('../scope/scope').WatchListener, boolean, CompiledExpression, string | ((scope: import('../scope/scope').Scope) => any) | CompiledExpression): any} [$$watchDelegate]
|
|
13
|
+
* @property {any[]|Function} inputs
|
|
14
|
+
* @property {function(any, any): any} [assign] - Assigns a value to a context. If value is not provided,
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
17
|
/**
|
|
@@ -30,7 +30,7 @@ import { Parser } from "./parser";
|
|
|
30
30
|
*/
|
|
31
31
|
|
|
32
32
|
/**
|
|
33
|
-
* @typedef {function(string|function(import('../scope/scope').Scope):any, function(any, import('../scope/scope').Scope, any):any=, boolean=): CompiledExpression} ParseService
|
|
33
|
+
* @typedef {function(CompiledExpression|string|function(import('../scope/scope').Scope):any, function(any, import('../scope/scope').Scope, any):any=, boolean=): CompiledExpression} ParseService
|
|
34
34
|
*/
|
|
35
35
|
|
|
36
36
|
export function $ParseProvider() {
|
|
@@ -219,21 +219,22 @@ function inputsWatchDelegate(
|
|
|
219
219
|
objectEquality,
|
|
220
220
|
parsedExpression,
|
|
221
221
|
) {
|
|
222
|
-
let inputExpressions = parsedExpression.inputs;
|
|
222
|
+
let inputExpressions = /** @type {Function} */ (parsedExpression.inputs);
|
|
223
223
|
let lastResult;
|
|
224
224
|
|
|
225
225
|
if (inputExpressions.length === 1) {
|
|
226
226
|
let oldInputValueOf = expressionInputDirtyCheck; // init to something unique so that equals check fails
|
|
227
227
|
|
|
228
|
-
|
|
228
|
+
let inputExpression = inputExpressions[0];
|
|
229
|
+
|
|
229
230
|
return scope.$watch(
|
|
230
231
|
($scope) => {
|
|
231
|
-
const newInputValue =
|
|
232
|
+
const newInputValue = inputExpression($scope);
|
|
232
233
|
if (
|
|
233
234
|
!expressionInputDirtyCheck(
|
|
234
235
|
newInputValue,
|
|
235
236
|
oldInputValueOf,
|
|
236
|
-
|
|
237
|
+
inputExpression.isPure,
|
|
237
238
|
)
|
|
238
239
|
) {
|
|
239
240
|
lastResult = parsedExpression($scope, undefined, undefined, [
|
|
@@ -246,48 +247,49 @@ function inputsWatchDelegate(
|
|
|
246
247
|
listener,
|
|
247
248
|
objectEquality,
|
|
248
249
|
);
|
|
249
|
-
}
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
}
|
|
257
|
-
|
|
258
|
-
return scope.$watch(
|
|
259
|
-
(scope) => {
|
|
260
|
-
let changed = false;
|
|
250
|
+
} else {
|
|
251
|
+
const oldInputValueOfValues = [];
|
|
252
|
+
const oldInputValues = [];
|
|
253
|
+
for (let i = 0, ii = inputExpressions.length; i < ii; i++) {
|
|
254
|
+
oldInputValueOfValues[i] = expressionInputDirtyCheck; // init to something unique so that equals check fails
|
|
255
|
+
oldInputValues[i] = null;
|
|
256
|
+
}
|
|
261
257
|
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
258
|
+
return scope.$watch(
|
|
259
|
+
(scope) => {
|
|
260
|
+
let changed = false;
|
|
261
|
+
|
|
262
|
+
for (let i = 0, ii = inputExpressions.length; i < ii; i++) {
|
|
263
|
+
const newInputValue = inputExpressions[i](scope);
|
|
264
|
+
if (
|
|
265
|
+
changed ||
|
|
266
|
+
(changed = !expressionInputDirtyCheck(
|
|
267
|
+
newInputValue,
|
|
268
|
+
oldInputValueOfValues[i],
|
|
269
|
+
inputExpressions[i].isPure,
|
|
270
|
+
))
|
|
271
|
+
) {
|
|
272
|
+
oldInputValues[i] = newInputValue;
|
|
273
|
+
oldInputValueOfValues[i] =
|
|
274
|
+
newInputValue && getValueOf(newInputValue);
|
|
275
|
+
}
|
|
274
276
|
}
|
|
275
|
-
}
|
|
276
277
|
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
278
|
+
if (changed) {
|
|
279
|
+
lastResult = parsedExpression(
|
|
280
|
+
scope,
|
|
281
|
+
undefined,
|
|
282
|
+
undefined,
|
|
283
|
+
oldInputValues,
|
|
284
|
+
);
|
|
285
|
+
}
|
|
285
286
|
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
287
|
+
return lastResult;
|
|
288
|
+
},
|
|
289
|
+
listener,
|
|
290
|
+
objectEquality,
|
|
291
|
+
);
|
|
292
|
+
}
|
|
291
293
|
}
|
|
292
294
|
|
|
293
295
|
function oneTimeWatchDelegate(
|
|
@@ -311,6 +313,7 @@ function oneTimeWatchDelegate(
|
|
|
311
313
|
oneTimeWatch.literal = parsedExpression.literal;
|
|
312
314
|
oneTimeWatch.constant = parsedExpression.constant;
|
|
313
315
|
oneTimeWatch.inputs = parsedExpression.inputs;
|
|
316
|
+
oneTimeWatch.oneTime = undefined;
|
|
314
317
|
|
|
315
318
|
// Allow other delegates to run on this wrapped expression
|
|
316
319
|
addWatchDelegate(oneTimeWatch);
|
package/src/core/scope/scope.js
CHANGED
|
@@ -386,7 +386,7 @@ export class Scope {
|
|
|
386
386
|
*
|
|
387
387
|
*
|
|
388
388
|
*
|
|
389
|
-
* @param {string | ((scope: Scope) => any)} watchExp Expression that is evaluated on each
|
|
389
|
+
* @param {string | ((scope: Scope) => any) | import("../parser/parse").CompiledExpression} watchExp Expression that is evaluated on each
|
|
390
390
|
* {@link ng.$rootScope.Scope#$digest $digest} cycle. A change in the return value triggers
|
|
391
391
|
* a call to the `listener`.
|
|
392
392
|
*
|
|
@@ -905,7 +905,6 @@ export class Scope {
|
|
|
905
905
|
}
|
|
906
906
|
|
|
907
907
|
/**
|
|
908
|
-
* @private
|
|
909
908
|
* @param {ScopePhase} phase
|
|
910
909
|
*/
|
|
911
910
|
beginPhase(phase) {
|
|
@@ -1075,12 +1074,8 @@ export class Scope {
|
|
|
1075
1074
|
this.$$nextSibling.$$prevSibling = this.$$prevSibling;
|
|
1076
1075
|
|
|
1077
1076
|
// Disable listeners, watchers and apply/digest methods
|
|
1078
|
-
this.$destroy =
|
|
1079
|
-
|
|
1080
|
-
this.$apply =
|
|
1081
|
-
this.$evalAsync =
|
|
1082
|
-
this.$applyAsync =
|
|
1083
|
-
() => {};
|
|
1077
|
+
this.$destroy = this.$digest = this.$apply = this.$applyAsync = () => {};
|
|
1078
|
+
this.$evalAsync = () => undefined;
|
|
1084
1079
|
this.$on =
|
|
1085
1080
|
this.$watch =
|
|
1086
1081
|
this.$watchGroup =
|
|
@@ -1359,6 +1354,7 @@ export class Scope {
|
|
|
1359
1354
|
* @param {string} name
|
|
1360
1355
|
*/
|
|
1361
1356
|
decrementListenerCount(count, name) {
|
|
1357
|
+
/** @type {Scope} */
|
|
1362
1358
|
let self = this;
|
|
1363
1359
|
for (; self; self = self.$parent) {
|
|
1364
1360
|
if (self.$$listenerCount[name] !== undefined) {
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
<script src="/jasmine/jasmine-5.1.2/jasmine-html.js"></script>
|
|
11
11
|
<script src="/jasmine/jasmine-5.1.2/boot0.js"></script>
|
|
12
12
|
<script src="/jasmine/jasmine-5.1.2/boot1.js"></script>
|
|
13
|
-
<script type="module" src="/src/
|
|
13
|
+
<script type="module" src="/src/directive/aria/aria.spec.js"></script>
|
|
14
14
|
</head>
|
|
15
15
|
<body>
|
|
16
16
|
<div id="dummy"></div>
|