ng-virtual-list 20.10.2 → 20.10.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +14 -14
- package/fesm2022/ng-virtual-list.mjs +234 -124
- package/fesm2022/ng-virtual-list.mjs.map +1 -1
- package/index.d.ts +18 -8
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -101,7 +101,7 @@ npm i ng-virtual-list
|
|
|
101
101
|
|
|
102
102
|
## 🚀 Quick Start
|
|
103
103
|
```html
|
|
104
|
-
<ng-virtual-list [items]="items" [bufferSize]="5" [itemRenderer]="itemRenderer" [itemSize]="64"></ng-virtual-list>
|
|
104
|
+
<ng-virtual-list [items]="items" [bufferSize]="5" [itemRenderer]="itemRenderer" [dynamicSize]="false" [itemSize]="64"></ng-virtual-list>
|
|
105
105
|
|
|
106
106
|
<ng-template #itemRenderer let-data="data">
|
|
107
107
|
@if (data) {
|
|
@@ -124,7 +124,7 @@ items = Array.from({ length: 100000 }, (_, i) => ({ id: i, name: `Item #${i}` })
|
|
|
124
124
|
Template:
|
|
125
125
|
```html
|
|
126
126
|
<ng-virtual-list class="list" direction="horizontal" [items]="horizontalItems" [bufferSize]="1" [maxBufferSize]="5"
|
|
127
|
-
[itemRenderer]="horizontalItemRenderer" [itemSize]="64" [methodForSelecting]="'select'"
|
|
127
|
+
[itemRenderer]="horizontalItemRenderer" [dynamicSize]="false" [itemSize]="64" [methodForSelecting]="'select'"
|
|
128
128
|
[selectedIds]="2" (onSelect)="onSelect($event)" (onItemClick)="onItemClick($event)"></ng-virtual-list>
|
|
129
129
|
|
|
130
130
|
<ng-template #horizontalItemRenderer let-data="data" let-config="config">
|
|
@@ -174,7 +174,7 @@ export class AppComponent {
|
|
|
174
174
|
Template:
|
|
175
175
|
```html
|
|
176
176
|
<ng-virtual-list class="list" direction="horizontal" [items]="horizontalGroupItems" [itemRenderer]="horizontalGroupItemRenderer"
|
|
177
|
-
[bufferSize]="1" [maxBufferSize]="5" [itemConfigMap]="horizontalGroupItemConfigMap" [itemSize]="54" [snap]="true"
|
|
177
|
+
[bufferSize]="1" [maxBufferSize]="5" [itemConfigMap]="horizontalGroupItemConfigMap" [dynamicSize]="false" [itemSize]="54" [snap]="true"
|
|
178
178
|
methodForSelecting="multi-select" [selectedIds]="[3,2]" (onSelect)="onSelect($event)" (onItemClick)="onItemClick($event)"></ng-virtual-list>
|
|
179
179
|
|
|
180
180
|
<ng-template #horizontalGroupItemRenderer let-data="data" let-config="config">
|
|
@@ -248,7 +248,7 @@ export class AppComponent {
|
|
|
248
248
|
Template:
|
|
249
249
|
```html
|
|
250
250
|
<ng-virtual-list class="list simple" [items]="items" [bufferSize]="1" [maxBufferSize]="5" [itemRenderer]="itemRenderer"
|
|
251
|
-
[itemSize]="40"></ng-virtual-list>
|
|
251
|
+
[dynamicSize]="false" [itemSize]="40"></ng-virtual-list>
|
|
252
252
|
|
|
253
253
|
<ng-template #itemRenderer let-data="data">
|
|
254
254
|
@if (data) {
|
|
@@ -289,7 +289,7 @@ export class AppComponent {
|
|
|
289
289
|
Template:
|
|
290
290
|
```html
|
|
291
291
|
<ng-virtual-list class="list simple" [items]="groupItems" [bufferSize]="1" [maxBufferSize]="5" [itemRenderer]="groupItemRenderer"
|
|
292
|
-
[itemConfigMap]="groupItemConfigMap" [itemSize]="40" [snap]="false"></ng-virtual-list>
|
|
292
|
+
[itemConfigMap]="groupItemConfigMap" [dynamicSize]="false" [itemSize]="40" [snap]="false"></ng-virtual-list>
|
|
293
293
|
|
|
294
294
|
<ng-template #groupItemRenderer let-data="data">
|
|
295
295
|
@if (data) {
|
|
@@ -316,7 +316,7 @@ Template:
|
|
|
316
316
|
Template (with snapping):
|
|
317
317
|
```html
|
|
318
318
|
<ng-virtual-list class="list simple" [items]="groupItems" [bufferSize]="1" [maxBufferSize]="5" [itemRenderer]="groupItemRenderer"
|
|
319
|
-
[itemConfigMap]="groupItemConfigMap" [itemSize]="40" [snap]="true"></ng-virtual-list>
|
|
319
|
+
[itemConfigMap]="groupItemConfigMap" [dynamicSize]="false" [itemSize]="40" [snap]="true"></ng-virtual-list>
|
|
320
320
|
|
|
321
321
|
<ng-template #groupItemRenderer let-data="data">
|
|
322
322
|
@if (data) {
|
|
@@ -381,7 +381,7 @@ Template
|
|
|
381
381
|
</div>
|
|
382
382
|
|
|
383
383
|
<ng-virtual-list #virtualList class="list" [items]="items" [itemRenderer]="itemRenderer" [bufferSize]="1" [maxBufferSize]="5"
|
|
384
|
-
[itemSize]="40"></ng-virtual-list>
|
|
384
|
+
[dynamicSize]="false" [itemSize]="40"></ng-virtual-list>
|
|
385
385
|
|
|
386
386
|
<ng-template #itemRenderer let-data="data">
|
|
387
387
|
@if (data) {
|
|
@@ -435,7 +435,7 @@ Virtual list with height-adjustable elements.
|
|
|
435
435
|
Template
|
|
436
436
|
```html
|
|
437
437
|
<ng-virtual-list #dynamicList class="list" [items]="groupDynamicItems" [itemRenderer]="groupItemRenderer" [bufferSize]="1" [maxBufferSize]="5"
|
|
438
|
-
[itemConfigMap]="groupDynamicItemConfigMap" [
|
|
438
|
+
[itemConfigMap]="groupDynamicItemConfigMap" [snap]="true"></ng-virtual-list>
|
|
439
439
|
|
|
440
440
|
<ng-template #groupItemRenderer let-data="data">
|
|
441
441
|
@if (data) {
|
|
@@ -649,7 +649,7 @@ Inputs
|
|
|
649
649
|
|---|---|---|
|
|
650
650
|
| id | number | Readonly. Returns the unique identifier of the component. |
|
|
651
651
|
| items | [IVirtualListCollection](https://github.com/DjonnyX/ng-virtual-list/blob/20.x/projects/ng-virtual-list/src/lib/models/collection.model.ts) | Collection of list items. The collection of elements must be immutable. |
|
|
652
|
-
| itemSize | number? = 24 | If direction = 'vertical', then the height of a typical element. If direction = 'horizontal', then the width of a typical element.
|
|
652
|
+
| itemSize | number? = 24 | If direction = 'vertical', then the height of a typical element. If direction = 'horizontal', then the width of a typical element. If the dynamicSize property is true, the items in the list can have different sizes, and you must specify the itemSize property to adjust the sizes of the items in the unallocated area. |
|
|
653
653
|
| bufferSize | number? = 2 | Number of elements outside the scope of visibility. Default value is 2. |
|
|
654
654
|
| maxBufferSize | number? = 10 | Maximum number of elements outside the scope of visibility. Default value is 10. If maxBufferSize is set to be greater than bufferSize, then adaptive buffer mode is enabled. The greater the scroll size, the more elements are allocated for rendering. |
|
|
655
655
|
| itemRenderer | TemplateRef | Rendering element template. |
|
|
@@ -661,7 +661,7 @@ Inputs
|
|
|
661
661
|
| snap | boolean? = false | Determines whether elements will snap. Default value is "false". |
|
|
662
662
|
| snappingMethod | [SnappingMethod? = 'normal'](https://github.com/DjonnyX/ng-virtual-list/blob/20.x/projects/ng-virtual-list/src/lib/enums/snapping-method.ts) | Snapping method. 'normal' - Normal group rendering. 'advanced' - The group is rendered on a transparent background. 'chat' - The group is rendered on a background. List items below the group are not rendered. |
|
|
663
663
|
| direction | [Direction? = 'vertical'](https://github.com/DjonnyX/ng-virtual-list/blob/20.x/projects/ng-virtual-list/src/lib/enums/direction.ts) | Determines the direction in which elements are placed. Default value is "vertical". |
|
|
664
|
-
| dynamicSize | boolean? =
|
|
664
|
+
| dynamicSize | boolean? = true | If true, items in the list may have different sizes, and the itemSize property must be specified to adjust the sizes of items in the unallocated area. If false then the items in the list have a fixed size specified by the itemSize property. The default value is true. |
|
|
665
665
|
| enabledBufferOptimization | boolean? = true | Experimental! Enables buffer optimization. Can only be used if items in the collection are not added or updated. |
|
|
666
666
|
| trackBy | string? = 'id' | The name of the property by which tracking is performed. |
|
|
667
667
|
| selectedIds | Array<[Id](https://github.com/DjonnyX/ng-virtual-list/blob/20.x/projects/ng-virtual-list/src/lib/types/id.ts)> \| [Id](https://github.com/DjonnyX/ng-virtual-list/blob/20.x/projects/ng-virtual-list/src/lib/types/id.ts) \| undefined | Sets the selected items. |
|
|
@@ -737,12 +737,12 @@ Properties
|
|
|
737
737
|
|
|
738
738
|
| Angular version | ng-virtual-list version | git | npm |
|
|
739
739
|
|--|--|--|--|
|
|
740
|
-
| 19.x | 19.10.
|
|
741
|
-
| 18.x | 18.10.
|
|
742
|
-
| 17.x | 17.10.
|
|
740
|
+
| 19.x | 19.10.1 | [19.x](https://github.com/DjonnyX/ng-virtual-list/tree/19.x) | [19.10.1](https://www.npmjs.com/package/ng-virtual-list/v/19.10.1) |
|
|
741
|
+
| 18.x | 18.10.1 | [18.x](https://github.com/DjonnyX/ng-virtual-list/tree/18.x) | [18.10.1](https://www.npmjs.com/package/ng-virtual-list/v/18.10.1) |
|
|
742
|
+
| 17.x | 17.10.1 | [17.x](https://github.com/DjonnyX/ng-virtual-list/tree/17.x) | [17.10.1](https://www.npmjs.com/package/ng-virtual-list/v/17.10.1) |
|
|
743
743
|
| 16.x | 16.10.0 | [16.x](https://github.com/DjonnyX/ng-virtual-list/tree/16.x) | [16.10.0](https://www.npmjs.com/package/ng-virtual-list/v/16.10.0) |
|
|
744
744
|
| 15.x | 15.10.0 | [15.x](https://github.com/DjonnyX/ng-virtual-list/tree/15.x) | [15.10.0](https://www.npmjs.com/package/ng-virtual-list/v/15.10.0) |
|
|
745
|
-
| 14.x | 14.10.
|
|
745
|
+
| 14.x | 14.10.1 | [14.x](https://github.com/DjonnyX/ng-virtual-list/tree/14.x) | [14.10.1](https://www.npmjs.com/package/ng-virtual-list/v/14.10.1) |
|
|
746
746
|
|
|
747
747
|
<br/>
|
|
748
748
|
|