@angular/core 11.1.2 → 11.2.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.
- package/bundles/core-testing.umd.js +1 -1
- package/bundles/core-testing.umd.min.js +1 -1
- package/bundles/core-testing.umd.min.js.map +1 -1
- package/bundles/core.umd.js +42 -27
- package/bundles/core.umd.js.map +1 -1
- package/bundles/core.umd.min.js +98 -98
- package/bundles/core.umd.min.js.map +1 -1
- package/core.d.ts +1 -1
- package/core.metadata.json +1 -1
- package/esm2015/src/change_detection/differs/default_iterable_differ.js +12 -11
- package/esm2015/src/render3/assert.js +10 -2
- package/esm2015/src/render3/collect_native_nodes.js +7 -12
- package/esm2015/src/render3/node_manipulation.js +20 -8
- package/esm2015/src/version.js +1 -1
- package/fesm2015/core.js +42 -27
- package/fesm2015/core.js.map +1 -1
- package/fesm2015/testing.js +1 -1
- package/package.json +1 -1
- package/src/r3_symbols.d.ts +1 -1
- package/testing/testing.d.ts +1 -1
- package/testing.d.ts +1 -1
package/fesm2015/core.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v11.
|
|
2
|
+
* @license Angular v11.2.0
|
|
3
3
|
* (c) 2010-2020 Google LLC. https://angular.io/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
@@ -1256,6 +1256,14 @@ function assertBetween(lower, upper, index) {
|
|
|
1256
1256
|
throwError(`Index out of range (expecting ${lower} <= ${index} < ${upper})`);
|
|
1257
1257
|
}
|
|
1258
1258
|
}
|
|
1259
|
+
function assertProjectionSlots(lView, errMessage) {
|
|
1260
|
+
assertDefined(lView[DECLARATION_COMPONENT_VIEW], 'Component views should exist.');
|
|
1261
|
+
assertDefined(lView[DECLARATION_COMPONENT_VIEW][T_HOST].projection, errMessage ||
|
|
1262
|
+
'Components with projection nodes (<ng-content>) must have projection slots defined.');
|
|
1263
|
+
}
|
|
1264
|
+
function assertParentView(lView, errMessage) {
|
|
1265
|
+
assertDefined(lView, errMessage || 'Component views should always have a parent view (component\'s host view)');
|
|
1266
|
+
}
|
|
1259
1267
|
/**
|
|
1260
1268
|
* This is a basic sanity check that the `injectorIndex` seems to point to what looks like a
|
|
1261
1269
|
* NodeInjector data structure.
|
|
@@ -7572,12 +7580,14 @@ function getFirstNativeNode(lView, tNode) {
|
|
|
7572
7580
|
return rNode || unwrapRNode(lView[tNode.index]);
|
|
7573
7581
|
}
|
|
7574
7582
|
else {
|
|
7575
|
-
const
|
|
7576
|
-
|
|
7577
|
-
|
|
7578
|
-
|
|
7579
|
-
|
|
7580
|
-
|
|
7583
|
+
const projectionNodes = getProjectionNodes(lView, tNode);
|
|
7584
|
+
if (projectionNodes !== null) {
|
|
7585
|
+
if (Array.isArray(projectionNodes)) {
|
|
7586
|
+
return projectionNodes[0];
|
|
7587
|
+
}
|
|
7588
|
+
const parentView = getLViewParent(lView[DECLARATION_COMPONENT_VIEW]);
|
|
7589
|
+
ngDevMode && assertParentView(parentView);
|
|
7590
|
+
return getFirstNativeNode(parentView, projectionNodes);
|
|
7581
7591
|
}
|
|
7582
7592
|
else {
|
|
7583
7593
|
return getFirstNativeNode(lView, tNode.next);
|
|
@@ -7586,6 +7596,16 @@ function getFirstNativeNode(lView, tNode) {
|
|
|
7586
7596
|
}
|
|
7587
7597
|
return null;
|
|
7588
7598
|
}
|
|
7599
|
+
function getProjectionNodes(lView, tNode) {
|
|
7600
|
+
if (tNode !== null) {
|
|
7601
|
+
const componentView = lView[DECLARATION_COMPONENT_VIEW];
|
|
7602
|
+
const componentHost = componentView[T_HOST];
|
|
7603
|
+
const slotIdx = tNode.projection;
|
|
7604
|
+
ngDevMode && assertProjectionSlots(lView);
|
|
7605
|
+
return componentHost.projection[slotIdx];
|
|
7606
|
+
}
|
|
7607
|
+
return null;
|
|
7608
|
+
}
|
|
7589
7609
|
function getBeforeNodeForView(viewIndexInContainer, lContainer) {
|
|
7590
7610
|
const nextViewIndex = CONTAINER_HEADER_OFFSET + viewIndexInContainer + 1;
|
|
7591
7611
|
if (nextViewIndex < lContainer.length) {
|
|
@@ -21369,7 +21389,7 @@ class Version {
|
|
|
21369
21389
|
/**
|
|
21370
21390
|
* @publicApi
|
|
21371
21391
|
*/
|
|
21372
|
-
const VERSION = new Version('11.
|
|
21392
|
+
const VERSION = new Version('11.2.0');
|
|
21373
21393
|
|
|
21374
21394
|
/**
|
|
21375
21395
|
* @license
|
|
@@ -21622,24 +21642,25 @@ class DefaultIterableDiffer {
|
|
|
21622
21642
|
// Remove the record from the collection since we know it does not match the item.
|
|
21623
21643
|
this._remove(record);
|
|
21624
21644
|
}
|
|
21625
|
-
//
|
|
21626
|
-
record = this.
|
|
21645
|
+
// See if we have evicted the item, which used to be at some anterior position of _itHead list.
|
|
21646
|
+
record = this._unlinkedRecords === null ? null : this._unlinkedRecords.get(itemTrackBy, null);
|
|
21627
21647
|
if (record !== null) {
|
|
21628
|
-
//
|
|
21629
|
-
// But first we need to check if identity changed, so we can update in view if necessary
|
|
21648
|
+
// It is an item which we have evicted earlier: reinsert it back into the list.
|
|
21649
|
+
// But first we need to check if identity changed, so we can update in view if necessary.
|
|
21630
21650
|
if (!Object.is(record.item, item))
|
|
21631
21651
|
this._addIdentityChange(record, item);
|
|
21632
|
-
this.
|
|
21652
|
+
this._reinsertAfter(record, previousRecord, index);
|
|
21633
21653
|
}
|
|
21634
21654
|
else {
|
|
21635
|
-
//
|
|
21636
|
-
record = this.
|
|
21655
|
+
// Attempt to see if the item is at some posterior position of _itHead list.
|
|
21656
|
+
record = this._linkedRecords === null ? null : this._linkedRecords.get(itemTrackBy, index);
|
|
21637
21657
|
if (record !== null) {
|
|
21638
|
-
//
|
|
21639
|
-
//
|
|
21658
|
+
// We have the item in _itHead at/after `index` position. We need to move it forward in the
|
|
21659
|
+
// collection.
|
|
21660
|
+
// But first we need to check if identity changed, so we can update in view if necessary.
|
|
21640
21661
|
if (!Object.is(record.item, item))
|
|
21641
21662
|
this._addIdentityChange(record, item);
|
|
21642
|
-
this.
|
|
21663
|
+
this._moveAfter(record, previousRecord, index);
|
|
21643
21664
|
}
|
|
21644
21665
|
else {
|
|
21645
21666
|
// It is a new item: add it.
|
|
@@ -22470,19 +22491,13 @@ function collectNativeNodes(tView, lView, tNode, result, isProjection = false) {
|
|
|
22470
22491
|
}
|
|
22471
22492
|
}
|
|
22472
22493
|
else if (tNodeType & 16 /* Projection */) {
|
|
22473
|
-
const
|
|
22474
|
-
const componentHost = componentView[T_HOST];
|
|
22475
|
-
const slotIdx = tNode.projection;
|
|
22476
|
-
ngDevMode &&
|
|
22477
|
-
assertDefined(componentHost.projection, 'Components with projection nodes (<ng-content>) must have projection slots defined.');
|
|
22478
|
-
const nodesInSlot = componentHost.projection[slotIdx];
|
|
22494
|
+
const nodesInSlot = getProjectionNodes(lView, tNode);
|
|
22479
22495
|
if (Array.isArray(nodesInSlot)) {
|
|
22480
22496
|
result.push(...nodesInSlot);
|
|
22481
22497
|
}
|
|
22482
22498
|
else {
|
|
22483
|
-
const parentView = getLViewParent(
|
|
22484
|
-
ngDevMode &&
|
|
22485
|
-
assertDefined(parentView, 'Component views should always have a parent view (component\'s host view)');
|
|
22499
|
+
const parentView = getLViewParent(lView[DECLARATION_COMPONENT_VIEW]);
|
|
22500
|
+
ngDevMode && assertParentView(parentView);
|
|
22486
22501
|
collectNativeNodes(parentView[TVIEW], parentView, nodesInSlot, result, true);
|
|
22487
22502
|
}
|
|
22488
22503
|
}
|