@angular-wave/angular.ts 0.0.50 → 0.0.52
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 +3 -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/animate-children-directive.js +19 -99
- package/src/animations/animate-children-directive.md +80 -0
- package/src/animations/animate-css-driver.js +250 -256
- package/src/animations/animate-css.js +646 -875
- package/src/animations/animate-css.md +263 -0
- package/src/animations/animate-js-driver.js +54 -56
- package/src/animations/animate-js.js +303 -306
- package/src/animations/animate-queue.js +707 -716
- package/src/animations/animate-swap.js +30 -119
- package/src/animations/animate-swap.md +88 -0
- package/src/animations/animation.js +3 -3
- package/src/animations/shared.js +2 -1
- package/src/core/animate/animate-runner.js +147 -145
- package/src/core/animate/animate.js +568 -582
- package/src/core/animate/anomate.md +13 -0
- package/src/core/compile/compile.spec.js +5 -6
- package/src/core/core.html +0 -1
- package/src/core/parser/ast-type.js +21 -20
- package/src/core/parser/ast.js +34 -35
- package/src/core/parser/interpreter.js +405 -136
- package/src/core/parser/lexer.js +14 -13
- package/src/core/parser/parse.js +31 -45
- package/src/core/parser/parse.spec.js +429 -444
- package/src/core/parser/parser.js +17 -9
- package/src/directive/select/select.js +301 -305
- package/src/loader.js +5 -1
- package/src/public.js +0 -1
- package/src/router/directives/state-directives.js +256 -574
- package/src/router/directives/state-directives.md +435 -0
- package/src/router/directives/view-directive.js +3 -3
- package/src/router/index.js +7 -7
- package/src/types.js +0 -13
- package/types/animations/animate-children-directive.d.ts +5 -80
- package/types/animations/animate-css-driver.d.ts +11 -0
- package/types/animations/animate-css.d.ts +8 -0
- package/types/animations/animate-js-driver.d.ts +8 -0
- package/types/animations/animate-js.d.ts +12 -0
- package/types/animations/animate-queue.d.ts +19 -0
- package/types/animations/animate-swap.d.ts +5 -89
- package/types/animations/shared.d.ts +1 -1
- package/types/core/animate/animate-runner.d.ts +32 -0
- package/types/core/animate/animate.d.ts +509 -0
- package/types/core/parser/ast-type.d.ts +24 -20
- package/types/core/parser/ast.d.ts +13 -14
- package/types/core/parser/interpreter.d.ts +24 -19
- package/types/core/parser/lexer.d.ts +6 -2
- package/types/core/parser/parse.d.ts +44 -38
- package/types/core/parser/parser.d.ts +2 -10
- package/types/directive/select/select.d.ts +79 -0
- package/types/loader.d.ts +397 -0
- package/types/router/directives/state-directives.d.ts +31 -0
- package/types/types.d.ts +0 -1
- package/src/core/document.spec.js +0 -52
- package/src/core/parser/shared.js +0 -234
- package/types/core/parser/shared.d.ts +0 -35
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AST } from "./ast";
|
|
2
|
-
import {
|
|
2
|
+
import { ASTType } from "./ast-type";
|
|
3
3
|
import { ASTInterpreter } from "./interpreter";
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -8,11 +8,6 @@ import { ASTInterpreter } from "./interpreter";
|
|
|
8
8
|
* @property {boolean} oneTime - True if expression should be evaluated only once
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
-
/**
|
|
12
|
-
* @typedef {Object} ParserOptions
|
|
13
|
-
* @property {function(string):any} literals
|
|
14
|
-
*/
|
|
15
|
-
|
|
16
11
|
/**
|
|
17
12
|
* @constructor
|
|
18
13
|
*/
|
|
@@ -21,11 +16,10 @@ export class Parser {
|
|
|
21
16
|
*
|
|
22
17
|
* @param {import('./lexer').Lexer} lexer
|
|
23
18
|
* @param {function(any):any} $filter
|
|
24
|
-
* @param {ParserOptions} options
|
|
25
19
|
*/
|
|
26
|
-
constructor(lexer, $filter
|
|
20
|
+
constructor(lexer, $filter) {
|
|
27
21
|
/** @type {AST} */
|
|
28
|
-
this.ast = new AST(lexer
|
|
22
|
+
this.ast = new AST(lexer);
|
|
29
23
|
|
|
30
24
|
/** @type {ASTInterpreter} */
|
|
31
25
|
this.astCompiler = new ASTInterpreter($filter);
|
|
@@ -63,3 +57,17 @@ export class Parser {
|
|
|
63
57
|
};
|
|
64
58
|
}
|
|
65
59
|
}
|
|
60
|
+
|
|
61
|
+
function isLiteral(ast) {
|
|
62
|
+
return (
|
|
63
|
+
ast.body.length === 0 ||
|
|
64
|
+
(ast.body.length === 1 &&
|
|
65
|
+
(ast.body[0].expression.type === ASTType.Literal ||
|
|
66
|
+
ast.body[0].expression.type === ASTType.ArrayExpression ||
|
|
67
|
+
ast.body[0].expression.type === ASTType.ObjectExpression))
|
|
68
|
+
);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
function isConstant(ast) {
|
|
72
|
+
return ast.constant;
|
|
73
|
+
}
|