ng-virtual-list 14.3.2 → 14.4.1
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 +9 -8
- package/esm2020/lib/components/ng-virtual-list-item.component.mjs +4 -4
- package/esm2020/lib/const/index.mjs +3 -2
- package/esm2020/lib/models/base-virtual-list-item-component.mjs +1 -1
- package/esm2020/lib/models/index.mjs +2 -3
- package/esm2020/lib/ng-virtual-list.component.mjs +55 -23
- package/esm2020/lib/utils/buffer-interpolation.mjs +27 -0
- package/esm2020/lib/utils/index.mjs +2 -6
- package/esm2020/lib/utils/trackBox.mjs +62 -13
- package/esm2020/lib/utils/tracker.mjs +1 -1
- package/fesm2015/ng-virtual-list.mjs +325 -218
- package/fesm2015/ng-virtual-list.mjs.map +1 -1
- package/fesm2020/ng-virtual-list.mjs +324 -217
- package/fesm2020/ng-virtual-list.mjs.map +1 -1
- package/lib/components/ng-virtual-list-item.component.d.ts +7 -7
- package/lib/const/index.d.ts +2 -1
- package/lib/models/base-virtual-list-item-component.d.ts +0 -1
- package/lib/models/index.d.ts +1 -4
- package/lib/ng-virtual-list.component.d.ts +78 -67
- package/lib/utils/buffer-interpolation.d.ts +5 -0
- package/lib/utils/index.d.ts +3 -6
- package/lib/utils/trackBox.d.ts +20 -2
- package/lib/utils/tracker.d.ts +11 -4
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ChangeDetectorRef, ElementRef, TemplateRef } from '@angular/core';
|
|
2
2
|
import { IRenderVirtualListItem } from '../models/render-item.model';
|
|
3
3
|
import { ISize } from '../types';
|
|
4
|
-
import { BaseVirtualListItemComponent } from '../models';
|
|
4
|
+
import { BaseVirtualListItemComponent } from '../models/base-virtual-list-item-component';
|
|
5
5
|
import * as i0 from "@angular/core";
|
|
6
6
|
/**
|
|
7
7
|
* Virtual list item component
|
|
@@ -10,15 +10,15 @@ import * as i0 from "@angular/core";
|
|
|
10
10
|
* @email djonnyx@gmail.com
|
|
11
11
|
*/
|
|
12
12
|
export declare class NgVirtualListItemComponent extends BaseVirtualListItemComponent {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
private _cdr;
|
|
14
|
+
private _elementRef;
|
|
15
|
+
private static __nextId;
|
|
16
|
+
private _id;
|
|
17
17
|
get id(): number;
|
|
18
18
|
regular: boolean;
|
|
19
19
|
data: IRenderVirtualListItem | undefined;
|
|
20
20
|
set item(v: IRenderVirtualListItem | undefined);
|
|
21
|
-
|
|
21
|
+
private _regularLength;
|
|
22
22
|
set regularLength(v: string);
|
|
23
23
|
get item(): IRenderVirtualListItem | undefined;
|
|
24
24
|
get itemId(): import("../types").Id | undefined;
|
|
@@ -26,7 +26,7 @@ export declare class NgVirtualListItemComponent extends BaseVirtualListItemCompo
|
|
|
26
26
|
set renderer(v: TemplateRef<any> | undefined);
|
|
27
27
|
get element(): HTMLElement;
|
|
28
28
|
constructor(_cdr: ChangeDetectorRef, _elementRef: ElementRef<HTMLElement>);
|
|
29
|
-
|
|
29
|
+
private update;
|
|
30
30
|
getBounds(): ISize;
|
|
31
31
|
show(): void;
|
|
32
32
|
hide(): void;
|
package/lib/const/index.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { SnappingMethods } from "../enums";
|
|
2
2
|
import { Directions } from "../enums/directions";
|
|
3
3
|
export declare const DEFAULT_ITEM_SIZE = 24;
|
|
4
|
-
export declare const
|
|
4
|
+
export declare const DEFAULT_BUFFER_SIZE = 2;
|
|
5
|
+
export declare const DEFAULT_MAX_BUFFER_SIZE = 100;
|
|
5
6
|
export declare const DEFAULT_LIST_SIZE = 400;
|
|
6
7
|
export declare const DEFAULT_SNAP = false;
|
|
7
8
|
export declare const DEFAULT_ENABLED_BUFFER_OPTIMIZATION = false;
|
|
@@ -18,7 +18,6 @@ export declare abstract class BaseVirtualListItemComponent {
|
|
|
18
18
|
abstract itemRenderer: TemplateRef<any> | undefined;
|
|
19
19
|
abstract set renderer(v: TemplateRef<any> | undefined);
|
|
20
20
|
abstract get element(): HTMLElement;
|
|
21
|
-
protected abstract update(): void;
|
|
22
21
|
abstract getBounds(): ISize;
|
|
23
22
|
abstract show(): void;
|
|
24
23
|
abstract hide(): void;
|
package/lib/models/index.d.ts
CHANGED
|
@@ -3,7 +3,4 @@ import { IScrollEvent } from './scroll-event.model';
|
|
|
3
3
|
import { IVirtualListItem } from './item.model';
|
|
4
4
|
import { IVirtualListStickyMap } from './sticky-map.model';
|
|
5
5
|
import { IVirtualListCollection } from './collection.model';
|
|
6
|
-
|
|
7
|
-
import { Component$1 } from './component.model';
|
|
8
|
-
export type { ScrollDirection, IScrollEvent, IVirtualListItem, IVirtualListStickyMap, IVirtualListCollection, Component$1, };
|
|
9
|
-
export { BaseVirtualListItemComponent, };
|
|
6
|
+
export type { ScrollDirection, IScrollEvent, IVirtualListItem, IVirtualListStickyMap, IVirtualListCollection, };
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
import { AfterViewInit, ChangeDetectorRef,
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { AfterViewInit, ChangeDetectorRef, ElementRef, EventEmitter, OnDestroy, OnInit, TemplateRef } from '@angular/core';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import { IScrollEvent, IVirtualListCollection, IVirtualListStickyMap } from './models';
|
|
4
4
|
import { Id, ISize } from './types';
|
|
5
|
-
import { IRenderVirtualListCollection } from './models/render-collection.model';
|
|
6
5
|
import { Direction, SnappingMethod } from './enums';
|
|
7
|
-
import { TrackBox } from './utils';
|
|
8
6
|
import { DisposableComponent } from './utils/disposableComponent';
|
|
9
7
|
import * as i0 from "@angular/core";
|
|
10
8
|
/**
|
|
@@ -16,19 +14,19 @@ import * as i0 from "@angular/core";
|
|
|
16
14
|
* @email djonnyx@gmail.com
|
|
17
15
|
*/
|
|
18
16
|
export declare class NgVirtualListComponent extends DisposableComponent implements AfterViewInit, OnInit, OnDestroy {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
17
|
+
private _cdr;
|
|
18
|
+
private _elementRef;
|
|
19
|
+
private static __nextId;
|
|
20
|
+
private _id;
|
|
23
21
|
/**
|
|
24
22
|
* Readonly. Returns the unique identifier of the component.
|
|
25
23
|
*/
|
|
26
24
|
get id(): number;
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
25
|
+
private _listContainerRef;
|
|
26
|
+
private _container;
|
|
27
|
+
private _list;
|
|
28
|
+
private _snapContainerRef;
|
|
29
|
+
private _snappedContainer;
|
|
32
30
|
/**
|
|
33
31
|
* Fires when the list has been scrolled.
|
|
34
32
|
*/
|
|
@@ -37,22 +35,22 @@ export declare class NgVirtualListComponent extends DisposableComponent implemen
|
|
|
37
35
|
* Fires when the list has completed scrolling.
|
|
38
36
|
*/
|
|
39
37
|
onScrollEnd: EventEmitter<IScrollEvent>;
|
|
40
|
-
|
|
38
|
+
private _$items;
|
|
41
39
|
readonly $items: Observable<IVirtualListCollection<Object> | undefined>;
|
|
42
|
-
|
|
40
|
+
private _itemsTransform;
|
|
43
41
|
/**
|
|
44
42
|
* Collection of list items.
|
|
45
43
|
*/
|
|
46
44
|
set items(v: IVirtualListCollection);
|
|
47
45
|
get items(): IVirtualListCollection;
|
|
48
|
-
|
|
46
|
+
private _$snap;
|
|
49
47
|
readonly $snap: Observable<boolean>;
|
|
50
48
|
/**
|
|
51
49
|
* Determines whether elements will snap. Default value is "true".
|
|
52
50
|
*/
|
|
53
51
|
set snap(v: boolean);
|
|
54
52
|
get snap(): boolean;
|
|
55
|
-
|
|
53
|
+
private _$enabledBufferOptimization;
|
|
56
54
|
readonly $enabledBufferOptimization: Observable<boolean>;
|
|
57
55
|
/**
|
|
58
56
|
* Experimental!
|
|
@@ -62,15 +60,15 @@ export declare class NgVirtualListComponent extends DisposableComponent implemen
|
|
|
62
60
|
*/
|
|
63
61
|
set enabledBufferOptimization(v: boolean);
|
|
64
62
|
get enabledBufferOptimization(): boolean;
|
|
65
|
-
|
|
63
|
+
private _$itemRenderer;
|
|
66
64
|
readonly $itemRenderer: Observable<TemplateRef<any> | undefined>;
|
|
67
|
-
|
|
65
|
+
private _$renderer;
|
|
68
66
|
/**
|
|
69
67
|
* Rendering element template.
|
|
70
68
|
*/
|
|
71
69
|
set itemRenderer(v: TemplateRef<any>);
|
|
72
70
|
get itemRenderer(): TemplateRef<any>;
|
|
73
|
-
|
|
71
|
+
private _$stickyMap;
|
|
74
72
|
readonly $stickyMap: Observable<IVirtualListStickyMap>;
|
|
75
73
|
/**
|
|
76
74
|
* Dictionary zIndex by id of the list element. If the value is not set or equal to 0,
|
|
@@ -78,8 +76,8 @@ export declare class NgVirtualListComponent extends DisposableComponent implemen
|
|
|
78
76
|
*/
|
|
79
77
|
set stickyMap(v: IVirtualListStickyMap);
|
|
80
78
|
get stickyMap(): IVirtualListStickyMap;
|
|
81
|
-
|
|
82
|
-
|
|
79
|
+
private _itemSizeOptions;
|
|
80
|
+
private _$itemSize;
|
|
83
81
|
readonly $itemSize: Observable<number>;
|
|
84
82
|
/**
|
|
85
83
|
* If direction = 'vertical', then the height of a typical element. If direction = 'horizontal', then the width of a typical element.
|
|
@@ -87,7 +85,7 @@ export declare class NgVirtualListComponent extends DisposableComponent implemen
|
|
|
87
85
|
*/
|
|
88
86
|
set itemSize(v: number);
|
|
89
87
|
get itemSize(): number;
|
|
90
|
-
|
|
88
|
+
private _$dynamicSize;
|
|
91
89
|
readonly $dynamicSize: Observable<boolean>;
|
|
92
90
|
/**
|
|
93
91
|
* If true then the items in the list can have different sizes and the itemSize property is ignored.
|
|
@@ -95,29 +93,43 @@ export declare class NgVirtualListComponent extends DisposableComponent implemen
|
|
|
95
93
|
*/
|
|
96
94
|
set dynamicSize(v: boolean);
|
|
97
95
|
get dynamicSize(): boolean;
|
|
98
|
-
|
|
96
|
+
private _$direction;
|
|
99
97
|
readonly $direction: Observable<Direction>;
|
|
100
98
|
/**
|
|
101
99
|
* Determines the direction in which elements are placed. Default value is "vertical".
|
|
102
100
|
*/
|
|
103
101
|
set direction(v: Direction);
|
|
104
102
|
get direction(): Direction;
|
|
105
|
-
protected _$itemsOffset: BehaviorSubject<number>;
|
|
106
|
-
readonly $itemsOffset: Observable<number>;
|
|
107
103
|
/**
|
|
108
|
-
*
|
|
104
|
+
* @deprecated "itemOffset" parameter is deprecated. Use "bufferSize" and "maxBufferSize".
|
|
109
105
|
*/
|
|
110
106
|
set itemsOffset(v: number);
|
|
111
|
-
|
|
112
|
-
|
|
107
|
+
private _$bufferSize;
|
|
108
|
+
readonly $bufferSize: Observable<number>;
|
|
109
|
+
/**
|
|
110
|
+
* Number of elements outside the scope of visibility. Default value is 2.
|
|
111
|
+
*/
|
|
112
|
+
set bufferSize(v: number);
|
|
113
|
+
get bufferSize(): number;
|
|
114
|
+
private _maxBufferSizeTransform;
|
|
115
|
+
private _$maxBufferSize;
|
|
116
|
+
readonly $maxBufferSize: Observable<number>;
|
|
117
|
+
/**
|
|
118
|
+
* Maximum number of elements outside the scope of visibility. Default value is 100.
|
|
119
|
+
* If maxBufferSize is set to be greater than bufferSize, then adaptive buffer mode is enabled.
|
|
120
|
+
* The greater the scroll size, the more elements are allocated for rendering.
|
|
121
|
+
*/
|
|
122
|
+
set maxBufferSize(v: number);
|
|
123
|
+
get maxBufferSize(): number;
|
|
124
|
+
private _$trackBy;
|
|
113
125
|
readonly $trackBy: Observable<string>;
|
|
114
126
|
/**
|
|
115
127
|
* The name of the property by which tracking is performed
|
|
116
128
|
*/
|
|
117
129
|
set trackBy(v: string);
|
|
118
130
|
get trackBy(): string;
|
|
119
|
-
|
|
120
|
-
|
|
131
|
+
private _isVertical;
|
|
132
|
+
private _$snappingMethod;
|
|
121
133
|
readonly $snappingMethod: Observable<SnappingMethod>;
|
|
122
134
|
/**
|
|
123
135
|
* Snapping method.
|
|
@@ -126,49 +138,48 @@ export declare class NgVirtualListComponent extends DisposableComponent implemen
|
|
|
126
138
|
*/
|
|
127
139
|
set snappingMethod(v: SnappingMethod);
|
|
128
140
|
get snappingMethod(): SnappingMethod;
|
|
129
|
-
|
|
141
|
+
private _isSnappingMethodAdvanced;
|
|
130
142
|
get isSnappingMethodAdvanced(): boolean;
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
143
|
+
private _displayComponents;
|
|
144
|
+
private _snapedDisplayComponent;
|
|
145
|
+
private _$bounds;
|
|
146
|
+
private _$scrollSize;
|
|
147
|
+
private _resizeObserver;
|
|
148
|
+
private _resizeSnappedComponentHandler;
|
|
149
|
+
private _resizeSnappedObserver;
|
|
150
|
+
private _onResizeHandler;
|
|
151
|
+
private _onScrollHandler;
|
|
152
|
+
private _$initialized;
|
|
141
153
|
readonly $initialized: Observable<boolean>;
|
|
142
154
|
/**
|
|
143
155
|
* Base class of the element component
|
|
144
156
|
*/
|
|
145
|
-
|
|
157
|
+
private _itemComponentClass;
|
|
146
158
|
/**
|
|
147
159
|
* Base class trackBox
|
|
148
160
|
*/
|
|
149
|
-
|
|
161
|
+
private _trackBoxClass;
|
|
150
162
|
/**
|
|
151
163
|
* Dictionary of element sizes by their id
|
|
152
164
|
*/
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
165
|
+
private _trackBox;
|
|
166
|
+
private _onTrackBoxChangeHandler;
|
|
167
|
+
private _$cacheVersion;
|
|
156
168
|
get $cacheVersion(): Observable<number>;
|
|
157
169
|
constructor(_cdr: ChangeDetectorRef, _elementRef: ElementRef<HTMLDivElement>);
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
protected resetRenderers(itemRenderer?: TemplateRef<HTMLElement>): void;
|
|
170
|
+
private onInit;
|
|
171
|
+
private listenCacheChangesIfNeed;
|
|
172
|
+
private getIsSnappingMethodAdvanced;
|
|
173
|
+
private getIsVertical;
|
|
174
|
+
private _componentsResizeObserver;
|
|
175
|
+
private createDisplayComponentsIfNeed;
|
|
176
|
+
private updateRegularRenderer;
|
|
177
|
+
private resetRenderers;
|
|
167
178
|
/**
|
|
168
179
|
* Tracking by id
|
|
169
180
|
*/
|
|
170
|
-
|
|
171
|
-
|
|
181
|
+
private tracking;
|
|
182
|
+
private resetBoundsSize;
|
|
172
183
|
/**
|
|
173
184
|
* Returns the bounds of an element with a given id
|
|
174
185
|
*/
|
|
@@ -178,17 +189,17 @@ export declare class NgVirtualListComponent extends DisposableComponent implemen
|
|
|
178
189
|
* Behavior accepts the values "auto", "instant" and "smooth".
|
|
179
190
|
*/
|
|
180
191
|
scrollTo(id: Id, behavior?: ScrollBehavior): void;
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
192
|
+
private _scrollToRepeatExecutionTimeout;
|
|
193
|
+
private clearScrollToRepeatExecutionTimeout;
|
|
194
|
+
private scrollToExecutor;
|
|
184
195
|
/**
|
|
185
196
|
* Scrolls the scroll area to the desired element with the specified ID.
|
|
186
197
|
*/
|
|
187
198
|
scrollToEnd(behavior?: ScrollBehavior): void;
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
199
|
+
private _onContainerScrollHandler;
|
|
200
|
+
private _onContainerScrollEndHandler;
|
|
201
|
+
private afterViewInit;
|
|
202
|
+
private dispose;
|
|
192
203
|
static ɵfac: i0.ɵɵFactoryDeclaration<NgVirtualListComponent, never>;
|
|
193
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<NgVirtualListComponent, "ng-virtual-list", never, { "items": "items"; "snap": "snap"; "enabledBufferOptimization": "enabledBufferOptimization"; "itemRenderer": "itemRenderer"; "stickyMap": "stickyMap"; "itemSize": "itemSize"; "dynamicSize": "dynamicSize"; "direction": "direction"; "itemsOffset": "itemsOffset"; "trackBy": "trackBy"; "snappingMethod": "snappingMethod"; }, { "onScroll": "onScroll"; "onScrollEnd": "onScrollEnd"; }, never, never, false>;
|
|
204
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<NgVirtualListComponent, "ng-virtual-list", never, { "items": "items"; "snap": "snap"; "enabledBufferOptimization": "enabledBufferOptimization"; "itemRenderer": "itemRenderer"; "stickyMap": "stickyMap"; "itemSize": "itemSize"; "dynamicSize": "dynamicSize"; "direction": "direction"; "itemsOffset": "itemsOffset"; "bufferSize": "bufferSize"; "maxBufferSize": "maxBufferSize"; "trackBy": "trackBy"; "snappingMethod": "snappingMethod"; }, { "onScroll": "onScroll"; "onScrollEnd": "onScrollEnd"; }, never, never, false>;
|
|
194
205
|
}
|
package/lib/utils/index.d.ts
CHANGED
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
import { isDirection } from "./isDirection";
|
|
2
1
|
import { debounce } from "./debounce";
|
|
3
2
|
import { toggleClassName } from './toggleClassName';
|
|
4
|
-
import {
|
|
5
|
-
import { TrackBox, IUpdateCollectionReturns, TRACK_BOX_CHANGE_EVENT_NAME, IMetrics, IRecalculateMetricsOptions, IGetItemPositionOptions, IUpdateCollectionOptions, CacheMapEvents, OnChangeEventListener, CacheMapListeners, ItemDisplayMethods } from "./trackBox";
|
|
6
|
-
import { CMap, ICacheMap, CACHE_BOX_CHANGE_EVENT_NAME } from './cacheMap';
|
|
3
|
+
import { IMetrics } from "./trackBox";
|
|
7
4
|
import { ScrollEvent } from "./scrollEvent";
|
|
8
|
-
export {
|
|
9
|
-
export type {
|
|
5
|
+
export { debounce, toggleClassName, ScrollEvent, };
|
|
6
|
+
export type { IMetrics, };
|
package/lib/utils/trackBox.d.ts
CHANGED
|
@@ -5,7 +5,8 @@ import { CacheMap, CMap } from "./cacheMap";
|
|
|
5
5
|
import { Tracker } from "./tracker";
|
|
6
6
|
import { ISize } from "../types";
|
|
7
7
|
import { HEIGHT_PROP_NAME, WIDTH_PROP_NAME } from "../const";
|
|
8
|
-
import {
|
|
8
|
+
import { IVirtualListStickyMap } from "../models";
|
|
9
|
+
import { BaseVirtualListItemComponent } from "../models/base-virtual-list-item-component";
|
|
9
10
|
export declare const TRACK_BOX_CHANGE_EVENT_NAME = "change";
|
|
10
11
|
export interface IMetrics {
|
|
11
12
|
delta: number;
|
|
@@ -46,7 +47,8 @@ export interface IRecalculateMetricsOptions<I extends {
|
|
|
46
47
|
collection: C;
|
|
47
48
|
isVertical: boolean;
|
|
48
49
|
itemSize: number;
|
|
49
|
-
|
|
50
|
+
bufferSize: number;
|
|
51
|
+
maxBufferSize: number;
|
|
50
52
|
dynamicSize: boolean;
|
|
51
53
|
scrollSize: number;
|
|
52
54
|
snap: boolean;
|
|
@@ -103,7 +105,9 @@ export declare class TrackBox<C extends BaseVirtualListItemComponent = any> exte
|
|
|
103
105
|
* Set the trackBy property
|
|
104
106
|
*/
|
|
105
107
|
set trackingPropertyName(v: string);
|
|
108
|
+
protected _trackingPropertyName: string;
|
|
106
109
|
constructor(trackingPropertyName: string);
|
|
110
|
+
protected initialize(): void;
|
|
107
111
|
set(id: Id, bounds: ISize): CMap<Id, ISize>;
|
|
108
112
|
protected _previousCollection: Array<{
|
|
109
113
|
id: Id;
|
|
@@ -117,6 +121,16 @@ export declare class TrackBox<C extends BaseVirtualListItemComponent = any> exte
|
|
|
117
121
|
protected _previousTotalSize: number;
|
|
118
122
|
protected _scrollDelta: number;
|
|
119
123
|
get scrollDelta(): number;
|
|
124
|
+
isAdaptiveBuffer: boolean;
|
|
125
|
+
protected _bufferSequenceExtraThreshold: number;
|
|
126
|
+
protected _maxBufferSequenceLength: number;
|
|
127
|
+
protected _bufferSizeSequence: Array<number>;
|
|
128
|
+
protected _bufferSize: number;
|
|
129
|
+
get bufferSize(): number;
|
|
130
|
+
protected _defaultBufferSize: number;
|
|
131
|
+
protected _maxBufferSize: number;
|
|
132
|
+
protected _resetBufferSizeTimeout: number;
|
|
133
|
+
protected _resetBufferSizeTimer: number | undefined;
|
|
120
134
|
protected lifeCircle(): void;
|
|
121
135
|
/**
|
|
122
136
|
* Scans the collection for deleted items and flushes the deleted item cache.
|
|
@@ -148,6 +162,10 @@ export declare class TrackBox<C extends BaseVirtualListItemComponent = any> exte
|
|
|
148
162
|
getNearestItem<I extends {
|
|
149
163
|
id: Id;
|
|
150
164
|
}, C extends Array<I>>(scrollSize: number, items: C, itemSize: number, isVertical: boolean): I | undefined;
|
|
165
|
+
protected _previousScrollSize: number;
|
|
166
|
+
protected updateAdaptiveBufferParams(metrics: IMetrics, totalItemsLength: number): void;
|
|
167
|
+
protected startResetBufferSizeTimer(): void;
|
|
168
|
+
protected disposeClearBufferSizeTimer(): void;
|
|
151
169
|
/**
|
|
152
170
|
* Calculates the position of an element based on the given scrollSize
|
|
153
171
|
*/
|
package/lib/utils/tracker.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { ComponentRef } from "@angular/core";
|
|
2
|
-
import {
|
|
2
|
+
import { ScrollDirection } from "../models";
|
|
3
3
|
import { Id, ISize } from "../types";
|
|
4
|
+
import { BaseVirtualListItemComponent } from "../models/base-virtual-list-item-component";
|
|
5
|
+
declare type TrackingPropertyId = string | number;
|
|
4
6
|
export interface IVirtualListItemComponent<I = any> {
|
|
5
7
|
getBounds(): ISize;
|
|
6
8
|
itemId: Id;
|
|
@@ -19,7 +21,9 @@ export declare class Tracker<C extends BaseVirtualListItemComponent = any> {
|
|
|
19
21
|
/**
|
|
20
22
|
* display objects dictionary of indexes by id
|
|
21
23
|
*/
|
|
22
|
-
|
|
24
|
+
protected _displayObjectIndexMapById: {
|
|
25
|
+
[id: number]: number;
|
|
26
|
+
};
|
|
23
27
|
set displayObjectIndexMapById(v: {
|
|
24
28
|
[id: number]: number;
|
|
25
29
|
});
|
|
@@ -29,12 +33,14 @@ export declare class Tracker<C extends BaseVirtualListItemComponent = any> {
|
|
|
29
33
|
/**
|
|
30
34
|
* Dictionary displayItems propertyNameId by items propertyNameId
|
|
31
35
|
*/
|
|
32
|
-
|
|
36
|
+
protected _trackMap: {
|
|
37
|
+
[id: TrackingPropertyId]: number;
|
|
38
|
+
} | null;
|
|
33
39
|
get trackMap(): {
|
|
34
40
|
[id: string]: number;
|
|
35
41
|
[id: number]: number;
|
|
36
42
|
} | null;
|
|
37
|
-
|
|
43
|
+
protected _trackingPropertyName: string;
|
|
38
44
|
set trackingPropertyName(v: string);
|
|
39
45
|
constructor(trackingPropertyName: string);
|
|
40
46
|
/**
|
|
@@ -44,3 +50,4 @@ export declare class Tracker<C extends BaseVirtualListItemComponent = any> {
|
|
|
44
50
|
untrackComponentByIdProperty(component?: C): void;
|
|
45
51
|
dispose(): void;
|
|
46
52
|
}
|
|
53
|
+
export {};
|