ng-virtual-list 18.0.13 → 18.0.14
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 -1
- package/esm2022/lib/components/ng-virtual-list-item.component.mjs +8 -2
- package/esm2022/lib/ng-virtual-list.component.mjs +30 -9
- package/esm2022/lib/utils/cacheMap.mjs +6 -2
- package/esm2022/lib/utils/trackBox.mjs +70 -20
- package/esm2022/lib/utils/tracker.mjs +19 -28
- package/fesm2022/ng-virtual-list.mjs +129 -106
- package/fesm2022/ng-virtual-list.mjs.map +1 -1
- package/lib/components/ng-virtual-list-item.component.d.ts +2 -0
- package/lib/ng-virtual-list.component.d.ts +6 -1
- package/lib/utils/trackBox.d.ts +8 -3
- package/lib/utils/tracker.d.ts +1 -1
- package/package.json +1 -1
- package/esm2022/lib/utils/collection.mjs +0 -50
- package/lib/utils/collection.d.ts +0 -19
|
@@ -3,7 +3,7 @@ import { signal, inject, ElementRef, Component, ChangeDetectionStrategy, viewChi
|
|
|
3
3
|
import * as i1 from '@angular/common';
|
|
4
4
|
import { CommonModule } from '@angular/common';
|
|
5
5
|
import { toObservable, takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
6
|
-
import { BehaviorSubject, filter, map,
|
|
6
|
+
import { BehaviorSubject, tap, filter, map, combineLatest, distinctUntilChanged, switchMap, of } from 'rxjs';
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* Axis of the arrangement of virtual list elements.
|
|
@@ -79,7 +79,7 @@ class NgVirtualListItemComponent {
|
|
|
79
79
|
const data = this._data = v;
|
|
80
80
|
if (data) {
|
|
81
81
|
const styles = this._elementRef.nativeElement.style;
|
|
82
|
-
styles.zIndex = data.config.sticky;
|
|
82
|
+
styles.zIndex = String(data.config.sticky);
|
|
83
83
|
if (data.config.snapped) {
|
|
84
84
|
styles.transform = ZEROS_TRANSLATE_3D;
|
|
85
85
|
styles.position = POSITION_STICKY;
|
|
@@ -93,6 +93,9 @@ class NgVirtualListItemComponent {
|
|
|
93
93
|
}
|
|
94
94
|
this.data.set(v);
|
|
95
95
|
}
|
|
96
|
+
get item() {
|
|
97
|
+
return this._data;
|
|
98
|
+
}
|
|
96
99
|
get itemId() {
|
|
97
100
|
return this._data?.id;
|
|
98
101
|
}
|
|
@@ -101,6 +104,9 @@ class NgVirtualListItemComponent {
|
|
|
101
104
|
this.itemRenderer.set(v);
|
|
102
105
|
}
|
|
103
106
|
_elementRef = inject((ElementRef));
|
|
107
|
+
get element() {
|
|
108
|
+
return this._elementRef.nativeElement;
|
|
109
|
+
}
|
|
104
110
|
constructor() {
|
|
105
111
|
this._id = NgVirtualListItemComponent.__nextId = NgVirtualListItemComponent.__nextId === Number.MAX_SAFE_INTEGER
|
|
106
112
|
? 0 : NgVirtualListItemComponent.__nextId + 1;
|
|
@@ -221,6 +227,9 @@ class Tracker {
|
|
|
221
227
|
return this._trackMap;
|
|
222
228
|
}
|
|
223
229
|
_trackingPropertyName;
|
|
230
|
+
set trackingPropertyName(v) {
|
|
231
|
+
this._trackingPropertyName = v;
|
|
232
|
+
}
|
|
224
233
|
constructor(trackingPropertyName) {
|
|
225
234
|
this._trackingPropertyName = trackingPropertyName;
|
|
226
235
|
}
|
|
@@ -238,17 +247,17 @@ class Tracker {
|
|
|
238
247
|
const diId = this._trackMap[itemTrackingProperty];
|
|
239
248
|
if (this._trackMap.hasOwnProperty(itemTrackingProperty)) {
|
|
240
249
|
const lastIndex = this._displayObjectIndexMapById[diId], el = components[lastIndex];
|
|
241
|
-
|
|
242
|
-
const elId = el?.instance?.[itemTrackingProperty];
|
|
250
|
+
const elId = el?.instance?.id;
|
|
243
251
|
if (el && elId === diId) {
|
|
244
252
|
const indexByUntrackedItems = untrackedItems.findIndex(v => {
|
|
245
|
-
|
|
246
|
-
return v.instance[itemTrackingProperty] === elId;
|
|
253
|
+
return v.instance.id === elId;
|
|
247
254
|
});
|
|
248
255
|
if (indexByUntrackedItems > -1) {
|
|
249
|
-
el.instance.item
|
|
250
|
-
|
|
251
|
-
afterComponentSetup
|
|
256
|
+
if (el.instance.item !== item) {
|
|
257
|
+
el.instance.item = item;
|
|
258
|
+
if (afterComponentSetup !== undefined) {
|
|
259
|
+
afterComponentSetup(el.instance, item);
|
|
260
|
+
}
|
|
252
261
|
}
|
|
253
262
|
untrackedItems.splice(indexByUntrackedItems, 1);
|
|
254
263
|
continue;
|
|
@@ -260,13 +269,14 @@ class Tracker {
|
|
|
260
269
|
if (untrackedItems.length > 0) {
|
|
261
270
|
const el = untrackedItems.shift(), item = items[i];
|
|
262
271
|
if (el) {
|
|
263
|
-
el.instance.item
|
|
264
|
-
|
|
265
|
-
this.
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
272
|
+
if (el.instance.item !== item) {
|
|
273
|
+
el.instance.item = item;
|
|
274
|
+
if (this._trackMap) {
|
|
275
|
+
this._trackMap[itemTrackingProperty] = el.instance.id;
|
|
276
|
+
}
|
|
277
|
+
if (afterComponentSetup !== undefined) {
|
|
278
|
+
afterComponentSetup(el.instance, item);
|
|
279
|
+
}
|
|
270
280
|
}
|
|
271
281
|
}
|
|
272
282
|
}
|
|
@@ -280,23 +290,10 @@ class Tracker {
|
|
|
280
290
|
return;
|
|
281
291
|
}
|
|
282
292
|
const propertyIdName = this._trackingPropertyName;
|
|
283
|
-
this._checkComponentProperty(component);
|
|
284
293
|
if (this._trackMap && component[propertyIdName] !== undefined) {
|
|
285
294
|
delete this._trackMap[propertyIdName];
|
|
286
295
|
}
|
|
287
296
|
}
|
|
288
|
-
_checkComponentProperty(component) {
|
|
289
|
-
if (!component) {
|
|
290
|
-
return;
|
|
291
|
-
}
|
|
292
|
-
const propertyIdName = this._trackingPropertyName;
|
|
293
|
-
try {
|
|
294
|
-
component[propertyIdName];
|
|
295
|
-
}
|
|
296
|
-
catch (err) {
|
|
297
|
-
throw Error(`Property ${propertyIdName} does not exist.`);
|
|
298
|
-
}
|
|
299
|
-
}
|
|
300
297
|
dispose() {
|
|
301
298
|
this._trackMap = null;
|
|
302
299
|
}
|
|
@@ -475,7 +472,11 @@ class CacheMap extends EventEmitter {
|
|
|
475
472
|
this.dispatch('change', this.version);
|
|
476
473
|
}
|
|
477
474
|
set(id, bounds) {
|
|
478
|
-
if (this._map.has(id)
|
|
475
|
+
if (this._map.has(id)) {
|
|
476
|
+
const b = this._map.get(id), bb = bounds;
|
|
477
|
+
if (b.width === bb.width && b.height === bb.height) {
|
|
478
|
+
return this._map;
|
|
479
|
+
}
|
|
479
480
|
return this._map;
|
|
480
481
|
}
|
|
481
482
|
const v = this._map.set(id, bounds);
|
|
@@ -502,56 +503,6 @@ class CacheMap extends EventEmitter {
|
|
|
502
503
|
}
|
|
503
504
|
}
|
|
504
505
|
|
|
505
|
-
/**
|
|
506
|
-
* Returns the removed or updated elements of a collection.
|
|
507
|
-
* @link https://github.com/DjonnyX/ng-virtual-list/blob/18.x/projects/ng-virtual-list/src/lib/utils/collection.ts
|
|
508
|
-
* @author Evgenii Grebennikov
|
|
509
|
-
* @email djonnyx@gmail.com
|
|
510
|
-
*/
|
|
511
|
-
const getCollectionRemovedOrUpdatedItems = (previousCollection, currentCollection) => {
|
|
512
|
-
const result = { deleted: new Array(), updated: new Array(), added: new Array(), notChanged: new Array() };
|
|
513
|
-
if (!currentCollection || currentCollection.length === 0) {
|
|
514
|
-
return { deleted: (previousCollection ? [...previousCollection] : []), updated: [], added: [], notChanged: [] };
|
|
515
|
-
}
|
|
516
|
-
if (!previousCollection || previousCollection.length === 0) {
|
|
517
|
-
return { deleted: [], updated: [], added: (currentCollection ? [...currentCollection] : []), notChanged: [] };
|
|
518
|
-
}
|
|
519
|
-
const collectionDict = {};
|
|
520
|
-
for (let i = 0, l = currentCollection.length; i < l; i++) {
|
|
521
|
-
const item = currentCollection[i];
|
|
522
|
-
if (item) {
|
|
523
|
-
collectionDict[item.id] = item;
|
|
524
|
-
}
|
|
525
|
-
}
|
|
526
|
-
const notChangedMap = {}, deletedMap = {}, updatedMap = {};
|
|
527
|
-
for (let i = 0, l = previousCollection.length; i < l; i++) {
|
|
528
|
-
const item = previousCollection[i], id = item.id;
|
|
529
|
-
if (item) {
|
|
530
|
-
if (collectionDict.hasOwnProperty(id)) {
|
|
531
|
-
if (item === collectionDict[id]) {
|
|
532
|
-
result.notChanged.push(item);
|
|
533
|
-
notChangedMap[item.id] = item;
|
|
534
|
-
continue;
|
|
535
|
-
}
|
|
536
|
-
else {
|
|
537
|
-
result.updated.push(item);
|
|
538
|
-
updatedMap[item.id] = item;
|
|
539
|
-
continue;
|
|
540
|
-
}
|
|
541
|
-
}
|
|
542
|
-
result.deleted.push(item);
|
|
543
|
-
deletedMap[item.id] = item;
|
|
544
|
-
}
|
|
545
|
-
}
|
|
546
|
-
for (let i = 0, l = currentCollection.length; i < l; i++) {
|
|
547
|
-
const item = currentCollection[i], id = item.id;
|
|
548
|
-
if (item && !deletedMap.hasOwnProperty(id) && !updatedMap.hasOwnProperty(id) && !notChangedMap.hasOwnProperty(id)) {
|
|
549
|
-
result.added.push(item);
|
|
550
|
-
}
|
|
551
|
-
}
|
|
552
|
-
return result;
|
|
553
|
-
};
|
|
554
|
-
|
|
555
506
|
const TRACK_BOX_CHANGE_EVENT_NAME = 'change';
|
|
556
507
|
var ItemDisplayMethods;
|
|
557
508
|
(function (ItemDisplayMethods) {
|
|
@@ -582,13 +533,22 @@ class TrackBox extends CacheMap {
|
|
|
582
533
|
}
|
|
583
534
|
this._displayComponents = v;
|
|
584
535
|
}
|
|
536
|
+
/**
|
|
537
|
+
* Set the trackBy property
|
|
538
|
+
*/
|
|
539
|
+
set trackingPropertyName(v) {
|
|
540
|
+
this._tracker.trackingPropertyName = v;
|
|
541
|
+
}
|
|
585
542
|
constructor(trackingPropertyName) {
|
|
586
543
|
super();
|
|
587
544
|
this._tracker = new Tracker(trackingPropertyName);
|
|
588
545
|
}
|
|
589
546
|
set(id, bounds) {
|
|
590
|
-
if (this._map.has(id)
|
|
591
|
-
|
|
547
|
+
if (this._map.has(id)) {
|
|
548
|
+
const b = this._map.get(id);
|
|
549
|
+
if (b?.width === bounds.width && b.height === bounds.height) {
|
|
550
|
+
return this._map;
|
|
551
|
+
}
|
|
592
552
|
}
|
|
593
553
|
const v = this._map.set(id, bounds);
|
|
594
554
|
this.bumpVersion();
|
|
@@ -611,31 +571,69 @@ class TrackBox extends CacheMap {
|
|
|
611
571
|
console.warn('Attention! The collection must be immutable.');
|
|
612
572
|
return;
|
|
613
573
|
}
|
|
614
|
-
|
|
615
|
-
this.clearCache(deleted, updated, added, itemSize);
|
|
574
|
+
this.updateCache(this._previousCollection, currentCollection, itemSize);
|
|
616
575
|
this._previousCollection = currentCollection;
|
|
617
576
|
}
|
|
618
577
|
/**
|
|
619
|
-
*
|
|
578
|
+
* Update the cache of items from the list
|
|
620
579
|
*/
|
|
621
|
-
|
|
622
|
-
if (
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
580
|
+
updateCache(previousCollection, currentCollection, itemSize) {
|
|
581
|
+
if (!currentCollection || currentCollection.length === 0) {
|
|
582
|
+
if (previousCollection) {
|
|
583
|
+
// deleted
|
|
584
|
+
for (let i = 0, l = previousCollection.length; i < l; i++) {
|
|
585
|
+
const item = previousCollection[i], id = item.id;
|
|
586
|
+
if (this._map.has(id)) {
|
|
587
|
+
this._map.delete(id);
|
|
588
|
+
}
|
|
627
589
|
}
|
|
628
590
|
}
|
|
591
|
+
return;
|
|
629
592
|
}
|
|
630
|
-
if (
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
593
|
+
if (!previousCollection || previousCollection.length === 0) {
|
|
594
|
+
if (currentCollection) {
|
|
595
|
+
// added
|
|
596
|
+
for (let i = 0, l = currentCollection.length; i < l; i++) {
|
|
597
|
+
const item = currentCollection[i], id = item.id;
|
|
598
|
+
this._map.set(id, { x: 0, y: 0, width: itemSize, height: itemSize, method: ItemDisplayMethods.CREATE });
|
|
599
|
+
}
|
|
600
|
+
}
|
|
601
|
+
return;
|
|
602
|
+
}
|
|
603
|
+
const collectionDict = {};
|
|
604
|
+
for (let i = 0, l = currentCollection.length; i < l; i++) {
|
|
605
|
+
const item = currentCollection[i];
|
|
606
|
+
if (item) {
|
|
607
|
+
collectionDict[item.id] = item;
|
|
608
|
+
}
|
|
609
|
+
}
|
|
610
|
+
const notChangedMap = {}, deletedMap = {}, updatedMap = {};
|
|
611
|
+
for (let i = 0, l = previousCollection.length; i < l; i++) {
|
|
612
|
+
const item = previousCollection[i], id = item.id;
|
|
613
|
+
if (item) {
|
|
614
|
+
if (collectionDict.hasOwnProperty(id)) {
|
|
615
|
+
if (item === collectionDict[id]) {
|
|
616
|
+
// not changed
|
|
617
|
+
notChangedMap[item.id] = item;
|
|
618
|
+
this._map.set(id, { ...(this._map.get(id) || { x: 0, y: 0, width: itemSize, height: itemSize }), method: ItemDisplayMethods.NOT_CHANGED });
|
|
619
|
+
continue;
|
|
620
|
+
}
|
|
621
|
+
else {
|
|
622
|
+
// updated
|
|
623
|
+
updatedMap[item.id] = item;
|
|
624
|
+
this._map.set(id, { ...(this._map.get(id) || { x: 0, y: 0, width: itemSize, height: itemSize }), method: ItemDisplayMethods.UPDATE });
|
|
625
|
+
continue;
|
|
626
|
+
}
|
|
627
|
+
}
|
|
628
|
+
// deleted
|
|
629
|
+
deletedMap[item.id] = item;
|
|
630
|
+
this._map.delete(id);
|
|
634
631
|
}
|
|
635
632
|
}
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
633
|
+
for (let i = 0, l = currentCollection.length; i < l; i++) {
|
|
634
|
+
const item = currentCollection[i], id = item.id;
|
|
635
|
+
if (item && !deletedMap.hasOwnProperty(id) && !updatedMap.hasOwnProperty(id) && !notChangedMap.hasOwnProperty(id)) {
|
|
636
|
+
// added
|
|
639
637
|
this._map.set(id, { x: 0, y: 0, width: itemSize, height: itemSize, method: ItemDisplayMethods.CREATE });
|
|
640
638
|
}
|
|
641
639
|
}
|
|
@@ -907,6 +905,10 @@ class TrackBox extends CacheMap {
|
|
|
907
905
|
this.clearScrollDirectionCache();
|
|
908
906
|
}
|
|
909
907
|
}
|
|
908
|
+
changes() {
|
|
909
|
+
this.bumpVersion();
|
|
910
|
+
this.fireChange();
|
|
911
|
+
}
|
|
910
912
|
generateDisplayCollection(items, stickyMap, metrics) {
|
|
911
913
|
const { normalizedItemWidth, normalizedItemHeight, dynamicSize, itemsFromStartToScrollEnd, isVertical, renderItems: renderItemsLength, scrollSize, sizeProperty, snap, snippedPos, startPosition, totalLength, startIndex, typicalItemSize, } = metrics, displayItems = [];
|
|
912
914
|
if (items.length) {
|
|
@@ -1267,10 +1269,14 @@ class NgVirtualListComponent {
|
|
|
1267
1269
|
_elementRef = inject((ElementRef));
|
|
1268
1270
|
_initialized;
|
|
1269
1271
|
$initialized;
|
|
1272
|
+
/**
|
|
1273
|
+
* The name of the property by which tracking is performed
|
|
1274
|
+
*/
|
|
1275
|
+
trackBy = input(TRACK_BY_PROPERTY_NAME);
|
|
1270
1276
|
/**
|
|
1271
1277
|
* Dictionary of element sizes by their id
|
|
1272
1278
|
*/
|
|
1273
|
-
_trackBox = new TrackBox(
|
|
1279
|
+
_trackBox = new TrackBox(this.trackBy());
|
|
1274
1280
|
_onTrackBoxChangeHandler = (v) => {
|
|
1275
1281
|
this._$cacheVersion.next(v);
|
|
1276
1282
|
};
|
|
@@ -1283,6 +1289,10 @@ class NgVirtualListComponent {
|
|
|
1283
1289
|
this._initialized = signal(false);
|
|
1284
1290
|
this.$initialized = toObservable(this._initialized);
|
|
1285
1291
|
this._trackBox.displayComponents = this._displayComponents;
|
|
1292
|
+
const $trackBy = toObservable(this.trackBy);
|
|
1293
|
+
$trackBy.pipe(takeUntilDestroyed(), tap(v => {
|
|
1294
|
+
this._trackBox.trackingPropertyName = v;
|
|
1295
|
+
})).subscribe();
|
|
1286
1296
|
const $bounds = toObservable(this._bounds).pipe(filter(b => !!b)), $items = toObservable(this.items).pipe(map(i => !i ? [] : i)), $scrollSize = toObservable(this._scrollSize), $itemSize = toObservable(this.itemSize).pipe(map(v => v <= 0 ? DEFAULT_ITEM_SIZE : v)), $itemsOffset = toObservable(this.itemsOffset).pipe(map(v => v < 0 ? DEFAULT_ITEMS_OFFSET : v)), $stickyMap = toObservable(this.stickyMap).pipe(map(v => !v ? {} : v)), $snap = toObservable(this.snap), $snapToItem = toObservable(this.snapToItem), $isVertical = toObservable(this.direction).pipe(map(v => this.getIsVertical(v || DEFAULT_DIRECTION))), $dynamicSize = toObservable(this.dynamicSize), $enabledBufferOptimization = toObservable(this.enabledBufferOptimization), $cacheVersion = this.$cacheVersion;
|
|
1287
1297
|
$isVertical.pipe(takeUntilDestroyed(), tap(v => {
|
|
1288
1298
|
this._isVertical = v;
|
|
@@ -1311,7 +1321,10 @@ class NgVirtualListComponent {
|
|
|
1311
1321
|
if (!this.isScrolling && dynamicSize && container) {
|
|
1312
1322
|
actualScrollSize = scrollSize + delta;
|
|
1313
1323
|
if (snapToItem) {
|
|
1314
|
-
|
|
1324
|
+
const items = this.items(), isVertical = this._isVertical, targetItem = this._trackBox.getNearestItem(actualScrollSize, items, itemSize, isVertical);
|
|
1325
|
+
if (targetItem) {
|
|
1326
|
+
this.scrollTo(targetItem.id, BEHAVIOR_INSTANT);
|
|
1327
|
+
}
|
|
1315
1328
|
}
|
|
1316
1329
|
else if (scrollSize !== actualScrollSize) {
|
|
1317
1330
|
const params = {
|
|
@@ -1347,6 +1360,9 @@ class NgVirtualListComponent {
|
|
|
1347
1360
|
const dir = d || this.direction();
|
|
1348
1361
|
return isDirection(dir, Directions.VERTICAL);
|
|
1349
1362
|
}
|
|
1363
|
+
_componentsResizeObserver = new ResizeObserver(() => {
|
|
1364
|
+
this._trackBox.changes();
|
|
1365
|
+
});
|
|
1350
1366
|
createDisplayComponentsIfNeed(displayItems) {
|
|
1351
1367
|
if (!displayItems || !this._listContainerRef) {
|
|
1352
1368
|
this._trackBox.setDisplayObjectIndexMapById({});
|
|
@@ -1358,15 +1374,19 @@ class NgVirtualListComponent {
|
|
|
1358
1374
|
if (_listContainerRef) {
|
|
1359
1375
|
const comp = _listContainerRef.createComponent(NgVirtualListItemComponent);
|
|
1360
1376
|
this._displayComponents.push(comp);
|
|
1377
|
+
this._componentsResizeObserver.observe(comp.instance.element);
|
|
1361
1378
|
}
|
|
1362
1379
|
}
|
|
1363
1380
|
const maxLength = displayItems.length;
|
|
1364
1381
|
while (this._displayComponents.length > maxLength) {
|
|
1365
1382
|
const comp = this._displayComponents.pop();
|
|
1366
|
-
comp
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1383
|
+
if (comp) {
|
|
1384
|
+
this._componentsResizeObserver.unobserve(comp.instance.element);
|
|
1385
|
+
comp?.destroy();
|
|
1386
|
+
const id = comp?.instance.item?.id;
|
|
1387
|
+
if (id !== undefined) {
|
|
1388
|
+
this._trackBox.untrackComponentByIdProperty(comp?.instance);
|
|
1389
|
+
}
|
|
1370
1390
|
}
|
|
1371
1391
|
}
|
|
1372
1392
|
this.resetRenderers();
|
|
@@ -1523,8 +1543,11 @@ class NgVirtualListComponent {
|
|
|
1523
1543
|
containerEl.nativeElement.removeEventListener(SCROLL_END, this._onScrollEndHandler);
|
|
1524
1544
|
containerEl.nativeElement.removeEventListener(SCROLL, this._onContainerScrollHandler);
|
|
1525
1545
|
containerEl.nativeElement.removeEventListener(SCROLL_END, this._onContainerScrollEndHandler);
|
|
1546
|
+
if (this._componentsResizeObserver) {
|
|
1547
|
+
this._componentsResizeObserver.disconnect();
|
|
1548
|
+
}
|
|
1526
1549
|
if (this._resizeObserver) {
|
|
1527
|
-
this._resizeObserver.
|
|
1550
|
+
this._resizeObserver.disconnect();
|
|
1528
1551
|
}
|
|
1529
1552
|
}
|
|
1530
1553
|
if (this._displayComponents) {
|
|
@@ -1535,7 +1558,7 @@ class NgVirtualListComponent {
|
|
|
1535
1558
|
}
|
|
1536
1559
|
}
|
|
1537
1560
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: NgVirtualListComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1538
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "18.2.13", type: NgVirtualListComponent, selector: "ng-virtual-list", inputs: { items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: true, transformFunction: null }, snap: { classPropertyName: "snap", publicName: "snap", isSignal: true, isRequired: false, transformFunction: null }, snapToItem: { classPropertyName: "snapToItem", publicName: "snapToItem", 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 }, stickyMap: { classPropertyName: "stickyMap", publicName: "stickyMap", 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 }, itemsOffset: { classPropertyName: "itemsOffset", publicName: "itemsOffset", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { onScroll: "onScroll", onScrollEnd: "onScrollEnd" }, viewQueries: [{ 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 }], ngImport: i0, template: "<div #container part=\"scroller\" class=\"ngvl__container\">\r\n <ul #list part=\"list\" class=\"ngvl__list\">\r\n <ng-container #renderersContainer></ng-container>\r\n </ul>\r\n</div>", styles: [":host{display:block;width:400px;overflow:hidden}:host(.horizontal){height:48px}:host(.vertical){height:320px}.ngvl__container{overflow:auto;width:100%;height:100%}.ngvl__list{position:relative;list-style:none;padding:0;margin:0;width:100%;height:100%}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.ShadowDom });
|
|
1561
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "18.2.13", type: NgVirtualListComponent, selector: "ng-virtual-list", inputs: { items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: true, transformFunction: null }, snap: { classPropertyName: "snap", publicName: "snap", isSignal: true, isRequired: false, transformFunction: null }, snapToItem: { classPropertyName: "snapToItem", publicName: "snapToItem", 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 }, stickyMap: { classPropertyName: "stickyMap", publicName: "stickyMap", 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 }, itemsOffset: { classPropertyName: "itemsOffset", publicName: "itemsOffset", isSignal: true, isRequired: false, transformFunction: null }, trackBy: { classPropertyName: "trackBy", publicName: "trackBy", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { onScroll: "onScroll", onScrollEnd: "onScrollEnd" }, viewQueries: [{ 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 }], ngImport: i0, template: "<div #container part=\"scroller\" class=\"ngvl__container\">\r\n <ul #list part=\"list\" class=\"ngvl__list\">\r\n <ng-container #renderersContainer></ng-container>\r\n </ul>\r\n</div>", styles: [":host{display:block;width:400px;overflow:hidden}:host(.horizontal){height:48px}:host(.vertical){height:320px}.ngvl__container{overflow:auto;width:100%;height:100%}.ngvl__list{position:relative;list-style:none;padding:0;margin:0;width:100%;height:100%}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.ShadowDom });
|
|
1539
1562
|
}
|
|
1540
1563
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: NgVirtualListComponent, decorators: [{
|
|
1541
1564
|
type: Component,
|