@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
  */
@@ -2568,6 +2568,7 @@ function ɵɵdefineComponent(componentDefinition) {
2568
2568
  setInput: null,
2569
2569
  schemas: componentDefinition.schemas || null,
2570
2570
  tView: null,
2571
+ applyHostDirectives: null,
2571
2572
  };
2572
2573
  const dependencies = componentDefinition.dependencies;
2573
2574
  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
@@ -13122,6 +13123,7 @@ function findDirectiveDefMatches(tView, viewData, tNode) {
13122
13123
  else {
13123
13124
  matches.push(def);
13124
13125
  }
13126
+ def.applyHostDirectives?.(tView, viewData, tNode, matches);
13125
13127
  }
13126
13128
  }
13127
13129
  }
@@ -14661,6 +14663,54 @@ function ɵɵCopyDefinitionFeature(definition) {
14661
14663
  }
14662
14664
  }
14663
14665
 
14666
+ /**
14667
+ * This feature add the host directives behavior to a directive definition by patching a
14668
+ * function onto it. The expectation is that the runtime will invoke the function during
14669
+ * directive matching.
14670
+ *
14671
+ * For example:
14672
+ * ```ts
14673
+ * class ComponentWithHostDirective {
14674
+ * static ɵcmp = defineComponent({
14675
+ * type: ComponentWithHostDirective,
14676
+ * features: [ɵɵHostDirectivesFeature([
14677
+ * SimpleHostDirective,
14678
+ * {directive: AdvancedHostDirective, inputs: ['foo: alias'], outputs: ['bar']},
14679
+ * ])]
14680
+ * });
14681
+ * }
14682
+ * ```
14683
+ *
14684
+ * @codeGenApi
14685
+ */
14686
+ function ɵɵHostDirectivesFeature(rawHostDirectives) {
14687
+ const unwrappedHostDirectives = Array.isArray(rawHostDirectives) ? rawHostDirectives : rawHostDirectives();
14688
+ const hostDirectives = unwrappedHostDirectives.map(dir => typeof dir === 'function' ? { directive: dir, inputs: EMPTY_OBJ, outputs: EMPTY_OBJ } : {
14689
+ directive: dir.directive,
14690
+ inputs: bindingArrayToMap(dir.inputs),
14691
+ outputs: bindingArrayToMap(dir.outputs)
14692
+ });
14693
+ return (definition) => {
14694
+ // TODO(crisbeto): implement host directive matching logic.
14695
+ definition.applyHostDirectives =
14696
+ (tView, viewData, tNode, matches) => { };
14697
+ };
14698
+ }
14699
+ /**
14700
+ * Converts an array in the form of `['publicName', 'alias', 'otherPublicName', 'otherAlias']` into
14701
+ * a map in the form of `{publicName: 'alias', otherPublicName: 'otherAlias'}`.
14702
+ */
14703
+ function bindingArrayToMap(bindings) {
14704
+ if (!bindings || bindings.length === 0) {
14705
+ return EMPTY_OBJ;
14706
+ }
14707
+ const result = {};
14708
+ for (let i = 1; i < bindings.length; i += 2) {
14709
+ result[bindings[i - 1]] = bindings[i];
14710
+ }
14711
+ return result;
14712
+ }
14713
+
14664
14714
  /**
14665
14715
  * @license
14666
14716
  * Copyright Google LLC All Rights Reserved.
@@ -24262,6 +24312,7 @@ const angularCoreEnv = (() => ({
24262
24312
  'ɵɵinvalidFactoryDep': ɵɵinvalidFactoryDep,
24263
24313
  'ɵɵtemplateRefExtractor': ɵɵtemplateRefExtractor,
24264
24314
  'ɵɵresetView': ɵɵresetView,
24315
+ 'ɵɵHostDirectivesFeature': ɵɵHostDirectivesFeature,
24265
24316
  'ɵɵNgOnChangesFeature': ɵɵNgOnChangesFeature,
24266
24317
  'ɵɵProvidersFeature': ɵɵProvidersFeature,
24267
24318
  'ɵɵCopyDefinitionFeature': ɵɵCopyDefinitionFeature,