ng-virtual-list 15.0.19 → 15.0.21
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/README.md +2 -0
- package/esm2020/lib/ng-virtual-list.component.mjs +4 -1
- package/esm2020/lib/utils/trackBox.mjs +10 -10
- package/fesm2015/ng-virtual-list.mjs +12 -9
- package/fesm2015/ng-virtual-list.mjs.map +1 -1
- package/fesm2020/ng-virtual-list.mjs +12 -9
- package/fesm2020/ng-virtual-list.mjs.map +1 -1
- package/lib/ng-virtual-list.component.d.ts +3 -0
- package/package.json +1 -1
|
@@ -856,8 +856,8 @@ class TrackBox extends CacheMap {
|
|
|
856
856
|
}
|
|
857
857
|
}
|
|
858
858
|
}
|
|
859
|
-
if (
|
|
860
|
-
const bounds =
|
|
859
|
+
if (deletedItemsMap.hasOwnProperty(i)) {
|
|
860
|
+
const bounds = deletedItemsMap[i], size = bounds[sizeProperty] ?? typicalItemSize;
|
|
861
861
|
if (y < scrollSize - size) {
|
|
862
862
|
leftSizeOfDeletedItems += size;
|
|
863
863
|
}
|
|
@@ -899,7 +899,7 @@ class TrackBox extends CacheMap {
|
|
|
899
899
|
}
|
|
900
900
|
}
|
|
901
901
|
}
|
|
902
|
-
else if (y
|
|
902
|
+
else if (y <= scrollSize - componentSize) {
|
|
903
903
|
leftItemsWeights.push(componentSize);
|
|
904
904
|
leftHiddenItemsWeight += componentSize;
|
|
905
905
|
itemsFromStartToScrollEnd = ii;
|
|
@@ -915,7 +915,7 @@ class TrackBox extends CacheMap {
|
|
|
915
915
|
itemsFromStartToDisplayEnd = ii;
|
|
916
916
|
totalItemsToDisplayEndWeight += componentSize;
|
|
917
917
|
itemsFromDisplayEndToOffsetEnd = itemsFromStartToDisplayEnd + rightItemsOffset;
|
|
918
|
-
if (y
|
|
918
|
+
if (y <= scrollSize - componentSize) {
|
|
919
919
|
switch (itemDisplayMethod) {
|
|
920
920
|
case ItemDisplayMethods.CREATE: {
|
|
921
921
|
leftSizeOfAddedItems += componentSizeDelta;
|
|
@@ -975,8 +975,8 @@ class TrackBox extends CacheMap {
|
|
|
975
975
|
map.set(id, { ...bounds, method: ItemDisplayMethods.NOT_CHANGED });
|
|
976
976
|
}
|
|
977
977
|
}
|
|
978
|
-
if (
|
|
979
|
-
const bounds =
|
|
978
|
+
if (deletedItemsMap.hasOwnProperty(i)) {
|
|
979
|
+
const bounds = deletedItemsMap[i], size = bounds[sizeProperty] ?? typicalItemSize;
|
|
980
980
|
if (y < scrollSize - size) {
|
|
981
981
|
leftSizeOfDeletedItems += size;
|
|
982
982
|
}
|
|
@@ -1006,9 +1006,9 @@ class TrackBox extends CacheMap {
|
|
|
1006
1006
|
rightItemLength = itemsFromStartToDisplayEnd + itemsOffset > totalLength
|
|
1007
1007
|
? totalLength - itemsFromStartToDisplayEnd : itemsOffset;
|
|
1008
1008
|
leftItemsWeight = leftItemLength * typicalItemSize;
|
|
1009
|
-
rightItemsWeight = rightItemLength * typicalItemSize
|
|
1010
|
-
|
|
1011
|
-
|
|
1009
|
+
rightItemsWeight = rightItemLength * typicalItemSize;
|
|
1010
|
+
leftHiddenItemsWeight = itemsFromStartToScrollEnd * typicalItemSize;
|
|
1011
|
+
totalItemsToDisplayEndWeight = itemsFromStartToDisplayEnd * typicalItemSize;
|
|
1012
1012
|
totalSize = totalLength * typicalItemSize;
|
|
1013
1013
|
const k = totalSize !== 0 ? previousTotalSize / totalSize : 0;
|
|
1014
1014
|
actualScrollSize = scrollSize * k;
|
|
@@ -1663,6 +1663,9 @@ class NgVirtualListComponent extends DisposableComponent {
|
|
|
1663
1663
|
}
|
|
1664
1664
|
}
|
|
1665
1665
|
}
|
|
1666
|
+
/**
|
|
1667
|
+
* Scrolls the scroll area to the desired element with the specified ID.
|
|
1668
|
+
*/
|
|
1666
1669
|
scrollToEnd(behavior = BEHAVIOR_INSTANT) {
|
|
1667
1670
|
const items = this.items, latItem = items[items.length > 0 ? items.length - 1 : 0];
|
|
1668
1671
|
this.scrollTo(latItem.id, behavior);
|