ng-virtual-list 0.7.3 → 14.0.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.
Files changed (66) hide show
  1. package/README.md +44 -71
  2. package/esm2020/lib/components/ng-virtual-list-item.component.mjs +80 -0
  3. package/esm2020/lib/const/index.mjs +34 -0
  4. package/esm2020/lib/enums/direction.mjs +2 -0
  5. package/esm2020/lib/enums/directions.mjs +18 -0
  6. package/esm2020/lib/enums/index.mjs +3 -0
  7. package/esm2020/lib/models/collection.model.mjs +3 -0
  8. package/esm2020/lib/models/index.mjs +2 -0
  9. package/esm2020/lib/models/item.model.mjs +3 -0
  10. package/esm2020/lib/models/render-collection.model.mjs +3 -0
  11. package/esm2020/lib/models/render-item-config.model.mjs +2 -0
  12. package/esm2020/lib/models/render-item.model.mjs +3 -0
  13. package/esm2020/lib/models/sticky-map.model.mjs +2 -0
  14. package/esm2020/lib/ng-virtual-list.component.mjs +510 -0
  15. package/esm2020/lib/ng-virtual-list.module.mjs +20 -0
  16. package/esm2020/lib/types/id.mjs +2 -0
  17. package/esm2020/lib/types/index.mjs +2 -0
  18. package/esm2020/lib/types/rect.mjs +2 -0
  19. package/esm2020/lib/types/size.mjs +2 -0
  20. package/esm2020/lib/utils/cacheMap.mjs +52 -0
  21. package/esm2020/lib/utils/debounce.mjs +31 -0
  22. package/esm2020/lib/utils/disposableComponent.mjs +29 -0
  23. package/esm2020/lib/utils/eventEmitter.mjs +106 -0
  24. package/esm2020/lib/utils/index.mjs +8 -0
  25. package/esm2020/lib/utils/isDirection.mjs +15 -0
  26. package/esm2020/lib/utils/toggleClassName.mjs +15 -0
  27. package/esm2020/lib/utils/trackBox.mjs +352 -0
  28. package/esm2020/lib/utils/tracker.mjs +108 -0
  29. package/esm2020/ng-virtual-list.mjs +5 -0
  30. package/esm2020/public-api.mjs +8 -0
  31. package/fesm2015/ng-virtual-list.mjs +1360 -0
  32. package/fesm2015/ng-virtual-list.mjs.map +1 -0
  33. package/fesm2020/ng-virtual-list.mjs +1359 -0
  34. package/fesm2020/ng-virtual-list.mjs.map +1 -0
  35. package/index.d.ts +5 -5
  36. package/lib/components/ng-virtual-list-item.component.d.ts +28 -28
  37. package/lib/const/index.d.ts +32 -31
  38. package/lib/enums/direction.d.ts +8 -2
  39. package/lib/enums/directions.d.ts +16 -4
  40. package/lib/enums/index.d.ts +4 -4
  41. package/lib/models/collection.model.d.ts +9 -3
  42. package/lib/models/index.d.ts +4 -4
  43. package/lib/models/item.model.d.ts +14 -5
  44. package/lib/models/render-collection.model.d.ts +9 -3
  45. package/lib/models/render-item-config.model.d.ts +33 -7
  46. package/lib/models/render-item.model.d.ts +28 -10
  47. package/lib/models/sticky-map.model.d.ts +12 -6
  48. package/lib/ng-virtual-list.component.d.ts +151 -110
  49. package/lib/ng-virtual-list.module.d.ts +9 -0
  50. package/lib/types/id.d.ts +7 -1
  51. package/lib/types/index.d.ts +4 -4
  52. package/lib/types/rect.d.ts +17 -5
  53. package/lib/types/size.d.ts +16 -4
  54. package/lib/utils/cacheMap.d.ts +34 -31
  55. package/lib/utils/debounce.d.ts +16 -10
  56. package/lib/utils/disposableComponent.d.ts +15 -0
  57. package/lib/utils/eventEmitter.d.ts +40 -37
  58. package/lib/utils/index.d.ts +7 -6
  59. package/lib/utils/isDirection.d.ts +8 -2
  60. package/lib/utils/toggleClassName.d.ts +7 -1
  61. package/lib/utils/trackBox.d.ts +113 -73
  62. package/lib/utils/tracker.d.ts +38 -38
  63. package/package.json +18 -6
  64. package/public-api.d.ts +4 -3
  65. package/fesm2022/ng-virtual-list.mjs +0 -939
  66. package/fesm2022/ng-virtual-list.mjs.map +0 -1
@@ -1,939 +0,0 @@
1
- import * as i0 from '@angular/core';
2
- import { signal, inject, ElementRef, ChangeDetectionStrategy, Component, viewChild, output, input, ViewContainerRef, ViewChild, ViewEncapsulation } from '@angular/core';
3
- import * as i1 from '@angular/common';
4
- import { CommonModule } from '@angular/common';
5
- import { toObservable, takeUntilDestroyed } from '@angular/core/rxjs-interop';
6
- import { BehaviorSubject, filter, map, tap, combineLatest, distinctUntilChanged, switchMap, of } from 'rxjs';
7
-
8
- var Directions;
9
- (function (Directions) {
10
- Directions["HORIZONTAL"] = "horizontal";
11
- Directions["VERTICAL"] = "vertical";
12
- })(Directions || (Directions = {}));
13
-
14
- const DEFAULT_ITEM_SIZE = 24;
15
- const DEFAULT_ITEMS_OFFSET = 2;
16
- const DEFAULT_LIST_SIZE = 400;
17
- const DEFAULT_SNAP = false;
18
- const DEFAULT_SNAP_TO_ITEM = false;
19
- const DEFAULT_DYNAMIC_SIZE = false;
20
- const TRACK_BY_PROPERTY_NAME = 'id';
21
- const DEFAULT_DIRECTION = Directions.VERTICAL;
22
- const DISPLAY_OBJECTS_LENGTH_MESUREMENT_ERROR = 1;
23
- // presets
24
- const BEHAVIOR_INSTANT = 'instant';
25
- const BEHAVIOR_AUTO = 'auto';
26
- const VISIBILITY_VISIBLE = 'visible';
27
- const VISIBILITY_HIDDEN = 'hidden';
28
- const SIZE_100_PERSENT = '100%';
29
- const SIZE_AUTO = 'auto';
30
- const POSITION_ABSOLUTE = 'absolute';
31
- const POSITION_STICKY = 'sticky';
32
- const TRANSLATE_3D = 'translate3d';
33
- const ZEROS_TRANSLATE_3D = `${TRANSLATE_3D}(0,0,0)`;
34
- const TOP_PROP_NAME = 'top';
35
- const LEFT_PROP_NAME = 'left';
36
- const X_PROP_NAME = 'x';
37
- const Y_PROP_NAME = 'y';
38
- const WIDTH_PROP_NAME = 'width';
39
- const HEIGHT_PROP_NAME = 'height';
40
- const PX = 'px';
41
- const SCROLL = 'scroll';
42
- const SCROLL_END = 'scrollend';
43
- const CLASS_LIST_VERTICAL = 'vertical';
44
- const CLASS_LIST_HORIZONTAL = 'horizontal';
45
-
46
- /**
47
- * Virtual list item component
48
- * @homepage https://github.com/DjonnyX/ng-virtual-list/tree/main/projects/ng-virtual-list
49
- * @author Evgenii Grebennikov
50
- * @email djonnyx@gmail.com
51
- */
52
- class NgVirtualListItemComponent {
53
- static __nextId = 0;
54
- _id;
55
- get id() {
56
- return this._id;
57
- }
58
- data = signal(undefined);
59
- _data = undefined;
60
- set item(v) {
61
- if (this._data === v) {
62
- return;
63
- }
64
- const data = this._data = v;
65
- if (data) {
66
- const styles = this._elementRef.nativeElement.style;
67
- styles.zIndex = data.config.sticky;
68
- if (data.config.snapped) {
69
- styles.transform = ZEROS_TRANSLATE_3D;
70
- styles.position = POSITION_STICKY;
71
- }
72
- else {
73
- styles.position = POSITION_ABSOLUTE;
74
- styles.transform = `${TRANSLATE_3D}(${data.config.isVertical ? 0 : data.measures.x}${PX}, ${data.config.isVertical ? data.measures.y : 0}${PX} , 0)`;
75
- }
76
- styles.height = data.config.isVertical ? data.config.dynamic ? SIZE_AUTO : `${data.measures.height}${PX}` : SIZE_100_PERSENT;
77
- styles.width = data.config.isVertical ? SIZE_100_PERSENT : data.config.dynamic ? SIZE_AUTO : `${data.measures.width}${PX}`;
78
- }
79
- this.data.set(v);
80
- }
81
- get itemId() {
82
- return this._data?.id;
83
- }
84
- itemRenderer = signal(undefined);
85
- set renderer(v) {
86
- this.itemRenderer.set(v);
87
- }
88
- _elementRef = inject((ElementRef));
89
- constructor() {
90
- this._id = NgVirtualListItemComponent.__nextId = NgVirtualListItemComponent.__nextId === Number.MAX_SAFE_INTEGER
91
- ? 0 : NgVirtualListItemComponent.__nextId + 1;
92
- }
93
- getBounds() {
94
- const el = this._elementRef.nativeElement, { width, height, left, top } = el.getBoundingClientRect();
95
- return { width, height, x: left, y: top };
96
- }
97
- showIfNeed() {
98
- const styles = this._elementRef.nativeElement.style;
99
- if (styles.visibility === VISIBILITY_VISIBLE) {
100
- return;
101
- }
102
- styles.visibility = VISIBILITY_VISIBLE;
103
- }
104
- hide() {
105
- const styles = this._elementRef.nativeElement.style;
106
- if (styles.visibility === VISIBILITY_HIDDEN) {
107
- return;
108
- }
109
- styles.visibility = VISIBILITY_HIDDEN;
110
- }
111
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: NgVirtualListItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
112
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.14", type: NgVirtualListItemComponent, isStandalone: true, selector: "ng-virtual-list-item", host: { classAttribute: "ngvl__item" }, ngImport: i0, template: "@let item = data();\r\n@let renderer = itemRenderer();\r\n\r\n@if (item) {\r\n<li #listItem part=\"item\" class=\"ngvl-item__container\" [ngClass]=\"{snipped: item.config.snapped}\">\r\n @if (renderer) {\r\n <ng-container [ngTemplateOutlet]=\"renderer\" [ngTemplateOutletContext]=\"{data: item.data || {}, config: item.config}\" />\r\n }\r\n</li>\r\n}", styles: [":host{display:block;position:absolute;left:0;top:0;box-sizing:border-box;overflow:hidden}.ngvl-item__container{margin:0;padding:0;overflow:hidden;background-color:#fff;width:inherit;height:inherit}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
113
- }
114
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: NgVirtualListItemComponent, decorators: [{
115
- type: Component,
116
- args: [{ selector: 'ng-virtual-list-item', imports: [CommonModule], host: {
117
- 'class': 'ngvl__item',
118
- }, changeDetection: ChangeDetectionStrategy.OnPush, template: "@let item = data();\r\n@let renderer = itemRenderer();\r\n\r\n@if (item) {\r\n<li #listItem part=\"item\" class=\"ngvl-item__container\" [ngClass]=\"{snipped: item.config.snapped}\">\r\n @if (renderer) {\r\n <ng-container [ngTemplateOutlet]=\"renderer\" [ngTemplateOutletContext]=\"{data: item.data || {}, config: item.config}\" />\r\n }\r\n</li>\r\n}", styles: [":host{display:block;position:absolute;left:0;top:0;box-sizing:border-box;overflow:hidden}.ngvl-item__container{margin:0;padding:0;overflow:hidden;background-color:#fff;width:inherit;height:inherit}\n"] }]
119
- }], ctorParameters: () => [] });
120
-
121
- const HORIZONTAL_ALIASES = [Directions.HORIZONTAL, 'horizontal'], VERTICAL_ALIASES = [Directions.VERTICAL, 'vertical'];
122
- const isDirection = (src, expected) => {
123
- if (HORIZONTAL_ALIASES.includes(expected)) {
124
- return HORIZONTAL_ALIASES.includes(src);
125
- }
126
- return VERTICAL_ALIASES.includes(src);
127
- };
128
-
129
- /**
130
- * Simple debounce function.
131
- * @homepage https://github.com/DjonnyX/ng-virtual-list/tree/main/projects/ng-virtual-list
132
- * @author Evgenii Grebennikov
133
- * @email djonnyx@gmail.com
134
- */
135
- const debounce = (cb, debounceTime = 0) => {
136
- let timeout;
137
- const dispose = () => {
138
- if (timeout !== undefined) {
139
- clearTimeout(timeout);
140
- }
141
- };
142
- const execute = (...args) => {
143
- dispose();
144
- timeout = setTimeout(() => {
145
- cb(...args);
146
- }, debounceTime);
147
- };
148
- return {
149
- execute,
150
- dispose,
151
- };
152
- };
153
-
154
- const toggleClassName = (el, className, remove = false) => {
155
- if (!el.classList.contains(className)) {
156
- el.classList.add(className);
157
- }
158
- else if (remove) {
159
- el.classList.remove(className);
160
- }
161
- };
162
-
163
- /**
164
- * Tracks display items by property
165
- * @homepage https://github.com/DjonnyX/ng-virtual-list/tree/main/projects/ng-virtual-list
166
- * @author Evgenii Grebennikov
167
- * @email djonnyx@gmail.com
168
- */
169
- class Tracker {
170
- /**
171
- * display objects dictionary of indexes by id
172
- */
173
- _displayObjectIndexMapById = {};
174
- set displayObjectIndexMapById(v) {
175
- if (this._displayObjectIndexMapById === v) {
176
- return;
177
- }
178
- this._displayObjectIndexMapById = v;
179
- }
180
- get displayObjectIndexMapById() {
181
- return this._displayObjectIndexMapById;
182
- }
183
- /**
184
- * Dictionary displayItems propertyNameId by items propertyNameId
185
- */
186
- _trackMap = {};
187
- get trackMap() {
188
- return this._trackMap;
189
- }
190
- _trackingPropertyName;
191
- constructor(trackingPropertyName) {
192
- this._trackingPropertyName = trackingPropertyName;
193
- }
194
- /**
195
- * tracking by propName
196
- */
197
- track(items, components, afterComponentSetup) {
198
- if (!items) {
199
- return;
200
- }
201
- const idPropName = this._trackingPropertyName, untrackedItems = [...components];
202
- for (let i = 0, l = items.length; i < l; i++) {
203
- const item = items[i], itemTrackingProperty = item[idPropName];
204
- if (this._trackMap) {
205
- const diId = this._trackMap[itemTrackingProperty];
206
- if (this._trackMap.hasOwnProperty(itemTrackingProperty)) {
207
- const lastIndex = this._displayObjectIndexMapById[diId], el = components[lastIndex];
208
- this._checkComponentProperty(el?.instance);
209
- const elId = el?.instance?.[itemTrackingProperty];
210
- if (el && elId === diId) {
211
- const indexByUntrackedItems = untrackedItems.findIndex(v => {
212
- this._checkComponentProperty(v.instance);
213
- return v.instance[itemTrackingProperty] === elId;
214
- });
215
- if (indexByUntrackedItems > -1) {
216
- el.instance.item = item;
217
- if (afterComponentSetup !== undefined) {
218
- afterComponentSetup(el.instance, item);
219
- }
220
- untrackedItems.splice(indexByUntrackedItems, 1);
221
- continue;
222
- }
223
- }
224
- delete this._trackMap[itemTrackingProperty];
225
- }
226
- }
227
- if (untrackedItems.length > 0) {
228
- const el = untrackedItems.shift(), item = items[i];
229
- if (el) {
230
- el.instance.item = item;
231
- if (this._trackMap) {
232
- this._checkComponentProperty(el.instance);
233
- this._trackMap[itemTrackingProperty] = el.instance[itemTrackingProperty];
234
- }
235
- if (afterComponentSetup !== undefined) {
236
- afterComponentSetup(el.instance, item);
237
- }
238
- }
239
- }
240
- }
241
- if (untrackedItems.length) {
242
- throw Error('Tracking by id caused an error.');
243
- }
244
- }
245
- untrackComponentByIdProperty(component) {
246
- if (!component) {
247
- return;
248
- }
249
- const propertyIdName = this._trackingPropertyName;
250
- this._checkComponentProperty(component);
251
- if (this._trackMap && component[propertyIdName] !== undefined) {
252
- delete this._trackMap[propertyIdName];
253
- }
254
- }
255
- _checkComponentProperty(component) {
256
- if (!component) {
257
- return;
258
- }
259
- const propertyIdName = this._trackingPropertyName;
260
- try {
261
- component[propertyIdName];
262
- }
263
- catch (err) {
264
- throw Error(`Property ${propertyIdName} does not exist.`);
265
- }
266
- }
267
- dispose() {
268
- this._trackMap = null;
269
- }
270
- }
271
-
272
- /**
273
- * Simple event emitter
274
- * @homepage https://github.com/DjonnyX/ng-virtual-list/tree/main/projects/ng-virtual-list
275
- * @author Evgenii Grebennikov
276
- * @email djonnyx@gmail.com
277
- */
278
- class EventEmitter {
279
- _listeners = {};
280
- _disposed = false;
281
- constructor() { }
282
- /**
283
- * Emits the event
284
- */
285
- dispatch(event, ...args) {
286
- const ctx = this;
287
- const listeners = this._listeners[event];
288
- if (Array.isArray(listeners)) {
289
- for (let i = 0, l = listeners.length; i < l; i++) {
290
- const listener = listeners[i];
291
- if (listener) {
292
- listener.apply(ctx, args);
293
- }
294
- }
295
- }
296
- }
297
- /**
298
- * Emits the event async
299
- */
300
- dispatchAsync(event, ...args) {
301
- queueMicrotask(() => {
302
- if (this._disposed) {
303
- return;
304
- }
305
- this.dispatch(event, ...args);
306
- });
307
- }
308
- /**
309
- * Returns true if the event listener is already subscribed.
310
- */
311
- hasEventListener(eventName, handler) {
312
- const event = eventName;
313
- if (this._listeners.hasOwnProperty(event)) {
314
- const listeners = this._listeners[event];
315
- const index = listeners.findIndex(v => v === handler);
316
- if (index > -1) {
317
- return true;
318
- }
319
- }
320
- return false;
321
- }
322
- /**
323
- * Add event listener
324
- */
325
- addEventListener(eventName, handler) {
326
- const event = eventName;
327
- if (!this._listeners.hasOwnProperty(event)) {
328
- this._listeners[event] = [];
329
- }
330
- this._listeners[event].push(handler);
331
- }
332
- /**
333
- * Remove event listener
334
- */
335
- removeEventListener(eventName, handler) {
336
- const event = eventName;
337
- if (!this._listeners.hasOwnProperty(event)) {
338
- return;
339
- }
340
- const listeners = this._listeners[event], index = listeners.findIndex(v => v === handler);
341
- if (index > -1) {
342
- listeners.splice(index, 1);
343
- if (listeners.length === 0) {
344
- delete this._listeners[event];
345
- }
346
- }
347
- }
348
- /**
349
- * Remove all listeners
350
- */
351
- removeAllListeners() {
352
- const events = Object.keys(this._listeners);
353
- while (events.length > 0) {
354
- const event = events.pop();
355
- if (event) {
356
- const listeners = this._listeners[event];
357
- if (Array.isArray(listeners)) {
358
- while (listeners.length > 0) {
359
- const listener = listeners.pop();
360
- if (listener) {
361
- this.removeEventListener(event, listener);
362
- }
363
- }
364
- }
365
- }
366
- }
367
- }
368
- dispose() {
369
- this._disposed = true;
370
- this.removeAllListeners();
371
- }
372
- }
373
-
374
- /**
375
- * Cache map.
376
- * Emits a change event on each mutation.
377
- * @homepage https://github.com/DjonnyX/ng-virtual-list/tree/main/projects/ng-virtual-list
378
- * @author Evgenii Grebennikov
379
- * @email djonnyx@gmail.com
380
- */
381
- class CacheMap extends EventEmitter {
382
- _map = new Map();
383
- _version = 0;
384
- get version() {
385
- return this._version;
386
- }
387
- constructor() {
388
- super();
389
- }
390
- bumpVersion() {
391
- this._version = this._version === Number.MAX_SAFE_INTEGER ? 0 : this._version + 1;
392
- }
393
- fireChange() {
394
- this.dispatch('change', this.version);
395
- }
396
- set(id, bounds) {
397
- if (this._map.has(id) && JSON.stringify(this._map.get(id)) === JSON.stringify(bounds)) {
398
- return this._map;
399
- }
400
- const v = this._map.set(id, bounds);
401
- this.bumpVersion();
402
- this.fireChange();
403
- return v;
404
- }
405
- has(id) {
406
- return this._map.has(id);
407
- }
408
- get(id) {
409
- return this._map.get(id);
410
- }
411
- forEach(callbackfn, thisArg) {
412
- return this._map.forEach(callbackfn, thisArg);
413
- }
414
- dispose() {
415
- super.dispose();
416
- this._map.clear();
417
- }
418
- }
419
-
420
- const TRACK_BOX_CHANGE_EVENT_NAME = 'change';
421
- /**
422
- * An object that performs tracking, calculations and caching.
423
- * @homepage https://github.com/DjonnyX/ng-virtual-list/tree/main/projects/ng-virtual-list
424
- * @author Evgenii Grebennikov
425
- * @email djonnyx@gmail.com
426
- */
427
- class TrackBox extends CacheMap {
428
- _tracker;
429
- _items;
430
- set items(v) {
431
- if (this._items === v) {
432
- return;
433
- }
434
- this._items = v;
435
- }
436
- _displayComponents;
437
- set displayComponents(v) {
438
- if (this._displayComponents === v) {
439
- return;
440
- }
441
- this._displayComponents = v;
442
- }
443
- constructor(trackingPropertyName) {
444
- super();
445
- this._tracker = new Tracker(trackingPropertyName);
446
- }
447
- set(id, bounds) {
448
- if (this._map.has(id) && JSON.stringify(this._map.get(id)) === JSON.stringify(bounds)) {
449
- return this._map;
450
- }
451
- const v = this._map.set(id, bounds);
452
- this.bumpVersion();
453
- this.fireChange();
454
- return v;
455
- }
456
- _fireChanges = (version) => {
457
- this.dispatch(TRACK_BOX_CHANGE_EVENT_NAME, version);
458
- };
459
- _debounceChanges = debounce(this._fireChanges, 0);
460
- fireChange() {
461
- this._debounceChanges.execute(this._version);
462
- }
463
- recalculateMetrics(options) {
464
- const { bounds, collection, dynamicSize, isVertical, itemSize, itemsOffset, scrollSize, snap, } = options;
465
- const { width, height } = bounds, sizeProperty = isVertical ? HEIGHT_PROP_NAME : WIDTH_PROP_NAME, size = isVertical ? height : width, weightToDisplayEnd = scrollSize + height, totalLength = collection.length, typicalItemSize = itemSize, totalSize = dynamicSize ? this.getBoundsFromCache(collection, typicalItemSize, isVertical) : totalLength * typicalItemSize, snippedPos = Math.floor(scrollSize), leftItemsWeights = [];
466
- let itemsFromStartToScrollEnd = -1, itemsFromDisplayEndToOffsetEnd = 0, itemsFromStartToDisplayEnd = -1, leftItemLength = 0, rightItemLength = 0, leftItemsWeight = 0, rightItemsWeight = 0, leftHiddenItemsWeight = 0, totalItemsToDisplayEndWeight = 0, startIndex;
467
- if (dynamicSize) {
468
- let y = 0;
469
- for (let i = 0, l = collection.length; i < l; i++) {
470
- const ii = i + 1, collectionItem = collection[i], map = this._map;
471
- let componentSize = 0;
472
- if (map.has(collectionItem.id)) {
473
- const bounds = map.get(collectionItem.id);
474
- componentSize = bounds ? bounds[sizeProperty] : typicalItemSize;
475
- }
476
- else {
477
- componentSize = typicalItemSize;
478
- }
479
- if (y < scrollSize - componentSize) {
480
- leftItemsWeights.push(componentSize);
481
- leftHiddenItemsWeight += componentSize;
482
- itemsFromStartToScrollEnd = ii;
483
- }
484
- if (y < scrollSize + size + componentSize) {
485
- itemsFromStartToDisplayEnd = ii;
486
- totalItemsToDisplayEndWeight += componentSize;
487
- itemsFromDisplayEndToOffsetEnd = itemsFromStartToDisplayEnd + itemsOffset;
488
- }
489
- else if (i < itemsFromDisplayEndToOffsetEnd) {
490
- rightItemsWeight += componentSize;
491
- }
492
- y += componentSize;
493
- }
494
- if (itemsFromStartToScrollEnd === -1) {
495
- itemsFromStartToScrollEnd = 0;
496
- }
497
- if (itemsFromStartToDisplayEnd === -1) {
498
- itemsFromStartToDisplayEnd = 0;
499
- }
500
- leftItemsWeights.splice(0, leftItemsWeights.length - itemsOffset);
501
- leftItemsWeights.forEach(v => {
502
- leftItemsWeight += v;
503
- });
504
- leftItemLength = Math.min(itemsFromStartToScrollEnd, itemsOffset);
505
- rightItemLength = itemsFromStartToDisplayEnd + itemsOffset > totalLength
506
- ? totalLength - itemsFromStartToDisplayEnd : itemsOffset;
507
- startIndex = itemsFromStartToScrollEnd - leftItemLength;
508
- }
509
- else {
510
- itemsFromStartToScrollEnd = Math.ceil(scrollSize / typicalItemSize);
511
- itemsFromStartToDisplayEnd = Math.ceil((scrollSize + size) / typicalItemSize);
512
- leftItemLength = Math.min(itemsFromStartToScrollEnd, itemsOffset);
513
- rightItemLength = itemsFromStartToDisplayEnd + itemsOffset > totalLength
514
- ? totalLength - itemsFromStartToDisplayEnd : itemsOffset;
515
- startIndex = itemsFromStartToScrollEnd - leftItemLength;
516
- leftItemsWeight = leftItemLength * typicalItemSize;
517
- rightItemsWeight = rightItemLength * typicalItemSize,
518
- leftHiddenItemsWeight = itemsFromStartToScrollEnd * typicalItemSize,
519
- totalItemsToDisplayEndWeight = itemsFromStartToDisplayEnd * typicalItemSize;
520
- }
521
- const itemsOnDisplay = totalItemsToDisplayEndWeight - leftHiddenItemsWeight, itemsOnDisplayLength = itemsFromStartToDisplayEnd - itemsFromStartToScrollEnd;
522
- const metrics = {
523
- itemsFromStartToScrollEnd,
524
- itemsFromStartToDisplayEnd,
525
- itemsOnDisplay,
526
- itemsOnDisplayLength,
527
- leftHiddenItemsWeight,
528
- leftItemLength,
529
- leftItemsWeight,
530
- rightItemLength,
531
- rightItemsWeight,
532
- snippedPos,
533
- totalItemsToDisplayEndWeight,
534
- totalSize,
535
- typicalItemSize,
536
- };
537
- return metrics;
538
- }
539
- /**
540
- * tracking by propName
541
- */
542
- track() {
543
- if (!this._items || !this._displayComponents) {
544
- return;
545
- }
546
- this._tracker.track(this._items, this._displayComponents);
547
- }
548
- setDisplayObjectIndexMapById(v) {
549
- this._tracker.displayObjectIndexMapById = v;
550
- }
551
- untrackComponentByIdProperty(component) {
552
- this._tracker.untrackComponentByIdProperty(component);
553
- }
554
- cacheElements() {
555
- if (!this._displayComponents) {
556
- return;
557
- }
558
- for (let i = 0, l = this._displayComponents.length; i < l; i++) {
559
- const component = this._displayComponents[i], itemId = component.instance.itemId;
560
- if (itemId === undefined) {
561
- continue;
562
- }
563
- const bounds = component.instance.getBounds();
564
- this.set(itemId, bounds);
565
- }
566
- }
567
- /**
568
- * Returns calculated bounds from cache
569
- */
570
- getBoundsFromCache(items, typicalItemSize, isVertical) {
571
- const sizeProperty = isVertical ? HEIGHT_PROP_NAME : WIDTH_PROP_NAME, map = this._map;
572
- let size = 0;
573
- for (let i = 0, l = items.length; i < l; i++) {
574
- const item = items[i];
575
- if (map.has(item.id)) {
576
- const bounds = map.get(item.id);
577
- size += bounds ? bounds[sizeProperty] : typicalItemSize;
578
- }
579
- else {
580
- size += typicalItemSize;
581
- }
582
- }
583
- return size;
584
- }
585
- dispose() {
586
- super.dispose();
587
- if (this._debounceChanges) {
588
- this._debounceChanges.dispose();
589
- }
590
- if (this._tracker) {
591
- this._tracker.dispose();
592
- }
593
- }
594
- }
595
-
596
- /**
597
- * Virtual list component.
598
- * Maximum performance for extremely large lists.
599
- * It is based on algorithms for virtualization of screen objects.
600
- * @homepage https://github.com/DjonnyX/ng-virtual-list/tree/main/projects/ng-virtual-list
601
- * @author Evgenii Grebennikov
602
- * @email djonnyx@gmail.com
603
- */
604
- class NgVirtualListComponent {
605
- static __nextId = 0;
606
- _id = NgVirtualListComponent.__nextId;
607
- /**
608
- * Readonly. Returns the unique identifier of the component.
609
- */
610
- get id() { return this._id; }
611
- _listContainerRef;
612
- _container = viewChild('container');
613
- _list = viewChild('list');
614
- /**
615
- * Fires when the list has been scrolled.
616
- */
617
- onScroll = output();
618
- /**
619
- * Fires when the list has completed scrolling.
620
- */
621
- onScrollEnd = output();
622
- /**
623
- * Collection of list items.
624
- */
625
- items = input.required();
626
- /**
627
- * Determines whether elements will snap. Default value is "true".
628
- */
629
- snap = input(DEFAULT_SNAP);
630
- /**
631
- * Determines whether scroll positions will be snapped to the element. Default value is "false".
632
- */
633
- snapToItem = input(DEFAULT_SNAP_TO_ITEM);
634
- /**
635
- * Rendering element template.
636
- */
637
- itemRenderer = input.required();
638
- /**
639
- * Dictionary zIndex by id of the list element. If the value is not set or equal to 0,
640
- * then a simple element is displayed, if the value is greater than 0, then the sticky position mode is enabled for the element.
641
- */
642
- stickyMap = input({});
643
- /**
644
- * If direction = 'vertical', then the height of a typical element. If direction = 'horizontal', then the width of a typical element.
645
- * Ignored if the dynamicSize property is true.
646
- */
647
- itemSize = input(DEFAULT_ITEM_SIZE);
648
- /**
649
- * If true then the items in the list can have different sizes and the itemSize property is ignored.
650
- * If false then the items in the list have a fixed size specified by the itemSize property. The default value is false.
651
- */
652
- dynamicSize = input(DEFAULT_DYNAMIC_SIZE);
653
- /**
654
- * Determines the direction in which elements are placed. Default value is "vertical".
655
- */
656
- direction = input(DEFAULT_DIRECTION);
657
- /**
658
- * Number of elements outside the scope of visibility. Default value is 2.
659
- */
660
- itemsOffset = input(DEFAULT_ITEMS_OFFSET);
661
- _isVertical = this.getIsVertical();
662
- _displayItems = signal(null);
663
- _displayComponents = [];
664
- _bounds = signal(null);
665
- _scrollSize = signal(0);
666
- _resizeObserver = null;
667
- _onResizeHandler = () => {
668
- this._bounds.set(this._container()?.nativeElement?.getBoundingClientRect() ?? null);
669
- };
670
- _onScrollHandler = (e) => {
671
- const target = e.target, scrollSize = this._isVertical ? target.scrollTop : target.scrollLeft;
672
- this._scrollSize.set(scrollSize);
673
- this.onScroll.emit(e);
674
- };
675
- _onScrollEndHandler = (e) => {
676
- const target = e.target, s = this.itemSize(), itemSize = s < 0 ? DEFAULT_ITEM_SIZE : s, snapToItem = this.snapToItem(), scrollSize = this._isVertical ? target.scrollTop : target.scrollLeft, scrollItems = Math.round(scrollSize / itemSize), actualScrollSize = snapToItem ? scrollItems * itemSize : scrollSize;
677
- if (target.scrollTop !== actualScrollSize) {
678
- const container = target, params = {
679
- [this._isVertical ? TOP_PROP_NAME : LEFT_PROP_NAME]: actualScrollSize,
680
- behavior: BEHAVIOR_INSTANT
681
- };
682
- container.scroll(params);
683
- }
684
- this.onScrollEnd.emit(e);
685
- };
686
- _elementRef = inject((ElementRef));
687
- _initialized = signal(false);
688
- /**
689
- * Dictionary of element sizes by their id
690
- */
691
- _trackBox = new TrackBox(TRACK_BY_PROPERTY_NAME);
692
- _onTrackBoxChangeHandler = (v) => {
693
- this._$cacheVersion.next(v);
694
- };
695
- _$cacheVersion = new BehaviorSubject(-1);
696
- get $cacheVersion() { return this._$cacheVersion.asObservable(); }
697
- constructor() {
698
- NgVirtualListComponent.__nextId = NgVirtualListComponent.__nextId + 1 === Number.MAX_SAFE_INTEGER
699
- ? 0 : NgVirtualListComponent.__nextId + 1;
700
- this._id = NgVirtualListComponent.__nextId;
701
- this._trackBox.displayComponents = this._displayComponents;
702
- 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), $isVertical = toObservable(this.direction).pipe(map(v => this.getIsVertical(v || DEFAULT_DIRECTION))), $dynamicSize = toObservable(this.dynamicSize), $cacheVersion = this.$cacheVersion, $displayItems = toObservable(this._displayItems), $initialized = toObservable(this._initialized);
703
- $isVertical.pipe(takeUntilDestroyed(), tap(v => {
704
- this._isVertical = v;
705
- const el = this._elementRef.nativeElement;
706
- toggleClassName(el, v ? CLASS_LIST_VERTICAL : CLASS_LIST_HORIZONTAL, true);
707
- })).subscribe();
708
- $dynamicSize.pipe(takeUntilDestroyed(), tap(dynamicSize => {
709
- if (dynamicSize) {
710
- if (!this._trackBox.hasEventListener(TRACK_BOX_CHANGE_EVENT_NAME, this._onTrackBoxChangeHandler)) {
711
- this._trackBox.addEventListener(TRACK_BOX_CHANGE_EVENT_NAME, this._onTrackBoxChangeHandler);
712
- }
713
- }
714
- else {
715
- if (this._trackBox.hasEventListener(TRACK_BOX_CHANGE_EVENT_NAME, this._onTrackBoxChangeHandler)) {
716
- this._trackBox.removeEventListener(TRACK_BOX_CHANGE_EVENT_NAME, this._onTrackBoxChangeHandler);
717
- }
718
- }
719
- })).subscribe();
720
- $displayItems.pipe(takeUntilDestroyed(), tap((displayItems) => {
721
- this._trackBox.items = displayItems;
722
- })).subscribe();
723
- combineLatest([$initialized, $bounds, $items, $stickyMap, $scrollSize, $itemSize,
724
- $itemsOffset, $snap, $isVertical, $dynamicSize, $cacheVersion,
725
- ]).pipe(takeUntilDestroyed(), distinctUntilChanged(), filter(([initialized]) => !!initialized), switchMap(([, bounds, items, stickyMap, scrollSize, itemSize, itemsOffset, snap, isVertical, dynamicSize, cacheVersion,]) => {
726
- this._trackBox.cacheElements();
727
- const { width, height } = bounds, { itemsFromStartToScrollEnd, itemsOnDisplay, itemsOnDisplayLength, leftHiddenItemsWeight, leftItemLength, leftItemsWeight, rightItemLength, rightItemsWeight, snippedPos, totalSize, typicalItemSize, } = this._trackBox.recalculateMetrics({
728
- bounds: { width, height }, collection: items,
729
- dynamicSize, isVertical, itemSize, itemsOffset, scrollSize, snap,
730
- });
731
- // Необходима кореляция startDisplayObjectY с помощью дельты от высоты предыдущей и текущей размеченной области по версии кэша.
732
- // TrackBox может расчитать дельту!
733
- return of({
734
- items, stickyMap, width, height, isVertical, scrollSize, itemsFromStartToScrollEnd,
735
- itemsOnDisplay, itemsOnDisplayLength, leftHiddenItemsWeight, itemSize: typicalItemSize,
736
- totalSize, snap, leftItemLength, leftItemsWeight, rightItemLength, rightItemsWeight, snippedPos,
737
- dynamicSize,
738
- });
739
- }), tap(({ items, stickyMap, width, height, isVertical, scrollSize, itemsFromStartToScrollEnd, itemsOnDisplay, itemsOnDisplayLength, leftHiddenItemsWeight, leftItemLength, leftItemsWeight, rightItemLength, rightItemsWeight, snippedPos, itemSize, totalSize, snap, dynamicSize: dynamic, }) => {
740
- const displayItems = [];
741
- if (items.length) {
742
- const sizeProperty = isVertical ? HEIGHT_PROP_NAME : WIDTH_PROP_NAME, w = isVertical ? width : itemSize, h = isVertical ? itemSize : height, totalItems = items.length, startIndex = itemsFromStartToScrollEnd - leftItemLength;
743
- let pos = leftHiddenItemsWeight - leftItemsWeight, renderItems = itemsOnDisplayLength + leftItemLength + rightItemLength, stickyItem, nextSticky, stickyItemIndex = -1, stickyItemSize = 0;
744
- if (snap) {
745
- for (let i = itemsFromStartToScrollEnd - 1; i >= 0; i--) {
746
- const id = items[i].id, sticky = stickyMap[id], size = dynamic ? this._trackBox.get(id)?.[sizeProperty] || itemSize : itemSize;
747
- stickyItemSize = size;
748
- if (sticky > 0) {
749
- const measures = {
750
- x: isVertical ? 0 : snippedPos,
751
- y: isVertical ? snippedPos : 0,
752
- width: w,
753
- height: h,
754
- }, config = {
755
- isVertical,
756
- sticky,
757
- snap,
758
- snapped: true,
759
- dynamic,
760
- };
761
- const itemData = items[i];
762
- stickyItem = { id, measures, data: itemData, config };
763
- stickyItemIndex = i;
764
- displayItems.push(stickyItem);
765
- break;
766
- }
767
- }
768
- }
769
- let i = startIndex;
770
- while (renderItems > 0) {
771
- if (i >= totalItems) {
772
- break;
773
- }
774
- const id = items[i].id, size = dynamic ? this._trackBox.get(id)?.[sizeProperty] || itemSize : itemSize;
775
- if (id !== stickyItem?.id) {
776
- const snaped = snap && stickyMap[id] > 0 && pos <= scrollSize, measures = {
777
- x: isVertical ? 0 : pos,
778
- y: isVertical ? pos : 0,
779
- width: w,
780
- height: h,
781
- }, config = {
782
- isVertical,
783
- sticky: stickyMap[id],
784
- snap,
785
- snapped: false,
786
- dynamic,
787
- };
788
- const itemData = items[i];
789
- const item = { id, measures, data: itemData, config };
790
- if (!nextSticky && stickyItemIndex < i && snap && stickyMap[id] > 0 && pos <= scrollSize + size) {
791
- item.measures.x = isVertical ? 0 : snaped ? snippedPos : pos;
792
- item.measures.y = isVertical ? snaped ? snippedPos : pos : 0;
793
- nextSticky = item;
794
- }
795
- displayItems.push(item);
796
- }
797
- renderItems -= 1;
798
- pos += size;
799
- i++;
800
- }
801
- const axis = isVertical ? Y_PROP_NAME : X_PROP_NAME;
802
- if (nextSticky && stickyItem && nextSticky.measures[axis] <= scrollSize + stickyItemSize) {
803
- if (nextSticky.measures[axis] > scrollSize) {
804
- stickyItem.measures[axis] = nextSticky.measures[axis] - stickyItemSize;
805
- stickyItem.config.snapped = nextSticky.config.snapped = false;
806
- stickyItem.config.sticky = 1;
807
- }
808
- else {
809
- nextSticky.config.snapped = true;
810
- }
811
- }
812
- }
813
- this._displayItems.set(displayItems);
814
- this.resetBoundsSize(isVertical, totalSize);
815
- })).subscribe();
816
- combineLatest([$initialized, toObservable(this.itemRenderer)]).pipe(takeUntilDestroyed(), distinctUntilChanged(), filter(([initialized]) => !!initialized), tap(([, itemRenderer]) => {
817
- this.resetRenderers(itemRenderer);
818
- }));
819
- combineLatest([$initialized, $displayItems]).pipe(takeUntilDestroyed(), distinctUntilChanged(), filter(([initialized]) => !!initialized), tap(([, displayItems]) => {
820
- this.createDisplayComponentsIfNeed(displayItems);
821
- this.tracking();
822
- })).subscribe();
823
- }
824
- ngOnInit() {
825
- this._initialized.set(true);
826
- }
827
- getIsVertical(d) {
828
- const dir = d || this.direction();
829
- return isDirection(dir, Directions.VERTICAL);
830
- }
831
- createDisplayComponentsIfNeed(displayItems) {
832
- if (!displayItems || !this._listContainerRef) {
833
- this._trackBox.setDisplayObjectIndexMapById({});
834
- return;
835
- }
836
- const _listContainerRef = this._listContainerRef;
837
- while (this._displayComponents.length < displayItems.length) {
838
- if (_listContainerRef) {
839
- const comp = _listContainerRef.createComponent(NgVirtualListItemComponent);
840
- this._displayComponents.push(comp);
841
- }
842
- }
843
- const maxLength = displayItems.length;
844
- while (this._displayComponents.length > maxLength) {
845
- const comp = this._displayComponents.pop();
846
- comp?.destroy();
847
- const id = comp?.instance.item?.id;
848
- if (id !== undefined) {
849
- this._trackBox.untrackComponentByIdProperty(comp?.instance);
850
- }
851
- }
852
- this.resetRenderers();
853
- }
854
- resetRenderers(itemRenderer) {
855
- const doMap = {};
856
- for (let i = 0, l = this._displayComponents.length; i < l; i++) {
857
- const item = this._displayComponents[i];
858
- item.instance.renderer = itemRenderer || this.itemRenderer();
859
- doMap[item.instance.id] = i;
860
- }
861
- this._trackBox.setDisplayObjectIndexMapById(doMap);
862
- }
863
- /**
864
- * tracking by id
865
- */
866
- tracking() {
867
- this._trackBox.track();
868
- }
869
- resetBoundsSize(isVertical, totalSize) {
870
- const l = this._list();
871
- if (l) {
872
- l.nativeElement.style[isVertical ? HEIGHT_PROP_NAME : WIDTH_PROP_NAME] = `${totalSize}${PX}`;
873
- }
874
- }
875
- /**
876
- * The method scrolls the list to the element with the given id and returns the value of the scrolled area.
877
- * Behavior accepts the values ​​"auto", "instant" and "smooth".
878
- */
879
- scrollTo(id, behavior = BEHAVIOR_AUTO) {
880
- const items = this.items();
881
- if (!items || !items.length) {
882
- return;
883
- }
884
- const index = items.findIndex(item => item.id === id), scrollSize = index * this.itemSize(), container = this._container();
885
- if (container) {
886
- const params = { [this._isVertical ? TOP_PROP_NAME : LEFT_PROP_NAME]: scrollSize, behavior };
887
- container.nativeElement.scroll(params);
888
- }
889
- }
890
- ngAfterViewInit() {
891
- const containerEl = this._container();
892
- if (containerEl) {
893
- containerEl.nativeElement.addEventListener(SCROLL, this._onScrollHandler);
894
- containerEl.nativeElement.addEventListener(SCROLL_END, this._onScrollEndHandler);
895
- this._resizeObserver = new ResizeObserver(this._onResizeHandler);
896
- this._resizeObserver.observe(containerEl.nativeElement);
897
- this._onResizeHandler();
898
- }
899
- }
900
- ngOnDestroy() {
901
- if (this._trackBox) {
902
- this._trackBox.dispose();
903
- }
904
- const containerEl = this._container();
905
- if (containerEl) {
906
- containerEl.nativeElement.removeEventListener(SCROLL, this._onScrollHandler);
907
- containerEl.nativeElement.removeEventListener(SCROLL_END, this._onScrollEndHandler);
908
- if (this._resizeObserver) {
909
- this._resizeObserver.unobserve(containerEl.nativeElement);
910
- }
911
- }
912
- if (this._displayComponents) {
913
- while (this._displayComponents.length > 0) {
914
- const comp = this._displayComponents.pop();
915
- comp?.destroy();
916
- }
917
- }
918
- }
919
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: NgVirtualListComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
920
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "19.2.14", type: NgVirtualListComponent, isStandalone: true, 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 }, 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"], dependencies: [{ kind: "ngmodule", type: CommonModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.ShadowDom });
921
- }
922
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: NgVirtualListComponent, decorators: [{
923
- type: Component,
924
- args: [{ selector: 'ng-virtual-list', imports: [CommonModule], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.ShadowDom, 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"] }]
925
- }], ctorParameters: () => [], propDecorators: { _listContainerRef: [{
926
- type: ViewChild,
927
- args: ['renderersContainer', { read: ViewContainerRef }]
928
- }] } });
929
-
930
- /*
931
- * Public API Surface of ng-virtual-list
932
- */
933
-
934
- /**
935
- * Generated bundle index. Do not edit.
936
- */
937
-
938
- export { NgVirtualListComponent };
939
- //# sourceMappingURL=ng-virtual-list.mjs.map