@angular/core 16.0.0-next.2 → 16.0.0-next.3
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/esm2020/src/application_ref.mjs +95 -87
- package/esm2020/src/application_tokens.mjs +27 -21
- package/esm2020/src/compiler/compiler_facade_interface.mjs +1 -1
- package/esm2020/src/core_private_export.mjs +2 -3
- package/esm2020/src/di/contextual.mjs +37 -0
- package/esm2020/src/di/index.mjs +2 -1
- package/esm2020/src/di/r3_injector.mjs +1 -1
- package/esm2020/src/errors.mjs +1 -1
- package/esm2020/src/hydration/annotate.mjs +136 -5
- package/esm2020/src/hydration/api.mjs +9 -1
- package/esm2020/src/hydration/cleanup.mjs +50 -0
- package/esm2020/src/hydration/error_handling.mjs +11 -3
- package/esm2020/src/hydration/interfaces.mjs +9 -2
- package/esm2020/src/hydration/node_lookup_utils.mjs +22 -14
- package/esm2020/src/hydration/skip_hydration.mjs +16 -1
- package/esm2020/src/hydration/utils.mjs +82 -7
- package/esm2020/src/hydration/views.mjs +80 -0
- package/esm2020/src/linker/template_ref.mjs +17 -2
- package/esm2020/src/linker/view_container_ref.mjs +110 -35
- package/esm2020/src/render3/component_ref.mjs +2 -2
- package/esm2020/src/render3/definition.mjs +114 -45
- package/esm2020/src/render3/instructions/element.mjs +18 -8
- package/esm2020/src/render3/instructions/element_container.mjs +12 -13
- package/esm2020/src/render3/instructions/shared.mjs +53 -16
- package/esm2020/src/render3/instructions/template.mjs +57 -6
- package/esm2020/src/render3/instructions/text.mjs +1 -1
- package/esm2020/src/render3/interfaces/container.mjs +3 -2
- package/esm2020/src/render3/interfaces/type_checks.mjs +2 -2
- package/esm2020/src/render3/interfaces/view.mjs +1 -1
- package/esm2020/src/render3/jit/module.mjs +3 -2
- package/esm2020/src/render3/ng_module_ref.mjs +9 -5
- package/esm2020/src/render3/util/discovery_utils.mjs +3 -2
- package/esm2020/src/util/ng_dev_mode.mjs +2 -1
- package/esm2020/src/version.mjs +1 -1
- package/esm2020/src/zone/ng_zone.mjs +62 -1
- package/esm2020/testing/src/logger.mjs +3 -3
- package/esm2020/testing/src/ng_zone_mock.mjs +3 -3
- package/esm2020/testing/src/test_bed_compiler.mjs +4 -4
- package/fesm2015/core.mjs +2354 -1657
- package/fesm2015/core.mjs.map +1 -1
- package/fesm2015/testing.mjs +1910 -1415
- package/fesm2015/testing.mjs.map +1 -1
- package/fesm2020/core.mjs +2288 -1581
- package/fesm2020/core.mjs.map +1 -1
- package/fesm2020/testing.mjs +5085 -4581
- package/fesm2020/testing.mjs.map +1 -1
- package/index.d.ts +370 -400
- package/package.json +1 -1
- package/schematics/ng-generate/standalone-migration/bundle.js +198 -99
- package/schematics/ng-generate/standalone-migration/bundle.js.map +3 -3
- package/testing/index.d.ts +1 -1
package/package.json
CHANGED
|
@@ -4055,27 +4055,27 @@ function asLiteral(value) {
|
|
|
4055
4055
|
}
|
|
4056
4056
|
return literal(value, INFERRED_TYPE);
|
|
4057
4057
|
}
|
|
4058
|
-
function
|
|
4059
|
-
|
|
4060
|
-
|
|
4058
|
+
function conditionallyCreateDirectiveBindingLiteral(map, keepDeclared) {
|
|
4059
|
+
const keys = Object.getOwnPropertyNames(map);
|
|
4060
|
+
if (keys.length === 0) {
|
|
4061
|
+
return null;
|
|
4061
4062
|
}
|
|
4062
|
-
return
|
|
4063
|
-
}
|
|
4064
|
-
function mapToExpression(map, keepDeclared) {
|
|
4065
|
-
return literalMap(Object.getOwnPropertyNames(map).map((key) => {
|
|
4063
|
+
return literalMap(keys.map((key) => {
|
|
4066
4064
|
const value = map[key];
|
|
4067
4065
|
let declaredName;
|
|
4068
4066
|
let publicName;
|
|
4069
4067
|
let minifiedName;
|
|
4070
4068
|
let needsDeclaredName;
|
|
4071
|
-
if (
|
|
4072
|
-
|
|
4069
|
+
if (typeof value === "string") {
|
|
4070
|
+
declaredName = key;
|
|
4073
4071
|
minifiedName = key;
|
|
4074
|
-
needsDeclaredName = publicName !== declaredName;
|
|
4075
|
-
} else {
|
|
4076
|
-
minifiedName = declaredName = key;
|
|
4077
4072
|
publicName = value;
|
|
4078
4073
|
needsDeclaredName = false;
|
|
4074
|
+
} else {
|
|
4075
|
+
minifiedName = key;
|
|
4076
|
+
declaredName = value.classPropertyName;
|
|
4077
|
+
publicName = value.bindingPropertyName;
|
|
4078
|
+
needsDeclaredName = publicName !== declaredName;
|
|
4079
4079
|
}
|
|
4080
4080
|
return {
|
|
4081
4081
|
key: minifiedName,
|
|
@@ -15123,8 +15123,8 @@ function baseDirectiveFields(meta, constantPool, bindingParser) {
|
|
|
15123
15123
|
definitionMap.set("viewQuery", createViewQueriesFunction(meta.viewQueries, constantPool, meta.name));
|
|
15124
15124
|
}
|
|
15125
15125
|
definitionMap.set("hostBindings", createHostBindingsFunction(meta.host, meta.typeSourceSpan, bindingParser, constantPool, meta.selector || "", meta.name, definitionMap));
|
|
15126
|
-
definitionMap.set("inputs",
|
|
15127
|
-
definitionMap.set("outputs",
|
|
15126
|
+
definitionMap.set("inputs", conditionallyCreateDirectiveBindingLiteral(meta.inputs, true));
|
|
15127
|
+
definitionMap.set("outputs", conditionallyCreateDirectiveBindingLiteral(meta.outputs));
|
|
15128
15128
|
if (meta.exportAs !== null) {
|
|
15129
15129
|
definitionMap.set("exportAs", literalArr(meta.exportAs.map((e) => literal(e))));
|
|
15130
15130
|
}
|
|
@@ -15320,11 +15320,16 @@ function createBaseDirectiveTypeParams(meta) {
|
|
|
15320
15320
|
typeWithParameters(meta.type.type, meta.typeArgumentCount),
|
|
15321
15321
|
selectorForType !== null ? stringAsType(selectorForType) : NONE_TYPE,
|
|
15322
15322
|
meta.exportAs !== null ? stringArrayAsType(meta.exportAs) : NONE_TYPE,
|
|
15323
|
-
expressionType(
|
|
15323
|
+
expressionType(getInputsTypeExpression(meta)),
|
|
15324
15324
|
expressionType(stringMapAsLiteralExpression(meta.outputs)),
|
|
15325
15325
|
stringArrayAsType(meta.queries.map((q) => q.propertyName))
|
|
15326
15326
|
];
|
|
15327
15327
|
}
|
|
15328
|
+
function getInputsTypeExpression(meta) {
|
|
15329
|
+
return literalMap(Object.keys(meta.inputs).map((key) => {
|
|
15330
|
+
return { key, value: literal(meta.inputs[key].bindingPropertyName), quoted: true };
|
|
15331
|
+
}));
|
|
15332
|
+
}
|
|
15328
15333
|
function createDirectiveType(meta) {
|
|
15329
15334
|
const typeParams = createBaseDirectiveTypeParams(meta);
|
|
15330
15335
|
typeParams.push(NONE_TYPE);
|
|
@@ -15834,8 +15839,8 @@ function convertQueryPredicate(predicate) {
|
|
|
15834
15839
|
return Array.isArray(predicate) ? predicate : createMayBeForwardRefExpression(new WrappedNodeExpr(predicate), 1);
|
|
15835
15840
|
}
|
|
15836
15841
|
function convertDirectiveFacadeToMetadata(facade) {
|
|
15837
|
-
const inputsFromMetadata =
|
|
15838
|
-
const outputsFromMetadata =
|
|
15842
|
+
const inputsFromMetadata = parseInputsArray(facade.inputs || []);
|
|
15843
|
+
const outputsFromMetadata = parseMappingStringArray(facade.outputs || []);
|
|
15839
15844
|
const propMetadata = facade.propMetadata;
|
|
15840
15845
|
const inputsFromType = {};
|
|
15841
15846
|
const outputsFromType = {};
|
|
@@ -15843,7 +15848,10 @@ function convertDirectiveFacadeToMetadata(facade) {
|
|
|
15843
15848
|
if (propMetadata.hasOwnProperty(field)) {
|
|
15844
15849
|
propMetadata[field].forEach((ann) => {
|
|
15845
15850
|
if (isInput(ann)) {
|
|
15846
|
-
inputsFromType[field] =
|
|
15851
|
+
inputsFromType[field] = {
|
|
15852
|
+
bindingPropertyName: ann.bindingPropertyName || field,
|
|
15853
|
+
classPropertyName: field
|
|
15854
|
+
};
|
|
15847
15855
|
} else if (isOutput(ann)) {
|
|
15848
15856
|
outputsFromType[field] = ann.bindingPropertyName || field;
|
|
15849
15857
|
}
|
|
@@ -15867,26 +15875,26 @@ function convertDirectiveFacadeToMetadata(facade) {
|
|
|
15867
15875
|
});
|
|
15868
15876
|
}
|
|
15869
15877
|
function convertDeclareDirectiveFacadeToMetadata(declaration, typeSourceSpan) {
|
|
15870
|
-
var _a, _b, _c, _d, _e, _f, _g, _h
|
|
15878
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
15871
15879
|
return {
|
|
15872
15880
|
name: declaration.type.name,
|
|
15873
15881
|
type: wrapReference(declaration.type),
|
|
15874
15882
|
typeSourceSpan,
|
|
15875
15883
|
internalType: new WrappedNodeExpr(declaration.type),
|
|
15876
15884
|
selector: (_a = declaration.selector) != null ? _a : null,
|
|
15877
|
-
inputs:
|
|
15878
|
-
outputs: (
|
|
15885
|
+
inputs: declaration.inputs ? inputsMappingToInputMetadata(declaration.inputs) : {},
|
|
15886
|
+
outputs: (_b = declaration.outputs) != null ? _b : {},
|
|
15879
15887
|
host: convertHostDeclarationToMetadata(declaration.host),
|
|
15880
|
-
queries: ((
|
|
15881
|
-
viewQueries: ((
|
|
15888
|
+
queries: ((_c = declaration.queries) != null ? _c : []).map(convertQueryDeclarationToMetadata),
|
|
15889
|
+
viewQueries: ((_d = declaration.viewQueries) != null ? _d : []).map(convertQueryDeclarationToMetadata),
|
|
15882
15890
|
providers: declaration.providers !== void 0 ? new WrappedNodeExpr(declaration.providers) : null,
|
|
15883
|
-
exportAs: (
|
|
15884
|
-
usesInheritance: (
|
|
15885
|
-
lifecycle: { usesOnChanges: (
|
|
15891
|
+
exportAs: (_e = declaration.exportAs) != null ? _e : null,
|
|
15892
|
+
usesInheritance: (_f = declaration.usesInheritance) != null ? _f : false,
|
|
15893
|
+
lifecycle: { usesOnChanges: (_g = declaration.usesOnChanges) != null ? _g : false },
|
|
15886
15894
|
deps: null,
|
|
15887
15895
|
typeArgumentCount: 0,
|
|
15888
15896
|
fullInheritance: false,
|
|
15889
|
-
isStandalone: (
|
|
15897
|
+
isStandalone: (_h = declaration.isStandalone) != null ? _h : false,
|
|
15890
15898
|
hostDirectives: convertHostDirectivesToMetadata(declaration)
|
|
15891
15899
|
};
|
|
15892
15900
|
}
|
|
@@ -15914,8 +15922,8 @@ function convertHostDirectivesToMetadata(metadata) {
|
|
|
15914
15922
|
} : {
|
|
15915
15923
|
directive: wrapReference(hostDirective.directive),
|
|
15916
15924
|
isForwardReference: false,
|
|
15917
|
-
inputs: hostDirective.inputs ?
|
|
15918
|
-
outputs: hostDirective.outputs ?
|
|
15925
|
+
inputs: hostDirective.inputs ? parseMappingStringArray(hostDirective.inputs) : null,
|
|
15926
|
+
outputs: hostDirective.outputs ? parseMappingStringArray(hostDirective.outputs) : null
|
|
15919
15927
|
};
|
|
15920
15928
|
});
|
|
15921
15929
|
}
|
|
@@ -16076,13 +16084,38 @@ function isInput(value) {
|
|
|
16076
16084
|
function isOutput(value) {
|
|
16077
16085
|
return value.ngMetadataName === "Output";
|
|
16078
16086
|
}
|
|
16079
|
-
function
|
|
16087
|
+
function inputsMappingToInputMetadata(inputs) {
|
|
16088
|
+
return Object.keys(inputs).reduce((result, key) => {
|
|
16089
|
+
const value = inputs[key];
|
|
16090
|
+
result[key] = typeof value === "string" ? { bindingPropertyName: value, classPropertyName: value } : { bindingPropertyName: value[0], classPropertyName: value[1] };
|
|
16091
|
+
return result;
|
|
16092
|
+
}, {});
|
|
16093
|
+
}
|
|
16094
|
+
function parseInputsArray(values) {
|
|
16080
16095
|
return values.reduce((results, value) => {
|
|
16081
|
-
|
|
16082
|
-
|
|
16096
|
+
if (typeof value === "string") {
|
|
16097
|
+
const [bindingPropertyName, classPropertyName] = parseMappingString(value);
|
|
16098
|
+
results[classPropertyName] = { bindingPropertyName, classPropertyName };
|
|
16099
|
+
} else {
|
|
16100
|
+
results[value.name] = {
|
|
16101
|
+
bindingPropertyName: value.alias || value.name,
|
|
16102
|
+
classPropertyName: value.name
|
|
16103
|
+
};
|
|
16104
|
+
}
|
|
16105
|
+
return results;
|
|
16106
|
+
}, {});
|
|
16107
|
+
}
|
|
16108
|
+
function parseMappingStringArray(values) {
|
|
16109
|
+
return values.reduce((results, value) => {
|
|
16110
|
+
const [publicName, fieldName] = parseMappingString(value);
|
|
16111
|
+
results[fieldName] = publicName;
|
|
16083
16112
|
return results;
|
|
16084
16113
|
}, {});
|
|
16085
16114
|
}
|
|
16115
|
+
function parseMappingString(value) {
|
|
16116
|
+
const [fieldName, bindingPropertyName] = value.split(":", 2).map((str) => str.trim());
|
|
16117
|
+
return [bindingPropertyName != null ? bindingPropertyName : fieldName, fieldName];
|
|
16118
|
+
}
|
|
16086
16119
|
function convertDeclarePipeFacadeToMetadata(declaration) {
|
|
16087
16120
|
var _a, _b;
|
|
16088
16121
|
return {
|
|
@@ -16111,7 +16144,7 @@ function publishFacade(global2) {
|
|
|
16111
16144
|
}
|
|
16112
16145
|
|
|
16113
16146
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/version.mjs
|
|
16114
|
-
var VERSION2 = new Version("16.0.0-next.
|
|
16147
|
+
var VERSION2 = new Version("16.0.0-next.3");
|
|
16115
16148
|
|
|
16116
16149
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/i18n/extractor_merger.mjs
|
|
16117
16150
|
var _I18N_ATTR = "i18n";
|
|
@@ -17426,7 +17459,7 @@ var MINIMUM_PARTIAL_LINKER_VERSION = "12.0.0";
|
|
|
17426
17459
|
function compileDeclareClassMetadata(metadata) {
|
|
17427
17460
|
const definitionMap = new DefinitionMap();
|
|
17428
17461
|
definitionMap.set("minVersion", literal(MINIMUM_PARTIAL_LINKER_VERSION));
|
|
17429
|
-
definitionMap.set("version", literal("16.0.0-next.
|
|
17462
|
+
definitionMap.set("version", literal("16.0.0-next.3"));
|
|
17430
17463
|
definitionMap.set("ngImport", importExpr(Identifiers.core));
|
|
17431
17464
|
definitionMap.set("type", metadata.type);
|
|
17432
17465
|
definitionMap.set("decorators", metadata.decorators);
|
|
@@ -17495,7 +17528,7 @@ function createDirectiveDefinitionMap(meta) {
|
|
|
17495
17528
|
var _a;
|
|
17496
17529
|
const definitionMap = new DefinitionMap();
|
|
17497
17530
|
definitionMap.set("minVersion", literal(MINIMUM_PARTIAL_LINKER_VERSION2));
|
|
17498
|
-
definitionMap.set("version", literal("16.0.0-next.
|
|
17531
|
+
definitionMap.set("version", literal("16.0.0-next.3"));
|
|
17499
17532
|
definitionMap.set("type", meta.internalType);
|
|
17500
17533
|
if (meta.isStandalone) {
|
|
17501
17534
|
definitionMap.set("isStandalone", literal(meta.isStandalone));
|
|
@@ -17503,8 +17536,8 @@ function createDirectiveDefinitionMap(meta) {
|
|
|
17503
17536
|
if (meta.selector !== null) {
|
|
17504
17537
|
definitionMap.set("selector", literal(meta.selector));
|
|
17505
17538
|
}
|
|
17506
|
-
definitionMap.set("inputs",
|
|
17507
|
-
definitionMap.set("outputs",
|
|
17539
|
+
definitionMap.set("inputs", conditionallyCreateDirectiveBindingLiteral(meta.inputs, true));
|
|
17540
|
+
definitionMap.set("outputs", conditionallyCreateDirectiveBindingLiteral(meta.outputs));
|
|
17508
17541
|
definitionMap.set("host", compileHostMetadata(meta.host));
|
|
17509
17542
|
definitionMap.set("providers", meta.providers);
|
|
17510
17543
|
if (meta.queries.length > 0) {
|
|
@@ -17677,7 +17710,7 @@ var MINIMUM_PARTIAL_LINKER_VERSION3 = "12.0.0";
|
|
|
17677
17710
|
function compileDeclareFactoryFunction(meta) {
|
|
17678
17711
|
const definitionMap = new DefinitionMap();
|
|
17679
17712
|
definitionMap.set("minVersion", literal(MINIMUM_PARTIAL_LINKER_VERSION3));
|
|
17680
|
-
definitionMap.set("version", literal("16.0.0-next.
|
|
17713
|
+
definitionMap.set("version", literal("16.0.0-next.3"));
|
|
17681
17714
|
definitionMap.set("ngImport", importExpr(Identifiers.core));
|
|
17682
17715
|
definitionMap.set("type", meta.internalType);
|
|
17683
17716
|
definitionMap.set("deps", compileDependencies(meta.deps));
|
|
@@ -17700,7 +17733,7 @@ function compileDeclareInjectableFromMetadata(meta) {
|
|
|
17700
17733
|
function createInjectableDefinitionMap(meta) {
|
|
17701
17734
|
const definitionMap = new DefinitionMap();
|
|
17702
17735
|
definitionMap.set("minVersion", literal(MINIMUM_PARTIAL_LINKER_VERSION4));
|
|
17703
|
-
definitionMap.set("version", literal("16.0.0-next.
|
|
17736
|
+
definitionMap.set("version", literal("16.0.0-next.3"));
|
|
17704
17737
|
definitionMap.set("ngImport", importExpr(Identifiers.core));
|
|
17705
17738
|
definitionMap.set("type", meta.internalType);
|
|
17706
17739
|
if (meta.providedIn !== void 0) {
|
|
@@ -17738,7 +17771,7 @@ function compileDeclareInjectorFromMetadata(meta) {
|
|
|
17738
17771
|
function createInjectorDefinitionMap(meta) {
|
|
17739
17772
|
const definitionMap = new DefinitionMap();
|
|
17740
17773
|
definitionMap.set("minVersion", literal(MINIMUM_PARTIAL_LINKER_VERSION5));
|
|
17741
|
-
definitionMap.set("version", literal("16.0.0-next.
|
|
17774
|
+
definitionMap.set("version", literal("16.0.0-next.3"));
|
|
17742
17775
|
definitionMap.set("ngImport", importExpr(Identifiers.core));
|
|
17743
17776
|
definitionMap.set("type", meta.internalType);
|
|
17744
17777
|
definitionMap.set("providers", meta.providers);
|
|
@@ -17759,7 +17792,7 @@ function compileDeclareNgModuleFromMetadata(meta) {
|
|
|
17759
17792
|
function createNgModuleDefinitionMap(meta) {
|
|
17760
17793
|
const definitionMap = new DefinitionMap();
|
|
17761
17794
|
definitionMap.set("minVersion", literal(MINIMUM_PARTIAL_LINKER_VERSION6));
|
|
17762
|
-
definitionMap.set("version", literal("16.0.0-next.
|
|
17795
|
+
definitionMap.set("version", literal("16.0.0-next.3"));
|
|
17763
17796
|
definitionMap.set("ngImport", importExpr(Identifiers.core));
|
|
17764
17797
|
definitionMap.set("type", meta.internalType);
|
|
17765
17798
|
if (meta.bootstrap.length > 0) {
|
|
@@ -17794,7 +17827,7 @@ function compileDeclarePipeFromMetadata(meta) {
|
|
|
17794
17827
|
function createPipeDefinitionMap(meta) {
|
|
17795
17828
|
const definitionMap = new DefinitionMap();
|
|
17796
17829
|
definitionMap.set("minVersion", literal(MINIMUM_PARTIAL_LINKER_VERSION7));
|
|
17797
|
-
definitionMap.set("version", literal("16.0.0-next.
|
|
17830
|
+
definitionMap.set("version", literal("16.0.0-next.3"));
|
|
17798
17831
|
definitionMap.set("ngImport", importExpr(Identifiers.core));
|
|
17799
17832
|
definitionMap.set("type", meta.internalType);
|
|
17800
17833
|
if (meta.isStandalone) {
|
|
@@ -17811,7 +17844,7 @@ function createPipeDefinitionMap(meta) {
|
|
|
17811
17844
|
publishFacade(_global);
|
|
17812
17845
|
|
|
17813
17846
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/version.mjs
|
|
17814
|
-
var VERSION3 = new Version("16.0.0-next.
|
|
17847
|
+
var VERSION3 = new Version("16.0.0-next.3");
|
|
17815
17848
|
|
|
17816
17849
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/transformers/api.mjs
|
|
17817
17850
|
var EmitFlags;
|
|
@@ -19792,8 +19825,14 @@ var ClassPropertyMapping = class {
|
|
|
19792
19825
|
const forwardMap = /* @__PURE__ */ new Map();
|
|
19793
19826
|
for (const classPropertyName of Object.keys(obj)) {
|
|
19794
19827
|
const value = obj[classPropertyName];
|
|
19795
|
-
|
|
19796
|
-
|
|
19828
|
+
let inputOrOutput;
|
|
19829
|
+
if (typeof value === "string") {
|
|
19830
|
+
inputOrOutput = { classPropertyName, bindingPropertyName: value };
|
|
19831
|
+
} else if (Array.isArray(value)) {
|
|
19832
|
+
inputOrOutput = { classPropertyName, bindingPropertyName: value[0] };
|
|
19833
|
+
} else {
|
|
19834
|
+
inputOrOutput = value;
|
|
19835
|
+
}
|
|
19797
19836
|
forwardMap.set(classPropertyName, inputOrOutput);
|
|
19798
19837
|
}
|
|
19799
19838
|
return new ClassPropertyMapping(forwardMap);
|
|
@@ -19830,17 +19869,13 @@ var ClassPropertyMapping = class {
|
|
|
19830
19869
|
toJointMappedObject() {
|
|
19831
19870
|
const obj = {};
|
|
19832
19871
|
for (const [classPropertyName, inputOrOutput] of this.forwardMap) {
|
|
19833
|
-
|
|
19834
|
-
obj[classPropertyName] = inputOrOutput.bindingPropertyName;
|
|
19835
|
-
} else {
|
|
19836
|
-
obj[classPropertyName] = [inputOrOutput.bindingPropertyName, classPropertyName];
|
|
19837
|
-
}
|
|
19872
|
+
obj[classPropertyName] = inputOrOutput;
|
|
19838
19873
|
}
|
|
19839
19874
|
return obj;
|
|
19840
19875
|
}
|
|
19841
19876
|
*[Symbol.iterator]() {
|
|
19842
|
-
for (const
|
|
19843
|
-
yield
|
|
19877
|
+
for (const inputOrOutput of this.forwardMap.values()) {
|
|
19878
|
+
yield inputOrOutput;
|
|
19844
19879
|
}
|
|
19845
19880
|
}
|
|
19846
19881
|
};
|
|
@@ -20080,7 +20115,7 @@ var DtsMetadataReader = class {
|
|
|
20080
20115
|
return param.typeValueReference.kind === 1 && param.typeValueReference.moduleName === "@angular/core" && param.typeValueReference.importedName === "TemplateRef";
|
|
20081
20116
|
});
|
|
20082
20117
|
const isStandalone = def.type.typeArguments.length > 7 && ((_a = readBooleanType(def.type.typeArguments[7])) != null ? _a : false);
|
|
20083
|
-
const inputs = ClassPropertyMapping.fromMappedObject(
|
|
20118
|
+
const inputs = ClassPropertyMapping.fromMappedObject(readInputsType(def.type.typeArguments[3]));
|
|
20084
20119
|
const outputs = ClassPropertyMapping.fromMappedObject(readMapType(def.type.typeArguments[4], readStringType));
|
|
20085
20120
|
const hostDirectives = def.type.typeArguments.length > 8 ? readHostDirectivesType(this.checker, def.type.typeArguments[8], ref.bestGuessOwningModule) : null;
|
|
20086
20121
|
return __spreadProps(__spreadValues({
|
|
@@ -20130,6 +20165,25 @@ var DtsMetadataReader = class {
|
|
|
20130
20165
|
};
|
|
20131
20166
|
}
|
|
20132
20167
|
};
|
|
20168
|
+
function readInputsType(type) {
|
|
20169
|
+
const inputsMap = {};
|
|
20170
|
+
if (import_typescript22.default.isTypeLiteralNode(type)) {
|
|
20171
|
+
for (const member of type.members) {
|
|
20172
|
+
if (!import_typescript22.default.isPropertySignature(member) || member.type === void 0 || member.name === void 0 || !import_typescript22.default.isStringLiteral(member.name) && !import_typescript22.default.isIdentifier(member.name)) {
|
|
20173
|
+
continue;
|
|
20174
|
+
}
|
|
20175
|
+
const stringValue = readStringType(member.type);
|
|
20176
|
+
if (stringValue != null) {
|
|
20177
|
+
inputsMap[member.name.text] = {
|
|
20178
|
+
bindingPropertyName: stringValue,
|
|
20179
|
+
classPropertyName: member.name.text,
|
|
20180
|
+
required: false
|
|
20181
|
+
};
|
|
20182
|
+
}
|
|
20183
|
+
}
|
|
20184
|
+
}
|
|
20185
|
+
return inputsMap;
|
|
20186
|
+
}
|
|
20133
20187
|
function readBaseClass2(clazz, checker, reflector) {
|
|
20134
20188
|
if (!isNamedClassDeclaration(clazz)) {
|
|
20135
20189
|
return reflector.hasBaseClass(clazz) ? "dynamic" : null;
|
|
@@ -20381,13 +20435,13 @@ var HostDirectivesResolver = class {
|
|
|
20381
20435
|
}
|
|
20382
20436
|
results.push(__spreadProps(__spreadValues({}, hostMeta), {
|
|
20383
20437
|
matchSource: MatchSource.HostDirective,
|
|
20384
|
-
inputs: this.filterMappings(hostMeta.inputs, current.inputs),
|
|
20385
|
-
outputs: this.filterMappings(hostMeta.outputs, current.outputs)
|
|
20438
|
+
inputs: ClassPropertyMapping.fromMappedObject(this.filterMappings(hostMeta.inputs, current.inputs, resolveInput)),
|
|
20439
|
+
outputs: ClassPropertyMapping.fromMappedObject(this.filterMappings(hostMeta.outputs, current.outputs, resolveOutput))
|
|
20386
20440
|
}));
|
|
20387
20441
|
}
|
|
20388
20442
|
return results;
|
|
20389
20443
|
}
|
|
20390
|
-
filterMappings(source, allowedProperties) {
|
|
20444
|
+
filterMappings(source, allowedProperties, valueResolver) {
|
|
20391
20445
|
const result = {};
|
|
20392
20446
|
if (allowedProperties !== null) {
|
|
20393
20447
|
for (const publicName in allowedProperties) {
|
|
@@ -20395,15 +20449,21 @@ var HostDirectivesResolver = class {
|
|
|
20395
20449
|
const bindings = source.getByBindingPropertyName(publicName);
|
|
20396
20450
|
if (bindings !== null) {
|
|
20397
20451
|
for (const binding of bindings) {
|
|
20398
|
-
result[binding.classPropertyName] = allowedProperties[publicName];
|
|
20452
|
+
result[binding.classPropertyName] = valueResolver(allowedProperties[publicName], binding.classPropertyName);
|
|
20399
20453
|
}
|
|
20400
20454
|
}
|
|
20401
20455
|
}
|
|
20402
20456
|
}
|
|
20403
20457
|
}
|
|
20404
|
-
return
|
|
20458
|
+
return result;
|
|
20405
20459
|
}
|
|
20406
20460
|
};
|
|
20461
|
+
function resolveInput(bindingName, classPropertyName) {
|
|
20462
|
+
return { bindingPropertyName: bindingName, classPropertyName, required: false };
|
|
20463
|
+
}
|
|
20464
|
+
function resolveOutput(bindingName) {
|
|
20465
|
+
return bindingName;
|
|
20466
|
+
}
|
|
20407
20467
|
|
|
20408
20468
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/partial_evaluator/src/diagnostics.mjs
|
|
20409
20469
|
var import_typescript24 = __toESM(require("typescript"), 1);
|
|
@@ -24432,10 +24492,12 @@ function extractDirectiveMetadata(clazz, decorator, reflector, evaluator, refEmi
|
|
|
24432
24492
|
const members = reflector.getMembersOfClass(clazz);
|
|
24433
24493
|
const decoratedElements = members.filter((member) => !member.isStatic && member.decorators !== null);
|
|
24434
24494
|
const coreModule = isCore ? void 0 : "@angular/core";
|
|
24435
|
-
const inputsFromMeta =
|
|
24436
|
-
const inputsFromFields =
|
|
24437
|
-
const
|
|
24438
|
-
const
|
|
24495
|
+
const inputsFromMeta = parseInputsArray2(directive, evaluator);
|
|
24496
|
+
const inputsFromFields = parseInputFields(filterToMembersWithDecorator(decoratedElements, "Input", coreModule), evaluator);
|
|
24497
|
+
const inputs = ClassPropertyMapping.fromMappedObject(__spreadValues(__spreadValues({}, inputsFromMeta), inputsFromFields));
|
|
24498
|
+
const outputsFromMeta = parseOutputsArray(directive, evaluator);
|
|
24499
|
+
const outputsFromFields = parseOutputFields(filterToMembersWithDecorator(decoratedElements, "Output", coreModule), evaluator);
|
|
24500
|
+
const outputs = ClassPropertyMapping.fromMappedObject(__spreadValues(__spreadValues({}, outputsFromMeta), outputsFromFields));
|
|
24439
24501
|
const contentChildFromFields = queriesFromFields(filterToMembersWithDecorator(decoratedElements, "ContentChild", coreModule), reflector, evaluator);
|
|
24440
24502
|
const contentChildrenFromFields = queriesFromFields(filterToMembersWithDecorator(decoratedElements, "ContentChildren", coreModule), reflector, evaluator);
|
|
24441
24503
|
const queries = [...contentChildFromFields, ...contentChildrenFromFields];
|
|
@@ -24487,8 +24549,6 @@ function extractDirectiveMetadata(clazz, decorator, reflector, evaluator, refEmi
|
|
|
24487
24549
|
const sourceFile = clazz.getSourceFile();
|
|
24488
24550
|
const type = wrapTypeReference(reflector, clazz);
|
|
24489
24551
|
const internalType = new WrappedNodeExpr(reflector.getInternalNameOfClass(clazz));
|
|
24490
|
-
const inputs = ClassPropertyMapping.fromMappedObject(__spreadValues(__spreadValues({}, inputsFromMeta), inputsFromFields));
|
|
24491
|
-
const outputs = ClassPropertyMapping.fromMappedObject(__spreadValues(__spreadValues({}, outputsFromMeta), outputsFromFields));
|
|
24492
24552
|
const rawHostDirectives = directive.get("hostDirectives") || null;
|
|
24493
24553
|
const hostDirectives = rawHostDirectives === null ? null : extractHostDirectives(rawHostDirectives, evaluator);
|
|
24494
24554
|
const metadata = {
|
|
@@ -24668,7 +24728,7 @@ function extractQueriesFromDecorator(queryData, reflector, evaluator, isCore) {
|
|
|
24668
24728
|
});
|
|
24669
24729
|
return { content, view };
|
|
24670
24730
|
}
|
|
24671
|
-
function
|
|
24731
|
+
function parseFieldStringArrayValue(directive, field, evaluator) {
|
|
24672
24732
|
if (!directive.has(field)) {
|
|
24673
24733
|
return null;
|
|
24674
24734
|
}
|
|
@@ -24708,44 +24768,80 @@ function queriesFromFields(fields, reflector, evaluator) {
|
|
|
24708
24768
|
function isPropertyTypeMember(member) {
|
|
24709
24769
|
return member.kind === ClassMemberKind.Getter || member.kind === ClassMemberKind.Setter || member.kind === ClassMemberKind.Property;
|
|
24710
24770
|
}
|
|
24711
|
-
function
|
|
24712
|
-
const metaValues = parseFieldArrayValue(directive, field, evaluator);
|
|
24713
|
-
return metaValues ? parseInputOutputMappingArray(metaValues) : EMPTY_OBJECT;
|
|
24714
|
-
}
|
|
24715
|
-
function parseInputOutputMappingArray(values) {
|
|
24771
|
+
function parseMappingStringArray2(values) {
|
|
24716
24772
|
return values.reduce((results, value) => {
|
|
24717
24773
|
if (typeof value !== "string") {
|
|
24718
24774
|
throw new Error("Mapping value must be a string");
|
|
24719
24775
|
}
|
|
24720
|
-
const [
|
|
24721
|
-
results[
|
|
24776
|
+
const [bindingPropertyName, fieldName] = parseMappingString2(value);
|
|
24777
|
+
results[fieldName] = bindingPropertyName;
|
|
24722
24778
|
return results;
|
|
24723
24779
|
}, {});
|
|
24724
24780
|
}
|
|
24725
|
-
function
|
|
24726
|
-
|
|
24781
|
+
function parseMappingString2(value) {
|
|
24782
|
+
const [fieldName, bindingPropertyName] = value.split(":", 2).map((str) => str.trim());
|
|
24783
|
+
return [bindingPropertyName != null ? bindingPropertyName : fieldName, fieldName];
|
|
24784
|
+
}
|
|
24785
|
+
function parseDecoratedFields(fields, evaluator, callback) {
|
|
24786
|
+
for (const field of fields) {
|
|
24727
24787
|
const fieldName = field.member.name;
|
|
24728
|
-
field.decorators
|
|
24729
|
-
if (decorator.args
|
|
24730
|
-
results[fieldName] = fieldName;
|
|
24731
|
-
} else if (decorator.args.length === 1) {
|
|
24732
|
-
const property = evaluator.evaluate(decorator.args[0]);
|
|
24733
|
-
if (typeof property !== "string") {
|
|
24734
|
-
throw createValueHasWrongTypeError(Decorator.nodeForError(decorator), property, `@${decorator.name} decorator argument must resolve to a string`);
|
|
24735
|
-
}
|
|
24736
|
-
results[fieldName] = mapValueResolver(property, fieldName);
|
|
24737
|
-
} else {
|
|
24788
|
+
for (const decorator of field.decorators) {
|
|
24789
|
+
if (decorator.args != null && decorator.args.length > 1) {
|
|
24738
24790
|
throw new FatalDiagnosticError(ErrorCode.DECORATOR_ARITY_WRONG, Decorator.nodeForError(decorator), `@${decorator.name} can have at most one argument, got ${decorator.args.length} argument(s)`);
|
|
24739
24791
|
}
|
|
24740
|
-
|
|
24741
|
-
|
|
24742
|
-
|
|
24792
|
+
const value = decorator.args != null && decorator.args.length > 0 ? evaluator.evaluate(decorator.args[0]) : null;
|
|
24793
|
+
callback(fieldName, value, decorator);
|
|
24794
|
+
}
|
|
24795
|
+
}
|
|
24796
|
+
}
|
|
24797
|
+
function parseInputsArray2(decoratorMetadata, evaluator) {
|
|
24798
|
+
const inputsField = decoratorMetadata.get("inputs");
|
|
24799
|
+
if (inputsField === void 0) {
|
|
24800
|
+
return {};
|
|
24801
|
+
}
|
|
24802
|
+
const inputs = {};
|
|
24803
|
+
const inputsArray = evaluator.evaluate(inputsField);
|
|
24804
|
+
if (!Array.isArray(inputsArray)) {
|
|
24805
|
+
throw createValueHasWrongTypeError(inputsField, inputsArray, `Failed to resolve @Directive.inputs to a string array`);
|
|
24806
|
+
}
|
|
24807
|
+
for (const value of inputsArray) {
|
|
24808
|
+
if (typeof value === "string") {
|
|
24809
|
+
const [bindingPropertyName, fieldName] = parseMappingString2(value);
|
|
24810
|
+
inputs[fieldName] = { bindingPropertyName, classPropertyName: fieldName, required: false };
|
|
24811
|
+
} else {
|
|
24812
|
+
throw createValueHasWrongTypeError(inputsField, value, `Failed to resolve @Directive.inputs to a string array`);
|
|
24813
|
+
}
|
|
24814
|
+
}
|
|
24815
|
+
return inputs;
|
|
24816
|
+
}
|
|
24817
|
+
function parseInputFields(inputMembers, evaluator) {
|
|
24818
|
+
const inputs = {};
|
|
24819
|
+
parseDecoratedFields(inputMembers, evaluator, (classPropertyName, options, decorator) => {
|
|
24820
|
+
let bindingPropertyName;
|
|
24821
|
+
if (options === null) {
|
|
24822
|
+
bindingPropertyName = classPropertyName;
|
|
24823
|
+
} else if (typeof options === "string") {
|
|
24824
|
+
bindingPropertyName = options;
|
|
24825
|
+
} else {
|
|
24826
|
+
throw createValueHasWrongTypeError(Decorator.nodeForError(decorator), options, `@${decorator.name} decorator argument must resolve to a string`);
|
|
24827
|
+
}
|
|
24828
|
+
inputs[classPropertyName] = { bindingPropertyName, classPropertyName, required: false };
|
|
24829
|
+
});
|
|
24830
|
+
return inputs;
|
|
24743
24831
|
}
|
|
24744
|
-
function
|
|
24745
|
-
|
|
24832
|
+
function parseOutputsArray(directive, evaluator) {
|
|
24833
|
+
const metaValues = parseFieldStringArrayValue(directive, "outputs", evaluator);
|
|
24834
|
+
return metaValues ? parseMappingStringArray2(metaValues) : EMPTY_OBJECT;
|
|
24746
24835
|
}
|
|
24747
|
-
function
|
|
24748
|
-
|
|
24836
|
+
function parseOutputFields(outputMembers, evaluator) {
|
|
24837
|
+
const outputs = {};
|
|
24838
|
+
parseDecoratedFields(outputMembers, evaluator, (fieldName, bindingPropertyName, decorator) => {
|
|
24839
|
+
if (bindingPropertyName != null && typeof bindingPropertyName !== "string") {
|
|
24840
|
+
throw createValueHasWrongTypeError(Decorator.nodeForError(decorator), bindingPropertyName, `@${decorator.name} decorator argument must resolve to a string`);
|
|
24841
|
+
}
|
|
24842
|
+
outputs[fieldName] = bindingPropertyName != null ? bindingPropertyName : fieldName;
|
|
24843
|
+
});
|
|
24844
|
+
return outputs;
|
|
24749
24845
|
}
|
|
24750
24846
|
function evaluateHostExpressionBindings(hostExpr, evaluator) {
|
|
24751
24847
|
const hostMetaMap = evaluator.evaluate(hostExpr);
|
|
@@ -24806,7 +24902,7 @@ function parseHostDirectivesMapping(field, resolvedValue, classReference, source
|
|
|
24806
24902
|
const nameForErrors = `@Directive.hostDirectives.${classReference.name.text}.${field}`;
|
|
24807
24903
|
const rawInputs = resolvedValue.get(field);
|
|
24808
24904
|
if (isStringArrayOrDie(rawInputs, nameForErrors, sourceExpression)) {
|
|
24809
|
-
return
|
|
24905
|
+
return parseMappingStringArray2(rawInputs);
|
|
24810
24906
|
}
|
|
24811
24907
|
}
|
|
24812
24908
|
return null;
|
|
@@ -24845,7 +24941,7 @@ var DirectiveSymbol = class extends SemanticSymbol {
|
|
|
24845
24941
|
if (!(previousSymbol instanceof DirectiveSymbol)) {
|
|
24846
24942
|
return true;
|
|
24847
24943
|
}
|
|
24848
|
-
if (!isArrayEqual(Array.from(this.inputs), Array.from(previousSymbol.inputs), isInputMappingEqual) || !isArrayEqual(Array.from(this.outputs), Array.from(previousSymbol.outputs),
|
|
24944
|
+
if (!isArrayEqual(Array.from(this.inputs), Array.from(previousSymbol.inputs), isInputMappingEqual) || !isArrayEqual(Array.from(this.outputs), Array.from(previousSymbol.outputs), isInputOrOutputEqual)) {
|
|
24849
24945
|
return true;
|
|
24850
24946
|
}
|
|
24851
24947
|
if (!areTypeParametersEqual(this.typeParameters, previousSymbol.typeParameters)) {
|
|
@@ -24861,7 +24957,10 @@ var DirectiveSymbol = class extends SemanticSymbol {
|
|
|
24861
24957
|
}
|
|
24862
24958
|
};
|
|
24863
24959
|
function isInputMappingEqual(current, previous) {
|
|
24864
|
-
return current
|
|
24960
|
+
return isInputOrOutputEqual(current, previous) && current.required === previous.required;
|
|
24961
|
+
}
|
|
24962
|
+
function isInputOrOutputEqual(current, previous) {
|
|
24963
|
+
return current.classPropertyName === previous.classPropertyName && current.bindingPropertyName === previous.bindingPropertyName;
|
|
24865
24964
|
}
|
|
24866
24965
|
function isTypeCheckMetaEqual(current, previous) {
|
|
24867
24966
|
if (current.hasNgTemplateContextGuard !== previous.hasNgTemplateContextGuard) {
|
|
@@ -26154,7 +26253,7 @@ var ComponentDecoratorHandler = class {
|
|
|
26154
26253
|
const componentStyleUrls = extractComponentStyleUrls(this.evaluator, component);
|
|
26155
26254
|
let inlineStyles;
|
|
26156
26255
|
if (component.has("styles")) {
|
|
26157
|
-
const litStyles =
|
|
26256
|
+
const litStyles = parseFieldStringArrayValue(component, "styles", this.evaluator);
|
|
26158
26257
|
if (litStyles === null) {
|
|
26159
26258
|
this.preanalyzeStylesCache.set(node, null);
|
|
26160
26259
|
} else {
|
|
@@ -26313,7 +26412,7 @@ var ComponentDecoratorHandler = class {
|
|
|
26313
26412
|
throw new Error("Inline resource processing requires asynchronous preanalyze.");
|
|
26314
26413
|
}
|
|
26315
26414
|
if (component.has("styles")) {
|
|
26316
|
-
const litStyles =
|
|
26415
|
+
const litStyles = parseFieldStringArrayValue(component, "styles", this.evaluator);
|
|
26317
26416
|
if (litStyles !== null) {
|
|
26318
26417
|
inlineStyles = [...litStyles];
|
|
26319
26418
|
styles.push(...litStyles);
|
|
@@ -30553,9 +30652,9 @@ var TcbDirectiveCtorOp = class extends TcbOp {
|
|
|
30553
30652
|
});
|
|
30554
30653
|
}
|
|
30555
30654
|
}
|
|
30556
|
-
for (const
|
|
30557
|
-
if (!genericInputs.has(
|
|
30558
|
-
genericInputs.set(
|
|
30655
|
+
for (const { classPropertyName } of this.dir.inputs) {
|
|
30656
|
+
if (!genericInputs.has(classPropertyName)) {
|
|
30657
|
+
genericInputs.set(classPropertyName, { type: "unset", field: classPropertyName });
|
|
30559
30658
|
}
|
|
30560
30659
|
}
|
|
30561
30660
|
const typeCtor = tcbCallTypeCtor(this.dir, this.tcb, Array.from(genericInputs.values()));
|