ng-virtual-list 21.9.2 → 21.9.4

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 CHANGED
@@ -776,13 +776,13 @@ Properties
776
776
 
777
777
  | Angular version | ng-virtual-list version | git | npm |
778
778
  |--|--|--|--|
779
- | 20.x | 20.9.2 | [20.x](https://github.com/DjonnyX/ng-virtual-list/tree/20.x) | [20.9.2](https://www.npmjs.com/package/ng-virtual-list/v/20.9.2) |
780
- | 19.x | 19.9.4 | [19.x](https://github.com/DjonnyX/ng-virtual-list/tree/19.x) | [19.9.4](https://www.npmjs.com/package/ng-virtual-list/v/19.9.4) |
781
- | 18.x | 18.9.2 | [18.x](https://github.com/DjonnyX/ng-virtual-list/tree/18.x) | [18.9.2](https://www.npmjs.com/package/ng-virtual-list/v/18.9.2) |
782
- | 17.x | 17.9.2 | [17.x](https://github.com/DjonnyX/ng-virtual-list/tree/17.x) | [17.9.2](https://www.npmjs.com/package/ng-virtual-list/v/17.9.2) |
783
- | 16.x | 16.9.2 | [16.x](https://github.com/DjonnyX/ng-virtual-list/tree/16.x) | [16.9.2](https://www.npmjs.com/package/ng-virtual-list/v/16.9.2) |
784
- | 15.x | 15.9.2 | [15.x](https://github.com/DjonnyX/ng-virtual-list/tree/15.x) | [15.9.2](https://www.npmjs.com/package/ng-virtual-list/v/15.9.2) |
785
- | 14.x | 14.9.2 | [14.x](https://github.com/DjonnyX/ng-virtual-list/tree/14.x) | [14.9.2](https://www.npmjs.com/package/ng-virtual-list/v/14.9.2) |
779
+ | 20.x | 20.9.3 | [20.x](https://github.com/DjonnyX/ng-virtual-list/tree/20.x) | [20.9.3](https://www.npmjs.com/package/ng-virtual-list/v/20.9.3) |
780
+ | 19.x | 19.9.5 | [19.x](https://github.com/DjonnyX/ng-virtual-list/tree/19.x) | [19.9.5](https://www.npmjs.com/package/ng-virtual-list/v/19.9.5) |
781
+ | 18.x | 18.9.3 | [18.x](https://github.com/DjonnyX/ng-virtual-list/tree/18.x) | [18.9.3](https://www.npmjs.com/package/ng-virtual-list/v/18.9.3) |
782
+ | 17.x | 17.9.3 | [17.x](https://github.com/DjonnyX/ng-virtual-list/tree/17.x) | [17.9.3](https://www.npmjs.com/package/ng-virtual-list/v/17.9.3) |
783
+ | 16.x | 16.9.4 | [16.x](https://github.com/DjonnyX/ng-virtual-list/tree/16.x) | [16.9.4](https://www.npmjs.com/package/ng-virtual-list/v/16.9.4) |
784
+ | 15.x | 15.9.4 | [15.x](https://github.com/DjonnyX/ng-virtual-list/tree/15.x) | [15.9.4](https://www.npmjs.com/package/ng-virtual-list/v/15.9.4) |
785
+ | 14.x | 14.9.4 | [14.x](https://github.com/DjonnyX/ng-virtual-list/tree/14.x) | [14.9.4](https://www.npmjs.com/package/ng-virtual-list/v/14.9.4) |
786
786
 
787
787
  <br/>
788
788
 
@@ -599,7 +599,6 @@ class NgVirtualListItemComponent extends BaseVirtualListItemComponent {
599
599
  config = signal({}, ...(ngDevMode ? [{ debugName: "config" }] : []));
600
600
  measures = signal(undefined, ...(ngDevMode ? [{ debugName: "measures" }] : []));
601
601
  focused = signal(false, ...(ngDevMode ? [{ debugName: "focused" }] : []));
602
- reseted = signal(false, ...(ngDevMode ? [{ debugName: "reseted" }] : []));
603
602
  part = signal(PART_DEFAULT_ITEM, ...(ngDevMode ? [{ debugName: "part" }] : []));
604
603
  maxClickDistance = signal(DEFAULT_CLICK_DISTANCE, ...(ngDevMode ? [{ debugName: "maxClickDistance" }] : []));
605
604
  data = signal(undefined, ...(ngDevMode ? [{ debugName: "data" }] : []));
@@ -683,7 +682,10 @@ class NgVirtualListItemComponent extends BaseVirtualListItemComponent {
683
682
  })).subscribe();
684
683
  this.classes = computed(() => {
685
684
  const data = this.data(), focused = this.focused();
686
- return { [CLASS_NAME_SNAPPED]: data?.config?.snapped ?? false, [CLASS_NAME_SNAPPED_OUT]: data?.config?.snappedOut ?? false, [CLASS_NAME_FOCUS]: focused };
685
+ return {
686
+ [CLASS_NAME_SNAPPED]: data?.config?.snapped ?? false, [CLASS_NAME_SNAPPED_OUT]: data?.config?.snappedOut ?? false,
687
+ [CLASS_NAME_FOCUS]: focused,
688
+ };
687
689
  }, ...(ngDevMode ? [{ debugName: "classes" }] : []));
688
690
  this.index = computed(() => {
689
691
  return this.config()?.tabIndex ?? -1;
@@ -692,7 +694,7 @@ class NgVirtualListItemComponent extends BaseVirtualListItemComponent {
692
694
  const data = this.data(), measures = this.measures(), config = this.config();
693
695
  return {
694
696
  data: data?.data, prevData: data?.previouseData, nextData: data?.nextData, measures,
695
- config, reseted: this.reseted(), index: data?.index ?? -1
697
+ config, reseted: false, index: data?.index ?? -1
696
698
  };
697
699
  }, ...(ngDevMode ? [{ debugName: "templateContext" }] : []));
698
700
  const $data = toObservable(this.data), $focused = toObservable(this.focused);
@@ -874,7 +876,6 @@ class NgVirtualListItemComponent extends BaseVirtualListItemComponent {
874
876
  return { width: width > 0 ? width : 1, height: height > 0 ? height : 1, };
875
877
  }
876
878
  show() {
877
- this.reseted.set(false);
878
879
  const el = this._elementRef.nativeElement, styles = el.style;
879
880
  styles.zIndex = this._data?.config?.zIndex ?? DEFAULT_ZINDEX;
880
881
  if (this.regular) {
@@ -891,7 +892,6 @@ class NgVirtualListItemComponent extends BaseVirtualListItemComponent {
891
892
  }
892
893
  }
893
894
  hide() {
894
- this.reseted.set(true);
895
895
  const el = this._elementRef.nativeElement, styles = el.style;
896
896
  styles.position = POSITION_ABSOLUTE;
897
897
  styles.transform = `${TRANSLATE_3D$1}(${this._data?.config?.isVertical ? 0 : ZEROS_POSITION},${this._data?.config?.isVertical ? 0 : ZEROS_POSITION},0)`;
@@ -1902,7 +1902,7 @@ class TrackBox extends CacheMap {
1902
1902
  * Calculates list metrics
1903
1903
  */
1904
1904
  recalculateMetrics(options) {
1905
- const { fromItemId, bounds, collection, dynamicSize, isVertical, itemSize, reversed, bufferSize: minBufferSize, scrollSize, snap, itemConfigMap, enabledBufferOptimization, previousTotalSize, crudDetected, deletedItemsMap } = options, roundedScrollSize = Math.round(scrollSize);
1905
+ const { fromItemId, bounds, collection, dynamicSize, isVertical, itemSize, bufferSize: minBufferSize, scrollSize, snap, itemConfigMap, enabledBufferOptimization, previousTotalSize, crudDetected, deletedItemsMap } = options, roundedScrollSize = Math.round(scrollSize);
1906
1906
  const trackBy = this._trackingPropertyName, bufferSize = Math.max(minBufferSize, this._bufferSize), { width, height } = bounds, sizeProperty = isVertical ? HEIGHT_PROP_NAME : WIDTH_PROP_NAME, size = isVertical ? height : width, totalLength = collection.length, typicalItemSize = itemSize, w = isVertical ? width : typicalItemSize, h = isVertical ? typicalItemSize : height, map = this._map, snapshot = this._snapshot, checkOverscrollItemsLimit = Math.ceil(typicalItemSize !== 0 ? size / typicalItemSize : 0), snippedPos = Math.floor(scrollSize) + this._scrollStartOffset, leftItemsWeights = [], isFromId = fromItemId !== undefined && (typeof fromItemId === 'number' && fromItemId > -1)
1907
1907
  || (typeof fromItemId === 'string' && fromItemId > '-1');
1908
1908
  let leftItemsOffset = 0, rightItemsOffset = 0;
@@ -2173,7 +2173,6 @@ class TrackBox extends CacheMap {
2173
2173
  totalSize,
2174
2174
  typicalItemSize,
2175
2175
  isFromItemIdFound,
2176
- reversed: options.reversed,
2177
2176
  isUpdating,
2178
2177
  };
2179
2178
  return metrics;
@@ -2191,7 +2190,7 @@ class TrackBox extends CacheMap {
2191
2190
  this.bumpVersion();
2192
2191
  }
2193
2192
  generateDisplayCollection(items, itemConfigMap, metrics) {
2194
- const { offsetY, offsetX, width, height, normalizedItemWidth, normalizedItemHeight, dynamicSize, itemsOnDisplayLength, itemsFromStartToScrollEnd, isVertical, renderItems: renderItemsLength, scrollSize, sizeProperty, snap, snippedPos, startPosition, totalLength, startIndex, typicalItemSize, reversed, } = metrics, displayItems = [];
2193
+ const { offsetY, offsetX, width, height, normalizedItemWidth, normalizedItemHeight, dynamicSize, itemsOnDisplayLength, itemsFromStartToScrollEnd, isVertical, renderItems: renderItemsLength, scrollSize, sizeProperty, snap, snippedPos, startPosition, totalLength, startIndex, typicalItemSize, } = metrics, displayItems = [];
2195
2194
  if (items.length) {
2196
2195
  const trackBy = this._trackingPropertyName, actualSnippedPosition = snippedPos, isSnappingMethodAdvanced = this.isSnappingMethodAdvanced, boundsSize = isVertical ? height : width, actualEndSnippedPosition = scrollSize + boundsSize - this._scrollEndOffset, positionOffset = isVertical ? offsetY : offsetX;
2197
2196
  let pos = startPosition, renderItems = renderItemsLength, stickyItem, nextSticky, stickyItemIndex = -1, stickyItemSize = 0, endStickyItem, nextEndSticky, endStickyItemIndex = -1, endStickyItemSize = 0, count = 1;
@@ -2307,7 +2306,7 @@ class TrackBox extends CacheMap {
2307
2306
  if (iterations > totalLength || i >= totalLength) {
2308
2307
  break;
2309
2308
  }
2310
- const collectionItem = items[reversed ? (items.length - i + 1) : i];
2309
+ const collectionItem = items[i];
2311
2310
  if (!collectionItem) {
2312
2311
  continue;
2313
2312
  }
@@ -3663,11 +3662,11 @@ class NgScrollerComponent {
3663
3662
  }
3664
3663
  }
3665
3664
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: NgScrollerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
3666
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.2.0", type: NgScrollerComponent, isStandalone: true, selector: "ng-scroller", inputs: { direction: { classPropertyName: "direction", publicName: "direction", isSignal: true, isRequired: false, transformFunction: null }, focusedElement: { classPropertyName: "focusedElement", publicName: "focusedElement", isSignal: true, isRequired: false, transformFunction: null }, content: { classPropertyName: "content", publicName: "content", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, classes: { classPropertyName: "classes", publicName: "classes", isSignal: true, isRequired: false, transformFunction: null }, startOffset: { classPropertyName: "startOffset", publicName: "startOffset", isSignal: true, isRequired: false, transformFunction: null }, endOffset: { classPropertyName: "endOffset", publicName: "endOffset", isSignal: true, isRequired: false, transformFunction: null }, scrollbarTheme: { classPropertyName: "scrollbarTheme", publicName: "scrollbarTheme", isSignal: true, isRequired: false, transformFunction: null }, scrollbarMinSize: { classPropertyName: "scrollbarMinSize", publicName: "scrollbarMinSize", isSignal: true, isRequired: false, transformFunction: null } }, viewQueries: [{ propertyName: "scrollContent", first: true, predicate: ["scrollContent"], descendants: true, isSignal: true }, { propertyName: "scrollViewport", first: true, predicate: ["scrollViewport"], descendants: true, isSignal: true }, { propertyName: "cdkScrollable", first: true, predicate: ["scrollViewport"], descendants: true, read: CdkScrollable }, { propertyName: "scrollBar", first: true, predicate: ["scrollBar"], descendants: true, read: NgScrollBarComponent }], ngImport: i0, template: "<div localeSensitive [langTextDir]=\"langTextDir()\" [listDir]=\"direction()\" class=\"ngvl__container\" [ngClass]=\"containerClasses()\">\r\n <div #scrollViewport cdkScrollable part=\"scroller\" class=\"ngvl__scroller\">\r\n <div #scrollContent [attr.aria-orientation]=\"direction()\" [attr.aria-activedescendant]=\"focusedElement()\"\r\n tabindex=\"0\" part=\"list\" class=\"ngvl__list\" [ngClass]=\"actualClasses()\">\r\n <ng-content></ng-content>\r\n </div>\r\n </div>\r\n <ng-scroll-bar #scrollBar [isVertical]=\"isVertical()\" [size]=\"thumbSize()\" [theme]=\"scrollbarTheme()\" [position]=\"thumbPosition()\"\r\n [thumbGradientPositions]=\"thumbGradientPositions()\" [loading]=\"loading()\" [prepared]=\"preparedSignal()\" [show]=\"thumbShow()\"\r\n (onDrag)=\"onScrollBarDragHandler($event)\"></ng-scroll-bar>\r\n</div>", styles: [":host{position:relative;overflow:hidden;-webkit-user-select:none;user-select:none}.ngvl__container{position:relative;overflow:hidden;display:grid;width:100%;height:100%;cursor:grab}.ngvl__container.grabbing{cursor:grabbing}.ngvl__container.horizontal{grid-template-rows:1fr auto}.ngvl__container.horizontal .ngvl__list{display:inline-flex}.ngvl__container.horizontal .ngvl__scroller{overflow:hidden}.ngvl__container.vertical{grid-template-columns:1fr auto}.ngvl__container.vertical .ngvl__scroller{overflow:hidden}.ngvl__scroller{display:block;position:relative;overflow:hidden;width:100%;height:100%}.ngvl__list{position:absolute;list-style:none;padding:0;margin:0;width:100%;height:100%;opacity:0}.ngvl__list.prepared{opacity:1;overflow:hidden}.ngvl__list.prepared.wait-for-preparation{transition:opacity .15s ease-out .1s}.ngvl__list.ready-to-start{transition:height .15s ease-out}.ngvl__list.ready-to-start.wait-for-preparation{transition:height .15s ease-out,opacity .15s ease-out .1s}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: CdkScrollable, selector: "[cdk-scrollable], [cdkScrollable]" }, { kind: "directive", type: LocaleSensitiveDirective, selector: "[localeSensitive]", inputs: ["langTextDir", "listDir"] }, { kind: "component", type: NgScrollBarComponent, selector: "ng-scroll-bar", inputs: ["loading", "isVertical", "position", "thumbGradientPositions", "size", "theme", "prepared", "show"], outputs: ["onDrag"] }] });
3665
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.2.0", type: NgScrollerComponent, isStandalone: true, selector: "ng-scroller", inputs: { direction: { classPropertyName: "direction", publicName: "direction", isSignal: true, isRequired: false, transformFunction: null }, focusedElement: { classPropertyName: "focusedElement", publicName: "focusedElement", isSignal: true, isRequired: false, transformFunction: null }, content: { classPropertyName: "content", publicName: "content", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, classes: { classPropertyName: "classes", publicName: "classes", isSignal: true, isRequired: false, transformFunction: null }, startOffset: { classPropertyName: "startOffset", publicName: "startOffset", isSignal: true, isRequired: false, transformFunction: null }, endOffset: { classPropertyName: "endOffset", publicName: "endOffset", isSignal: true, isRequired: false, transformFunction: null }, scrollbarTheme: { classPropertyName: "scrollbarTheme", publicName: "scrollbarTheme", isSignal: true, isRequired: false, transformFunction: null }, scrollbarMinSize: { classPropertyName: "scrollbarMinSize", publicName: "scrollbarMinSize", isSignal: true, isRequired: false, transformFunction: null } }, viewQueries: [{ propertyName: "scrollContent", first: true, predicate: ["scrollContent"], descendants: true, isSignal: true }, { propertyName: "scrollViewport", first: true, predicate: ["scrollViewport"], descendants: true, isSignal: true }, { propertyName: "cdkScrollable", first: true, predicate: ["scrollViewport"], descendants: true, read: CdkScrollable }, { propertyName: "scrollBar", first: true, predicate: ["scrollBar"], descendants: true, read: NgScrollBarComponent }], ngImport: i0, template: "<div localeSensitive [langTextDir]=\"langTextDir()\" [listDir]=\"direction()\" class=\"ngvl__container\" [ngClass]=\"containerClasses()\">\r\n <div #scrollViewport cdkScrollable part=\"scroller\" class=\"ngvl__scroller\">\r\n <div #scrollContent [attr.aria-orientation]=\"direction()\" [attr.aria-activedescendant]=\"focusedElement()\"\r\n tabindex=\"0\" part=\"list\" class=\"ngvl__list\" [ngClass]=\"actualClasses()\">\r\n <ng-content></ng-content>\r\n </div>\r\n </div>\r\n <ng-scroll-bar #scrollBar [isVertical]=\"isVertical()\" [size]=\"thumbSize()\" [theme]=\"scrollbarTheme()\" [position]=\"thumbPosition()\"\r\n [thumbGradientPositions]=\"thumbGradientPositions()\" [loading]=\"loading()\" [prepared]=\"preparedSignal()\" [show]=\"thumbShow()\"\r\n (onDrag)=\"onScrollBarDragHandler($event)\"></ng-scroll-bar>\r\n</div>", styles: [":host{position:relative;overflow:hidden;-webkit-user-select:none;user-select:none}.ngvl__container{position:relative;overflow:hidden;display:grid;width:100%;height:100%;cursor:grab}.ngvl__container.grabbing{cursor:grabbing}.ngvl__container.horizontal{grid-template-rows:1fr auto}.ngvl__container.horizontal .ngvl__list{display:inline-flex}.ngvl__container.horizontal .ngvl__scroller{overflow:hidden}.ngvl__container.vertical{grid-template-columns:1fr auto}.ngvl__container.vertical .ngvl__scroller{overflow:hidden}.ngvl__scroller{display:block;position:relative;overflow:hidden;width:100%;height:100%}.ngvl__list{position:absolute;list-style:none;padding:0;margin:0;width:100%;height:100%}.ngvl__list.prepared{overflow:hidden}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: CdkScrollable, selector: "[cdk-scrollable], [cdkScrollable]" }, { kind: "directive", type: LocaleSensitiveDirective, selector: "[localeSensitive]", inputs: ["langTextDir", "listDir"] }, { kind: "component", type: NgScrollBarComponent, selector: "ng-scroll-bar", inputs: ["loading", "isVertical", "position", "thumbGradientPositions", "size", "theme", "prepared", "show"], outputs: ["onDrag"] }] });
3667
3666
  }
3668
3667
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: NgScrollerComponent, decorators: [{
3669
3668
  type: Component,
3670
- args: [{ selector: 'ng-scroller', imports: [CommonModule, CdkScrollable, LocaleSensitiveDirective, NgScrollBarComponent], template: "<div localeSensitive [langTextDir]=\"langTextDir()\" [listDir]=\"direction()\" class=\"ngvl__container\" [ngClass]=\"containerClasses()\">\r\n <div #scrollViewport cdkScrollable part=\"scroller\" class=\"ngvl__scroller\">\r\n <div #scrollContent [attr.aria-orientation]=\"direction()\" [attr.aria-activedescendant]=\"focusedElement()\"\r\n tabindex=\"0\" part=\"list\" class=\"ngvl__list\" [ngClass]=\"actualClasses()\">\r\n <ng-content></ng-content>\r\n </div>\r\n </div>\r\n <ng-scroll-bar #scrollBar [isVertical]=\"isVertical()\" [size]=\"thumbSize()\" [theme]=\"scrollbarTheme()\" [position]=\"thumbPosition()\"\r\n [thumbGradientPositions]=\"thumbGradientPositions()\" [loading]=\"loading()\" [prepared]=\"preparedSignal()\" [show]=\"thumbShow()\"\r\n (onDrag)=\"onScrollBarDragHandler($event)\"></ng-scroll-bar>\r\n</div>", styles: [":host{position:relative;overflow:hidden;-webkit-user-select:none;user-select:none}.ngvl__container{position:relative;overflow:hidden;display:grid;width:100%;height:100%;cursor:grab}.ngvl__container.grabbing{cursor:grabbing}.ngvl__container.horizontal{grid-template-rows:1fr auto}.ngvl__container.horizontal .ngvl__list{display:inline-flex}.ngvl__container.horizontal .ngvl__scroller{overflow:hidden}.ngvl__container.vertical{grid-template-columns:1fr auto}.ngvl__container.vertical .ngvl__scroller{overflow:hidden}.ngvl__scroller{display:block;position:relative;overflow:hidden;width:100%;height:100%}.ngvl__list{position:absolute;list-style:none;padding:0;margin:0;width:100%;height:100%;opacity:0}.ngvl__list.prepared{opacity:1;overflow:hidden}.ngvl__list.prepared.wait-for-preparation{transition:opacity .15s ease-out .1s}.ngvl__list.ready-to-start{transition:height .15s ease-out}.ngvl__list.ready-to-start.wait-for-preparation{transition:height .15s ease-out,opacity .15s ease-out .1s}\n"] }]
3669
+ args: [{ selector: 'ng-scroller', imports: [CommonModule, CdkScrollable, LocaleSensitiveDirective, NgScrollBarComponent], template: "<div localeSensitive [langTextDir]=\"langTextDir()\" [listDir]=\"direction()\" class=\"ngvl__container\" [ngClass]=\"containerClasses()\">\r\n <div #scrollViewport cdkScrollable part=\"scroller\" class=\"ngvl__scroller\">\r\n <div #scrollContent [attr.aria-orientation]=\"direction()\" [attr.aria-activedescendant]=\"focusedElement()\"\r\n tabindex=\"0\" part=\"list\" class=\"ngvl__list\" [ngClass]=\"actualClasses()\">\r\n <ng-content></ng-content>\r\n </div>\r\n </div>\r\n <ng-scroll-bar #scrollBar [isVertical]=\"isVertical()\" [size]=\"thumbSize()\" [theme]=\"scrollbarTheme()\" [position]=\"thumbPosition()\"\r\n [thumbGradientPositions]=\"thumbGradientPositions()\" [loading]=\"loading()\" [prepared]=\"preparedSignal()\" [show]=\"thumbShow()\"\r\n (onDrag)=\"onScrollBarDragHandler($event)\"></ng-scroll-bar>\r\n</div>", styles: [":host{position:relative;overflow:hidden;-webkit-user-select:none;user-select:none}.ngvl__container{position:relative;overflow:hidden;display:grid;width:100%;height:100%;cursor:grab}.ngvl__container.grabbing{cursor:grabbing}.ngvl__container.horizontal{grid-template-rows:1fr auto}.ngvl__container.horizontal .ngvl__list{display:inline-flex}.ngvl__container.horizontal .ngvl__scroller{overflow:hidden}.ngvl__container.vertical{grid-template-columns:1fr auto}.ngvl__container.vertical .ngvl__scroller{overflow:hidden}.ngvl__scroller{display:block;position:relative;overflow:hidden;width:100%;height:100%}.ngvl__list{position:absolute;list-style:none;padding:0;margin:0;width:100%;height:100%}.ngvl__list.prepared{overflow:hidden}\n"] }]
3671
3670
  }], ctorParameters: () => [], propDecorators: { scrollContent: [{ type: i0.ViewChild, args: ['scrollContent', { isSignal: true }] }], cdkScrollable: [{
3672
3671
  type: ViewChild,
3673
3672
  args: ['scrollViewport', { read: CdkScrollable }]
@@ -4514,27 +4513,27 @@ class NgVirtualListComponent {
4514
4513
  });
4515
4514
  let prepared = false, readyToStart = false, isUserScrolling = false;
4516
4515
  this.$prepared.pipe(takeUntilDestroyed(), distinctUntilChanged(), tap(v => {
4517
- const waitForPreparation = this.waitForPreparation();
4518
- if (waitForPreparation) {
4519
- if (!v) {
4520
- prepared = readyToStart = v;
4516
+ if (!v) {
4517
+ this.cacheClean();
4518
+ readyToStart = isUserScrolling = false;
4519
+ prepared = readyToStart = v;
4520
+ const waitForPreparation = this.waitForPreparation();
4521
+ if (waitForPreparation) {
4521
4522
  const scrollerComponent = this._scrollerComponent();
4522
4523
  if (scrollerComponent) {
4523
4524
  scrollerComponent.prepared = v;
4524
4525
  }
4525
4526
  this.classes.set({ prepared: v, [WAIT_FOR_PREPARATION]: waitForPreparation });
4526
- this.cacheClean();
4527
4527
  }
4528
- }
4529
- else {
4530
- prepared = readyToStart = true;
4531
- const scrollerComponent = this._scrollerComponent();
4532
- if (scrollerComponent) {
4533
- scrollerComponent.prepared = true;
4528
+ else {
4529
+ const scrollerComponent = this._scrollerComponent();
4530
+ if (scrollerComponent) {
4531
+ scrollerComponent.prepared = true;
4532
+ }
4533
+ this.classes.set({ prepared: true, [READY_TO_START]: true, [WAIT_FOR_PREPARATION]: waitForPreparation });
4534
4534
  }
4535
- this.classes.set({ prepared: true, [READY_TO_START]: true, [WAIT_FOR_PREPARATION]: waitForPreparation });
4536
4535
  }
4537
- }), filter$1(v => !!v), debounceTime(0), takeUntilDestroyed(this._destroyRef), tap(v => {
4536
+ }), filter$1(v => !!v), delay(0), takeUntilDestroyed(this._destroyRef), tap(v => {
4538
4537
  prepared = v;
4539
4538
  }), delay(0), takeUntilDestroyed(this._destroyRef), tap(v => {
4540
4539
  const waitForPreparation = this.waitForPreparation(), scrollerComponent = this._scrollerComponent(), val = v || !waitForPreparation;
@@ -4693,14 +4692,12 @@ class NgVirtualListComponent {
4693
4692
  const { width, height, x, y } = bounds, viewportSize = (isVertical ? height : width);
4694
4693
  let scrollLength = Math.round(this._totalSize()) ?? 0, actualScrollLength = Math.round(scrollLength === 0 ? 0 : scrollLength > viewportSize ? scrollLength - viewportSize : scrollLength), roundedMaxPosition = Math.round(actualScrollLength), scrollPosition = Math.round(actualScrollSize);
4695
4694
  const opts = {
4696
- bounds: { width, height, x, y }, dynamicSize, isVertical, itemSize, reversed: false,
4695
+ bounds: { width, height, x, y }, dynamicSize, isVertical, itemSize,
4697
4696
  bufferSize, maxBufferSize, scrollSize: actualScrollSize, snap, enabledBufferOptimization,
4698
4697
  };
4699
- if (snapScrollToBottom && scrollLength > viewportSize && !prepared) {
4700
- const { totalSize: calculatedTotalSize } = this._trackBox.getMetrics(items, itemConfigMap, { ...opts, reversed: true });
4701
- totalSize = calculatedTotalSize;
4698
+ if (snapScrollToBottom && !prepared) {
4702
4699
  actualScrollSize = (totalSize > viewportSize ? totalSize - viewportSize : 0);
4703
- const { displayItems: calculatedDisplayItems, totalSize: calculatedTotalSize1 } = this._trackBox.updateCollection(items, itemConfigMap, { ...opts, reversed: true, scrollSize: actualScrollSize });
4700
+ const { displayItems: calculatedDisplayItems, totalSize: calculatedTotalSize1 } = this._trackBox.updateCollection(items, itemConfigMap, { ...opts, scrollSize: actualScrollSize });
4704
4701
  displayItems = calculatedDisplayItems;
4705
4702
  totalSize = calculatedTotalSize1;
4706
4703
  scrollLength = Math.round(totalSize) ?? 0;
@@ -4905,7 +4902,7 @@ class NgVirtualListComponent {
4905
4902
  if (dynamicSize) {
4906
4903
  const { width, height, x, y } = this._bounds() || { x: 0, y: 0, width: DEFAULT_LIST_SIZE, height: DEFAULT_LIST_SIZE }, itemConfigMap = this.itemConfigMap(), items = this._actualItems(), isVertical = this._isVertical, currentScollSize = (isVertical ? scrollerComponent.scrollTop : scrollerComponent.scrollLeft), delta = this._trackBox.delta, opts = {
4907
4904
  bounds: { width, height, x, y }, collection: items, dynamicSize, isVertical: this._isVertical, itemSize,
4908
- bufferSize: this.bufferSize(), maxBufferSize: this.maxBufferSize(), reversed: false,
4905
+ bufferSize: this.bufferSize(), maxBufferSize: this.maxBufferSize(),
4909
4906
  scrollSize: (isVertical ? scrollerComponent.scrollTop : scrollerComponent.scrollLeft) + delta,
4910
4907
  snap: this.snap(), fromItemId: id, enabledBufferOptimization: this.enabledBufferOptimization(),
4911
4908
  }, scrollSize = this._trackBox.getItemPosition(id, itemConfigMap, opts), params = {
@@ -5205,6 +5202,7 @@ class NgVirtualListComponent {
5205
5202
  if (scrollerComponent) {
5206
5203
  scrollerComponent.reset();
5207
5204
  }
5205
+ this._$prepared.next(false);
5208
5206
  }
5209
5207
  stopSnappingScrollToEnd() {
5210
5208
  const scroller = this._scrollerComponent();