ng-virtual-list 19.1.30 → 20.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.
package/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # NgVirtualList
2
2
  Maximum performance for extremely large lists.
3
3
 
4
- Angular version 19.X.X.
4
+ Angular version 20.X.X.
5
5
 
6
6
  ![intro](https://github.com/user-attachments/assets/80fbed6c-9f77-48c3-a7a6-2cedf32aebc2)
7
7
 
@@ -28,9 +28,9 @@ Template:
28
28
 
29
29
  <ng-template #hotizontalItemRenderer let-data="data">
30
30
  @if (data) {
31
- <div class="list__h-container" (click)="onItemClick(data)">
32
- <span>{{data.name}}</span>
33
- </div>
31
+ <div class="list__h-container" (click)="onItemClick(data)">
32
+ <span>{{data.name}}</span>
33
+ </div>
34
34
  }
35
35
  </ng-template>
36
36
  ```
@@ -68,14 +68,14 @@ Template:
68
68
  @if (data) {
69
69
  @switch (data.type) {
70
70
  @case ("group-header") {
71
- <div class="list__h-group-container">
72
- <span>{{data.name}}</span>
73
- </div>
71
+ <div class="list__h-group-container">
72
+ <span>{{data.name}}</span>
73
+ </div>
74
74
  }
75
75
  @default {
76
- <div class="list__h-container" (click)="onItemClick(data)">
77
- <span>{{data.name}}</span>
78
- </div>
76
+ <div class="list__h-container" (click)="onItemClick(data)">
77
+ <span>{{data.name}}</span>
78
+ </div>
79
79
  }
80
80
  }
81
81
  }
@@ -124,9 +124,9 @@ Template:
124
124
 
125
125
  <ng-template #itemRenderer let-data="data">
126
126
  @if (data) {
127
- <div class="list__container">
128
- <p>{{data.name}}</p>
129
- </div>
127
+ <div class="list__container">
128
+ <p>{{data.name}}</p>
129
+ </div>
130
130
  }
131
131
  </ng-template>
132
132
  ```
@@ -167,14 +167,14 @@ Template:
167
167
  @if (data) {
168
168
  @switch (data.type) {
169
169
  @case ("group-header") {
170
- <div class="list__group-container">
171
- <p>{{data.name}}</p>
172
- </div>
170
+ <div class="list__group-container">
171
+ <p>{{data.name}}</p>
172
+ </div>
173
173
  }
174
174
  @default {
175
- <div class="list__container">
176
- <p>{{data.name}}</p>
177
- </div>
175
+ <div class="list__container">
176
+ <p>{{data.name}}</p>
177
+ </div>
178
178
  }
179
179
  }
180
180
  }
@@ -194,14 +194,14 @@ Template (with snapping):
194
194
  @if (data) {
195
195
  @switch (data.type) {
196
196
  @case ("group-header") {
197
- <div class="list__group-container">
198
- <p>{{data.name}}</p>
199
- </div>
197
+ <div class="list__group-container">
198
+ <p>{{data.name}}</p>
199
+ </div>
200
200
  }
201
201
  @default {
202
- <div class="list__container">
203
- <p>{{data.name}}</p>
204
- </div>
202
+ <div class="list__container">
203
+ <p>{{data.name}}</p>
204
+ </div>
205
205
  }
206
206
  }
207
207
  }
@@ -435,23 +435,22 @@ List items are encapsulated in shadowDOM, so to override default styles you need
435
435
 
436
436
  ## API
437
437
 
438
- [NgVirtualListComponent](https://github.com/DjonnyX/ng-virtual-list/blob/19.x/projects/ng-virtual-list/src/lib/ng-virtual-list.component.ts)
438
+ [NgVirtualListComponent](https://github.com/DjonnyX/ng-virtual-list/blob/main/projects/ng-virtual-list/src/lib/ng-virtual-list.component.ts)
439
439
 
440
440
  Inputs
441
441
 
442
442
  | Property | Type | Description |
443
443
  |---|---|---|
444
444
  | id | number | Readonly. Returns the unique identifier of the component. |
445
- | items | [IVirtualListCollection](https://github.com/DjonnyX/ng-virtual-list/blob/19.x/projects/ng-virtual-list/src/lib/models/collection.model.ts) | Collection of list items. The collection of elements must be immutable. |
445
+ | items | [IVirtualListCollection](https://github.com/DjonnyX/ng-virtual-list/blob/main/projects/ng-virtual-list/src/lib/models/collection.model.ts) | Collection of list items. |
446
446
  | itemSize | number? = 24 | If direction = 'vertical', then the height of a typical element. If direction = 'horizontal', then the width of a typical element. Ignored if the dynamicSize property is true. |
447
447
  | itemsOffset | number? = 2 | Number of elements outside the scope of visibility. Default value is 2. |
448
448
  | itemRenderer | TemplateRef | Rendering element template. |
449
- | stickyMap | [IVirtualListStickyMap?](https://github.com/DjonnyX/ng-virtual-list/blob/19.x/projects/ng-virtual-list/src/lib/models/sticky-map.model.ts) | Dictionary zIndex by id of the list element. If the value is not set or equal to 0, then a simple element is displayed, if the value is greater than 0, then the sticky position mode is enabled for the element. |
449
+ | stickyMap | [IVirtualListStickyMap?](https://github.com/DjonnyX/ng-virtual-list/blob/main/projects/ng-virtual-list/src/lib/models/sticky-map.model.ts) | Dictionary zIndex by id of the list element. If the value is not set or equal to 0, then a simple element is displayed, if the value is greater than 0, then the sticky position mode is enabled for the element. |
450
450
  | snap | boolean? = false | Determines whether elements will snap. Default value is "false". |
451
- | direction | [Direction? = 'vertical'](https://github.com/DjonnyX/ng-virtual-list/blob/19.x/projects/ng-virtual-list/src/lib/enums/direction.ts) | Determines the direction in which elements are placed. Default value is "vertical". |
451
+ | snapToItem | boolean? = false | Determines whether scroll positions will be snapped to the element. Default value is "false". |
452
+ | direction | [Direction? = 'vertical'](https://github.com/DjonnyX/ng-virtual-list/blob/main/projects/ng-virtual-list/src/lib/enums/direction.ts) | Determines the direction in which elements are placed. Default value is "vertical". |
452
453
  | dynamicSize | boolean? = false | If true then the items in the list can have different sizes and the itemSize property is ignored. If false then the items in the list have a fixed size specified by the itemSize property. The default value is false. |
453
- | enabledBufferOptimization | boolean? = true | Experimental! Enables buffer optimization. Can only be used if items in the collection are not added or updated. |
454
- | trackBy | string? = 'id' | The name of the property by which tracking is performed. |
455
454
 
456
455
  <br/>
457
456
 
@@ -459,8 +458,8 @@ Outputs
459
458
 
460
459
  | Event | Type | Description |
461
460
  |---|---|---|
462
- | onScroll | ([IScrollEvent](https://github.com/DjonnyX/ng-virtual-list/blob/19.x/projects/ng-virtual-list/src/lib/models/scroll-event.model.ts)) => void | Fires when the list has been scrolled. |
463
- | onScrollEnd | ([IScrollEvent](https://github.com/DjonnyX/ng-virtual-list/blob/19.x/projects/ng-virtual-list/src/lib/models/scroll-event.model.ts)) => void | Fires when the list has completed scrolling. |
461
+ | onScroll | (scrollSize: number) => void | Fires when the list has been scrolled. |
462
+ | onScrollEnd | (scrollSize: number) => void | Fires when the list has completed scrolling. |
464
463
 
465
464
  <br/>
466
465
 
@@ -468,30 +467,4 @@ Methods
468
467
 
469
468
  | Method | Type | Description |
470
469
  |--|--|--|
471
- | scrollTo | (id: [Id](https://github.com/DjonnyX/ng-virtual-list/blob/19.x/projects/ng-virtual-list/src/lib/types/id.ts), behavior: ScrollBehavior = 'auto') => number | The method scrolls the list to the element with the given id and returns the value of the scrolled area. Behavior accepts the values ​​"auto", "instant" and "smooth". |
472
-
473
- <br/>
474
-
475
- ## Licence
476
-
477
- MIT License
478
-
479
- Copyright (c) 2025 Evgenii Grebennikov
480
-
481
- Permission is hereby granted, free of charge, to any person obtaining a copy
482
- of this software and associated documentation files (the "Software"), to deal
483
- in the Software without restriction, including without limitation the rights
484
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
485
- copies of the Software, and to permit persons to whom the Software is
486
- furnished to do so, subject to the following conditions:
487
-
488
- The above copyright notice and this permission notice shall be included in all
489
- copies or substantial portions of the Software.
490
-
491
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
492
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
493
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
494
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
495
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
496
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
497
- SOFTWARE.
470
+ | scrollTo | (id: [Id](https://github.com/DjonnyX/ng-virtual-list/blob/main/projects/ng-virtual-list/src/lib/types/id.ts), behavior: ScrollBehavior = 'auto') => number | The method scrolls the list to the element with the given id and returns the value of the scrolled area. Behavior accepts the values ​​"auto", "instant" and "smooth". |