@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
  */
@@ -2114,54 +2114,6 @@ var ChangeDetectionStrategy;
2114
2114
  */
2115
2115
  ChangeDetectionStrategy[ChangeDetectionStrategy["Default"] = 1] = "Default";
2116
2116
  })(ChangeDetectionStrategy || (ChangeDetectionStrategy = {}));
2117
- /**
2118
- * Defines the possible states of the default change detector.
2119
- * @see `ChangeDetectorRef`
2120
- */
2121
- var ChangeDetectorStatus;
2122
- (function (ChangeDetectorStatus) {
2123
- /**
2124
- * A state in which, after calling `detectChanges()`, the change detector
2125
- * state becomes `Checked`, and must be explicitly invoked or reactivated.
2126
- */
2127
- ChangeDetectorStatus[ChangeDetectorStatus["CheckOnce"] = 0] = "CheckOnce";
2128
- /**
2129
- * A state in which change detection is skipped until the change detector mode
2130
- * becomes `CheckOnce`.
2131
- */
2132
- ChangeDetectorStatus[ChangeDetectorStatus["Checked"] = 1] = "Checked";
2133
- /**
2134
- * A state in which change detection continues automatically until explicitly
2135
- * deactivated.
2136
- */
2137
- ChangeDetectorStatus[ChangeDetectorStatus["CheckAlways"] = 2] = "CheckAlways";
2138
- /**
2139
- * A state in which a change detector sub tree is not a part of the main tree and
2140
- * should be skipped.
2141
- */
2142
- ChangeDetectorStatus[ChangeDetectorStatus["Detached"] = 3] = "Detached";
2143
- /**
2144
- * Indicates that the change detector encountered an error checking a binding
2145
- * or calling a directive lifecycle method and is now in an inconsistent state. Change
2146
- * detectors in this state do not detect changes.
2147
- */
2148
- ChangeDetectorStatus[ChangeDetectorStatus["Errored"] = 4] = "Errored";
2149
- /**
2150
- * Indicates that the change detector has been destroyed.
2151
- */
2152
- ChangeDetectorStatus[ChangeDetectorStatus["Destroyed"] = 5] = "Destroyed";
2153
- })(ChangeDetectorStatus || (ChangeDetectorStatus = {}));
2154
- /**
2155
- * Reports whether a given strategy is currently the default for change detection.
2156
- * @param changeDetectionStrategy The strategy to check.
2157
- * @returns True if the given strategy is the current default, false otherwise.
2158
- * @see `ChangeDetectorStatus`
2159
- * @see `ChangeDetectorRef`
2160
- */
2161
- function isDefaultChangeDetectionStrategy(changeDetectionStrategy) {
2162
- return changeDetectionStrategy == null ||
2163
- changeDetectionStrategy === ChangeDetectionStrategy.Default;
2164
- }
2165
2117
 
2166
2118
  /**
2167
2119
  * Defines the CSS styles encapsulation policies for the {@link Component} decorator's
@@ -8742,7 +8694,7 @@ class Version {
8742
8694
  /**
8743
8695
  * @publicApi
8744
8696
  */
8745
- const VERSION = new Version('15.2.0');
8697
+ const VERSION = new Version('15.2.2');
8746
8698
 
8747
8699
  // This default value is when checking the hierarchy for a token.
8748
8700
  //
@@ -10555,6 +10507,7 @@ function createTNodeAtIndex(tView, index, type, name, attrs) {
10555
10507
  // In the case of i18n the `currentTNode` may already be linked, in which case we don't want
10556
10508
  // to break the links which i18n created.
10557
10509
  currentTNode.next = tNode;
10510
+ tNode.prev = currentTNode;
10558
10511
  }
10559
10512
  }
10560
10513
  }
@@ -10993,8 +10946,9 @@ function createTNode(tView, tParent, type, index, value, attrs) {
10993
10946
  initialInputs: undefined,
10994
10947
  inputs: null,
10995
10948
  outputs: null,
10996
- tViews: null,
10949
+ tView: null,
10997
10950
  next: null,
10951
+ prev: null,
10998
10952
  projectionNext: null,
10999
10953
  child: null,
11000
10954
  parent: tParent,
@@ -11204,7 +11158,6 @@ function resolveDirectives(tView, lView, tNode, localRefs) {
11204
11158
  // Please make sure to have explicit type for `exportsMap`. Inferred type triggers bug in
11205
11159
  // tsickle.
11206
11160
  ngDevMode && assertFirstCreatePass(tView);
11207
- let hasDirectives = false;
11208
11161
  if (getBindingsEnabled()) {
11209
11162
  const exportsMap = localRefs === null ? null : { '': -1 };
11210
11163
  const matchResult = findDirectiveDefMatches(tView, tNode);
@@ -11217,7 +11170,6 @@ function resolveDirectives(tView, lView, tNode, localRefs) {
11217
11170
  [directiveDefs, hostDirectiveDefs] = matchResult;
11218
11171
  }
11219
11172
  if (directiveDefs !== null) {
11220
- hasDirectives = true;
11221
11173
  initializeDirectives(tView, lView, tNode, directiveDefs, exportsMap, hostDirectiveDefs);
11222
11174
  }
11223
11175
  if (exportsMap)
@@ -11225,7 +11177,6 @@ function resolveDirectives(tView, lView, tNode, localRefs) {
11225
11177
  }
11226
11178
  // Merge the template attrs last so that they have the highest priority.
11227
11179
  tNode.mergedAttrs = mergeHostAttrs(tNode.mergedAttrs, tNode.attrs);
11228
- return hasDirectives;
11229
11180
  }
11230
11181
  /** Initializes the data structures necessary for a list of directives to be instantiated. */
11231
11182
  function initializeDirectives(tView, lView, tNode, directives, exportsMap, hostDirectiveDefs) {
@@ -13091,41 +13042,19 @@ function validateMappings(bindingType, def, hostDirectiveBindings) {
13091
13042
  }
13092
13043
  }
13093
13044
 
13094
- let _symbolIterator = null;
13095
- function getSymbolIterator() {
13096
- if (!_symbolIterator) {
13097
- const Symbol = _global$1['Symbol'];
13098
- if (Symbol && Symbol.iterator) {
13099
- _symbolIterator = Symbol.iterator;
13100
- }
13101
- else {
13102
- // es6-shim specific logic
13103
- const keys = Object.getOwnPropertyNames(Map.prototype);
13104
- for (let i = 0; i < keys.length; ++i) {
13105
- const key = keys[i];
13106
- if (key !== 'entries' && key !== 'size' &&
13107
- Map.prototype[key] === Map.prototype['entries']) {
13108
- _symbolIterator = key;
13109
- }
13110
- }
13111
- }
13112
- }
13113
- return _symbolIterator;
13114
- }
13115
-
13116
13045
  function isIterable(obj) {
13117
- return obj !== null && typeof obj === 'object' && obj[getSymbolIterator()] !== undefined;
13046
+ return obj !== null && typeof obj === 'object' && obj[Symbol.iterator] !== undefined;
13118
13047
  }
13119
13048
  function isListLikeIterable(obj) {
13120
13049
  if (!isJsObject(obj))
13121
13050
  return false;
13122
13051
  return Array.isArray(obj) ||
13123
13052
  (!(obj instanceof Map) && // JS Map are iterables but return entries as [k, v]
13124
- getSymbolIterator() in obj); // JS Iterable have a Symbol.iterator prop
13053
+ Symbol.iterator in obj); // JS Iterable have a Symbol.iterator prop
13125
13054
  }
13126
13055
  function areIterablesEqual(a, b, comparator) {
13127
- const iterator1 = a[getSymbolIterator()]();
13128
- const iterator2 = b[getSymbolIterator()]();
13056
+ const iterator1 = a[Symbol.iterator]();
13057
+ const iterator2 = b[Symbol.iterator]();
13129
13058
  while (true) {
13130
13059
  const item1 = iterator1.next();
13131
13060
  const item2 = iterator2.next();
@@ -13144,7 +13073,7 @@ function iterateListLike(obj, fn) {
13144
13073
  }
13145
13074
  }
13146
13075
  else {
13147
- const iterator = obj[getSymbolIterator()]();
13076
+ const iterator = obj[Symbol.iterator]();
13148
13077
  let item;
13149
13078
  while (!((item = iterator.next()).done)) {
13150
13079
  fn(item.value);
@@ -13797,7 +13726,7 @@ function templateFirstCreatePass(index, tView, lView, templateFn, decls, vars, t
13797
13726
  const tNode = getOrCreateTNode(tView, index, 4 /* TNodeType.Container */, tagName || null, getConstant(tViewConsts, attrsIndex));
13798
13727
  resolveDirectives(tView, lView, tNode, getConstant(tViewConsts, localRefsIndex));
13799
13728
  registerPostOrderHooks(tView, tNode);
13800
- const embeddedTView = tNode.tViews = createTView(2 /* TViewType.Embedded */, tNode, templateFn, decls, vars, tView.directiveRegistry, tView.pipeRegistry, null, tView.schemas, tViewConsts);
13729
+ const embeddedTView = tNode.tView = createTView(2 /* TViewType.Embedded */, tNode, templateFn, decls, vars, tView.directiveRegistry, tView.pipeRegistry, null, tView.schemas, tViewConsts);
13801
13730
  if (tView.queries !== null) {
13802
13731
  tView.queries.template(tView, tNode);
13803
13732
  embeddedTView.queries = tView.queries.embeddedTView(tNode);
@@ -13907,16 +13836,13 @@ function setDirectiveInputsWhichShadowsStyling(tView, tNode, lView, value, isCla
13907
13836
  setInputsForProperty(tView, lView, inputs[property], property, value);
13908
13837
  }
13909
13838
 
13910
- function elementStartFirstCreatePass(index, tView, lView, native, name, attrsIndex, localRefsIndex) {
13839
+ function elementStartFirstCreatePass(index, tView, lView, name, attrsIndex, localRefsIndex) {
13911
13840
  ngDevMode && assertFirstCreatePass(tView);
13912
13841
  ngDevMode && ngDevMode.firstCreatePass++;
13913
13842
  const tViewConsts = tView.consts;
13914
13843
  const attrs = getConstant(tViewConsts, attrsIndex);
13915
13844
  const tNode = getOrCreateTNode(tView, index, 2 /* TNodeType.Element */, name, attrs);
13916
- const hasDirectives = resolveDirectives(tView, lView, tNode, getConstant(tViewConsts, localRefsIndex));
13917
- if (ngDevMode) {
13918
- validateElementIsKnown(native, lView, tNode.value, tView.schemas, hasDirectives);
13919
- }
13845
+ resolveDirectives(tView, lView, tNode, getConstant(tViewConsts, localRefsIndex));
13920
13846
  if (tNode.attrs !== null) {
13921
13847
  computeStaticStyling(tNode, tNode.attrs, false);
13922
13848
  }
@@ -13951,10 +13877,14 @@ function ɵɵelementStart(index, name, attrsIndex, localRefsIndex) {
13951
13877
  assertEqual(getBindingIndex(), tView.bindingStartIndex, 'elements should be created before any bindings');
13952
13878
  ngDevMode && assertIndexInRange(lView, adjustedIndex);
13953
13879
  const renderer = lView[RENDERER];
13954
- const native = lView[adjustedIndex] = createElementNode(renderer, name, getNamespace$1());
13955
13880
  const tNode = tView.firstCreatePass ?
13956
- elementStartFirstCreatePass(adjustedIndex, tView, lView, native, name, attrsIndex, localRefsIndex) :
13881
+ elementStartFirstCreatePass(adjustedIndex, tView, lView, name, attrsIndex, localRefsIndex) :
13957
13882
  tView.data[adjustedIndex];
13883
+ const native = lView[adjustedIndex] = createElementNode(renderer, name, getNamespace$1());
13884
+ const hasDirectives = isDirectiveHost(tNode);
13885
+ if (ngDevMode && tView.firstCreatePass) {
13886
+ validateElementIsKnown(native, lView, tNode.value, tView.schemas, hasDirectives);
13887
+ }
13958
13888
  setCurrentTNode(tNode, true);
13959
13889
  setupStaticAttributes(renderer, native, tNode);
13960
13890
  if ((tNode.flags & 32 /* TNodeFlags.isDetached */) !== 32 /* TNodeFlags.isDetached */) {
@@ -13969,7 +13899,7 @@ function ɵɵelementStart(index, name, attrsIndex, localRefsIndex) {
13969
13899
  attachPatchData(native, lView);
13970
13900
  }
13971
13901
  increaseElementDepthCount();
13972
- if (isDirectiveHost(tNode)) {
13902
+ if (hasDirectives) {
13973
13903
  createDirectivesInstances(tView, lView, tNode);
13974
13904
  executeContentQueries(tView, tNode, lView);
13975
13905
  }
@@ -18155,7 +18085,7 @@ function getTIcu(tView, index) {
18155
18085
  if (value === null || typeof value === 'string')
18156
18086
  return null;
18157
18087
  if (ngDevMode &&
18158
- !(value.hasOwnProperty('tViews') || value.hasOwnProperty('currentCaseLViewIndex'))) {
18088
+ !(value.hasOwnProperty('tView') || value.hasOwnProperty('currentCaseLViewIndex'))) {
18159
18089
  throwError('We expect to get \'null\'|\'TIcu\'|\'TIcuContainer\', but got: ' + value);
18160
18090
  }
18161
18091
  // Here the `value.hasOwnProperty('currentCaseLViewIndex')` is a polymorphic read as it can be
@@ -18184,7 +18114,7 @@ function getTIcu(tView, index) {
18184
18114
  function setTIcu(tView, index, tIcu) {
18185
18115
  const tNode = tView.data[index];
18186
18116
  ngDevMode &&
18187
- assertEqual(tNode === null || tNode.hasOwnProperty('tViews'), true, 'We expect to get \'null\'|\'TIcuContainer\'');
18117
+ assertEqual(tNode === null || tNode.hasOwnProperty('tView'), true, 'We expect to get \'null\'|\'TIcuContainer\'');
18188
18118
  if (tNode === null) {
18189
18119
  tView.data[index] = tIcu;
18190
18120
  }
@@ -21284,7 +21214,8 @@ function _wrapInTimeout(fn) {
21284
21214
  const EventEmitter = EventEmitter_;
21285
21215
 
21286
21216
  function symbolIterator() {
21287
- return this._results[getSymbolIterator()]();
21217
+ // @ts-expect-error accessing a private member
21218
+ return this._results[Symbol.iterator]();
21288
21219
  }
21289
21220
  /**
21290
21221
  * An unmodifiable list of items that Angular keeps up to date when the state
@@ -21336,11 +21267,10 @@ class QueryList {
21336
21267
  // This function should be declared on the prototype, but doing so there will cause the class
21337
21268
  // declaration to have side-effects and become not tree-shakable. For this reason we do it in
21338
21269
  // the constructor.
21339
- // [getSymbolIterator()](): Iterator<T> { ... }
21340
- const symbol = getSymbolIterator();
21270
+ // [Symbol.iterator](): Iterator<T> { ... }
21341
21271
  const proto = QueryList.prototype;
21342
- if (!proto[symbol])
21343
- proto[symbol] = symbolIterator;
21272
+ if (!proto[Symbol.iterator])
21273
+ proto[Symbol.iterator] = symbolIterator;
21344
21274
  }
21345
21275
  /**
21346
21276
  * Returns the QueryList entry at `index`.
@@ -21479,7 +21409,7 @@ const R3TemplateRef = class TemplateRef extends ViewEngineTemplateRef {
21479
21409
  this.elementRef = elementRef;
21480
21410
  }
21481
21411
  createEmbeddedView(context, injector) {
21482
- const embeddedTView = this._declarationTContainer.tViews;
21412
+ const embeddedTView = this._declarationTContainer.tView;
21483
21413
  const embeddedLView = createLView(this._declarationLView, embeddedTView, context, 16 /* LViewFlags.CheckAlways */, null, embeddedTView.declTNode, null, null, null, null, injector || null);
21484
21414
  const declarationLContainer = this._declarationLView[this._declarationTContainer.index];
21485
21415
  ngDevMode && assertLContainer(declarationLContainer);
@@ -21509,7 +21439,7 @@ function injectTemplateRef() {
21509
21439
  */
21510
21440
  function createTemplateRef(hostTNode, hostLView) {
21511
21441
  if (hostTNode.type & 4 /* TNodeType.Container */) {
21512
- ngDevMode && assertDefined(hostTNode.tViews, 'TView must be allocated');
21442
+ ngDevMode && assertDefined(hostTNode.tView, 'TView must be allocated');
21513
21443
  return new R3TemplateRef(hostLView, hostTNode, createElementRef(hostTNode, hostLView));
21514
21444
  }
21515
21445
  return null;