@angular/compiler-cli 21.1.0-next.4 → 21.1.0
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/bundles/{chunk-ML6J2RBK.js → chunk-ATAZXXPH.js} +2 -2
- package/bundles/{chunk-OPZT26MK.js → chunk-C6LLJPQH.js} +1 -1
- package/bundles/{chunk-6VDGFZBQ.js → chunk-EWMF72RR.js} +34 -12
- package/bundles/{chunk-LS5RJ5CS.js → chunk-FROPOOFC.js} +9 -1
- package/bundles/{chunk-PUEBQK4X.js → chunk-TTZRVNVM.js} +178 -91
- package/bundles/{chunk-ZJZNLTWN.js → chunk-WEF4HIPN.js} +2 -2
- package/bundles/index.js +5 -5
- package/bundles/linker/babel/index.js +14 -4
- package/bundles/linker/index.js +2 -2
- package/bundles/private/migrations.js +3 -3
- package/bundles/private/testing.js +2 -2
- package/bundles/private/tooling.js +2 -2
- package/bundles/src/bin/ng_xi18n.js +5 -5
- package/bundles/src/bin/ngc.js +5 -5
- package/linker/babel/src/ast/babel_ast_factory.d.ts +6 -5
- package/linker/src/file_linker/partial_linkers/util.d.ts +1 -1
- package/package.json +2 -2
- package/src/ngtsc/diagnostics/index.d.ts +1 -1
- package/src/ngtsc/diagnostics/src/error_code.d.ts +1 -1
- package/src/ngtsc/diagnostics/src/error_details_base_url.d.ts +1 -0
- package/src/ngtsc/translator/src/api/ast_factory.d.ts +19 -2
- package/src/ngtsc/translator/src/translator.d.ts +1 -0
- package/src/ngtsc/translator/src/typescript_ast_factory.d.ts +1 -0
- package/src/ngtsc/typecheck/src/oob.d.ts +2 -2
- package/src/ngtsc/typecheck/src/ops/directive_constructor.d.ts +3 -3
- package/src/ngtsc/typecheck/src/ops/inputs.d.ts +4 -3
- package/src/ngtsc/typecheck/src/ops/signal_forms.d.ts +14 -7
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
import {
|
|
9
9
|
Context,
|
|
10
10
|
ExpressionTranslatorVisitor
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-FROPOOFC.js";
|
|
12
12
|
|
|
13
13
|
// packages/compiler-cli/linker/src/fatal_linker_error.js
|
|
14
14
|
var FatalLinkerError = class extends Error {
|
|
@@ -455,7 +455,7 @@ import { compileDirectiveFromMetadata, makeBindingParser, ParseLocation, ParseSo
|
|
|
455
455
|
// packages/compiler-cli/linker/src/file_linker/partial_linkers/util.js
|
|
456
456
|
import { createMayBeForwardRefExpression, outputAst as o2 } from "@angular/compiler";
|
|
457
457
|
import semver from "semver";
|
|
458
|
-
var PLACEHOLDER_VERSION = "21.1.0
|
|
458
|
+
var PLACEHOLDER_VERSION = "21.1.0";
|
|
459
459
|
function wrapReference(wrapped) {
|
|
460
460
|
return { value: wrapped, type: wrapped };
|
|
461
461
|
}
|
package/bundles/index.js
CHANGED
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
isTsDiagnostic,
|
|
18
18
|
performCompilation,
|
|
19
19
|
readConfiguration
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-ATAZXXPH.js";
|
|
21
21
|
import {
|
|
22
22
|
ConsoleLogger,
|
|
23
23
|
LogLevel
|
|
@@ -34,7 +34,7 @@ import {
|
|
|
34
34
|
freshCompilationTicket,
|
|
35
35
|
incrementalFromStateTicket,
|
|
36
36
|
isDocEntryWithSourceInfo
|
|
37
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-EWMF72RR.js";
|
|
38
38
|
import {
|
|
39
39
|
ActivePerfRecorder,
|
|
40
40
|
ErrorCode,
|
|
@@ -46,8 +46,8 @@ import {
|
|
|
46
46
|
getInitializerApiJitTransform,
|
|
47
47
|
isLocalCompilationDiagnostics,
|
|
48
48
|
ngErrorCode
|
|
49
|
-
} from "./chunk-
|
|
50
|
-
import "./chunk-
|
|
49
|
+
} from "./chunk-TTZRVNVM.js";
|
|
50
|
+
import "./chunk-FROPOOFC.js";
|
|
51
51
|
import {
|
|
52
52
|
InvalidFileSystem,
|
|
53
53
|
LogicalFileSystem,
|
|
@@ -77,7 +77,7 @@ import "./chunk-G7GFT6BU.js";
|
|
|
77
77
|
|
|
78
78
|
// packages/compiler-cli/src/version.js
|
|
79
79
|
import { Version } from "@angular/compiler";
|
|
80
|
-
var VERSION = new Version("21.1.0
|
|
80
|
+
var VERSION = new Version("21.1.0");
|
|
81
81
|
|
|
82
82
|
// packages/compiler-cli/private/tooling.js
|
|
83
83
|
var GLOBAL_DEFS_FOR_TERSER = {
|
|
@@ -8,13 +8,13 @@ import {
|
|
|
8
8
|
LinkerEnvironment,
|
|
9
9
|
assert,
|
|
10
10
|
isFatalLinkerError
|
|
11
|
-
} from "../../chunk-
|
|
11
|
+
} from "../../chunk-WEF4HIPN.js";
|
|
12
12
|
import {
|
|
13
13
|
ConsoleLogger,
|
|
14
14
|
LogLevel
|
|
15
15
|
} from "../../chunk-6HOSNZU5.js";
|
|
16
16
|
import "../../chunk-HYJ2H3FU.js";
|
|
17
|
-
import "../../chunk-
|
|
17
|
+
import "../../chunk-FROPOOFC.js";
|
|
18
18
|
import {
|
|
19
19
|
NodeJSFileSystem
|
|
20
20
|
} from "../../chunk-XYYEESKY.js";
|
|
@@ -86,6 +86,9 @@ var BabelAstFactory = class {
|
|
|
86
86
|
);
|
|
87
87
|
}
|
|
88
88
|
createExpressionStatement = t.expressionStatement;
|
|
89
|
+
createSpreadElement(expression) {
|
|
90
|
+
return t.spreadElement(expression);
|
|
91
|
+
}
|
|
89
92
|
createFunctionDeclaration(functionName, parameters, body) {
|
|
90
93
|
assert(body, t.isBlockStatement, "a block");
|
|
91
94
|
return t.functionDeclaration(t.identifier(functionName), parameters.map((param) => t.identifier(param)), body);
|
|
@@ -126,9 +129,14 @@ var BabelAstFactory = class {
|
|
|
126
129
|
throw new Error(`Invalid literal: ${value} (${typeof value})`);
|
|
127
130
|
}
|
|
128
131
|
}
|
|
129
|
-
createNewExpression
|
|
132
|
+
createNewExpression(expression, args) {
|
|
133
|
+
return t.newExpression(expression, args);
|
|
134
|
+
}
|
|
130
135
|
createObjectLiteral(properties) {
|
|
131
136
|
return t.objectExpression(properties.map((prop) => {
|
|
137
|
+
if (prop.kind === "spread") {
|
|
138
|
+
return t.spreadElement(prop.expression);
|
|
139
|
+
}
|
|
132
140
|
const key = prop.quoted ? t.stringLiteral(prop.propertyName) : t.identifier(prop.propertyName);
|
|
133
141
|
return t.objectProperty(key, prop.value);
|
|
134
142
|
}));
|
|
@@ -142,7 +150,9 @@ var BabelAstFactory = class {
|
|
|
142
150
|
false
|
|
143
151
|
);
|
|
144
152
|
}
|
|
145
|
-
createReturnStatement
|
|
153
|
+
createReturnStatement(expression) {
|
|
154
|
+
return t.returnStatement(expression);
|
|
155
|
+
}
|
|
146
156
|
createTaggedTemplate(tag, template) {
|
|
147
157
|
return t.taggedTemplateExpression(tag, this.createTemplateLiteral(template));
|
|
148
158
|
}
|
package/bundles/linker/index.js
CHANGED
|
@@ -10,9 +10,9 @@ import {
|
|
|
10
10
|
assert,
|
|
11
11
|
isFatalLinkerError,
|
|
12
12
|
needsLinking
|
|
13
|
-
} from "../chunk-
|
|
13
|
+
} from "../chunk-WEF4HIPN.js";
|
|
14
14
|
import "../chunk-HYJ2H3FU.js";
|
|
15
|
-
import "../chunk-
|
|
15
|
+
import "../chunk-FROPOOFC.js";
|
|
16
16
|
import "../chunk-G7GFT6BU.js";
|
|
17
17
|
export {
|
|
18
18
|
DEFAULT_LINKER_OPTIONS,
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import {
|
|
6
6
|
DiagnosticCategoryLabel,
|
|
7
7
|
NgCompiler
|
|
8
|
-
} from "../chunk-
|
|
8
|
+
} from "../chunk-EWMF72RR.js";
|
|
9
9
|
import {
|
|
10
10
|
CompilationMode,
|
|
11
11
|
DtsMetadataReader,
|
|
@@ -32,8 +32,8 @@ import {
|
|
|
32
32
|
queryDecoratorNames,
|
|
33
33
|
reflectObjectLiteral,
|
|
34
34
|
unwrapExpression
|
|
35
|
-
} from "../chunk-
|
|
36
|
-
import "../chunk-
|
|
35
|
+
} from "../chunk-TTZRVNVM.js";
|
|
36
|
+
import "../chunk-FROPOOFC.js";
|
|
37
37
|
import {
|
|
38
38
|
getFileSystem,
|
|
39
39
|
isLocalRelativePath
|
|
@@ -6,8 +6,8 @@ import {
|
|
|
6
6
|
ImportedSymbolsTracker,
|
|
7
7
|
TypeScriptReflectionHost,
|
|
8
8
|
getInitializerApiJitTransform
|
|
9
|
-
} from "../chunk-
|
|
10
|
-
import "../chunk-
|
|
9
|
+
} from "../chunk-TTZRVNVM.js";
|
|
10
|
+
import "../chunk-FROPOOFC.js";
|
|
11
11
|
import {
|
|
12
12
|
InvalidFileSystem,
|
|
13
13
|
absoluteFrom,
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
import {
|
|
6
6
|
angularJitApplicationTransform
|
|
7
|
-
} from "../chunk-
|
|
8
|
-
import "../chunk-
|
|
7
|
+
} from "../chunk-TTZRVNVM.js";
|
|
8
|
+
import "../chunk-FROPOOFC.js";
|
|
9
9
|
import "../chunk-JEXAXD23.js";
|
|
10
10
|
import "../chunk-XYYEESKY.js";
|
|
11
11
|
import "../chunk-G7GFT6BU.js";
|
|
@@ -6,13 +6,13 @@
|
|
|
6
6
|
import {
|
|
7
7
|
main,
|
|
8
8
|
readCommandLineAndConfiguration
|
|
9
|
-
} from "../../chunk-
|
|
9
|
+
} from "../../chunk-C6LLJPQH.js";
|
|
10
10
|
import {
|
|
11
11
|
EmitFlags
|
|
12
|
-
} from "../../chunk-
|
|
13
|
-
import "../../chunk-
|
|
14
|
-
import "../../chunk-
|
|
15
|
-
import "../../chunk-
|
|
12
|
+
} from "../../chunk-ATAZXXPH.js";
|
|
13
|
+
import "../../chunk-EWMF72RR.js";
|
|
14
|
+
import "../../chunk-TTZRVNVM.js";
|
|
15
|
+
import "../../chunk-FROPOOFC.js";
|
|
16
16
|
import {
|
|
17
17
|
setFileSystem
|
|
18
18
|
} from "../../chunk-JEXAXD23.js";
|
package/bundles/src/bin/ngc.js
CHANGED
|
@@ -5,11 +5,11 @@
|
|
|
5
5
|
|
|
6
6
|
import {
|
|
7
7
|
main
|
|
8
|
-
} from "../../chunk-
|
|
9
|
-
import "../../chunk-
|
|
10
|
-
import "../../chunk-
|
|
11
|
-
import "../../chunk-
|
|
12
|
-
import "../../chunk-
|
|
8
|
+
} from "../../chunk-C6LLJPQH.js";
|
|
9
|
+
import "../../chunk-ATAZXXPH.js";
|
|
10
|
+
import "../../chunk-EWMF72RR.js";
|
|
11
|
+
import "../../chunk-TTZRVNVM.js";
|
|
12
|
+
import "../../chunk-FROPOOFC.js";
|
|
13
13
|
import {
|
|
14
14
|
setFileSystem
|
|
15
15
|
} from "../../chunk-JEXAXD23.js";
|
|
@@ -10,7 +10,7 @@ import { AstFactory, BinaryOperator, LeadingComment, ObjectLiteralProperty, Sour
|
|
|
10
10
|
/**
|
|
11
11
|
* A Babel flavored implementation of the AstFactory.
|
|
12
12
|
*/
|
|
13
|
-
export declare class BabelAstFactory implements AstFactory<t.Statement, t.Expression> {
|
|
13
|
+
export declare class BabelAstFactory implements AstFactory<t.Statement, t.Expression | t.SpreadElement> {
|
|
14
14
|
/** The absolute path to the source file being compiled. */
|
|
15
15
|
private sourceUrl;
|
|
16
16
|
constructor(
|
|
@@ -21,10 +21,11 @@ export declare class BabelAstFactory implements AstFactory<t.Statement, t.Expres
|
|
|
21
21
|
createAssignment(target: t.Expression, operator: BinaryOperator, value: t.Expression): t.Expression;
|
|
22
22
|
createBinaryExpression(leftOperand: t.Expression, operator: BinaryOperator, rightOperand: t.Expression): t.Expression;
|
|
23
23
|
createBlock: typeof t.blockStatement;
|
|
24
|
-
createCallExpression(callee: t.Expression, args: t.Expression[], pure: boolean): t.Expression;
|
|
24
|
+
createCallExpression(callee: t.Expression, args: (t.Expression | t.SpreadElement)[], pure: boolean): t.Expression;
|
|
25
25
|
createConditional: typeof t.conditionalExpression;
|
|
26
26
|
createElementAccess(expression: t.Expression, element: t.Expression): t.Expression;
|
|
27
27
|
createExpressionStatement: typeof t.expressionStatement;
|
|
28
|
+
createSpreadElement(expression: t.Expression): t.SpreadElement;
|
|
28
29
|
createFunctionDeclaration(functionName: string, parameters: string[], body: t.Statement): t.Statement;
|
|
29
30
|
createArrowFunctionExpression(parameters: string[], body: t.Statement | t.Expression): t.Expression;
|
|
30
31
|
createFunctionExpression(functionName: string | null, parameters: string[], body: t.Statement): t.Expression;
|
|
@@ -32,11 +33,11 @@ export declare class BabelAstFactory implements AstFactory<t.Statement, t.Expres
|
|
|
32
33
|
createIfStatement: typeof t.ifStatement;
|
|
33
34
|
createDynamicImport(url: string | t.Expression): t.Expression;
|
|
34
35
|
createLiteral(value: string | number | boolean | null | undefined): t.Expression;
|
|
35
|
-
createNewExpression:
|
|
36
|
+
createNewExpression(expression: t.Expression, args: t.Expression[]): t.Expression;
|
|
36
37
|
createObjectLiteral(properties: ObjectLiteralProperty<t.Expression>[]): t.Expression;
|
|
37
38
|
createParenthesizedExpression: typeof t.parenthesizedExpression;
|
|
38
39
|
createPropertyAccess(expression: t.Expression, propertyName: string): t.Expression;
|
|
39
|
-
createReturnStatement:
|
|
40
|
+
createReturnStatement(expression: t.Expression | null): t.Statement;
|
|
40
41
|
createTaggedTemplate(tag: t.Expression, template: TemplateLiteral<t.Expression>): t.Expression;
|
|
41
42
|
createTemplateLiteral(template: TemplateLiteral<t.Expression>): t.TemplateLiteral;
|
|
42
43
|
createThrowStatement: typeof t.throwStatement;
|
|
@@ -45,5 +46,5 @@ export declare class BabelAstFactory implements AstFactory<t.Statement, t.Expres
|
|
|
45
46
|
createUnaryExpression: typeof t.unaryExpression;
|
|
46
47
|
createVariableDeclaration(variableName: string, initializer: t.Expression | null, type: VariableDeclarationType): t.Statement;
|
|
47
48
|
createRegularExpressionLiteral(body: string, flags: string | null): t.Expression;
|
|
48
|
-
setSourceMapRange<T extends t.Statement | t.Expression | t.TemplateElement>(node: T, sourceMapRange: SourceMapRange | null): T;
|
|
49
|
+
setSourceMapRange<T extends t.Statement | t.Expression | t.TemplateElement | t.SpreadElement>(node: T, sourceMapRange: SourceMapRange | null): T;
|
|
49
50
|
}
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import { MaybeForwardRefExpression, outputAst as o, R3DeclareDependencyMetadata, R3DependencyMetadata, R3Reference } from '@angular/compiler';
|
|
9
9
|
import { AstObject, AstValue } from '../../ast/ast_value';
|
|
10
|
-
export declare const PLACEHOLDER_VERSION = "21.1.0
|
|
10
|
+
export declare const PLACEHOLDER_VERSION = "21.1.0";
|
|
11
11
|
export declare function wrapReference<TExpression>(wrapped: o.WrappedNodeExpr<TExpression>): R3Reference;
|
|
12
12
|
/**
|
|
13
13
|
* Parses the value of an enum from the AST value's symbol name.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@angular/compiler-cli",
|
|
3
|
-
"version": "21.1.0
|
|
3
|
+
"version": "21.1.0",
|
|
4
4
|
"description": "Angular - the compiler CLI for Node.js",
|
|
5
5
|
"typings": "index.d.ts",
|
|
6
6
|
"bin": {
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"typescript": "5.9.3"
|
|
44
44
|
},
|
|
45
45
|
"peerDependencies": {
|
|
46
|
-
"@angular/compiler": "21.1.0
|
|
46
|
+
"@angular/compiler": "21.1.0",
|
|
47
47
|
"typescript": ">=5.9 <6.0"
|
|
48
48
|
},
|
|
49
49
|
"peerDependenciesMeta": {
|
|
@@ -8,6 +8,6 @@
|
|
|
8
8
|
export { COMPILER_ERRORS_WITH_GUIDES } from './src/docs';
|
|
9
9
|
export { addDiagnosticChain, FatalDiagnosticError, isFatalDiagnosticError, isLocalCompilationDiagnostics, makeDiagnostic, makeDiagnosticChain, makeRelatedInformation, } from './src/error';
|
|
10
10
|
export { ErrorCode } from './src/error_code';
|
|
11
|
-
export { ERROR_DETAILS_PAGE_BASE_URL } from './src/error_details_base_url';
|
|
11
|
+
export { ERROR_DETAILS_PAGE_BASE_URL, DOC_PAGE_BASE_URL } from './src/error_details_base_url';
|
|
12
12
|
export { ExtendedTemplateDiagnosticName } from './src/extended_template_diagnostic_name';
|
|
13
13
|
export { ngErrorCode, replaceTsWithNgInErrors } from './src/util';
|
|
@@ -365,7 +365,7 @@ export declare enum ErrorCode {
|
|
|
365
365
|
* prefetch timer delay that is not earlier than the main timer, or an identical prefetch
|
|
366
366
|
*/
|
|
367
367
|
DEFER_TRIGGER_MISCONFIGURATION = 8021,
|
|
368
|
-
/** Raised when the user has an unsupported binding on a `
|
|
368
|
+
/** Raised when the user has an unsupported binding on a `FormField` directive. */
|
|
369
369
|
FORM_FIELD_UNSUPPORTED_BINDING = 8022,
|
|
370
370
|
/**
|
|
371
371
|
* A two way binding in a template has an incorrect syntax,
|
|
@@ -226,6 +226,12 @@ export interface AstFactory<TStatement, TExpression> {
|
|
|
226
226
|
* @param flags Flags of the regex, if any.
|
|
227
227
|
*/
|
|
228
228
|
createRegularExpressionLiteral(body: string, flags: string | null): TExpression;
|
|
229
|
+
/**
|
|
230
|
+
* Create a spread element, typically in an array or function call. E.g. `[...a]` or `fn(...b)`.
|
|
231
|
+
*
|
|
232
|
+
* @param target Expression of the spread element.
|
|
233
|
+
*/
|
|
234
|
+
createSpreadElement(expression: TExpression): TExpression;
|
|
229
235
|
/**
|
|
230
236
|
* Attach a source map range to the given node.
|
|
231
237
|
*
|
|
@@ -268,9 +274,11 @@ export interface SourceMapRange {
|
|
|
268
274
|
end: SourceMapLocation;
|
|
269
275
|
}
|
|
270
276
|
/**
|
|
271
|
-
* Information used by the `AstFactory` to create a property
|
|
277
|
+
* Information used by the `AstFactory` to create a property assignment
|
|
278
|
+
* on an object literal expression.
|
|
272
279
|
*/
|
|
273
|
-
export interface
|
|
280
|
+
export interface ObjectLiteralAssignment<TExpression> {
|
|
281
|
+
kind: 'property';
|
|
274
282
|
propertyName: string;
|
|
275
283
|
value: TExpression;
|
|
276
284
|
/**
|
|
@@ -278,6 +286,15 @@ export interface ObjectLiteralProperty<TExpression> {
|
|
|
278
286
|
*/
|
|
279
287
|
quoted: boolean;
|
|
280
288
|
}
|
|
289
|
+
/**
|
|
290
|
+
* Information used by the `AstFactory` to create a spread on an object literal expression.
|
|
291
|
+
*/
|
|
292
|
+
export interface ObjectLiteralSpread<TExpression> {
|
|
293
|
+
kind: 'spread';
|
|
294
|
+
expression: TExpression;
|
|
295
|
+
}
|
|
296
|
+
/** Possible properties in an object literal. */
|
|
297
|
+
export type ObjectLiteralProperty<TExpression> = ObjectLiteralAssignment<TExpression> | ObjectLiteralSpread<TExpression>;
|
|
281
298
|
/**
|
|
282
299
|
* Information used by the `AstFactory` to create a template literal string (i.e. a back-ticked
|
|
283
300
|
* string with interpolations).
|
|
@@ -56,6 +56,7 @@ export declare class ExpressionTranslatorVisitor<TFile, TStatement, TExpression>
|
|
|
56
56
|
visitLiteralMapExpr(ast: o.LiteralMapExpr, context: Context): TExpression;
|
|
57
57
|
visitCommaExpr(ast: o.CommaExpr, context: Context): never;
|
|
58
58
|
visitTemplateLiteralElementExpr(ast: o.TemplateLiteralElementExpr, context: any): void;
|
|
59
|
+
visitSpreadElementExpr(ast: o.outputAst.SpreadElementExpr, context: any): TExpression;
|
|
59
60
|
visitWrappedNodeExpr(ast: o.WrappedNodeExpr<any>, _context: Context): any;
|
|
60
61
|
visitTypeofExpr(ast: o.TypeofExpr, context: Context): TExpression;
|
|
61
62
|
visitVoidExpr(ast: o.VoidExpr, context: Context): TExpression;
|
|
@@ -37,6 +37,7 @@ export declare class TypeScriptAstFactory implements AstFactory<ts.Statement, ts
|
|
|
37
37
|
createObjectLiteral(properties: ObjectLiteralProperty<ts.Expression>[]): ts.Expression;
|
|
38
38
|
createParenthesizedExpression: (expression: ts.Expression) => ts.ParenthesizedExpression;
|
|
39
39
|
createPropertyAccess: (expression: ts.Expression, name: string | ts.MemberName) => ts.PropertyAccessExpression;
|
|
40
|
+
createSpreadElement: (expression: ts.Expression) => ts.SpreadElement;
|
|
40
41
|
createReturnStatement(expression: ts.Expression | null): ts.Statement;
|
|
41
42
|
createTaggedTemplate(tag: ts.Expression, template: TemplateLiteral<ts.Expression>): ts.Expression;
|
|
42
43
|
createTemplateLiteral(template: TemplateLiteral<ts.Expression>): ts.TemplateLiteral;
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* Use of this source code is governed by an MIT-style license that can be
|
|
6
6
|
* found in the LICENSE file at https://angular.dev/license
|
|
7
7
|
*/
|
|
8
|
-
import { BindingPipe, PropertyRead,
|
|
8
|
+
import { AST, BindingPipe, PropertyRead, TmplAstBoundAttribute, TmplAstBoundEvent, TmplAstComponent, TmplAstDirective, TmplAstElement, TmplAstForLoopBlock, TmplAstForLoopBlockEmpty, TmplAstHoverDeferredTrigger, TmplAstIfBlockBranch, TmplAstInteractionDeferredTrigger, TmplAstLetDeclaration, TmplAstReference, TmplAstSwitchBlockCase, TmplAstTemplate, TmplAstTextAttribute, TmplAstVariable, TmplAstViewportDeferredTrigger } from '@angular/compiler';
|
|
9
9
|
import ts from 'typescript';
|
|
10
10
|
import { ClassDeclaration } from '../../reflection';
|
|
11
11
|
import { TemplateDiagnostic, TypeCheckId } from '../api';
|
|
@@ -130,7 +130,7 @@ export interface OutOfBandDiagnosticRecorder {
|
|
|
130
130
|
*/
|
|
131
131
|
deferImplicitTriggerInvalidPlaceholder(id: TypeCheckId, trigger: TmplAstHoverDeferredTrigger | TmplAstInteractionDeferredTrigger | TmplAstViewportDeferredTrigger): void;
|
|
132
132
|
/**
|
|
133
|
-
* Reports an unsupported binding on a form `
|
|
133
|
+
* Reports an unsupported binding on a form `FormField` node.
|
|
134
134
|
*/
|
|
135
135
|
formFieldUnsupportedBinding(id: TypeCheckId, node: TmplAstBoundAttribute | TmplAstTextAttribute): void;
|
|
136
136
|
}
|
|
@@ -11,7 +11,7 @@ import { TcbOp } from './base';
|
|
|
11
11
|
import { Context } from './context';
|
|
12
12
|
import type { Scope } from './scope';
|
|
13
13
|
import { TypeCheckableDirectiveMeta } from '../../api';
|
|
14
|
-
import {
|
|
14
|
+
import { CustomFormControlType } from './signal_forms';
|
|
15
15
|
/**
|
|
16
16
|
* A `TcbOp` which constructs an instance of a directive with types inferred from its inputs. The
|
|
17
17
|
* inputs themselves are not checked here; checking of inputs is achieved in `TcbDirectiveInputsOp`.
|
|
@@ -29,8 +29,8 @@ export declare class TcbDirectiveCtorOp extends TcbOp {
|
|
|
29
29
|
private scope;
|
|
30
30
|
private node;
|
|
31
31
|
private dir;
|
|
32
|
-
private
|
|
33
|
-
constructor(tcb: Context, scope: Scope, node: DirectiveOwner, dir: TypeCheckableDirectiveMeta,
|
|
32
|
+
private customFormControlType;
|
|
33
|
+
constructor(tcb: Context, scope: Scope, node: DirectiveOwner, dir: TypeCheckableDirectiveMeta, customFormControlType: CustomFormControlType | null);
|
|
34
34
|
get optional(): boolean;
|
|
35
35
|
execute(): ts.Identifier;
|
|
36
36
|
circularFallback(): TcbOp;
|
|
@@ -11,7 +11,7 @@ import type { Context } from './context';
|
|
|
11
11
|
import type { Scope } from './scope';
|
|
12
12
|
import { TypeCheckableDirectiveMeta } from '../../api';
|
|
13
13
|
import { TcbOp } from './base';
|
|
14
|
-
import {
|
|
14
|
+
import { CustomFormControlType } from './signal_forms';
|
|
15
15
|
import { LocalSymbol } from './references';
|
|
16
16
|
/**
|
|
17
17
|
* Translates the given attribute binding to a `ts.Expression`.
|
|
@@ -28,8 +28,9 @@ export declare class TcbDirectiveInputsOp extends TcbOp {
|
|
|
28
28
|
private scope;
|
|
29
29
|
private node;
|
|
30
30
|
private dir;
|
|
31
|
-
private
|
|
32
|
-
|
|
31
|
+
private isFormControl;
|
|
32
|
+
private customFormControlType;
|
|
33
|
+
constructor(tcb: Context, scope: Scope, node: TmplAstTemplate | TmplAstElement | TmplAstComponent | TmplAstDirective, dir: TypeCheckableDirectiveMeta, isFormControl: boolean | undefined, customFormControlType: CustomFormControlType | null);
|
|
33
34
|
get optional(): boolean;
|
|
34
35
|
execute(): null;
|
|
35
36
|
private checkRequiredInputs;
|
|
@@ -6,17 +6,17 @@
|
|
|
6
6
|
* found in the LICENSE file at https://angular.dev/license
|
|
7
7
|
*/
|
|
8
8
|
import { DirectiveOwner, TmplAstComponent, TmplAstDirective, TmplAstElement, TmplAstNode, TmplAstTemplate } from '@angular/compiler';
|
|
9
|
+
import { TypeCheckableDirectiveMeta } from '../../api';
|
|
9
10
|
import { TcbOp } from './base';
|
|
11
|
+
import { TcbBoundAttribute } from './bindings';
|
|
10
12
|
import type { Context } from './context';
|
|
11
13
|
import type { Scope } from './scope';
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
/** Possible types of custom field directives. */
|
|
15
|
-
export type CustomFieldType = 'value' | 'checkbox';
|
|
14
|
+
/** Possible types of custom form control directives. */
|
|
15
|
+
export type CustomFormControlType = 'value' | 'checkbox';
|
|
16
16
|
/** Names of input fields to which users aren't allowed to bind when using a `field` directive. */
|
|
17
17
|
export declare const customFormControlBannedInputFields: Set<string>;
|
|
18
18
|
/**
|
|
19
|
-
* A `TcbOp` which constructs an instance of the signal forms `
|
|
19
|
+
* A `TcbOp` which constructs an instance of the signal forms `FormField` directive on a native element.
|
|
20
20
|
*/
|
|
21
21
|
export declare class TcbNativeFieldOp extends TcbOp {
|
|
22
22
|
protected tcb: Context;
|
|
@@ -39,13 +39,20 @@ export declare class TcbNativeRadioButtonFieldOp extends TcbNativeFieldOp {
|
|
|
39
39
|
execute(): null;
|
|
40
40
|
}
|
|
41
41
|
/** Expands the set of bound inputs with the ones from custom field directives. */
|
|
42
|
-
export declare function expandBoundAttributesForField(directive: TypeCheckableDirectiveMeta, node: TmplAstTemplate | TmplAstElement | TmplAstComponent | TmplAstDirective,
|
|
42
|
+
export declare function expandBoundAttributesForField(directive: TypeCheckableDirectiveMeta, node: TmplAstTemplate | TmplAstElement | TmplAstComponent | TmplAstDirective, customFormControlType: CustomFormControlType | null): TcbBoundAttribute[] | null;
|
|
43
43
|
export declare function isFieldDirective(meta: TypeCheckableDirectiveMeta): boolean;
|
|
44
44
|
/** Determines if a directive is a custom field and its type. */
|
|
45
|
-
export declare function getCustomFieldDirectiveType(meta: TypeCheckableDirectiveMeta):
|
|
45
|
+
export declare function getCustomFieldDirectiveType(meta: TypeCheckableDirectiveMeta): CustomFormControlType | null;
|
|
46
46
|
/** Determines if a directive usage is on a native field. */
|
|
47
47
|
export declare function isNativeField(dir: TypeCheckableDirectiveMeta, node: TmplAstNode, allDirectiveMatches: TypeCheckableDirectiveMeta[]): node is TmplAstElement & {
|
|
48
48
|
name: 'input' | 'select' | 'textarea';
|
|
49
49
|
};
|
|
50
50
|
/** Checks whether a node has bindings that aren't supported on fields. */
|
|
51
51
|
export declare function checkUnsupportedFieldBindings(node: DirectiveOwner, unsupportedBindingFields: Set<string>, tcb: Context): void;
|
|
52
|
+
/**
|
|
53
|
+
* Determines whether a node is a form control based on its matching directives.
|
|
54
|
+
*
|
|
55
|
+
* A node is a form control if it has a matching `FormField` directive, and no other directives match
|
|
56
|
+
* the `field` input.
|
|
57
|
+
*/
|
|
58
|
+
export declare function isFormControl(allDirectiveMatches: TypeCheckableDirectiveMeta[]): boolean;
|