ng-virtual-list 14.0.13 → 14.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/esm2020/lib/components/ng-virtual-list-item.component.mjs +2 -2
- package/esm2020/lib/const/index.mjs +2 -3
- package/esm2020/lib/ng-virtual-list.component.mjs +72 -193
- package/esm2020/lib/utils/cacheMap.mjs +15 -7
- package/esm2020/lib/utils/trackBox.mjs +38 -8
- package/esm2020/lib/utils/tracker.mjs +17 -24
- package/fesm2015/ng-virtual-list.mjs +135 -226
- package/fesm2015/ng-virtual-list.mjs.map +1 -1
- package/fesm2020/ng-virtual-list.mjs +136 -227
- package/fesm2020/ng-virtual-list.mjs.map +1 -1
- package/lib/components/ng-virtual-list-item.component.d.ts +1 -1
- package/lib/const/index.d.ts +1 -2
- package/lib/ng-virtual-list.component.d.ts +4 -17
- package/lib/utils/tracker.d.ts +10 -4
- package/package.json +1 -1
|
@@ -23,7 +23,7 @@ export declare class NgVirtualListItemComponent {
|
|
|
23
23
|
get element(): HTMLElement;
|
|
24
24
|
constructor(_cdr: ChangeDetectorRef, _elementRef: ElementRef<HTMLElement>);
|
|
25
25
|
getBounds(): IRect;
|
|
26
|
-
|
|
26
|
+
show(): void;
|
|
27
27
|
hide(): void;
|
|
28
28
|
static ɵfac: i0.ɵɵFactoryDeclaration<NgVirtualListItemComponent, never>;
|
|
29
29
|
static ɵcmp: i0.ɵɵComponentDeclaration<NgVirtualListItemComponent, "ng-virtual-list-item", never, {}, {}, never, never, false>;
|
package/lib/const/index.d.ts
CHANGED
|
@@ -3,8 +3,7 @@ export declare const DEFAULT_ITEM_SIZE = 24;
|
|
|
3
3
|
export declare const DEFAULT_ITEMS_OFFSET = 2;
|
|
4
4
|
export declare const DEFAULT_LIST_SIZE = 400;
|
|
5
5
|
export declare const DEFAULT_SNAP = false;
|
|
6
|
-
export declare const DEFAULT_ENABLED_BUFFER_OPTIMIZATION =
|
|
7
|
-
export declare const DEFAULT_SNAP_TO_ITEM = false;
|
|
6
|
+
export declare const DEFAULT_ENABLED_BUFFER_OPTIMIZATION = false;
|
|
8
7
|
export declare const DEFAULT_DYNAMIC_SIZE = false;
|
|
9
8
|
export declare const TRACK_BY_PROPERTY_NAME = "id";
|
|
10
9
|
export declare const DEFAULT_DIRECTION = Directions.VERTICAL;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AfterViewInit, ComponentRef, ElementRef,
|
|
1
|
+
import { AfterViewInit, ChangeDetectorRef, ComponentRef, ElementRef, EventEmitter, OnDestroy, TemplateRef, ViewContainerRef } from '@angular/core';
|
|
2
2
|
import { BehaviorSubject, Observable } from 'rxjs';
|
|
3
3
|
import { NgVirtualListItemComponent } from './components/ng-virtual-list-item.component';
|
|
4
4
|
import { IScrollEvent, IVirtualListCollection, IVirtualListStickyMap } from './models';
|
|
@@ -49,16 +49,10 @@ export declare class NgVirtualListComponent extends DisposableComponent implemen
|
|
|
49
49
|
*/
|
|
50
50
|
set snap(v: boolean);
|
|
51
51
|
get snap(): boolean;
|
|
52
|
-
private _$snapToItem;
|
|
53
|
-
readonly $snapToItem: Observable<boolean>;
|
|
54
|
-
/**
|
|
55
|
-
* Determines whether scroll positions will be snapped to the element. Default value is "false".
|
|
56
|
-
*/
|
|
57
|
-
set snapToItem(v: boolean);
|
|
58
|
-
get snapToItem(): boolean;
|
|
59
52
|
private _$enabledBufferOptimization;
|
|
60
53
|
readonly $enabledBufferOptimization: Observable<boolean>;
|
|
61
54
|
/**
|
|
55
|
+
* Experimental!
|
|
62
56
|
* Enables buffer optimization.
|
|
63
57
|
* Can only be used if items in the collection are not added or updated. Otherwise, artifacts in the form of twitching of the scroll area are possible.
|
|
64
58
|
* Works only if the property dynamic = true
|
|
@@ -122,15 +116,9 @@ export declare class NgVirtualListComponent extends DisposableComponent implemen
|
|
|
122
116
|
protected _displayComponents: Array<ComponentRef<NgVirtualListItemComponent>>;
|
|
123
117
|
protected _$bounds: BehaviorSubject<DOMRect | null>;
|
|
124
118
|
protected _$scrollSize: BehaviorSubject<number>;
|
|
125
|
-
private _isScrollingDebounces;
|
|
126
|
-
private _isScrolling;
|
|
127
|
-
get isScrolling(): boolean;
|
|
128
119
|
private _resizeObserver;
|
|
129
120
|
private _onResizeHandler;
|
|
130
|
-
private _scrolls;
|
|
131
121
|
private _onScrollHandler;
|
|
132
|
-
private scrollImmediately;
|
|
133
|
-
private _onScrollEndHandler;
|
|
134
122
|
private _$initialized;
|
|
135
123
|
readonly $initialized: Observable<boolean>;
|
|
136
124
|
/**
|
|
@@ -163,13 +151,12 @@ export declare class NgVirtualListComponent extends DisposableComponent implemen
|
|
|
163
151
|
scrollTo(id: Id, behavior?: ScrollBehavior): void;
|
|
164
152
|
private _scrollToRepeatExecutionTimeout;
|
|
165
153
|
private clearScrollToRepeatExecutionTimeout;
|
|
166
|
-
protected scrollToExecutor(id: Id, behavior: ScrollBehavior, iteration?: number): void;
|
|
154
|
+
protected scrollToExecutor(id: Id, behavior: ScrollBehavior, iteration?: number, isLastIteration?: boolean): void;
|
|
167
155
|
scrollToEnd(behavior?: ScrollBehavior): void;
|
|
168
156
|
private _onContainerScrollHandler;
|
|
169
157
|
private _onContainerScrollEndHandler;
|
|
170
158
|
ngAfterViewInit(): void;
|
|
171
|
-
private clearScrollImmediately;
|
|
172
159
|
ngOnDestroy(): void;
|
|
173
160
|
static ɵfac: i0.ɵɵFactoryDeclaration<NgVirtualListComponent, never>;
|
|
174
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<NgVirtualListComponent, "ng-virtual-list", never, { "items": "items"; "snap": "snap"; "
|
|
161
|
+
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"; }, { "onScroll": "onScroll"; "onScrollEnd": "onScrollEnd"; }, never, never, false>;
|
|
175
162
|
}
|
package/lib/utils/tracker.d.ts
CHANGED
|
@@ -1,13 +1,18 @@
|
|
|
1
1
|
import { ComponentRef } from "@angular/core";
|
|
2
|
+
import { ScrollDirection } from "../models";
|
|
3
|
+
interface IVirtualListItemComponent<I = any> {
|
|
4
|
+
id: number;
|
|
5
|
+
item: I;
|
|
6
|
+
show: () => void;
|
|
7
|
+
hide: () => void;
|
|
8
|
+
}
|
|
2
9
|
/**
|
|
3
10
|
* Tracks display items by property
|
|
4
11
|
* @link https://github.com/DjonnyX/ng-virtual-list/blob/14.x/projects/ng-virtual-list/src/lib/utils/tracker.ts
|
|
5
12
|
* @author Evgenii Grebennikov
|
|
6
13
|
* @email djonnyx@gmail.com
|
|
7
14
|
*/
|
|
8
|
-
export declare class Tracker<I = any, C = {
|
|
9
|
-
[prop: string]: any;
|
|
10
|
-
}> {
|
|
15
|
+
export declare class Tracker<I = any, C extends IVirtualListItemComponent = any> {
|
|
11
16
|
/**
|
|
12
17
|
* display objects dictionary of indexes by id
|
|
13
18
|
*/
|
|
@@ -32,7 +37,8 @@ export declare class Tracker<I = any, C = {
|
|
|
32
37
|
/**
|
|
33
38
|
* tracking by propName
|
|
34
39
|
*/
|
|
35
|
-
track(items: Array<any>, components: Array<ComponentRef<
|
|
40
|
+
track(items: Array<any>, components: Array<ComponentRef<C>>, direction: ScrollDirection): void;
|
|
36
41
|
untrackComponentByIdProperty(component?: C): void;
|
|
37
42
|
dispose(): void;
|
|
38
43
|
}
|
|
44
|
+
export {};
|