@angular/core 15.2.0 → 15.2.2

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.
Files changed (33) hide show
  1. package/esm2020/src/application_ref.mjs +14 -3
  2. package/esm2020/src/application_tokens.mjs +1 -12
  3. package/esm2020/src/change_detection/change_detection.mjs +2 -2
  4. package/esm2020/src/change_detection/constants.mjs +1 -49
  5. package/esm2020/src/core.mjs +3 -3
  6. package/esm2020/src/core_private_export.mjs +1 -5
  7. package/esm2020/src/core_render3_private_export.mjs +2 -1
  8. package/esm2020/src/linker/query_list.mjs +6 -7
  9. package/esm2020/src/linker/template_ref.mjs +3 -3
  10. package/esm2020/src/render3/i18n/i18n_util.mjs +3 -3
  11. package/esm2020/src/render3/instructions/element.mjs +10 -9
  12. package/esm2020/src/render3/instructions/shared.mjs +4 -5
  13. package/esm2020/src/render3/instructions/template.mjs +2 -2
  14. package/esm2020/src/render3/interfaces/node.mjs +1 -1
  15. package/esm2020/src/render3/jit/directive.mjs +1 -2
  16. package/esm2020/src/util/iterable.mjs +6 -7
  17. package/esm2020/src/version.mjs +1 -1
  18. package/esm2020/testing/src/logger.mjs +3 -3
  19. package/esm2020/testing/src/ng_zone_mock.mjs +3 -3
  20. package/fesm2015/core.mjs +43 -116
  21. package/fesm2015/core.mjs.map +1 -1
  22. package/fesm2015/testing.mjs +29 -99
  23. package/fesm2015/testing.mjs.map +1 -1
  24. package/fesm2020/core.mjs +42 -116
  25. package/fesm2020/core.mjs.map +1 -1
  26. package/fesm2020/testing.mjs +29 -99
  27. package/fesm2020/testing.mjs.map +1 -1
  28. package/index.d.ts +17 -70
  29. package/package.json +2 -2
  30. package/schematics/ng-generate/standalone-migration/bundle.js +475 -416
  31. package/schematics/ng-generate/standalone-migration/bundle.js.map +4 -4
  32. package/testing/index.d.ts +1 -1
  33. package/esm2020/src/util/symbol.mjs +0 -30
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v15.2.0
2
+ * @license Angular v15.2.2
3
3
  * (c) 2010-2022 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -2115,54 +2115,6 @@ var ChangeDetectionStrategy;
2115
2115
  */
2116
2116
  ChangeDetectionStrategy[ChangeDetectionStrategy["Default"] = 1] = "Default";
2117
2117
  })(ChangeDetectionStrategy || (ChangeDetectionStrategy = {}));
2118
- /**
2119
- * Defines the possible states of the default change detector.
2120
- * @see `ChangeDetectorRef`
2121
- */
2122
- var ChangeDetectorStatus;
2123
- (function (ChangeDetectorStatus) {
2124
- /**
2125
- * A state in which, after calling `detectChanges()`, the change detector
2126
- * state becomes `Checked`, and must be explicitly invoked or reactivated.
2127
- */
2128
- ChangeDetectorStatus[ChangeDetectorStatus["CheckOnce"] = 0] = "CheckOnce";
2129
- /**
2130
- * A state in which change detection is skipped until the change detector mode
2131
- * becomes `CheckOnce`.
2132
- */
2133
- ChangeDetectorStatus[ChangeDetectorStatus["Checked"] = 1] = "Checked";
2134
- /**
2135
- * A state in which change detection continues automatically until explicitly
2136
- * deactivated.
2137
- */
2138
- ChangeDetectorStatus[ChangeDetectorStatus["CheckAlways"] = 2] = "CheckAlways";
2139
- /**
2140
- * A state in which a change detector sub tree is not a part of the main tree and
2141
- * should be skipped.
2142
- */
2143
- ChangeDetectorStatus[ChangeDetectorStatus["Detached"] = 3] = "Detached";
2144
- /**
2145
- * Indicates that the change detector encountered an error checking a binding
2146
- * or calling a directive lifecycle method and is now in an inconsistent state. Change
2147
- * detectors in this state do not detect changes.
2148
- */
2149
- ChangeDetectorStatus[ChangeDetectorStatus["Errored"] = 4] = "Errored";
2150
- /**
2151
- * Indicates that the change detector has been destroyed.
2152
- */
2153
- ChangeDetectorStatus[ChangeDetectorStatus["Destroyed"] = 5] = "Destroyed";
2154
- })(ChangeDetectorStatus || (ChangeDetectorStatus = {}));
2155
- /**
2156
- * Reports whether a given strategy is currently the default for change detection.
2157
- * @param changeDetectionStrategy The strategy to check.
2158
- * @returns True if the given strategy is the current default, false otherwise.
2159
- * @see `ChangeDetectorStatus`
2160
- * @see `ChangeDetectorRef`
2161
- */
2162
- function isDefaultChangeDetectionStrategy(changeDetectionStrategy) {
2163
- return changeDetectionStrategy == null ||
2164
- changeDetectionStrategy === ChangeDetectionStrategy.Default;
2165
- }
2166
2118
 
2167
2119
  /**
2168
2120
  * Defines the CSS styles encapsulation policies for the {@link Component} decorator's
@@ -8750,7 +8702,7 @@ class Version {
8750
8702
  /**
8751
8703
  * @publicApi
8752
8704
  */
8753
- const VERSION = new Version('15.2.0');
8705
+ const VERSION = new Version('15.2.2');
8754
8706
 
8755
8707
  // This default value is when checking the hierarchy for a token.
8756
8708
  //
@@ -10564,6 +10516,7 @@ function createTNodeAtIndex(tView, index, type, name, attrs) {
10564
10516
  // In the case of i18n the `currentTNode` may already be linked, in which case we don't want
10565
10517
  // to break the links which i18n created.
10566
10518
  currentTNode.next = tNode;
10519
+ tNode.prev = currentTNode;
10567
10520
  }
10568
10521
  }
10569
10522
  }
@@ -11002,8 +10955,9 @@ function createTNode(tView, tParent, type, index, value, attrs) {
11002
10955
  initialInputs: undefined,
11003
10956
  inputs: null,
11004
10957
  outputs: null,
11005
- tViews: null,
10958
+ tView: null,
11006
10959
  next: null,
10960
+ prev: null,
11007
10961
  projectionNext: null,
11008
10962
  child: null,
11009
10963
  parent: tParent,
@@ -11213,7 +11167,6 @@ function resolveDirectives(tView, lView, tNode, localRefs) {
11213
11167
  // Please make sure to have explicit type for `exportsMap`. Inferred type triggers bug in
11214
11168
  // tsickle.
11215
11169
  ngDevMode && assertFirstCreatePass(tView);
11216
- let hasDirectives = false;
11217
11170
  if (getBindingsEnabled()) {
11218
11171
  const exportsMap = localRefs === null ? null : { '': -1 };
11219
11172
  const matchResult = findDirectiveDefMatches(tView, tNode);
@@ -11226,7 +11179,6 @@ function resolveDirectives(tView, lView, tNode, localRefs) {
11226
11179
  [directiveDefs, hostDirectiveDefs] = matchResult;
11227
11180
  }
11228
11181
  if (directiveDefs !== null) {
11229
- hasDirectives = true;
11230
11182
  initializeDirectives(tView, lView, tNode, directiveDefs, exportsMap, hostDirectiveDefs);
11231
11183
  }
11232
11184
  if (exportsMap)
@@ -11234,7 +11186,6 @@ function resolveDirectives(tView, lView, tNode, localRefs) {
11234
11186
  }
11235
11187
  // Merge the template attrs last so that they have the highest priority.
11236
11188
  tNode.mergedAttrs = mergeHostAttrs(tNode.mergedAttrs, tNode.attrs);
11237
- return hasDirectives;
11238
11189
  }
11239
11190
  /** Initializes the data structures necessary for a list of directives to be instantiated. */
11240
11191
  function initializeDirectives(tView, lView, tNode, directives, exportsMap, hostDirectiveDefs) {
@@ -13101,41 +13052,19 @@ function validateMappings(bindingType, def, hostDirectiveBindings) {
13101
13052
  }
13102
13053
  }
13103
13054
 
13104
- let _symbolIterator = null;
13105
- function getSymbolIterator() {
13106
- if (!_symbolIterator) {
13107
- const Symbol = _global$1['Symbol'];
13108
- if (Symbol && Symbol.iterator) {
13109
- _symbolIterator = Symbol.iterator;
13110
- }
13111
- else {
13112
- // es6-shim specific logic
13113
- const keys = Object.getOwnPropertyNames(Map.prototype);
13114
- for (let i = 0; i < keys.length; ++i) {
13115
- const key = keys[i];
13116
- if (key !== 'entries' && key !== 'size' &&
13117
- Map.prototype[key] === Map.prototype['entries']) {
13118
- _symbolIterator = key;
13119
- }
13120
- }
13121
- }
13122
- }
13123
- return _symbolIterator;
13124
- }
13125
-
13126
13055
  function isIterable(obj) {
13127
- return obj !== null && typeof obj === 'object' && obj[getSymbolIterator()] !== undefined;
13056
+ return obj !== null && typeof obj === 'object' && obj[Symbol.iterator] !== undefined;
13128
13057
  }
13129
13058
  function isListLikeIterable(obj) {
13130
13059
  if (!isJsObject(obj))
13131
13060
  return false;
13132
13061
  return Array.isArray(obj) ||
13133
13062
  (!(obj instanceof Map) && // JS Map are iterables but return entries as [k, v]
13134
- getSymbolIterator() in obj); // JS Iterable have a Symbol.iterator prop
13063
+ Symbol.iterator in obj); // JS Iterable have a Symbol.iterator prop
13135
13064
  }
13136
13065
  function areIterablesEqual(a, b, comparator) {
13137
- const iterator1 = a[getSymbolIterator()]();
13138
- const iterator2 = b[getSymbolIterator()]();
13066
+ const iterator1 = a[Symbol.iterator]();
13067
+ const iterator2 = b[Symbol.iterator]();
13139
13068
  while (true) {
13140
13069
  const item1 = iterator1.next();
13141
13070
  const item2 = iterator2.next();
@@ -13154,7 +13083,7 @@ function iterateListLike(obj, fn) {
13154
13083
  }
13155
13084
  }
13156
13085
  else {
13157
- const iterator = obj[getSymbolIterator()]();
13086
+ const iterator = obj[Symbol.iterator]();
13158
13087
  let item;
13159
13088
  while (!((item = iterator.next()).done)) {
13160
13089
  fn(item.value);
@@ -13807,7 +13736,7 @@ function templateFirstCreatePass(index, tView, lView, templateFn, decls, vars, t
13807
13736
  const tNode = getOrCreateTNode(tView, index, 4 /* TNodeType.Container */, tagName || null, getConstant(tViewConsts, attrsIndex));
13808
13737
  resolveDirectives(tView, lView, tNode, getConstant(tViewConsts, localRefsIndex));
13809
13738
  registerPostOrderHooks(tView, tNode);
13810
- const embeddedTView = tNode.tViews = createTView(2 /* TViewType.Embedded */, tNode, templateFn, decls, vars, tView.directiveRegistry, tView.pipeRegistry, null, tView.schemas, tViewConsts);
13739
+ const embeddedTView = tNode.tView = createTView(2 /* TViewType.Embedded */, tNode, templateFn, decls, vars, tView.directiveRegistry, tView.pipeRegistry, null, tView.schemas, tViewConsts);
13811
13740
  if (tView.queries !== null) {
13812
13741
  tView.queries.template(tView, tNode);
13813
13742
  embeddedTView.queries = tView.queries.embeddedTView(tNode);
@@ -13917,16 +13846,13 @@ function setDirectiveInputsWhichShadowsStyling(tView, tNode, lView, value, isCla
13917
13846
  setInputsForProperty(tView, lView, inputs[property], property, value);
13918
13847
  }
13919
13848
 
13920
- function elementStartFirstCreatePass(index, tView, lView, native, name, attrsIndex, localRefsIndex) {
13849
+ function elementStartFirstCreatePass(index, tView, lView, name, attrsIndex, localRefsIndex) {
13921
13850
  ngDevMode && assertFirstCreatePass(tView);
13922
13851
  ngDevMode && ngDevMode.firstCreatePass++;
13923
13852
  const tViewConsts = tView.consts;
13924
13853
  const attrs = getConstant(tViewConsts, attrsIndex);
13925
13854
  const tNode = getOrCreateTNode(tView, index, 2 /* TNodeType.Element */, name, attrs);
13926
- const hasDirectives = resolveDirectives(tView, lView, tNode, getConstant(tViewConsts, localRefsIndex));
13927
- if (ngDevMode) {
13928
- validateElementIsKnown(native, lView, tNode.value, tView.schemas, hasDirectives);
13929
- }
13855
+ resolveDirectives(tView, lView, tNode, getConstant(tViewConsts, localRefsIndex));
13930
13856
  if (tNode.attrs !== null) {
13931
13857
  computeStaticStyling(tNode, tNode.attrs, false);
13932
13858
  }
@@ -13961,10 +13887,14 @@ function ɵɵelementStart(index, name, attrsIndex, localRefsIndex) {
13961
13887
  assertEqual(getBindingIndex(), tView.bindingStartIndex, 'elements should be created before any bindings');
13962
13888
  ngDevMode && assertIndexInRange(lView, adjustedIndex);
13963
13889
  const renderer = lView[RENDERER];
13964
- const native = lView[adjustedIndex] = createElementNode(renderer, name, getNamespace$1());
13965
13890
  const tNode = tView.firstCreatePass ?
13966
- elementStartFirstCreatePass(adjustedIndex, tView, lView, native, name, attrsIndex, localRefsIndex) :
13891
+ elementStartFirstCreatePass(adjustedIndex, tView, lView, name, attrsIndex, localRefsIndex) :
13967
13892
  tView.data[adjustedIndex];
13893
+ const native = lView[adjustedIndex] = createElementNode(renderer, name, getNamespace$1());
13894
+ const hasDirectives = isDirectiveHost(tNode);
13895
+ if (ngDevMode && tView.firstCreatePass) {
13896
+ validateElementIsKnown(native, lView, tNode.value, tView.schemas, hasDirectives);
13897
+ }
13968
13898
  setCurrentTNode(tNode, true);
13969
13899
  setupStaticAttributes(renderer, native, tNode);
13970
13900
  if ((tNode.flags & 32 /* TNodeFlags.isDetached */) !== 32 /* TNodeFlags.isDetached */) {
@@ -13979,7 +13909,7 @@ function ɵɵelementStart(index, name, attrsIndex, localRefsIndex) {
13979
13909
  attachPatchData(native, lView);
13980
13910
  }
13981
13911
  increaseElementDepthCount();
13982
- if (isDirectiveHost(tNode)) {
13912
+ if (hasDirectives) {
13983
13913
  createDirectivesInstances(tView, lView, tNode);
13984
13914
  executeContentQueries(tView, tNode, lView);
13985
13915
  }
@@ -18165,7 +18095,7 @@ function getTIcu(tView, index) {
18165
18095
  if (value === null || typeof value === 'string')
18166
18096
  return null;
18167
18097
  if (ngDevMode &&
18168
- !(value.hasOwnProperty('tViews') || value.hasOwnProperty('currentCaseLViewIndex'))) {
18098
+ !(value.hasOwnProperty('tView') || value.hasOwnProperty('currentCaseLViewIndex'))) {
18169
18099
  throwError('We expect to get \'null\'|\'TIcu\'|\'TIcuContainer\', but got: ' + value);
18170
18100
  }
18171
18101
  // Here the `value.hasOwnProperty('currentCaseLViewIndex')` is a polymorphic read as it can be
@@ -18194,7 +18124,7 @@ function getTIcu(tView, index) {
18194
18124
  function setTIcu(tView, index, tIcu) {
18195
18125
  const tNode = tView.data[index];
18196
18126
  ngDevMode &&
18197
- assertEqual(tNode === null || tNode.hasOwnProperty('tViews'), true, 'We expect to get \'null\'|\'TIcuContainer\'');
18127
+ assertEqual(tNode === null || tNode.hasOwnProperty('tView'), true, 'We expect to get \'null\'|\'TIcuContainer\'');
18198
18128
  if (tNode === null) {
18199
18129
  tView.data[index] = tIcu;
18200
18130
  }
@@ -21295,7 +21225,8 @@ function _wrapInTimeout(fn) {
21295
21225
  const EventEmitter = EventEmitter_;
21296
21226
 
21297
21227
  function symbolIterator() {
21298
- return this._results[getSymbolIterator()]();
21228
+ // @ts-expect-error accessing a private member
21229
+ return this._results[Symbol.iterator]();
21299
21230
  }
21300
21231
  /**
21301
21232
  * An unmodifiable list of items that Angular keeps up to date when the state
@@ -21347,11 +21278,10 @@ class QueryList {
21347
21278
  // This function should be declared on the prototype, but doing so there will cause the class
21348
21279
  // declaration to have side-effects and become not tree-shakable. For this reason we do it in
21349
21280
  // the constructor.
21350
- // [getSymbolIterator()](): Iterator<T> { ... }
21351
- const symbol = getSymbolIterator();
21281
+ // [Symbol.iterator](): Iterator<T> { ... }
21352
21282
  const proto = QueryList.prototype;
21353
- if (!proto[symbol])
21354
- proto[symbol] = symbolIterator;
21283
+ if (!proto[Symbol.iterator])
21284
+ proto[Symbol.iterator] = symbolIterator;
21355
21285
  }
21356
21286
  /**
21357
21287
  * Returns the QueryList entry at `index`.
@@ -21490,7 +21420,7 @@ const R3TemplateRef = class TemplateRef extends ViewEngineTemplateRef {
21490
21420
  this.elementRef = elementRef;
21491
21421
  }
21492
21422
  createEmbeddedView(context, injector) {
21493
- const embeddedTView = this._declarationTContainer.tViews;
21423
+ const embeddedTView = this._declarationTContainer.tView;
21494
21424
  const embeddedLView = createLView(this._declarationLView, embeddedTView, context, 16 /* LViewFlags.CheckAlways */, null, embeddedTView.declTNode, null, null, null, null, injector || null);
21495
21425
  const declarationLContainer = this._declarationLView[this._declarationTContainer.index];
21496
21426
  ngDevMode && assertLContainer(declarationLContainer);
@@ -21520,7 +21450,7 @@ function injectTemplateRef() {
21520
21450
  */
21521
21451
  function createTemplateRef(hostTNode, hostLView) {
21522
21452
  if (hostTNode.type & 4 /* TNodeType.Container */) {
21523
- ngDevMode && assertDefined(hostTNode.tViews, 'TView must be allocated');
21453
+ ngDevMode && assertDefined(hostTNode.tView, 'TView must be allocated');
21524
21454
  return new R3TemplateRef(hostLView, hostTNode, createElementRef(hostTNode, hostLView));
21525
21455
  }
21526
21456
  return null;