@angular-wave/angular.ts 0.0.43 → 0.0.45
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/README.md +1 -1
- package/dist/angular-ts.esm.js +2 -2
- package/dist/angular-ts.umd.js +2 -2
- package/package.json +1 -1
- package/src/animations/module.js +1 -1
- package/src/exts/aria/aria.js +2 -130
- package/src/exts/aria/aria.md +145 -0
- package/src/exts/messages/messages.js +1 -1
- package/src/filters/filter.js +14 -2
- package/src/filters/filters.js +2 -2
- package/src/filters/limit-to.js +11 -4
- package/src/filters/order-by.js +0 -5
- package/src/index.js +2 -1
- package/src/injector.js +1 -1
- package/src/loader.js +60 -60
- package/src/public.js +1 -1
- package/src/router/directives/directives.test.js +1 -1
- package/src/router/index.js +1 -1
- package/src/router/params/param-type.js +3 -3
- package/src/router/services.spec.js +3 -3
- package/src/router/state/state-service.js +0 -8
- package/src/shared/jqlite/jqlite.js +751 -699
- package/src/shared/jqlite/jqlite.spec.js +0 -8
- package/src/shared/utils.js +3 -3
- package/src/src.test.js +1 -1
- package/src/types.js +6 -6
- package/tsconfig.json +1 -1
- package/types/filters/filter.d.ts +2 -2
- package/types/filters/filters.d.ts +4 -4
- package/types/filters/limit-to.d.ts +2 -2
- package/types/filters/order-by.d.ts +1 -6
- package/types/public.d.ts +2 -2
- package/types/router/params/param-type.d.ts +3 -3
- package/types/router/state/state-service.d.ts +9 -15
- package/types/shared/jqlite/jqlite.d.ts +46 -19
- package/types/shared/utils.d.ts +1 -1
- package/types/types.d.ts +5 -5
- package/types-back/index.d.ts +0 -24
package/package.json
CHANGED
package/src/animations/module.js
CHANGED
|
@@ -760,7 +760,7 @@ import { $$AnimateJsDriverProvider } from "./animate-js-driver";
|
|
|
760
760
|
* Click here {@link ng.$animate to learn more about animations with `$animate`}.
|
|
761
761
|
*/
|
|
762
762
|
export function initAnimateModule() {
|
|
763
|
-
window
|
|
763
|
+
window["angular"]
|
|
764
764
|
.module("ngAnimate", [])
|
|
765
765
|
.directive("ngAnimateSwap", ngAnimateSwapDirective)
|
|
766
766
|
|
package/src/exts/aria/aria.js
CHANGED
|
@@ -1,64 +1,9 @@
|
|
|
1
1
|
import { extend } from "../../shared/utils";
|
|
2
2
|
|
|
3
|
-
/**
|
|
4
|
-
* @ngdoc module
|
|
5
|
-
* @name ngAria
|
|
6
|
-
* @description
|
|
7
|
-
*
|
|
8
|
-
* The `ngAria` module provides support for common
|
|
9
|
-
* [<abbr title="Accessible Rich Internet Applications">ARIA</abbr>](http://www.w3.org/TR/wai-aria/)
|
|
10
|
-
* attributes that convey state or semantic information about the application for users
|
|
11
|
-
* of assistive technologies, such as screen readers.
|
|
12
|
-
*
|
|
13
|
-
* ## Usage
|
|
14
|
-
*
|
|
15
|
-
* For ngAria to do its magic, simply include the module `ngAria` as a dependency. The following
|
|
16
|
-
* directives are supported:
|
|
17
|
-
* `ngModel`, `ngChecked`, `ngReadonly`, `ngRequired`, `ngValue`, `ngDisabled`, `ngShow`, `ngHide`,
|
|
18
|
-
* `ngClick`, `ngDblClick`, and `ngMessages`.
|
|
19
|
-
*
|
|
20
|
-
* Below is a more detailed breakdown of the attributes handled by ngAria:
|
|
21
|
-
*
|
|
22
|
-
* | Directive | Supported Attributes |
|
|
23
|
-
* |---------------------------------------------|-----------------------------------------------------------------------------------------------------|
|
|
24
|
-
* | {@link ng.directive:ngModel ngModel} | aria-checked, aria-valuemin, aria-valuemax, aria-valuenow, aria-invalid, aria-required, input roles |
|
|
25
|
-
* | {@link ng.directive:ngDisabled ngDisabled} | aria-disabled |
|
|
26
|
-
* | {@link ng.directive:ngRequired ngRequired} | aria-required |
|
|
27
|
-
* | {@link ng.directive:ngChecked ngChecked} | aria-checked |
|
|
28
|
-
* | {@link ng.directive:ngReadonly ngReadonly} | aria-readonly |
|
|
29
|
-
* | {@link ng.directive:ngValue ngValue} | aria-checked |
|
|
30
|
-
* | {@link ng.directive:ngShow ngShow} | aria-hidden |
|
|
31
|
-
* | {@link ng.directive:ngHide ngHide} | aria-hidden |
|
|
32
|
-
* | {@link ng.directive:ngDblclick ngDblclick} | tabindex |
|
|
33
|
-
* | {@link module:ngMessages ngMessages} | aria-live |
|
|
34
|
-
* | {@link ng.directive:ngClick ngClick} | tabindex, keydown event, button role |
|
|
35
|
-
*
|
|
36
|
-
* Find out more information about each directive by reading the
|
|
37
|
-
* {@link guide/accessibility ngAria Developer Guide}.
|
|
38
|
-
*
|
|
39
|
-
* ## Example
|
|
40
|
-
* Using ngDisabled with ngAria:
|
|
41
|
-
* ```html
|
|
42
|
-
* <md-checkbox ng-disabled="disabled">
|
|
43
|
-
* ```
|
|
44
|
-
* Becomes:
|
|
45
|
-
* ```html
|
|
46
|
-
* <md-checkbox ng-disabled="disabled" aria-disabled="true">
|
|
47
|
-
* ```
|
|
48
|
-
*
|
|
49
|
-
* ## Disabling Specific Attributes
|
|
50
|
-
* It is possible to disable individual attributes added by ngAria with the
|
|
51
|
-
* {@link ngAria.$ariaProvider#config config} method. For more details, see the
|
|
52
|
-
* {@link guide/accessibility Developer Guide}.
|
|
53
|
-
*
|
|
54
|
-
* ## Disabling `ngAria` on Specific Elements
|
|
55
|
-
* It is possible to make `ngAria` ignore a specific element, by adding the `ng-aria-disable`
|
|
56
|
-
* attribute on it. Note that only the element itself (and not its child elements) will be ignored.
|
|
57
|
-
*/
|
|
58
3
|
const ARIA_DISABLE_ATTR = "ngAriaDisable";
|
|
59
4
|
|
|
60
5
|
export function initAriaModule() {
|
|
61
|
-
window
|
|
6
|
+
window["angular"]
|
|
62
7
|
.module("ngAria", ["ng"])
|
|
63
8
|
.provider("$aria", $AriaProvider)
|
|
64
9
|
.directive("ngShow", [
|
|
@@ -437,31 +382,6 @@ function $AriaProvider() {
|
|
|
437
382
|
bindRoleForClick: true,
|
|
438
383
|
};
|
|
439
384
|
|
|
440
|
-
/**
|
|
441
|
-
* @ngdoc method
|
|
442
|
-
* @name $ariaProvider#config
|
|
443
|
-
*
|
|
444
|
-
* @param {object} newConfig object to enable/disable specific ARIA attributes
|
|
445
|
-
*
|
|
446
|
-
* - **ariaHidden** – `{boolean}` – Enables/disables aria-hidden tags
|
|
447
|
-
* - **ariaChecked** – `{boolean}` – Enables/disables aria-checked tags
|
|
448
|
-
* - **ariaReadonly** – `{boolean}` – Enables/disables aria-readonly tags
|
|
449
|
-
* - **ariaDisabled** – `{boolean}` – Enables/disables aria-disabled tags
|
|
450
|
-
* - **ariaRequired** – `{boolean}` – Enables/disables aria-required tags
|
|
451
|
-
* - **ariaInvalid** – `{boolean}` – Enables/disables aria-invalid tags
|
|
452
|
-
* - **ariaValue** – `{boolean}` – Enables/disables aria-valuemin, aria-valuemax and
|
|
453
|
-
* aria-valuenow tags
|
|
454
|
-
* - **tabindex** – `{boolean}` – Enables/disables tabindex tags
|
|
455
|
-
* - **bindKeydown** – `{boolean}` – Enables/disables keyboard event binding on non-interactive
|
|
456
|
-
* elements (such as `div` or `li`) using ng-click, making them more accessible to users of
|
|
457
|
-
* assistive technologies
|
|
458
|
-
* - **bindRoleForClick** – `{boolean}` – Adds role=button to non-interactive elements (such as
|
|
459
|
-
* `div` or `li`) using ng-click, making them more accessible to users of assistive
|
|
460
|
-
* technologies
|
|
461
|
-
*
|
|
462
|
-
* @description
|
|
463
|
-
* Enables/disables various ARIA attributes
|
|
464
|
-
*/
|
|
465
385
|
this.config = function (newConfig) {
|
|
466
386
|
config = extend(config, newConfig);
|
|
467
387
|
};
|
|
@@ -484,55 +404,7 @@ function $AriaProvider() {
|
|
|
484
404
|
}
|
|
485
405
|
};
|
|
486
406
|
}
|
|
487
|
-
|
|
488
|
-
* @ngdoc service
|
|
489
|
-
* @name $aria
|
|
490
|
-
*
|
|
491
|
-
* @description
|
|
492
|
-
*
|
|
493
|
-
* The $aria service contains helper methods for applying common
|
|
494
|
-
* [ARIA](http://www.w3.org/TR/wai-aria/) attributes to HTML directives.
|
|
495
|
-
*
|
|
496
|
-
* ngAria injects common accessibility attributes that tell assistive technologies when HTML
|
|
497
|
-
* elements are enabled, selected, hidden, and more. To see how this is performed with ngAria,
|
|
498
|
-
* let's review a code snippet from ngAria itself:
|
|
499
|
-
*
|
|
500
|
-
*```js
|
|
501
|
-
* ngAriaModule.directive('ngDisabled', ['$aria', function($aria) {
|
|
502
|
-
* return $aria.$$watchExpr('ngDisabled', 'aria-disabled', nativeAriaNodeNames, false);
|
|
503
|
-
* }])
|
|
504
|
-
*```
|
|
505
|
-
* Shown above, the ngAria module creates a directive with the same signature as the
|
|
506
|
-
* traditional `ng-disabled` directive. But this ngAria version is dedicated to
|
|
507
|
-
* solely managing accessibility attributes on custom elements. The internal `$aria` service is
|
|
508
|
-
* used to watch the boolean attribute `ngDisabled`. If it has not been explicitly set by the
|
|
509
|
-
* developer, `aria-disabled` is injected as an attribute with its value synchronized to the
|
|
510
|
-
* value in `ngDisabled`.
|
|
511
|
-
*
|
|
512
|
-
* Because ngAria hooks into the `ng-disabled` directive, developers do not have to do
|
|
513
|
-
* anything to enable this feature. The `aria-disabled` attribute is automatically managed
|
|
514
|
-
* simply as a silent side-effect of using `ng-disabled` with the ngAria module.
|
|
515
|
-
*
|
|
516
|
-
* The full list of directives that interface with ngAria:
|
|
517
|
-
* * **ngModel**
|
|
518
|
-
* * **ngChecked**
|
|
519
|
-
* * **ngReadonly**
|
|
520
|
-
* * **ngRequired**
|
|
521
|
-
* * **ngDisabled**
|
|
522
|
-
* * **ngValue**
|
|
523
|
-
* * **ngShow**
|
|
524
|
-
* * **ngHide**
|
|
525
|
-
* * **ngClick**
|
|
526
|
-
* * **ngDblclick**
|
|
527
|
-
* * **ngMessages**
|
|
528
|
-
*
|
|
529
|
-
* Read the {@link guide/accessibility ngAria Developer Guide} for a thorough explanation of each
|
|
530
|
-
* directive.
|
|
531
|
-
*
|
|
532
|
-
*
|
|
533
|
-
* ## Dependencies
|
|
534
|
-
* Requires the {@link ngAria} module to be installed.
|
|
535
|
-
*/
|
|
407
|
+
|
|
536
408
|
this.$get = function () {
|
|
537
409
|
return {
|
|
538
410
|
config(key) {
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
/\*\*
|
|
2
|
+
|
|
3
|
+
- @ngdoc module
|
|
4
|
+
- @name ngAria
|
|
5
|
+
- @description
|
|
6
|
+
-
|
|
7
|
+
- The `ngAria` module provides support for common
|
|
8
|
+
- [<abbr title="Accessible Rich Internet Applications">ARIA</abbr>](http://www.w3.org/TR/wai-aria/)
|
|
9
|
+
- attributes that convey state or semantic information about the application for users
|
|
10
|
+
- of assistive technologies, such as screen readers.
|
|
11
|
+
-
|
|
12
|
+
- ## Usage
|
|
13
|
+
-
|
|
14
|
+
- For ngAria to do its magic, simply include the module `ngAria` as a dependency. The following
|
|
15
|
+
- directives are supported:
|
|
16
|
+
- `ngModel`, `ngChecked`, `ngReadonly`, `ngRequired`, `ngValue`, `ngDisabled`, `ngShow`, `ngHide`,
|
|
17
|
+
- `ngClick`, `ngDblClick`, and `ngMessages`.
|
|
18
|
+
-
|
|
19
|
+
- Below is a more detailed breakdown of the attributes handled by ngAria:
|
|
20
|
+
-
|
|
21
|
+
- | Directive | Supported Attributes |
|
|
22
|
+
- |---------------------------------------------|-----------------------------------------------------------------------------------------------------|
|
|
23
|
+
- | {@link ng.directive:ngModel ngModel} | aria-checked, aria-valuemin, aria-valuemax, aria-valuenow, aria-invalid, aria-required, input roles |
|
|
24
|
+
- | {@link ng.directive:ngDisabled ngDisabled} | aria-disabled |
|
|
25
|
+
- | {@link ng.directive:ngRequired ngRequired} | aria-required |
|
|
26
|
+
- | {@link ng.directive:ngChecked ngChecked} | aria-checked |
|
|
27
|
+
- | {@link ng.directive:ngReadonly ngReadonly} | aria-readonly |
|
|
28
|
+
- | {@link ng.directive:ngValue ngValue} | aria-checked |
|
|
29
|
+
- | {@link ng.directive:ngShow ngShow} | aria-hidden |
|
|
30
|
+
- | {@link ng.directive:ngHide ngHide} | aria-hidden |
|
|
31
|
+
- | {@link ng.directive:ngDblclick ngDblclick} | tabindex |
|
|
32
|
+
- | {@link module:ngMessages ngMessages} | aria-live |
|
|
33
|
+
- | {@link ng.directive:ngClick ngClick} | tabindex, keydown event, button role |
|
|
34
|
+
-
|
|
35
|
+
- Find out more information about each directive by reading the
|
|
36
|
+
- {@link guide/accessibility ngAria Developer Guide}.
|
|
37
|
+
-
|
|
38
|
+
- ## Example
|
|
39
|
+
- Using ngDisabled with ngAria:
|
|
40
|
+
- ```html
|
|
41
|
+
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
- <md-checkbox ng-disabled="disabled">
|
|
45
|
+
- ```
|
|
46
|
+
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
- Becomes:
|
|
50
|
+
- ```html
|
|
51
|
+
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
- <md-checkbox ng-disabled="disabled" aria-disabled="true">
|
|
55
|
+
- ```
|
|
56
|
+
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
-
|
|
60
|
+
- ## Disabling Specific Attributes
|
|
61
|
+
- It is possible to disable individual attributes added by ngAria with the
|
|
62
|
+
- {@link ngAria.$ariaProvider#config config} method. For more details, see the
|
|
63
|
+
- {@link guide/accessibility Developer Guide}.
|
|
64
|
+
-
|
|
65
|
+
- ## Disabling `ngAria` on Specific Elements
|
|
66
|
+
- It is possible to make `ngAria` ignore a specific element, by adding the `ng-aria-disable`
|
|
67
|
+
- attribute on it. Note that only the element itself (and not its child elements) will be ignored.
|
|
68
|
+
\*/
|
|
69
|
+
|
|
70
|
+
/\*\*
|
|
71
|
+
|
|
72
|
+
- @ngdoc service
|
|
73
|
+
- @name $aria
|
|
74
|
+
-
|
|
75
|
+
- @description
|
|
76
|
+
-
|
|
77
|
+
- The $aria service contains helper methods for applying common
|
|
78
|
+
- [ARIA](http://www.w3.org/TR/wai-aria/) attributes to HTML directives.
|
|
79
|
+
-
|
|
80
|
+
- ngAria injects common accessibility attributes that tell assistive technologies when HTML
|
|
81
|
+
- elements are enabled, selected, hidden, and more. To see how this is performed with ngAria,
|
|
82
|
+
- let's review a code snippet from ngAria itself:
|
|
83
|
+
- \*```js
|
|
84
|
+
- ngAriaModule.directive('ngDisabled', ['$aria', function($aria) {
|
|
85
|
+
- return $aria.$$watchExpr('ngDisabled', 'aria-disabled', nativeAriaNodeNames, false);
|
|
86
|
+
- }])
|
|
87
|
+
\*```
|
|
88
|
+
- Shown above, the ngAria module creates a directive with the same signature as the
|
|
89
|
+
- traditional `ng-disabled` directive. But this ngAria version is dedicated to
|
|
90
|
+
- solely managing accessibility attributes on custom elements. The internal `$aria` service is
|
|
91
|
+
- used to watch the boolean attribute `ngDisabled`. If it has not been explicitly set by the
|
|
92
|
+
- developer, `aria-disabled` is injected as an attribute with its value synchronized to the
|
|
93
|
+
- value in `ngDisabled`.
|
|
94
|
+
-
|
|
95
|
+
- Because ngAria hooks into the `ng-disabled` directive, developers do not have to do
|
|
96
|
+
- anything to enable this feature. The `aria-disabled` attribute is automatically managed
|
|
97
|
+
- simply as a silent side-effect of using `ng-disabled` with the ngAria module.
|
|
98
|
+
-
|
|
99
|
+
- The full list of directives that interface with ngAria:
|
|
100
|
+
- - **ngModel**
|
|
101
|
+
- - **ngChecked**
|
|
102
|
+
- - **ngReadonly**
|
|
103
|
+
- - **ngRequired**
|
|
104
|
+
- - **ngDisabled**
|
|
105
|
+
- - **ngValue**
|
|
106
|
+
- - **ngShow**
|
|
107
|
+
- - **ngHide**
|
|
108
|
+
- - **ngClick**
|
|
109
|
+
- - **ngDblclick**
|
|
110
|
+
- - **ngMessages**
|
|
111
|
+
-
|
|
112
|
+
- Read the {@link guide/accessibility ngAria Developer Guide} for a thorough explanation of each
|
|
113
|
+
- directive.
|
|
114
|
+
-
|
|
115
|
+
-
|
|
116
|
+
- ## Dependencies
|
|
117
|
+
- Requires the {@link ngAria} module to be installed.
|
|
118
|
+
\*/
|
|
119
|
+
|
|
120
|
+
/\*\*
|
|
121
|
+
|
|
122
|
+
- @ngdoc method
|
|
123
|
+
- @name $ariaProvider#config
|
|
124
|
+
-
|
|
125
|
+
- @param {object} newConfig object to enable/disable specific ARIA attributes
|
|
126
|
+
-
|
|
127
|
+
- - **ariaHidden** – `{boolean}` – Enables/disables aria-hidden tags
|
|
128
|
+
- - **ariaChecked** – `{boolean}` – Enables/disables aria-checked tags
|
|
129
|
+
- - **ariaReadonly** – `{boolean}` – Enables/disables aria-readonly tags
|
|
130
|
+
- - **ariaDisabled** – `{boolean}` – Enables/disables aria-disabled tags
|
|
131
|
+
- - **ariaRequired** – `{boolean}` – Enables/disables aria-required tags
|
|
132
|
+
- - **ariaInvalid** – `{boolean}` – Enables/disables aria-invalid tags
|
|
133
|
+
- - **ariaValue** – `{boolean}` – Enables/disables aria-valuemin, aria-valuemax and
|
|
134
|
+
- aria-valuenow tags
|
|
135
|
+
- - **tabindex** – `{boolean}` – Enables/disables tabindex tags
|
|
136
|
+
- - **bindKeydown** – `{boolean}` – Enables/disables keyboard event binding on non-interactive
|
|
137
|
+
- elements (such as `div` or `li`) using ng-click, making them more accessible to users of
|
|
138
|
+
- assistive technologies
|
|
139
|
+
- - **bindRoleForClick** – `{boolean}` – Adds role=button to non-interactive elements (such as
|
|
140
|
+
- `div` or `li`) using ng-click, making them more accessible to users of assistive
|
|
141
|
+
- technologies
|
|
142
|
+
-
|
|
143
|
+
- @description
|
|
144
|
+
- Enables/disables various ARIA attributes
|
|
145
|
+
\*/
|
package/src/filters/filter.js
CHANGED
|
@@ -10,9 +10,17 @@ import {
|
|
|
10
10
|
} from "../shared/utils";
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
|
-
* @returns {
|
|
13
|
+
* @returns {function(Array, string|Object|function(any, number, []):[], function(any, any):boolean|boolean, string?): Array}
|
|
14
14
|
*/
|
|
15
15
|
export function filterFilter() {
|
|
16
|
+
/**
|
|
17
|
+
* @param {Array} array The source array.
|
|
18
|
+
* @param {string|Object|function(any, number, []):[]} expression The predicate to be used for selecting items from `array`.
|
|
19
|
+
* @param {function(any, any):boolean|boolean} [comparator] Comparator which is used in determining if values retrieved using `expression`
|
|
20
|
+
* (when it is not a function) should be considered a match based on the expected value (from the filter expression) and actual value (from the object in the array).
|
|
21
|
+
* @param {string} [anyPropertyKey] The special property name that matches against any property.
|
|
22
|
+
* @return {Array} Filtered array
|
|
23
|
+
*/
|
|
16
24
|
return function (array, expression, comparator, anyPropertyKey) {
|
|
17
25
|
if (!isArrayLike(array)) {
|
|
18
26
|
if (array == null) {
|
|
@@ -27,7 +35,8 @@ export function filterFilter() {
|
|
|
27
35
|
|
|
28
36
|
anyPropertyKey = anyPropertyKey || "$";
|
|
29
37
|
let predicateFn;
|
|
30
|
-
|
|
38
|
+
|
|
39
|
+
let matchAgainstAnyProp = false;
|
|
31
40
|
|
|
32
41
|
switch (getTypeForFilter(expression)) {
|
|
33
42
|
case "function":
|
|
@@ -56,6 +65,7 @@ export function filterFilter() {
|
|
|
56
65
|
}
|
|
57
66
|
|
|
58
67
|
// Helper functions for `filterFilter`
|
|
68
|
+
/** @private */
|
|
59
69
|
function createPredicateFn(
|
|
60
70
|
expression,
|
|
61
71
|
comparator,
|
|
@@ -114,6 +124,7 @@ function createPredicateFn(
|
|
|
114
124
|
return predicateFn;
|
|
115
125
|
}
|
|
116
126
|
|
|
127
|
+
/** @private */
|
|
117
128
|
function deepCompare(
|
|
118
129
|
actual,
|
|
119
130
|
expected,
|
|
@@ -201,6 +212,7 @@ function deepCompare(
|
|
|
201
212
|
}
|
|
202
213
|
|
|
203
214
|
// Used for easily differentiating between `null` and actual `object`
|
|
215
|
+
/** @private */
|
|
204
216
|
function getTypeForFilter(val) {
|
|
205
217
|
return val === null ? "null" : typeof val;
|
|
206
218
|
}
|
package/src/filters/filters.js
CHANGED
|
@@ -151,7 +151,7 @@ function roundNumber(parsedNumber, fractionSize, minFrac, maxFrac) {
|
|
|
151
151
|
* }} pattern
|
|
152
152
|
* @param {string} groupSep The string to separate groups of number (e.g. `,`)
|
|
153
153
|
* @param {string} decimalSep The string to act as the decimal separator (e.g. `.`)
|
|
154
|
-
* @param {
|
|
154
|
+
* @param {any} fractionSize The size of the fractional part of the number
|
|
155
155
|
* @return {string} The number formatted as a string
|
|
156
156
|
*/
|
|
157
157
|
|
|
@@ -227,7 +227,7 @@ export function formatNumber(
|
|
|
227
227
|
}
|
|
228
228
|
|
|
229
229
|
/**
|
|
230
|
-
* @returns {
|
|
230
|
+
* @returns {function(Object, number?): Object}
|
|
231
231
|
*/
|
|
232
232
|
export function jsonFilter() {
|
|
233
233
|
return function (object, spacing) {
|
package/src/filters/limit-to.js
CHANGED
|
@@ -7,9 +7,14 @@ import {
|
|
|
7
7
|
} from "../shared/utils";
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
|
-
* @returns {
|
|
10
|
+
* @returns {function(Array|ArrayLike|string|number, string|number, (string|number)?):Array|ArrayLike|string|number}
|
|
11
11
|
*/
|
|
12
12
|
export function limitToFilter() {
|
|
13
|
+
/**
|
|
14
|
+
* @param {Array|ArrayLike|string|number} input Array/array-like, string, or number to be limited.
|
|
15
|
+
* @param {string|number} limit The length of the returned array or string.
|
|
16
|
+
* @param {string|number} [begin] Index at which to begin limitation. As a negative index, `begin` indicates an offset from the end of `input`. Defaults to `0`.
|
|
17
|
+
*/
|
|
13
18
|
return function (input, limit, begin) {
|
|
14
19
|
if (Math.abs(Number(limit)) === Infinity) {
|
|
15
20
|
limit = Number(limit);
|
|
@@ -21,14 +26,15 @@ export function limitToFilter() {
|
|
|
21
26
|
if (isNumber(input)) input = input.toString();
|
|
22
27
|
if (!isArrayLike(input)) return input;
|
|
23
28
|
|
|
24
|
-
begin = !begin || isNaN(begin) ? 0 : toInt(begin);
|
|
25
|
-
begin =
|
|
29
|
+
begin = !begin || isNaN(/** @type {any} */ (begin)) ? 0 : toInt(begin);
|
|
30
|
+
begin =
|
|
31
|
+
begin < 0 ? Math.max(0, /** @type {[]} */ (input).length + begin) : begin;
|
|
26
32
|
|
|
27
33
|
if (limit >= 0) {
|
|
28
34
|
return sliceFn(input, begin, begin + limit);
|
|
29
35
|
} else {
|
|
30
36
|
if (begin === 0) {
|
|
31
|
-
return sliceFn(input, limit, input.length);
|
|
37
|
+
return sliceFn(input, limit, /** @type {[]} */ (input).length);
|
|
32
38
|
} else {
|
|
33
39
|
return sliceFn(input, Math.max(0, begin + limit), begin);
|
|
34
40
|
}
|
|
@@ -36,6 +42,7 @@ export function limitToFilter() {
|
|
|
36
42
|
};
|
|
37
43
|
}
|
|
38
44
|
|
|
45
|
+
/** @private */
|
|
39
46
|
function sliceFn(input, begin, end) {
|
|
40
47
|
if (isString(input)) return input.slice(begin, end);
|
|
41
48
|
|
package/src/filters/order-by.js
CHANGED
|
@@ -10,11 +10,6 @@ import {
|
|
|
10
10
|
|
|
11
11
|
orderByFilter.$inject = ["$parse"];
|
|
12
12
|
|
|
13
|
-
/**
|
|
14
|
-
*
|
|
15
|
-
* @param {angular.IParseService} $parse
|
|
16
|
-
* @returns
|
|
17
|
-
*/
|
|
18
13
|
export function orderByFilter($parse) {
|
|
19
14
|
return function (array, sortPredicate, reverseOrder, compareFn) {
|
|
20
15
|
if (array == null) return array;
|
package/src/index.js
CHANGED
package/src/injector.js
CHANGED
|
@@ -249,7 +249,7 @@ export function createInjector(modulesToLoad, strictDi) {
|
|
|
249
249
|
|
|
250
250
|
try {
|
|
251
251
|
if (isString(module)) {
|
|
252
|
-
moduleFn = window
|
|
252
|
+
moduleFn = window["angular"].module(module);
|
|
253
253
|
instanceInjector.modules[module] = moduleFn;
|
|
254
254
|
runBlocks = runBlocks
|
|
255
255
|
.concat(loadModules(moduleFn.requires))
|