@angular/core 14.2.0 → 15.0.0-next.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.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v14.2.0
2
+ * @license Angular v15.0.0-next.0
3
3
  * (c) 2010-2022 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -2569,6 +2569,7 @@ function ɵɵdefineComponent(componentDefinition) {
2569
2569
  setInput: null,
2570
2570
  schemas: componentDefinition.schemas || null,
2571
2571
  tView: null,
2572
+ applyHostDirectives: null,
2572
2573
  };
2573
2574
  const dependencies = componentDefinition.dependencies;
2574
2575
  const feature = componentDefinition.features;
@@ -7643,7 +7644,7 @@ class Version {
7643
7644
  /**
7644
7645
  * @publicApi
7645
7646
  */
7646
- const VERSION = new Version('14.2.0');
7647
+ const VERSION = new Version('15.0.0-next.0');
7647
7648
 
7648
7649
  /**
7649
7650
  * @license
@@ -13097,6 +13098,7 @@ function invokeHostBindingsInCreationMode(def, directive) {
13097
13098
  * If a component is matched (at most one), it is returned in first position in the array.
13098
13099
  */
13099
13100
  function findDirectiveDefMatches(tView, viewData, tNode) {
13101
+ var _a;
13100
13102
  ngDevMode && assertFirstCreatePass(tView);
13101
13103
  ngDevMode && assertTNodeType(tNode, 3 /* TNodeType.AnyRNode */ | 12 /* TNodeType.AnyContainer */);
13102
13104
  const registry = tView.directiveRegistry;
@@ -13124,6 +13126,7 @@ function findDirectiveDefMatches(tView, viewData, tNode) {
13124
13126
  else {
13125
13127
  matches.push(def);
13126
13128
  }
13129
+ (_a = def.applyHostDirectives) === null || _a === void 0 ? void 0 : _a.call(def, tView, viewData, tNode, matches);
13127
13130
  }
13128
13131
  }
13129
13132
  }
@@ -14663,6 +14666,54 @@ function ɵɵCopyDefinitionFeature(definition) {
14663
14666
  }
14664
14667
  }
14665
14668
 
14669
+ /**
14670
+ * This feature add the host directives behavior to a directive definition by patching a
14671
+ * function onto it. The expectation is that the runtime will invoke the function during
14672
+ * directive matching.
14673
+ *
14674
+ * For example:
14675
+ * ```ts
14676
+ * class ComponentWithHostDirective {
14677
+ * static ɵcmp = defineComponent({
14678
+ * type: ComponentWithHostDirective,
14679
+ * features: [ɵɵHostDirectivesFeature([
14680
+ * SimpleHostDirective,
14681
+ * {directive: AdvancedHostDirective, inputs: ['foo: alias'], outputs: ['bar']},
14682
+ * ])]
14683
+ * });
14684
+ * }
14685
+ * ```
14686
+ *
14687
+ * @codeGenApi
14688
+ */
14689
+ function ɵɵHostDirectivesFeature(rawHostDirectives) {
14690
+ const unwrappedHostDirectives = Array.isArray(rawHostDirectives) ? rawHostDirectives : rawHostDirectives();
14691
+ const hostDirectives = unwrappedHostDirectives.map(dir => typeof dir === 'function' ? { directive: dir, inputs: EMPTY_OBJ, outputs: EMPTY_OBJ } : {
14692
+ directive: dir.directive,
14693
+ inputs: bindingArrayToMap(dir.inputs),
14694
+ outputs: bindingArrayToMap(dir.outputs)
14695
+ });
14696
+ return (definition) => {
14697
+ // TODO(crisbeto): implement host directive matching logic.
14698
+ definition.applyHostDirectives =
14699
+ (tView, viewData, tNode, matches) => { };
14700
+ };
14701
+ }
14702
+ /**
14703
+ * Converts an array in the form of `['publicName', 'alias', 'otherPublicName', 'otherAlias']` into
14704
+ * a map in the form of `{publicName: 'alias', otherPublicName: 'otherAlias'}`.
14705
+ */
14706
+ function bindingArrayToMap(bindings) {
14707
+ if (!bindings || bindings.length === 0) {
14708
+ return EMPTY_OBJ;
14709
+ }
14710
+ const result = {};
14711
+ for (let i = 1; i < bindings.length; i += 2) {
14712
+ result[bindings[i - 1]] = bindings[i];
14713
+ }
14714
+ return result;
14715
+ }
14716
+
14666
14717
  /**
14667
14718
  * @license
14668
14719
  * Copyright Google LLC All Rights Reserved.
@@ -24265,6 +24316,7 @@ const angularCoreEnv = (() => ({
24265
24316
  'ɵɵinvalidFactoryDep': ɵɵinvalidFactoryDep,
24266
24317
  'ɵɵtemplateRefExtractor': ɵɵtemplateRefExtractor,
24267
24318
  'ɵɵresetView': ɵɵresetView,
24319
+ 'ɵɵHostDirectivesFeature': ɵɵHostDirectivesFeature,
24268
24320
  'ɵɵNgOnChangesFeature': ɵɵNgOnChangesFeature,
24269
24321
  'ɵɵProvidersFeature': ɵɵProvidersFeature,
24270
24322
  'ɵɵCopyDefinitionFeature': ɵɵCopyDefinitionFeature,