ng-virtual-list 17.7.12 → 17.7.13

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.
@@ -1,6 +1,6 @@
1
1
  import * as i0 from '@angular/core';
2
2
  import { Injectable, inject, ChangeDetectorRef, signal, ElementRef, ChangeDetectionStrategy, Component, viewChild, output, input, ViewContainerRef, ViewChild, ViewEncapsulation, NO_ERRORS_SCHEMA, NgModule } from '@angular/core';
3
- import { Subject, tap, fromEvent, combineLatest, map, filter, distinctUntilChanged, switchMap, of } from 'rxjs';
3
+ import { Subject, tap, fromEvent, combineLatest, map, filter, distinctUntilChanged, skip, switchMap, of } from 'rxjs';
4
4
  import { BehaviorSubject } from 'rxjs/internal/BehaviorSubject';
5
5
  import { takeUntilDestroyed, toObservable } from '@angular/core/rxjs-interop';
6
6
  import * as i1 from '@angular/common';
@@ -110,6 +110,7 @@ const CLASS_LIST_VERTICAL = 'vertical';
110
110
  const CLASS_LIST_HORIZONTAL = 'horizontal';
111
111
  // styles
112
112
  const PART_DEFAULT_ITEM = 'item';
113
+ const PART_ITEM_NEW = ' item-new';
113
114
  const PART_ITEM_ODD = ' item-odd';
114
115
  const PART_ITEM_EVEN = ' item-even';
115
116
  const PART_ITEM_SNAPPED = ' item-snapped';
@@ -648,6 +649,9 @@ class NgVirtualListItemComponent extends BaseVirtualListItemComponent {
648
649
  if (isCollapsed) {
649
650
  part += PART_ITEM_COLLAPSED;
650
651
  }
652
+ if (v ? v.config.new : false) {
653
+ part += PART_ITEM_NEW;
654
+ }
651
655
  if (this.focus()) {
652
656
  part += PART_ITEM_FOCUSED;
653
657
  }
@@ -1333,6 +1337,7 @@ class TrackBox extends CacheMap {
1333
1337
  _maxBufferSize = this._defaultBufferSize;
1334
1338
  _resetBufferSizeTimeout = DEFAULT_RESET_BUFFER_SIZE_TIMEOUT;
1335
1339
  _resetBufferSizeTimer;
1340
+ isInit = true;
1336
1341
  lifeCircle() {
1337
1342
  this.fireChangeIfNeed();
1338
1343
  this.lifeCircleDo();
@@ -1345,6 +1350,9 @@ class TrackBox extends CacheMap {
1345
1350
  console.warn('Attention! The collection must be immutable.');
1346
1351
  return;
1347
1352
  }
1353
+ if (this.isInit && !(!this._previousCollection || this._previousCollection.length === 0)) {
1354
+ this.isInit = false;
1355
+ }
1348
1356
  this.updateCache(this._previousCollection, currentCollection, itemSize);
1349
1357
  this._previousCollection = currentCollection;
1350
1358
  }
@@ -1568,10 +1576,10 @@ class TrackBox extends CacheMap {
1568
1576
  else {
1569
1577
  leftItemsOffset = rightItemsOffset = bufferSize;
1570
1578
  }
1571
- let itemsFromStartToScrollEnd = -1, itemsFromDisplayEndToOffsetEnd = 0, itemsFromStartToDisplayEnd = -1, leftItemLength = 0, rightItemLength = 0, leftItemsWeight = 0, rightItemsWeight = 0, leftHiddenItemsWeight = 0, totalItemsToDisplayEndWeight = 0, leftSizeOfAddedItems = 0, leftSizeOfUpdatedItems = 0, leftSizeOfDeletedItems = 0, itemById = undefined, itemByIdPos = 0, targetDisplayItemIndex = -1, isTargetInOverscroll = false, actualScrollSize = itemByIdPos, totalSize = 0, startIndex, isFromItemIdFound = false;
1579
+ let itemsFromStartToScrollEnd = -1, itemsFromDisplayEndToOffsetEnd = 0, itemsFromStartToDisplayEnd = -1, leftItemLength = 0, rightItemLength = 0, leftItemsWeight = 0, rightItemsWeight = 0, leftHiddenItemsWeight = 0, totalItemsToDisplayEndWeight = 0, leftSizeOfAddedItems = 0, leftSizeOfUpdatedItems = 0, leftSizeOfDeletedItems = 0, itemById = undefined, itemByIdPos = 0, targetDisplayItemIndex = -1, isTargetInOverscroll = false, actualScrollSize = itemByIdPos, totalSize = 0, startIndex, isFromItemIdFound = false, deltaFromStartCreation = 0;
1572
1580
  // If the list is dynamic or there are new elements in the collection, then it switches to the long algorithm.
1573
1581
  if (dynamicSize) {
1574
- let y = 0, stickyCollectionItem = undefined, stickyComponentSize = 0;
1582
+ let y = 0, stickyCollectionItem = undefined, stickyComponentSize = 0, isNew = true;
1575
1583
  for (let i = 0, l = collection.length; i < l; i++) {
1576
1584
  const ii = i + 1, collectionItem = collection[i], id = collectionItem.id;
1577
1585
  let componentSize = 0, componentSizeDelta = 0, itemDisplayMethod = ItemDisplayMethods.NOT_CHANGED;
@@ -1579,17 +1587,24 @@ class TrackBox extends CacheMap {
1579
1587
  const bounds = map.get(id) || { width: typicalItemSize, height: typicalItemSize };
1580
1588
  componentSize = bounds[sizeProperty];
1581
1589
  itemDisplayMethod = bounds?.method ?? ItemDisplayMethods.UPDATE;
1590
+ const isItemNew = bounds.isNew ?? true;
1591
+ if (isNew && (this.isInit || (!isItemNew && i > 0))) {
1592
+ isNew = false;
1593
+ }
1582
1594
  switch (itemDisplayMethod) {
1583
1595
  case ItemDisplayMethods.UPDATE: {
1584
1596
  const snapshotBounds = snapshot.get(id);
1585
1597
  const componentSnapshotSize = componentSize - (snapshotBounds ? snapshotBounds[sizeProperty] : typicalItemSize);
1586
- componentSizeDelta = componentSnapshotSize;
1587
- map.set(id, { ...bounds, method: ItemDisplayMethods.NOT_CHANGED });
1598
+ componentSizeDelta = isItemNew ? 0 : componentSnapshotSize;
1599
+ map.set(id, { ...bounds, method: ItemDisplayMethods.NOT_CHANGED, isNew: false });
1600
+ if (isItemNew) {
1601
+ deltaFromStartCreation += componentSize;
1602
+ }
1588
1603
  break;
1589
1604
  }
1590
1605
  case ItemDisplayMethods.CREATE: {
1591
- componentSizeDelta = typicalItemSize;
1592
- map.set(id, { ...bounds, method: ItemDisplayMethods.NOT_CHANGED });
1606
+ componentSizeDelta = isNew ? 0 : typicalItemSize;
1607
+ map.set(id, { ...bounds, method: isNew ? ItemDisplayMethods.UPDATE : ItemDisplayMethods.NOT_CHANGED, isNew });
1593
1608
  break;
1594
1609
  }
1595
1610
  }
@@ -1753,7 +1768,7 @@ class TrackBox extends CacheMap {
1753
1768
  actualScrollSize = scrollSize * k;
1754
1769
  }
1755
1770
  startIndex = Math.min(itemsFromStartToScrollEnd - leftItemLength, totalLength > 0 ? totalLength - 1 : 0);
1756
- const itemsOnDisplayWeight = totalItemsToDisplayEndWeight - leftItemsWeight, itemsOnDisplayLength = itemsFromStartToDisplayEnd - itemsFromStartToScrollEnd, startPosition = leftHiddenItemsWeight - leftItemsWeight, renderItems = itemsOnDisplayLength + leftItemLength + rightItemLength, delta = leftSizeOfUpdatedItems + leftSizeOfAddedItems - leftSizeOfDeletedItems;
1771
+ const itemsOnDisplayWeight = totalItemsToDisplayEndWeight - leftItemsWeight, itemsOnDisplayLength = itemsFromStartToDisplayEnd - itemsFromStartToScrollEnd, startPosition = leftHiddenItemsWeight - leftItemsWeight, renderItems = itemsOnDisplayLength + leftItemLength + rightItemLength, delta = leftSizeOfUpdatedItems + leftSizeOfAddedItems - leftSizeOfDeletedItems + deltaFromStartCreation;
1757
1772
  const metrics = {
1758
1773
  delta,
1759
1774
  normalizedItemWidth: w,
@@ -1810,7 +1825,7 @@ class TrackBox extends CacheMap {
1810
1825
  if (!items[i]) {
1811
1826
  continue;
1812
1827
  }
1813
- const id = items[i].id, sticky = itemConfigMap[id]?.sticky ?? 0, selectable = itemConfigMap[id]?.selectable ?? true, collapsable = itemConfigMap[id]?.collapsable ?? false, size = dynamicSize ? this.get(id)?.[sizeProperty] || typicalItemSize : typicalItemSize;
1828
+ const id = items[i].id, cache = this.get(id), sticky = itemConfigMap[id]?.sticky ?? 0, selectable = itemConfigMap[id]?.selectable ?? true, collapsable = itemConfigMap[id]?.collapsable ?? false, size = dynamicSize ? cache?.[sizeProperty] || typicalItemSize : typicalItemSize;
1814
1829
  if (sticky === 1) {
1815
1830
  const isOdd = i % 2 != 0, measures = {
1816
1831
  x: isVertical ? 0 : actualSnippedPosition,
@@ -1819,6 +1834,7 @@ class TrackBox extends CacheMap {
1819
1834
  height: isVertical ? size : normalizedItemHeight,
1820
1835
  delta: 0,
1821
1836
  }, config = {
1837
+ new: cache.isNew === true,
1822
1838
  odd: isOdd,
1823
1839
  even: !isOdd,
1824
1840
  isVertical,
@@ -1849,8 +1865,8 @@ class TrackBox extends CacheMap {
1849
1865
  if (!items[i]) {
1850
1866
  continue;
1851
1867
  }
1852
- const id = items[i].id, sticky = itemConfigMap[id]?.sticky ?? 0, selectable = itemConfigMap[id]?.selectable ?? true, collapsable = itemConfigMap[id]?.collapsable ?? false, size = dynamicSize
1853
- ? this.get(id)?.[sizeProperty] || typicalItemSize
1868
+ const id = items[i].id, cache = this.get(id), sticky = itemConfigMap[id]?.sticky ?? 0, selectable = itemConfigMap[id]?.selectable ?? true, collapsable = itemConfigMap[id]?.collapsable ?? false, size = dynamicSize
1869
+ ? cache?.[sizeProperty] || typicalItemSize
1854
1870
  : typicalItemSize;
1855
1871
  if (sticky === 2) {
1856
1872
  const isOdd = i % 2 != 0, w = isVertical ? normalizedItemWidth : size, h = isVertical ? size : normalizedItemHeight, measures = {
@@ -1860,6 +1876,7 @@ class TrackBox extends CacheMap {
1860
1876
  height: h,
1861
1877
  delta: 0,
1862
1878
  }, config = {
1879
+ new: cache.isNew === true,
1863
1880
  odd: isOdd,
1864
1881
  even: !isOdd,
1865
1882
  isVertical,
@@ -1891,7 +1908,7 @@ class TrackBox extends CacheMap {
1891
1908
  if (!items[i]) {
1892
1909
  continue;
1893
1910
  }
1894
- const id = items[i].id, size = dynamicSize ? this.get(id)?.[sizeProperty] || typicalItemSize : typicalItemSize;
1911
+ const id = items[i].id, cache = this.get(id), size = dynamicSize ? cache?.[sizeProperty] || typicalItemSize : typicalItemSize;
1895
1912
  if (id !== stickyItem?.id && id !== endStickyItem?.id) {
1896
1913
  const isOdd = i % 2 != 0, sticky = itemConfigMap[id]?.sticky ?? 0, selectable = itemConfigMap[id]?.selectable ?? true, collapsable = itemConfigMap[id]?.collapsable ?? false, snapped = snap && (sticky === 1 && pos <= scrollSize || sticky === 2 && pos >= scrollSize + boundsSize - size), measures = {
1897
1914
  x: isVertical ? sticky === 1 ? 0 : boundsSize - size : pos,
@@ -1900,6 +1917,7 @@ class TrackBox extends CacheMap {
1900
1917
  height: isVertical ? size : normalizedItemHeight,
1901
1918
  delta: 0,
1902
1919
  }, config = {
1920
+ new: cache.isNew === true,
1903
1921
  odd: isOdd,
1904
1922
  even: !isOdd,
1905
1923
  isVertical,
@@ -2003,7 +2021,7 @@ class TrackBox extends CacheMap {
2003
2021
  continue;
2004
2022
  }
2005
2023
  const bounds = component.instance.getBounds();
2006
- this.set(itemId, bounds);
2024
+ this.set(itemId, { ...(this.get(itemId) || {}), ...bounds });
2007
2025
  }
2008
2026
  }
2009
2027
  dispose() {
@@ -2149,6 +2167,14 @@ class NgVirtualListComponent {
2149
2167
  * Fires when elements are collapsed.
2150
2168
  */
2151
2169
  onCollapse = output();
2170
+ /**
2171
+ * Fires when the scroll reaches the start.
2172
+ */
2173
+ onScrollReachStart = output();
2174
+ /**
2175
+ * Fires when the scroll reaches the end.
2176
+ */
2177
+ onScrollReachEnd = output();
2152
2178
  _itemsOptions = {
2153
2179
  transform: (v) => {
2154
2180
  let valid = validateArray(v, true);
@@ -2206,7 +2232,7 @@ class NgVirtualListComponent {
2206
2232
  selectedIds = input(undefined, { ...this._selectedIdsOptions });
2207
2233
  _collapsedIdsOptions = {
2208
2234
  transform: (v) => {
2209
- let valid = validateArray(v, true) || validateString(v, true) || validateFloat(v, true);
2235
+ let valid = validateArray(v, true);
2210
2236
  if (valid) {
2211
2237
  if (v && Array.isArray(v)) {
2212
2238
  for (let i = 0, l = v.length; i < l; i++) {
@@ -2219,7 +2245,7 @@ class NgVirtualListComponent {
2219
2245
  }
2220
2246
  }
2221
2247
  if (!valid) {
2222
- console.error('The "collapsedIds" parameter must be of type `Array<Id> | Id` or `undefined`.');
2248
+ console.error('The "collapsedIds" parameter must be of type `Array<Id>.');
2223
2249
  return [];
2224
2250
  }
2225
2251
  return v;
@@ -2292,10 +2318,9 @@ class NgVirtualListComponent {
2292
2318
  enabledBufferOptimization = input(DEFAULT_ENABLED_BUFFER_OPTIMIZATION, { ...this._enabledBufferOptimizationOptions });
2293
2319
  _itemRendererOptions = {
2294
2320
  transform: (v) => {
2295
- const valid = validateObject(v);
2296
- if (v) {
2297
- Object.hasOwn(v, 'elementRef');
2298
- Object.hasOwn(v, 'createEmbeddedView');
2321
+ let valid = validateObject(v);
2322
+ if (v && !(typeof v.elementRef === 'object' && typeof v.createEmbeddedView === 'function')) {
2323
+ valid = false;
2299
2324
  }
2300
2325
  if (!valid) {
2301
2326
  throw Error('The "itemRenderer" parameter must be of type `TemplateRef`.');
@@ -2487,6 +2512,8 @@ class NgVirtualListComponent {
2487
2512
  _snapedDisplayComponent;
2488
2513
  _bounds = signal(null);
2489
2514
  _scrollSize = signal(0);
2515
+ _isScrollStart = signal(true);
2516
+ _isScrollFinished = signal(false);
2490
2517
  _resizeObserver = null;
2491
2518
  _resizeSnappedComponentHandler = () => {
2492
2519
  const list = this._list(), container = this._container(), bounds = this._bounds(), snappedComponent = this._snapedDisplayComponent?.instance;
@@ -2585,7 +2612,17 @@ class NgVirtualListComponent {
2585
2612
  toObservable(this._list).pipe(takeUntilDestroyed(), filter(v => !!v), tap(v => {
2586
2613
  this._service.listElement = v.nativeElement;
2587
2614
  })).subscribe();
2588
- const $trackBy = toObservable(this.trackBy), $selectByClick = toObservable(this.selectByClick), $collapseByClick = toObservable(this.collapseByClick);
2615
+ const $trackBy = toObservable(this.trackBy), $selectByClick = toObservable(this.selectByClick), $collapseByClick = toObservable(this.collapseByClick), $isScrollStart = toObservable(this._isScrollStart), $isScrollFinished = toObservable(this._isScrollFinished);
2616
+ $isScrollStart.pipe(takeUntilDestroyed(), distinctUntilChanged(), skip(1), tap(v => {
2617
+ if (v) {
2618
+ this.onScrollReachStart.emit();
2619
+ }
2620
+ })).subscribe();
2621
+ $isScrollFinished.pipe(takeUntilDestroyed(), distinctUntilChanged(), skip(1), tap(v => {
2622
+ if (v) {
2623
+ this.onScrollReachEnd.emit();
2624
+ }
2625
+ })).subscribe();
2589
2626
  $selectByClick.pipe(takeUntilDestroyed(), tap(v => {
2590
2627
  this._service.selectByClick = v;
2591
2628
  })).subscribe();
@@ -2673,6 +2710,9 @@ class NgVirtualListComponent {
2673
2710
  this.resetBoundsSize(isVertical, totalSize);
2674
2711
  this.createDisplayComponentsIfNeed(displayItems);
2675
2712
  this.tracking();
2713
+ const scrollLength = (this._isVertical ? this._container()?.nativeElement.scrollHeight ?? 0 : this._container()?.nativeElement.scrollWidth) ?? 0, actualScrollLength = scrollLength === 0 ? 0 : scrollLength - (this._isVertical ? height : width), scrollPosition = actualScrollSize + this._trackBox.delta;
2714
+ this._isScrollStart.set(scrollPosition === 0);
2715
+ this._isScrollFinished.set(scrollPosition === actualScrollLength);
2676
2716
  if (this._isSnappingMethodAdvanced) {
2677
2717
  this.updateRegularRenderer();
2678
2718
  }
@@ -2997,7 +3037,7 @@ class NgVirtualListComponent {
2997
3037
  }
2998
3038
  }
2999
3039
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: NgVirtualListComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
3000
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.3.12", type: NgVirtualListComponent, selector: "ng-virtual-list", inputs: { items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: true, transformFunction: null }, selectedIds: { classPropertyName: "selectedIds", publicName: "selectedIds", isSignal: true, isRequired: false, transformFunction: null }, collapsedIds: { classPropertyName: "collapsedIds", publicName: "collapsedIds", isSignal: true, isRequired: false, transformFunction: null }, selectByClick: { classPropertyName: "selectByClick", publicName: "selectByClick", isSignal: true, isRequired: false, transformFunction: null }, collapseByClick: { classPropertyName: "collapseByClick", publicName: "collapseByClick", isSignal: true, isRequired: false, transformFunction: null }, snap: { classPropertyName: "snap", publicName: "snap", isSignal: true, isRequired: false, transformFunction: null }, enabledBufferOptimization: { classPropertyName: "enabledBufferOptimization", publicName: "enabledBufferOptimization", isSignal: true, isRequired: false, transformFunction: null }, itemRenderer: { classPropertyName: "itemRenderer", publicName: "itemRenderer", isSignal: true, isRequired: true, transformFunction: null }, itemConfigMap: { classPropertyName: "itemConfigMap", publicName: "itemConfigMap", isSignal: true, isRequired: false, transformFunction: null }, itemSize: { classPropertyName: "itemSize", publicName: "itemSize", isSignal: true, isRequired: false, transformFunction: null }, dynamicSize: { classPropertyName: "dynamicSize", publicName: "dynamicSize", isSignal: true, isRequired: false, transformFunction: null }, direction: { classPropertyName: "direction", publicName: "direction", isSignal: true, isRequired: false, transformFunction: null }, bufferSize: { classPropertyName: "bufferSize", publicName: "bufferSize", isSignal: true, isRequired: false, transformFunction: null }, maxBufferSize: { classPropertyName: "maxBufferSize", publicName: "maxBufferSize", isSignal: true, isRequired: false, transformFunction: null }, snappingMethod: { classPropertyName: "snappingMethod", publicName: "snappingMethod", isSignal: true, isRequired: false, transformFunction: null }, methodForSelecting: { classPropertyName: "methodForSelecting", publicName: "methodForSelecting", isSignal: true, isRequired: false, transformFunction: null }, trackBy: { classPropertyName: "trackBy", publicName: "trackBy", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { onScroll: "onScroll", onScrollEnd: "onScrollEnd", onViewportChange: "onViewportChange", onItemClick: "onItemClick", onSelect: "onSelect", onCollapse: "onCollapse" }, host: { styleAttribute: "position: relative;" }, providers: [NgVirtualListService], viewQueries: [{ propertyName: "_snappedContainer", first: true, predicate: ["snapped"], descendants: true, isSignal: true }, { propertyName: "_container", first: true, predicate: ["container"], descendants: true, isSignal: true }, { propertyName: "_list", first: true, predicate: ["list"], descendants: true, isSignal: true }, { propertyName: "_listContainerRef", first: true, predicate: ["renderersContainer"], descendants: true, read: ViewContainerRef }, { propertyName: "_snapContainerRef", first: true, predicate: ["snapRendererContainer"], descendants: true, read: ViewContainerRef }], ngImport: i0, template: "@if (snap()) {\r\n <div #snapped part=\"snapped-item\" class=\"ngvl__list-snapper\">\r\n <ng-container #snapRendererContainer></ng-container>\r\n </div>\r\n}\r\n<div #container part=\"scroller\" class=\"ngvl__scroller\">\r\n <div [attr.aria-orientation]=\"orientation\" [attr.aria-activedescendant]=\"focusedElement()\" #list part=\"list\" class=\"ngvl__list\">\r\n <ng-container #renderersContainer></ng-container>\r\n </div>\r\n</div>", styles: [":host{position:relative;display:block;width:400px;overflow:hidden}:host(.horizontal){height:48px}:host(.horizontal) .ngvl__list{display:inline-flex}:host(.horizontal) .ngvl__scroller{overflow:auto hidden}:host(.vertical) .ngvl__scroller{overflow:hidden auto}:host(.vertical){height:320px}.ngvl__scroller{overflow:auto;width:100%;height:100%}.ngvl__list-snapper{pointer-events:none;position:absolute;list-style:none;left:0;top:0;z-index:1}.ngvl__list{position:relative;list-style:none;padding:0;margin:0;width:100%;height:100%}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.ShadowDom });
3040
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.3.12", type: NgVirtualListComponent, selector: "ng-virtual-list", inputs: { items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: true, transformFunction: null }, selectedIds: { classPropertyName: "selectedIds", publicName: "selectedIds", isSignal: true, isRequired: false, transformFunction: null }, collapsedIds: { classPropertyName: "collapsedIds", publicName: "collapsedIds", isSignal: true, isRequired: false, transformFunction: null }, selectByClick: { classPropertyName: "selectByClick", publicName: "selectByClick", isSignal: true, isRequired: false, transformFunction: null }, collapseByClick: { classPropertyName: "collapseByClick", publicName: "collapseByClick", isSignal: true, isRequired: false, transformFunction: null }, snap: { classPropertyName: "snap", publicName: "snap", isSignal: true, isRequired: false, transformFunction: null }, enabledBufferOptimization: { classPropertyName: "enabledBufferOptimization", publicName: "enabledBufferOptimization", isSignal: true, isRequired: false, transformFunction: null }, itemRenderer: { classPropertyName: "itemRenderer", publicName: "itemRenderer", isSignal: true, isRequired: true, transformFunction: null }, itemConfigMap: { classPropertyName: "itemConfigMap", publicName: "itemConfigMap", isSignal: true, isRequired: false, transformFunction: null }, itemSize: { classPropertyName: "itemSize", publicName: "itemSize", isSignal: true, isRequired: false, transformFunction: null }, dynamicSize: { classPropertyName: "dynamicSize", publicName: "dynamicSize", isSignal: true, isRequired: false, transformFunction: null }, direction: { classPropertyName: "direction", publicName: "direction", isSignal: true, isRequired: false, transformFunction: null }, bufferSize: { classPropertyName: "bufferSize", publicName: "bufferSize", isSignal: true, isRequired: false, transformFunction: null }, maxBufferSize: { classPropertyName: "maxBufferSize", publicName: "maxBufferSize", isSignal: true, isRequired: false, transformFunction: null }, snappingMethod: { classPropertyName: "snappingMethod", publicName: "snappingMethod", isSignal: true, isRequired: false, transformFunction: null }, methodForSelecting: { classPropertyName: "methodForSelecting", publicName: "methodForSelecting", isSignal: true, isRequired: false, transformFunction: null }, trackBy: { classPropertyName: "trackBy", publicName: "trackBy", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { onScroll: "onScroll", onScrollEnd: "onScrollEnd", onViewportChange: "onViewportChange", onItemClick: "onItemClick", onSelect: "onSelect", onCollapse: "onCollapse", onScrollReachStart: "onScrollReachStart", onScrollReachEnd: "onScrollReachEnd" }, host: { styleAttribute: "position: relative;" }, providers: [NgVirtualListService], viewQueries: [{ propertyName: "_snappedContainer", first: true, predicate: ["snapped"], descendants: true, isSignal: true }, { propertyName: "_container", first: true, predicate: ["container"], descendants: true, isSignal: true }, { propertyName: "_list", first: true, predicate: ["list"], descendants: true, isSignal: true }, { propertyName: "_listContainerRef", first: true, predicate: ["renderersContainer"], descendants: true, read: ViewContainerRef }, { propertyName: "_snapContainerRef", first: true, predicate: ["snapRendererContainer"], descendants: true, read: ViewContainerRef }], ngImport: i0, template: "@if (snap()) {\r\n <div #snapped part=\"snapped-item\" class=\"ngvl__list-snapper\">\r\n <ng-container #snapRendererContainer></ng-container>\r\n </div>\r\n}\r\n<div #container part=\"scroller\" class=\"ngvl__scroller\">\r\n <div [attr.aria-orientation]=\"orientation\" [attr.aria-activedescendant]=\"focusedElement()\" #list part=\"list\" class=\"ngvl__list\">\r\n <ng-container #renderersContainer></ng-container>\r\n </div>\r\n</div>", styles: [":host{position:relative;display:block;width:400px;overflow:hidden}:host(.horizontal){height:48px}:host(.horizontal) .ngvl__list{display:inline-flex}:host(.horizontal) .ngvl__scroller{overflow:auto hidden}:host(.vertical) .ngvl__scroller{overflow:hidden auto}:host(.vertical){height:320px}.ngvl__scroller{overflow:auto;width:100%;height:100%}.ngvl__list-snapper{pointer-events:none;position:absolute;list-style:none;left:0;top:0;z-index:1}.ngvl__list{position:relative;list-style:none;padding:0;margin:0;width:100%;height:100%}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.ShadowDom });
3001
3041
  }
3002
3042
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: NgVirtualListComponent, decorators: [{
3003
3043
  type: Component,