@angular/core 9.1.5 → 9.1.9

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 (78) hide show
  1. package/bundles/core-testing.umd.js +1 -1
  2. package/bundles/core-testing.umd.min.js +1 -1
  3. package/bundles/core-testing.umd.min.js.map +1 -1
  4. package/bundles/core.umd.js +99 -334
  5. package/bundles/core.umd.js.map +1 -1
  6. package/bundles/core.umd.min.js +126 -133
  7. package/bundles/core.umd.min.js.map +1 -1
  8. package/core.d.ts +47 -102
  9. package/core.metadata.json +1 -1
  10. package/esm2015/index.js +2 -2
  11. package/esm2015/public_api.js +2 -2
  12. package/esm2015/src/core.js +2 -2
  13. package/esm2015/src/core_render3_private_export.js +2 -2
  14. package/esm2015/src/reflection/reflection_capabilities.js +2 -2
  15. package/esm2015/src/render3/assert.js +1 -8
  16. package/esm2015/src/render3/component.js +2 -2
  17. package/esm2015/src/render3/component_ref.js +5 -3
  18. package/esm2015/src/render3/index.js +2 -2
  19. package/esm2015/src/render3/instructions/all.js +2 -3
  20. package/esm2015/src/render3/instructions/element.js +9 -6
  21. package/esm2015/src/render3/instructions/element_container.js +2 -2
  22. package/esm2015/src/render3/instructions/lview_debug.js +14 -11
  23. package/esm2015/src/render3/instructions/shared.js +32 -63
  24. package/esm2015/src/render3/instructions/styling.js +2 -2
  25. package/esm2015/src/render3/instructions/template.js +100 -0
  26. package/esm2015/src/render3/interfaces/container.js +9 -32
  27. package/esm2015/src/render3/interfaces/node.js +34 -4
  28. package/esm2015/src/render3/interfaces/view.js +1 -1
  29. package/esm2015/src/render3/jit/environment.js +1 -6
  30. package/esm2015/src/render3/node_assert.js +1 -1
  31. package/esm2015/src/render3/node_manipulation.js +3 -3
  32. package/esm2015/src/render3/styling/static_styling.js +25 -20
  33. package/esm2015/src/render3/util/view_traversal_utils.js +28 -2
  34. package/esm2015/src/render3/util/view_utils.js +2 -17
  35. package/esm2015/src/render3/view_engine_compatibility.js +3 -7
  36. package/esm2015/src/render3/view_ref.js +1 -10
  37. package/esm2015/src/util/assert.js +1 -1
  38. package/esm2015/src/version.js +1 -1
  39. package/esm5/src/core_render3_private_export.js +2 -2
  40. package/esm5/src/reflection/reflection_capabilities.js +2 -2
  41. package/esm5/src/render3/assert.js +1 -4
  42. package/esm5/src/render3/component.js +2 -2
  43. package/esm5/src/render3/component_ref.js +5 -3
  44. package/esm5/src/render3/index.js +2 -2
  45. package/esm5/src/render3/instructions/all.js +2 -3
  46. package/esm5/src/render3/instructions/element.js +9 -6
  47. package/esm5/src/render3/instructions/element_container.js +2 -2
  48. package/esm5/src/render3/instructions/lview_debug.js +8 -12
  49. package/esm5/src/render3/instructions/shared.js +30 -55
  50. package/esm5/src/render3/instructions/styling.js +2 -2
  51. package/esm5/src/render3/instructions/template.js +73 -0
  52. package/esm5/src/render3/interfaces/container.js +10 -2
  53. package/esm5/src/render3/interfaces/node.js +1 -1
  54. package/esm5/src/render3/interfaces/view.js +1 -1
  55. package/esm5/src/render3/jit/environment.js +1 -6
  56. package/esm5/src/render3/node_assert.js +1 -1
  57. package/esm5/src/render3/node_manipulation.js +3 -3
  58. package/esm5/src/render3/styling/static_styling.js +23 -18
  59. package/esm5/src/render3/util/view_traversal_utils.js +20 -2
  60. package/esm5/src/render3/util/view_utils.js +2 -8
  61. package/esm5/src/render3/view_engine_compatibility.js +3 -6
  62. package/esm5/src/render3/view_ref.js +1 -5
  63. package/esm5/src/util/assert.js +1 -1
  64. package/esm5/src/version.js +1 -1
  65. package/fesm2015/core.js +151 -435
  66. package/fesm2015/core.js.map +1 -1
  67. package/fesm2015/testing.js +1 -1
  68. package/fesm5/core.js +100 -330
  69. package/fesm5/core.js.map +1 -1
  70. package/fesm5/testing.js +1 -1
  71. package/package.json +1 -1
  72. package/src/r3_symbols.d.ts +1 -1
  73. package/testing/testing.d.ts +1 -1
  74. package/testing.d.ts +1 -1
  75. package/esm2015/src/render3/instructions/container.js +0 -227
  76. package/esm2015/src/render3/instructions/embedded_view.js +0 -151
  77. package/esm5/src/render3/instructions/container.js +0 -173
  78. package/esm5/src/render3/instructions/embedded_view.js +0 -127
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v9.1.5
2
+ * @license Angular v9.1.9
3
3
  * (c) 2010-2020 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -2126,7 +2126,15 @@
2126
2126
  * without having to remember the specific indices.
2127
2127
  * Uglify will inline these when minifying so there shouldn't be a cost.
2128
2128
  */
2129
- var ACTIVE_INDEX = 2;
2129
+ /**
2130
+ * Flag to signify that this `LContainer` may have transplanted views which need to be change
2131
+ * detected. (see: `LView[DECLARATION_COMPONENT_VIEW])`.
2132
+ *
2133
+ * This flag, once set, is never unset for the `LContainer`. This means that when unset we can skip
2134
+ * a lot of work in `refreshEmbeddedViews`. But when set we still need to verify
2135
+ * that the `MOVED_VIEWS` are transplanted and on-push.
2136
+ */
2137
+ var HAS_TRANSPLANTED_VIEWS = 2;
2130
2138
  // PARENT, NEXT, TRANSPLANTED_VIEWS_TO_REFRESH are indices 3, 4, and 5
2131
2139
  // As we already have these constants in LView, we don't need to re-create them.
2132
2140
  // T_HOST is index 6
@@ -2219,9 +2227,6 @@
2219
2227
  arr = lView;
2220
2228
  assertEqual(arr.length, index, "index " + index + " expected to be at the end of arr (length " + arr.length + ")");
2221
2229
  }
2222
- function assertLContainerOrUndefined(value) {
2223
- value && assertEqual(isLContainer(value), true, 'Expecting LContainer or undefined or null');
2224
- }
2225
2230
  function assertLContainer(value) {
2226
2231
  assertDefined(value, 'LContainer must be defined');
2227
2232
  assertEqual(isLContainer(value), true, 'Expecting LContainer');
@@ -2514,12 +2519,6 @@
2514
2519
  function resetPreOrderHookFlags(lView) {
2515
2520
  lView[PREORDER_HOOK_FLAGS] = 0;
2516
2521
  }
2517
- function getLContainerActiveIndex(lContainer) {
2518
- return lContainer[ACTIVE_INDEX] >> 1 /* SHIFT */;
2519
- }
2520
- function setLContainerActiveIndex(lContainer, index) {
2521
- lContainer[ACTIVE_INDEX] = index << 1 /* SHIFT */;
2522
- }
2523
2522
  /**
2524
2523
  * Updates the `TRANSPLANTED_VIEWS_TO_REFRESH` counter on the `LContainer` as well as the parents
2525
2524
  * whose
@@ -6416,6 +6415,24 @@
6416
6415
  assertDefined(rootView[CONTEXT], 'RootView has no context. Perhaps it is disconnected?');
6417
6416
  return rootView[CONTEXT];
6418
6417
  }
6418
+ /**
6419
+ * Gets the first `LContainer` in the LView or `null` if none exists.
6420
+ */
6421
+ function getFirstLContainer(lView) {
6422
+ return getNearestLContainer(lView[CHILD_HEAD]);
6423
+ }
6424
+ /**
6425
+ * Gets the next `LContainer` that is a sibling of the given container.
6426
+ */
6427
+ function getNextLContainer(container) {
6428
+ return getNearestLContainer(container[NEXT]);
6429
+ }
6430
+ function getNearestLContainer(viewOrContainer) {
6431
+ while (viewOrContainer !== null && !isLContainer(viewOrContainer)) {
6432
+ viewOrContainer = viewOrContainer[NEXT];
6433
+ }
6434
+ return viewOrContainer;
6435
+ }
6419
6436
 
6420
6437
  /**
6421
6438
  * @license
@@ -6769,8 +6786,10 @@
6769
6786
  parent, //
6770
6787
  projection, //
6771
6788
  styles, //
6789
+ stylesWithoutHost, //
6772
6790
  residualStyles, //
6773
6791
  classes, //
6792
+ classesWithoutHost, //
6774
6793
  residualClasses, //
6775
6794
  classBindings, //
6776
6795
  styleBindings) {
@@ -6798,8 +6817,10 @@
6798
6817
  this.parent = parent;
6799
6818
  this.projection = projection;
6800
6819
  this.styles = styles;
6820
+ this.stylesWithoutHost = stylesWithoutHost;
6801
6821
  this.residualStyles = residualStyles;
6802
6822
  this.classes = classes;
6823
+ this.classesWithoutHost = classesWithoutHost;
6803
6824
  this.residualClasses = residualClasses;
6804
6825
  this.classBindings = classBindings;
6805
6826
  this.styleBindings = styleBindings;
@@ -7193,17 +7214,9 @@
7193
7214
  function LContainerDebug(_raw_lContainer) {
7194
7215
  this._raw_lContainer = _raw_lContainer;
7195
7216
  }
7196
- Object.defineProperty(LContainerDebug.prototype, "activeIndex", {
7197
- get: function () {
7198
- return getLContainerActiveIndex(this._raw_lContainer);
7199
- },
7200
- enumerable: true,
7201
- configurable: true
7202
- });
7203
7217
  Object.defineProperty(LContainerDebug.prototype, "hasTransplantedViews", {
7204
7218
  get: function () {
7205
- return (this._raw_lContainer[ACTIVE_INDEX] & 1 /* HAS_TRANSPLANTED_VIEWS */) ===
7206
- 1 /* HAS_TRANSPLANTED_VIEWS */;
7219
+ return this._raw_lContainer[HAS_TRANSPLANTED_VIEWS];
7207
7220
  },
7208
7221
  enumerable: true,
7209
7222
  configurable: true
@@ -7659,7 +7672,7 @@
7659
7672
  tView.node = tNode = createTNode(tView, tParentNode, //
7660
7673
  2 /* View */, index, null, null);
7661
7674
  }
7662
- return lView[T_HOST] = tNode;
7675
+ lView[T_HOST] = tNode;
7663
7676
  }
7664
7677
  /**
7665
7678
  * When elements are created dynamically after a view blueprint is created (e.g. through
@@ -7799,7 +7812,7 @@
7799
7812
  // insertion points. This is needed to avoid the situation where the template is defined in this
7800
7813
  // `LView` but its declaration appears after the insertion component.
7801
7814
  markTransplantedViewsForRefresh(lView);
7802
- refreshDynamicEmbeddedViews(lView);
7815
+ refreshEmbeddedViews(lView);
7803
7816
  // Content query results must be refreshed before content hooks are called.
7804
7817
  if (tView.contentQueries !== null) {
7805
7818
  refreshContentQueries(tView, lView);
@@ -8170,8 +8183,10 @@
8170
8183
  tParent, // parent: TElementNode|TContainerNode|null
8171
8184
  null, // projection: number|(ITNode|RNode[])[]|null
8172
8185
  null, // styles: string|null
8186
+ null, // stylesWithoutHost: string|null
8173
8187
  undefined, // residualStyles: string|null
8174
8188
  null, // classes: string|null
8189
+ null, // classesWithoutHost: string|null
8175
8190
  undefined, // residualClasses: string|null
8176
8191
  0, // classBindings: TStylingRange;
8177
8192
  0) :
@@ -8199,8 +8214,10 @@
8199
8214
  parent: tParent,
8200
8215
  projection: null,
8201
8216
  styles: null,
8217
+ stylesWithoutHost: null,
8202
8218
  residualStyles: undefined,
8203
8219
  classes: null,
8220
+ classesWithoutHost: null,
8204
8221
  residualClasses: undefined,
8205
8222
  classBindings: 0,
8206
8223
  styleBindings: 0,
@@ -8847,7 +8864,7 @@
8847
8864
  // https://jsperf.com/array-literal-vs-new-array-really
8848
8865
  var lContainer = new (ngDevMode ? LContainerArray : Array)(hostNative, // host native
8849
8866
  true, // Boolean `true` in this position signifies that this is an `LContainer`
8850
- -1 /* DYNAMIC_EMBEDDED_VIEWS_ONLY */ << 1 /* SHIFT */, // active index
8867
+ false, // has transplanted views
8851
8868
  currentView, // parent
8852
8869
  null, // next
8853
8870
  0, // transplanted views to refresh count
@@ -8861,10 +8878,10 @@
8861
8878
  return lContainer;
8862
8879
  }
8863
8880
  /**
8864
- * Goes over dynamic embedded views (ones created through ViewContainerRef APIs) and refreshes
8881
+ * Goes over embedded views (ones created through ViewContainerRef APIs) and refreshes
8865
8882
  * them by executing an associated template function.
8866
8883
  */
8867
- function refreshDynamicEmbeddedViews(lView) {
8884
+ function refreshEmbeddedViews(lView) {
8868
8885
  for (var lContainer = getFirstLContainer(lView); lContainer !== null; lContainer = getNextLContainer(lContainer)) {
8869
8886
  for (var i = CONTAINER_HEADER_OFFSET; i < lContainer.length; i++) {
8870
8887
  var embeddedLView = lContainer[i];
@@ -8876,60 +8893,31 @@
8876
8893
  }
8877
8894
  }
8878
8895
  }
8879
- /**
8880
- * Gets the first `LContainer` in the LView or `null` if none exists.
8881
- */
8882
- function getFirstLContainer(lView) {
8883
- var viewOrContainer = lView[CHILD_HEAD];
8884
- while (viewOrContainer !== null &&
8885
- !(isLContainer(viewOrContainer) &&
8886
- viewOrContainer[ACTIVE_INDEX] >> 1 /* SHIFT */ ===
8887
- -1 /* DYNAMIC_EMBEDDED_VIEWS_ONLY */)) {
8888
- viewOrContainer = viewOrContainer[NEXT];
8889
- }
8890
- return viewOrContainer;
8891
- }
8892
- /**
8893
- * Gets the next `LContainer` that is a sibling of the given container.
8894
- */
8895
- function getNextLContainer(container) {
8896
- var viewOrContainer = container[NEXT];
8897
- while (viewOrContainer !== null &&
8898
- !(isLContainer(viewOrContainer) &&
8899
- viewOrContainer[ACTIVE_INDEX] >> 1 /* SHIFT */ ===
8900
- -1 /* DYNAMIC_EMBEDDED_VIEWS_ONLY */)) {
8901
- viewOrContainer = viewOrContainer[NEXT];
8902
- }
8903
- return viewOrContainer;
8904
- }
8905
8896
  /**
8906
8897
  * Mark transplanted views as needing to be refreshed at their insertion points.
8907
8898
  *
8908
- * See: `ActiveIndexFlag.HAS_TRANSPLANTED_VIEWS` and `LView[DECLARATION_COMPONENT_VIEW]` for
8909
- * explanation of transplanted views.
8910
- *
8911
8899
  * @param lView The `LView` that may have transplanted views.
8912
8900
  */
8913
8901
  function markTransplantedViewsForRefresh(lView) {
8914
8902
  for (var lContainer = getFirstLContainer(lView); lContainer !== null; lContainer = getNextLContainer(lContainer)) {
8915
- if ((lContainer[ACTIVE_INDEX] & 1 /* HAS_TRANSPLANTED_VIEWS */) !== 0) {
8916
- var movedViews = lContainer[MOVED_VIEWS];
8917
- ngDevMode && assertDefined(movedViews, 'Transplanted View flags set but missing MOVED_VIEWS');
8918
- for (var i = 0; i < movedViews.length; i++) {
8919
- var movedLView = movedViews[i];
8920
- var insertionLContainer = movedLView[PARENT];
8921
- ngDevMode && assertLContainer(insertionLContainer);
8922
- // We don't want to increment the counter if the moved LView was already marked for
8923
- // refresh.
8924
- if ((movedLView[FLAGS] & 1024 /* RefreshTransplantedView */) === 0) {
8925
- updateTransplantedViewCount(insertionLContainer, 1);
8926
- }
8927
- // Note, it is possible that the `movedViews` is tracking views that are transplanted *and*
8928
- // those that aren't (declaration component === insertion component). In the latter case,
8929
- // it's fine to add the flag, as we will clear it immediately in
8930
- // `refreshDynamicEmbeddedViews` for the view currently being refreshed.
8931
- movedLView[FLAGS] |= 1024 /* RefreshTransplantedView */;
8903
+ if (!lContainer[HAS_TRANSPLANTED_VIEWS])
8904
+ continue;
8905
+ var movedViews = lContainer[MOVED_VIEWS];
8906
+ ngDevMode && assertDefined(movedViews, 'Transplanted View flags set but missing MOVED_VIEWS');
8907
+ for (var i = 0; i < movedViews.length; i++) {
8908
+ var movedLView = movedViews[i];
8909
+ var insertionLContainer = movedLView[PARENT];
8910
+ ngDevMode && assertLContainer(insertionLContainer);
8911
+ // We don't want to increment the counter if the moved LView was already marked for
8912
+ // refresh.
8913
+ if ((movedLView[FLAGS] & 1024 /* RefreshTransplantedView */) === 0) {
8914
+ updateTransplantedViewCount(insertionLContainer, 1);
8932
8915
  }
8916
+ // Note, it is possible that the `movedViews` is tracking views that are transplanted *and*
8917
+ // those that aren't (declaration component === insertion component). In the latter case,
8918
+ // it's fine to add the flag, as we will clear it immediately in
8919
+ // `refreshEmbeddedViews` for the view currently being refreshed.
8920
+ movedLView[FLAGS] |= 1024 /* RefreshTransplantedView */;
8933
8921
  }
8934
8922
  }
8935
8923
  }
@@ -9500,7 +9488,7 @@
9500
9488
  // At this point the declaration-component is not same as insertion-component; this means that
9501
9489
  // this is a transplanted view. Mark the declared lView as having transplanted views so that
9502
9490
  // those views can participate in CD.
9503
- declarationContainer[ACTIVE_INDEX] |= 1 /* HAS_TRANSPLANTED_VIEWS */;
9491
+ declarationContainer[HAS_TRANSPLANTED_VIEWS] = true;
9504
9492
  }
9505
9493
  if (movedViews === null) {
9506
9494
  declarationContainer[MOVED_VIEWS] = [lView];
@@ -10289,10 +10277,6 @@
10289
10277
  this._cdRefInjectingView = _cdRefInjectingView;
10290
10278
  this._appRef = null;
10291
10279
  this._viewContainerRef = null;
10292
- /**
10293
- * @internal
10294
- */
10295
- this._tViewNode = null;
10296
10280
  }
10297
10281
  Object.defineProperty(ViewRef.prototype, "rootNodes", {
10298
10282
  get: function () {
@@ -10685,9 +10669,7 @@
10685
10669
  embeddedLView[QUERIES] = declarationViewLQueries.createEmbeddedView(embeddedTView);
10686
10670
  }
10687
10671
  renderView(embeddedTView, embeddedLView, context);
10688
- var viewRef = new ViewRef(embeddedLView);
10689
- viewRef._tViewNode = embeddedLView[T_HOST];
10690
- return viewRef;
10672
+ return new ViewRef(embeddedLView);
10691
10673
  };
10692
10674
  return TemplateRef;
10693
10675
  }(TemplateRefToken));
@@ -10878,7 +10860,6 @@
10878
10860
  if (isLContainer(slotValue)) {
10879
10861
  // If the host is a container, we don't need to create a new LContainer
10880
10862
  lContainer = slotValue;
10881
- setLContainerActiveIndex(lContainer, -1 /* DYNAMIC_EMBEDDED_VIEWS_ONLY */);
10882
10863
  }
10883
10864
  else {
10884
10865
  var commentNode = void 0;
@@ -11069,7 +11050,7 @@
11069
11050
  var DELEGATE_CTOR = /^function\s+\S+\(\)\s*{[\s\S]+\.apply\(this,\s*arguments\)/;
11070
11051
  var INHERITED_CLASS = /^class\s+[A-Za-z\d$_]*\s*extends\s+[^{]+{/;
11071
11052
  var INHERITED_CLASS_WITH_CTOR = /^class\s+[A-Za-z\d$_]*\s*extends\s+[^{]+{[\s\S]*constructor\s*\(/;
11072
- var INHERITED_CLASS_WITH_DELEGATE_CTOR = /^class\s+[A-Za-z\d$_]*\s*extends\s+[^{]+{[\s\S]*constructor\s*\(\)\s*{\s+super\(\.\.\.arguments\)/;
11053
+ var INHERITED_CLASS_WITH_DELEGATE_CTOR = /^class\s+[A-Za-z\d$_]*\s*extends\s+[^{]+{[\s\S]*constructor\s*\(\)\s*{\s*super\(\.\.\.arguments\)/;
11073
11054
  /**
11074
11055
  * Determine whether a stringified type is a class which delegates its constructor
11075
11056
  * to its parent.
@@ -13530,29 +13511,34 @@
13530
13511
  *
13531
13512
  * @param tNode The `TNode` into which the styling information should be loaded.
13532
13513
  * @param attrs `TAttributes` containing the styling information.
13514
+ * @param writeToHost Where should the resulting static styles be written?
13515
+ * - `false` Write to `TNode.stylesWithoutHost` / `TNode.classesWithoutHost`
13516
+ * - `true` Write to `TNode.styles` / `TNode.classes`
13533
13517
  */
13534
- function computeStaticStyling(tNode, attrs) {
13518
+ function computeStaticStyling(tNode, attrs, writeToHost) {
13535
13519
  ngDevMode &&
13536
13520
  assertFirstCreatePass(getTView(), 'Expecting to be called in first template pass only');
13537
- var styles = tNode.styles;
13538
- var classes = tNode.classes;
13521
+ var styles = writeToHost ? tNode.styles : null;
13522
+ var classes = writeToHost ? tNode.classes : null;
13539
13523
  var mode = 0;
13540
- for (var i = 0; i < attrs.length; i++) {
13541
- var value = attrs[i];
13542
- if (typeof value === 'number') {
13543
- mode = value;
13544
- }
13545
- else if (mode == 1 /* Classes */) {
13546
- classes = concatStringsWithSpace(classes, value);
13547
- }
13548
- else if (mode == 2 /* Styles */) {
13549
- var style = value;
13550
- var styleValue = attrs[++i];
13551
- styles = concatStringsWithSpace(styles, style + ': ' + styleValue + ';');
13524
+ if (attrs !== null) {
13525
+ for (var i = 0; i < attrs.length; i++) {
13526
+ var value = attrs[i];
13527
+ if (typeof value === 'number') {
13528
+ mode = value;
13529
+ }
13530
+ else if (mode == 1 /* Classes */) {
13531
+ classes = concatStringsWithSpace(classes, value);
13532
+ }
13533
+ else if (mode == 2 /* Styles */) {
13534
+ var style = value;
13535
+ var styleValue = attrs[++i];
13536
+ styles = concatStringsWithSpace(styles, style + ': ' + styleValue + ';');
13537
+ }
13552
13538
  }
13553
13539
  }
13554
- styles !== null && (tNode.styles = styles);
13555
- classes !== null && (tNode.classes = classes);
13540
+ writeToHost ? tNode.styles = styles : tNode.stylesWithoutHost = styles;
13541
+ writeToHost ? tNode.classes = classes : tNode.classesWithoutHost = classes;
13556
13542
  }
13557
13543
 
13558
13544
  /**
@@ -14450,26 +14436,6 @@
14450
14436
  * Use of this source code is governed by an MIT-style license that can be
14451
14437
  * found in the LICENSE file at https://angular.io/license
14452
14438
  */
14453
- /**
14454
- * Creates an LContainer for inline views, e.g.
14455
- *
14456
- * % if (showing) {
14457
- * <div></div>
14458
- * % }
14459
- *
14460
- * @param index The index of the container in the data array
14461
- *
14462
- * @codeGenApi
14463
- */
14464
- function ɵɵcontainer(index) {
14465
- var lView = getLView();
14466
- var tView = getTView();
14467
- var tNode = containerInternal(tView, lView, index, null, null);
14468
- if (tView.firstCreatePass) {
14469
- tNode.tViews = [];
14470
- }
14471
- setIsNotParent();
14472
- }
14473
14439
  function templateFirstCreatePass(index, tView, lView, templateFn, decls, vars, tagName, attrsIndex, localRefsIndex) {
14474
14440
  ngDevMode && assertFirstCreatePass(tView);
14475
14441
  ngDevMode && ngDevMode.firstCreatePass++;
@@ -14526,83 +14492,6 @@
14526
14492
  saveResolvedLocalsInData(lView, tNode, localRefExtractor);
14527
14493
  }
14528
14494
  }
14529
- /**
14530
- * Sets a container up to receive views.
14531
- *
14532
- * @param index The index of the container in the data array
14533
- *
14534
- * @codeGenApi
14535
- */
14536
- function ɵɵcontainerRefreshStart(index) {
14537
- var lView = getLView();
14538
- var tView = getTView();
14539
- var previousOrParentTNode = load(tView.data, index);
14540
- ngDevMode && assertNodeType(previousOrParentTNode, 0 /* Container */);
14541
- setPreviousOrParentTNode(previousOrParentTNode, true);
14542
- lView[index + HEADER_OFFSET][ACTIVE_INDEX] = 0;
14543
- // We need to execute init hooks here so ngOnInit hooks are called in top level views
14544
- // before they are called in embedded views (for backwards compatibility).
14545
- if (!getCheckNoChangesMode()) {
14546
- var hooksInitPhaseCompleted = (lView[FLAGS] & 3 /* InitPhaseStateMask */) === 3 /* InitPhaseCompleted */;
14547
- if (hooksInitPhaseCompleted) {
14548
- var preOrderCheckHooks = tView.preOrderCheckHooks;
14549
- if (preOrderCheckHooks !== null) {
14550
- executeCheckHooks(lView, preOrderCheckHooks, null);
14551
- }
14552
- }
14553
- else {
14554
- var preOrderHooks = tView.preOrderHooks;
14555
- if (preOrderHooks !== null) {
14556
- executeInitAndCheckHooks(lView, preOrderHooks, 0 /* OnInitHooksToBeRun */, null);
14557
- }
14558
- incrementInitPhaseFlags(lView, 0 /* OnInitHooksToBeRun */);
14559
- }
14560
- }
14561
- }
14562
- /**
14563
- * Marks the end of the LContainer.
14564
- *
14565
- * Marking the end of LContainer is the time when to child views get inserted or removed.
14566
- *
14567
- * @codeGenApi
14568
- */
14569
- function ɵɵcontainerRefreshEnd() {
14570
- var previousOrParentTNode = getPreviousOrParentTNode();
14571
- if (getIsParent()) {
14572
- setIsNotParent();
14573
- }
14574
- else {
14575
- ngDevMode && assertNodeType(previousOrParentTNode, 2 /* View */);
14576
- ngDevMode && assertHasParent(previousOrParentTNode);
14577
- previousOrParentTNode = previousOrParentTNode.parent;
14578
- setPreviousOrParentTNode(previousOrParentTNode, false);
14579
- }
14580
- ngDevMode && assertNodeType(previousOrParentTNode, 0 /* Container */);
14581
- var lContainer = getLView()[previousOrParentTNode.index];
14582
- var nextIndex = getLContainerActiveIndex(lContainer);
14583
- // remove extra views at the end of the container
14584
- while (nextIndex < lContainer.length - CONTAINER_HEADER_OFFSET) {
14585
- removeView(lContainer, nextIndex);
14586
- }
14587
- }
14588
- function containerInternal(tView, lView, nodeIndex, tagName, attrs) {
14589
- ngDevMode &&
14590
- assertEqual(getBindingIndex(), tView.bindingStartIndex, 'container nodes should be created before any bindings');
14591
- var adjustedIndex = nodeIndex + HEADER_OFFSET;
14592
- ngDevMode && assertDataInRange(lView, nodeIndex + HEADER_OFFSET);
14593
- ngDevMode && ngDevMode.rendererCreateComment++;
14594
- var comment = lView[adjustedIndex] =
14595
- lView[RENDERER].createComment(ngDevMode ? 'container' : '');
14596
- var tNode = getOrCreateTNode(tView, lView[T_HOST], nodeIndex, 0 /* Container */, tagName, attrs);
14597
- var lContainer = lView[adjustedIndex] = createLContainer(comment, lView, comment, tNode);
14598
- appendChild(tView, lView, comment, tNode);
14599
- attachPatchData(comment, lView);
14600
- // Containers are added to the current view tree instead of their embedded views
14601
- // because views can be removed and re-inserted.
14602
- addToViewTree(lView, lContainer);
14603
- ngDevMode && assertNodeType(getPreviousOrParentTNode(), 0 /* Container */);
14604
- return tNode;
14605
- }
14606
14495
 
14607
14496
  /**
14608
14497
  * @license
@@ -14741,8 +14630,11 @@
14741
14630
  var tNode = getOrCreateTNode(tView, lView[T_HOST], index, 3 /* Element */, name, attrs);
14742
14631
  var hasDirectives = resolveDirectives(tView, lView, tNode, getConstant(tViewConsts, localRefsIndex));
14743
14632
  ngDevMode && warnAboutUnknownElement(tView, lView, native, tNode, hasDirectives);
14633
+ if (tNode.attrs !== null) {
14634
+ computeStaticStyling(tNode, tNode.attrs, false);
14635
+ }
14744
14636
  if (tNode.mergedAttrs !== null) {
14745
- computeStaticStyling(tNode, tNode.mergedAttrs);
14637
+ computeStaticStyling(tNode, tNode.mergedAttrs, true);
14746
14638
  }
14747
14639
  if (tView.queries !== null) {
14748
14640
  tView.queries.elementStart(tView, tNode);
@@ -14831,11 +14723,11 @@
14831
14723
  tView.queries.elementEnd(previousOrParentTNode);
14832
14724
  }
14833
14725
  }
14834
- if (tNode.classes !== null && hasClassInput(tNode)) {
14835
- setDirectiveInputsWhichShadowsStyling(tView, tNode, getLView(), tNode.classes, true);
14726
+ if (tNode.classesWithoutHost != null && hasClassInput(tNode)) {
14727
+ setDirectiveInputsWhichShadowsStyling(tView, tNode, getLView(), tNode.classesWithoutHost, true);
14836
14728
  }
14837
- if (tNode.styles !== null && hasStyleInput(tNode)) {
14838
- setDirectiveInputsWhichShadowsStyling(tView, tNode, getLView(), tNode.styles, false);
14729
+ if (tNode.stylesWithoutHost != null && hasStyleInput(tNode)) {
14730
+ setDirectiveInputsWhichShadowsStyling(tView, tNode, getLView(), tNode.stylesWithoutHost, false);
14839
14731
  }
14840
14732
  }
14841
14733
  /**
@@ -14903,7 +14795,7 @@
14903
14795
  // While ng-container doesn't necessarily support styling, we use the style context to identify
14904
14796
  // and execute directives on the ng-container.
14905
14797
  if (attrs !== null) {
14906
- computeStaticStyling(tNode, attrs);
14798
+ computeStaticStyling(tNode, attrs, true);
14907
14799
  }
14908
14800
  var localRefs = getConstant(tViewConsts, localRefsIndex);
14909
14801
  resolveDirectives(tView, lView, tNode, localRefs);
@@ -14989,124 +14881,6 @@
14989
14881
  ɵɵelementContainerEnd();
14990
14882
  }
14991
14883
 
14992
- /**
14993
- * @license
14994
- * Copyright Google Inc. All Rights Reserved.
14995
- *
14996
- * Use of this source code is governed by an MIT-style license that can be
14997
- * found in the LICENSE file at https://angular.io/license
14998
- */
14999
- /**
15000
- * Marks the start of an embedded view.
15001
- *
15002
- * @param viewBlockId The ID of this view
15003
- * @return boolean Whether or not this view is in creation mode
15004
- *
15005
- * @codeGenApi
15006
- */
15007
- function ɵɵembeddedViewStart(viewBlockId, decls, vars) {
15008
- var lView = getLView();
15009
- var previousOrParentTNode = getPreviousOrParentTNode();
15010
- // The previous node can be a view node if we are processing an inline for loop
15011
- var containerTNode = previousOrParentTNode.type === 2 /* View */ ?
15012
- previousOrParentTNode.parent :
15013
- previousOrParentTNode;
15014
- var lContainer = lView[containerTNode.index];
15015
- ngDevMode && assertNodeType(containerTNode, 0 /* Container */);
15016
- var viewToRender = scanForView(lContainer, getLContainerActiveIndex(lContainer), viewBlockId);
15017
- if (viewToRender) {
15018
- setIsParent();
15019
- enterView(viewToRender, viewToRender[TVIEW].node);
15020
- }
15021
- else {
15022
- // When we create a new LView, we always reset the state of the instructions.
15023
- viewToRender = createLView(lView, getOrCreateEmbeddedTView(viewBlockId, decls, vars, containerTNode), null, 16 /* CheckAlways */, null, null);
15024
- var tParentNode = getIsParent() ? previousOrParentTNode :
15025
- previousOrParentTNode && previousOrParentTNode.parent;
15026
- assignTViewNodeToLView(viewToRender[TVIEW], tParentNode, viewBlockId, viewToRender);
15027
- enterView(viewToRender, viewToRender[TVIEW].node);
15028
- }
15029
- if (lContainer) {
15030
- if (isCreationMode(viewToRender)) {
15031
- // it is a new view, insert it into collection of views for a given container
15032
- insertView(viewToRender[TVIEW], viewToRender, lContainer, getLContainerActiveIndex(lContainer));
15033
- }
15034
- lContainer[ACTIVE_INDEX] += 2 /* INCREMENT */;
15035
- }
15036
- return isCreationMode(viewToRender) ? 1 /* Create */ | 2 /* Update */ :
15037
- 2 /* Update */;
15038
- }
15039
- /**
15040
- * Initialize the TView (e.g. static data) for the active embedded view.
15041
- *
15042
- * Each embedded view block must create or retrieve its own TView. Otherwise, the embedded view's
15043
- * static data for a particular node would overwrite the static data for a node in the view above
15044
- * it with the same index (since it's in the same template).
15045
- *
15046
- * @param viewIndex The index of the TView in TNode.tViews
15047
- * @param decls The number of nodes, local refs, and pipes in this template
15048
- * @param vars The number of bindings and pure function bindings in this template
15049
- * @param container The parent container in which to look for the view's static data
15050
- * @returns TView
15051
- */
15052
- function getOrCreateEmbeddedTView(viewIndex, decls, vars, parent) {
15053
- var tView = getLView()[TVIEW];
15054
- ngDevMode && assertNodeType(parent, 0 /* Container */);
15055
- var containerTViews = parent.tViews;
15056
- ngDevMode && assertDefined(containerTViews, 'TView expected');
15057
- ngDevMode && assertEqual(Array.isArray(containerTViews), true, 'TViews should be in an array');
15058
- if (viewIndex >= containerTViews.length || containerTViews[viewIndex] == null) {
15059
- containerTViews[viewIndex] = createTView(2 /* Embedded */, viewIndex, null, decls, vars, tView.directiveRegistry, tView.pipeRegistry, null, null, tView.consts);
15060
- }
15061
- return containerTViews[viewIndex];
15062
- }
15063
- /**
15064
- * Looks for a view with a given view block id inside a provided LContainer.
15065
- * Removes views that need to be deleted in the process.
15066
- *
15067
- * @param lContainer to search for views
15068
- * @param startIdx starting index in the views array to search from
15069
- * @param viewBlockId exact view block id to look for
15070
- */
15071
- function scanForView(lContainer, startIdx, viewBlockId) {
15072
- for (var i = startIdx + CONTAINER_HEADER_OFFSET; i < lContainer.length; i++) {
15073
- var viewAtPositionId = lContainer[i][TVIEW].id;
15074
- if (viewAtPositionId === viewBlockId) {
15075
- return lContainer[i];
15076
- }
15077
- else if (viewAtPositionId < viewBlockId) {
15078
- // found a view that should not be at this position - remove
15079
- removeView(lContainer, i - CONTAINER_HEADER_OFFSET);
15080
- }
15081
- else {
15082
- // found a view with id greater than the one we are searching for
15083
- // which means that required view doesn't exist and can't be found at
15084
- // later positions in the views array - stop the searchdef.cont here
15085
- break;
15086
- }
15087
- }
15088
- return null;
15089
- }
15090
- /**
15091
- * Marks the end of an embedded view.
15092
- *
15093
- * @codeGenApi
15094
- */
15095
- function ɵɵembeddedViewEnd() {
15096
- var lView = getLView();
15097
- var tView = getTView();
15098
- var viewHost = lView[T_HOST];
15099
- var context = lView[CONTEXT];
15100
- if (isCreationMode(lView)) {
15101
- renderView(tView, lView, context); // creation mode pass
15102
- }
15103
- refreshView(tView, lView, tView.template, context); // update mode pass
15104
- var lContainer = lView[PARENT];
15105
- ngDevMode && assertLContainerOrUndefined(lContainer);
15106
- leaveView();
15107
- setPreviousOrParentTNode(viewHost, false);
15108
- }
15109
-
15110
14884
  /**
15111
14885
  * Returns the current OpaqueViewState instance.
15112
14886
  *
@@ -16904,7 +16678,7 @@
16904
16678
  // the binding has removed it. This would confuse `[ngStyle]`/`[ngClass]` to do the wrong
16905
16679
  // thing as it would think that the static portion was removed. For this reason we
16906
16680
  // concatenate it so that `[ngStyle]`/`[ngClass]` can continue to work on changed.
16907
- var staticPrefix = isClassBased ? tNode.classes : tNode.styles;
16681
+ var staticPrefix = isClassBased ? tNode.classesWithoutHost : tNode.stylesWithoutHost;
16908
16682
  ngDevMode && isClassBased === false && staticPrefix !== null &&
16909
16683
  assertEqual(staticPrefix.endsWith(';'), true, 'Expecting static portion to end with \';\'');
16910
16684
  if (staticPrefix !== null) {
@@ -19409,7 +19183,7 @@
19409
19183
  var tNode = getOrCreateTNode(tView, null, 0, 3 /* Element */, null, null);
19410
19184
  var mergedAttrs = tNode.mergedAttrs = def.hostAttrs;
19411
19185
  if (mergedAttrs !== null) {
19412
- computeStaticStyling(tNode, mergedAttrs);
19186
+ computeStaticStyling(tNode, mergedAttrs, true);
19413
19187
  if (rNode !== null) {
19414
19188
  setUpAttributes(hostRenderer, rNode, mergedAttrs);
19415
19189
  if (tNode.classes !== null) {
@@ -20445,7 +20219,7 @@
20445
20219
  /**
20446
20220
  * @publicApi
20447
20221
  */
20448
- var VERSION = new Version('9.1.5');
20222
+ var VERSION = new Version('9.1.9');
20449
20223
 
20450
20224
  /**
20451
20225
  * @license
@@ -23571,7 +23345,8 @@
23571
23345
  if (!rootSelectorOrNode || isIsolated) {
23572
23346
  // The host element of the internal or isolated root view is attached to the component's host
23573
23347
  // view node.
23574
- componentRef.hostView._tViewNode.child = tElementNode;
23348
+ ngDevMode && assertNodeOfPossibleTypes(rootTView.node, 2 /* View */);
23349
+ rootTView.node.child = tElementNode;
23575
23350
  }
23576
23351
  return componentRef;
23577
23352
  };
@@ -23606,7 +23381,7 @@
23606
23381
  _this.destroyCbs = [];
23607
23382
  _this.instance = instance;
23608
23383
  _this.hostView = _this.changeDetectorRef = new RootViewRef(_rootLView);
23609
- _this.hostView._tViewNode = assignTViewNodeToLView(_rootLView[TVIEW], null, -1, _rootLView);
23384
+ assignTViewNodeToLView(_rootLView[TVIEW], null, -1, _rootLView);
23610
23385
  _this.componentType = componentType;
23611
23386
  return _this;
23612
23387
  }
@@ -26677,10 +26452,7 @@
26677
26452
  'ɵɵProvidersFeature': ɵɵProvidersFeature,
26678
26453
  'ɵɵCopyDefinitionFeature': ɵɵCopyDefinitionFeature,
26679
26454
  'ɵɵInheritDefinitionFeature': ɵɵInheritDefinitionFeature,
26680
- 'ɵɵcontainer': ɵɵcontainer,
26681
26455
  'ɵɵnextContext': ɵɵnextContext,
26682
- 'ɵɵcontainerRefreshStart': ɵɵcontainerRefreshStart,
26683
- 'ɵɵcontainerRefreshEnd': ɵɵcontainerRefreshEnd,
26684
26456
  'ɵɵnamespaceHTML': ɵɵnamespaceHTML,
26685
26457
  'ɵɵnamespaceMathML': ɵɵnamespaceMathML,
26686
26458
  'ɵɵnamespaceSVG': ɵɵnamespaceSVG,
@@ -26780,8 +26552,6 @@
26780
26552
  'ɵɵtextInterpolate7': ɵɵtextInterpolate7,
26781
26553
  'ɵɵtextInterpolate8': ɵɵtextInterpolate8,
26782
26554
  'ɵɵtextInterpolateV': ɵɵtextInterpolateV,
26783
- 'ɵɵembeddedViewStart': ɵɵembeddedViewStart,
26784
- 'ɵɵembeddedViewEnd': ɵɵembeddedViewEnd,
26785
26555
  'ɵɵi18n': ɵɵi18n,
26786
26556
  'ɵɵi18nAttributes': ɵɵi18nAttributes,
26787
26557
  'ɵɵi18nExp': ɵɵi18nExp,
@@ -33329,9 +33099,6 @@
33329
33099
  exports.ɵɵclassMapInterpolateV = ɵɵclassMapInterpolateV;
33330
33100
  exports.ɵɵclassProp = ɵɵclassProp;
33331
33101
  exports.ɵɵcomponentHostSyntheticListener = ɵɵcomponentHostSyntheticListener;
33332
- exports.ɵɵcontainer = ɵɵcontainer;
33333
- exports.ɵɵcontainerRefreshEnd = ɵɵcontainerRefreshEnd;
33334
- exports.ɵɵcontainerRefreshStart = ɵɵcontainerRefreshStart;
33335
33102
  exports.ɵɵcontentQuery = ɵɵcontentQuery;
33336
33103
  exports.ɵɵdefaultStyleSanitizer = ɵɵdefaultStyleSanitizer;
33337
33104
  exports.ɵɵdefineComponent = ɵɵdefineComponent;
@@ -33348,8 +33115,6 @@
33348
33115
  exports.ɵɵelementContainerStart = ɵɵelementContainerStart;
33349
33116
  exports.ɵɵelementEnd = ɵɵelementEnd;
33350
33117
  exports.ɵɵelementStart = ɵɵelementStart;
33351
- exports.ɵɵembeddedViewEnd = ɵɵembeddedViewEnd;
33352
- exports.ɵɵembeddedViewStart = ɵɵembeddedViewStart;
33353
33118
  exports.ɵɵenableBindings = ɵɵenableBindings;
33354
33119
  exports.ɵɵgetCurrentView = ɵɵgetCurrentView;
33355
33120
  exports.ɵɵgetFactoryOf = ɵɵgetFactoryOf;