ng-virtual-list 19.11.4 → 19.12.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 +76 -36
- package/fesm2022/ng-virtual-list.mjs +5271 -2955
- package/fesm2022/ng-virtual-list.mjs.map +1 -1
- package/lib/components/ng-list-item/base/base-virtual-list-item-component.d.ts +16 -2
- package/lib/components/ng-list-item/const/index.d.ts +1 -1
- package/lib/components/ng-list-item/ng-virtual-list-item.component.d.ts +2 -1
- package/lib/components/ng-list-item/ng-virtual-list-item.module.d.ts +2 -2
- package/lib/components/ng-list-item/utils/create-display-id.d.ts +6 -0
- package/lib/components/ng-list-item/utils/get-element-by-index.d.ts +15 -1
- package/lib/components/ng-list-item/utils/index.d.ts +2 -1
- package/lib/components/ng-list-item/utils/matrix-3d.d.ts +7 -0
- package/lib/components/ng-prerender-container/components/ng-prerender-list/ng-prerender-list.component.d.ts +5 -4
- package/lib/components/ng-prerender-container/components/ng-prerender-list-item/ng-prerender-list-item.component.d.ts +2 -2
- package/lib/components/ng-prerender-container/components/ng-prerender-list-item/ng-prerender-list-item.module.d.ts +2 -2
- package/lib/components/ng-prerender-container/components/ng-prerender-scroller/ng-prerender-scroller.component.d.ts +3 -3
- package/lib/components/ng-prerender-container/interfaces/refresh-params.d.ts +1 -0
- package/lib/components/ng-prerender-container/ng-prerender-container.component.d.ts +6 -5
- package/lib/components/ng-scroll-bar/ng-scroll-bar.component.d.ts +5 -2
- package/lib/components/ng-scroll-view/base/base-scroll-view.component.d.ts +14 -3
- package/lib/components/ng-scroll-view/const/index.d.ts +3 -1
- package/lib/components/ng-scroll-view/interfaces/scroll-to-params.d.ts +3 -0
- package/lib/components/ng-scroll-view/ng-scroll-view.component.d.ts +51 -8
- package/lib/components/ng-scroll-view/utils/calculate-direction.d.ts +6 -0
- package/lib/components/ng-scroll-view/utils/calculate-velocity.d.ts +7 -0
- package/lib/components/ng-scroll-view/utils/get-dir.d.ts +7 -0
- package/lib/components/ng-scroll-view/utils/index.d.ts +3 -1
- package/lib/components/ng-scroll-view/utils/matrix-3d.d.ts +7 -0
- package/lib/components/ng-scroller/ng-scroller.component.d.ts +25 -26
- package/lib/const/index.d.ts +46 -5
- package/lib/core/cache-map.d.ts +0 -10
- package/lib/core/const/index.d.ts +1 -0
- package/lib/core/enums/index.d.ts +2 -0
- package/lib/core/enums/item-display-methods.d.ts +12 -0
- package/lib/core/events/index.d.ts +2 -0
- package/lib/core/events/track-box-events.d.ts +10 -0
- package/lib/core/interfaces/get-item-position-options.d.ts +10 -0
- package/lib/core/interfaces/get-metrics-returns.d.ts +11 -0
- package/lib/core/interfaces/index.d.ts +8 -0
- package/lib/core/interfaces/item.d.ts +9 -0
- package/lib/core/interfaces/metrics.d.ts +51 -0
- package/lib/core/interfaces/recalculate-metrics-options.d.ts +32 -0
- package/lib/core/interfaces/update-collection-options.d.ts +10 -0
- package/lib/core/interfaces/update-collection-returns.d.ts +14 -0
- package/lib/core/track-box.d.ts +25 -95
- package/lib/core/tracker.d.ts +1 -1
- package/lib/core/types/cache-map-events.d.ts +8 -0
- package/lib/core/types/cache-map-listeners.d.ts +9 -0
- package/lib/core/types/cache.d.ts +12 -0
- package/lib/core/types/index.d.ts +6 -0
- package/lib/core/types/on-change-event-listener.d.ts +7 -0
- package/lib/core/types/on-tick-event-listener.d.ts +7 -0
- package/lib/core/utils/get-service-id-prop.d.ts +7 -0
- package/lib/core/utils/index.d.ts +2 -0
- package/lib/directives/index.d.ts +2 -2
- package/lib/directives/locale-sensitive/locale-sensitive.directive.d.ts +1 -1
- package/lib/directives/{item-click/item-click.directive.d.ts → virtual-click/virtual-click.directive.d.ts} +5 -5
- package/lib/directives/virtual-click/virtual-click.module.d.ts +8 -0
- package/lib/enums/alignments.d.ts +10 -0
- package/lib/enums/collapsing-modes.d.ts +20 -0
- package/lib/enums/index.d.ts +7 -9
- package/lib/enums/{method-for-selecting-types.d.ts → selecting-modes-types.d.ts} +3 -3
- package/lib/enums/{methods-for-selecting.d.ts → selecting-modes.d.ts} +3 -3
- package/lib/enums/snap-to-item-aligns.d.ts +20 -0
- package/lib/enums/spreading-modes.d.ts +16 -0
- package/lib/interfaces/animation-params.d.ts +1 -0
- package/lib/interfaces/base-virtual-list-item-component.d.ts +13 -13
- package/lib/interfaces/index.d.ts +3 -2
- package/lib/interfaces/item-transformation.d.ts +22 -0
- package/lib/interfaces/point.d.ts +16 -0
- package/lib/interfaces/scroll-options.d.ts +4 -0
- package/lib/interfaces/scroll-params.d.ts +2 -1
- package/lib/models/item-config-map.model.d.ts +5 -0
- package/lib/models/item.model.d.ts +7 -0
- package/lib/models/render-item-config.model.d.ts +50 -0
- package/lib/models/render-item-measures.model.d.ts +71 -0
- package/lib/ng-virtual-list-public.service.d.ts +4 -5
- package/lib/ng-virtual-list.component.d.ts +161 -26
- package/lib/ng-virtual-list.service.d.ts +30 -12
- package/lib/transformations/deck-of-cards-3d.d.ts +54 -0
- package/lib/transformations/deck-of-cards.d.ts +50 -0
- package/lib/transformations/event-horizon.d.ts +26 -0
- package/lib/transformations/index.d.ts +7 -0
- package/lib/transformations/linear.d.ts +26 -0
- package/lib/transformations/swipe-3d.d.ts +38 -0
- package/lib/types/alignment.d.ts +8 -0
- package/lib/types/arithmetic-expression.d.ts +10 -0
- package/lib/types/collapsing-mode.d.ts +8 -0
- package/lib/{enums → types}/collection-mode.d.ts +1 -1
- package/lib/types/color.d.ts +4 -0
- package/lib/{enums → types}/direction.d.ts +1 -1
- package/lib/types/float-or-persentage-value.d.ts +7 -0
- package/lib/types/focus-item-params.d.ts +6 -0
- package/lib/types/gradient-color-position.d.ts +1 -1
- package/lib/types/index.d.ts +15 -1
- package/lib/types/item-transform.d.ts +9 -0
- package/lib/types/scroll-direction.d.ts +2 -0
- package/lib/types/selecting-mode.d.ts +8 -0
- package/lib/types/snap-to-item-align.d.ts +8 -0
- package/lib/types/snapping-distance.d.ts +8 -0
- package/lib/{enums → types}/snapping-method.d.ts +1 -1
- package/lib/types/spreading-mode.d.ts +8 -0
- package/lib/{enums → types}/text-direction.d.ts +1 -1
- package/lib/utils/animator/animator.d.ts +10 -17
- package/lib/utils/animator/const/index.d.ts +1 -0
- package/lib/utils/animator/index.d.ts +2 -1
- package/lib/utils/animator/interfaces/animator-params.d.ts +18 -0
- package/lib/utils/animator/interfaces/animator-update-data.d.ts +13 -0
- package/lib/utils/animator/interfaces/index.d.ts +3 -0
- package/lib/utils/animator/types/easing.d.ts +6 -0
- package/lib/utils/get-scroll-state-version.d.ts +1 -0
- package/lib/utils/is-collapse-mode.d.ts +8 -0
- package/lib/utils/is-collection-mode.d.ts +1 -1
- package/lib/utils/is-direction.d.ts +1 -1
- package/lib/utils/is-persentage-value.d.ts +7 -0
- package/lib/utils/is-select-mode.d.ts +8 -0
- package/lib/utils/is-spreading-mode.d.ts +8 -0
- package/lib/utils/normalize-collection.d.ts +8 -0
- package/lib/utils/parse-arithmetic-expression.d.ts +8 -0
- package/lib/utils/parse-float-or-persentage-value.d.ts +7 -0
- package/lib/utils/scrolling-direction.d.ts +17 -0
- package/lib/utils/snapping-method.d.ts +1 -1
- package/package.json +1 -1
- package/public-api.d.ts +3 -0
- package/lib/components/ng-scroller/const/index.d.ts +0 -1
- package/lib/directives/item-click/item-click.module.d.ts +0 -8
- package/lib/enums/method-for-selecting.d.ts +0 -8
- package/lib/utils/is-method-for-selecting.d.ts +0 -8
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ElementRef, Signal, TemplateRef } from '@angular/core';
|
|
2
2
|
import { Subject } from 'rxjs';
|
|
3
|
-
import { Id } from '../../types';
|
|
3
|
+
import { Id, TextDirection } from '../../types';
|
|
4
4
|
import { NgScrollBarComponent } from "../ng-scroll-bar/ng-scroll-bar.component";
|
|
5
5
|
import { GradientColorPositions } from '../../types/gradient-color-positions';
|
|
6
|
-
import { TextDirection } from '../../enums';
|
|
7
6
|
import { IScrollToParams, NgScrollView } from '../ng-scroll-view';
|
|
8
7
|
import { IScrollBarDragEvent } from '../ng-scroll-bar/interfaces';
|
|
9
8
|
import { ISize } from '../../interfaces';
|
|
@@ -17,12 +16,14 @@ export declare const SCROLL_EVENT: Event;
|
|
|
17
16
|
* @author Evgenii Alexandrovich Grebennikov
|
|
18
17
|
* @email djonnyx@gmail.com
|
|
19
18
|
*/
|
|
20
|
-
export declare class NgScrollerComponent extends NgScrollView
|
|
19
|
+
export declare class NgScrollerComponent extends NgScrollView {
|
|
21
20
|
readonly scrollBar: NgScrollBarComponent | undefined;
|
|
21
|
+
readonly filter: Signal<ElementRef<SVGFEGaussianBlurElement> | undefined>;
|
|
22
22
|
readonly onScrollbarVisible: import("@angular/core").OutputEmitterRef<boolean>;
|
|
23
23
|
readonly scrollbarEnabled: import("@angular/core").InputSignal<boolean>;
|
|
24
24
|
readonly scrollbarInteractive: import("@angular/core").InputSignal<boolean>;
|
|
25
25
|
readonly focusedElement: import("@angular/core").InputSignal<Id | null>;
|
|
26
|
+
readonly overlappingScrollbar: import("@angular/core").InputSignal<boolean>;
|
|
26
27
|
readonly content: import("@angular/core").InputSignal<HTMLElement | undefined>;
|
|
27
28
|
readonly loading: import("@angular/core").InputSignal<boolean>;
|
|
28
29
|
readonly classes: import("@angular/core").InputSignal<{
|
|
@@ -34,6 +35,9 @@ export declare class NgScrollerComponent extends NgScrollView implements OnDestr
|
|
|
34
35
|
readonly scrollbarThumbParams: import("@angular/core").InputSignal<{
|
|
35
36
|
[propName: string]: any;
|
|
36
37
|
} | null>;
|
|
38
|
+
readonly motionBlur: import("@angular/core").InputSignal<number | "disabled">;
|
|
39
|
+
readonly maxMotionBlur: import("@angular/core").InputSignal<number>;
|
|
40
|
+
readonly motionBlurEnabled: import("@angular/core").InputSignal<boolean>;
|
|
37
41
|
readonly actualClasses: Signal<{
|
|
38
42
|
[cName: string]: boolean;
|
|
39
43
|
}>;
|
|
@@ -44,42 +48,33 @@ export declare class NgScrollerComponent extends NgScrollView implements OnDestr
|
|
|
44
48
|
readonly thumbSize: import("@angular/core").WritableSignal<number>;
|
|
45
49
|
readonly scrollbarShow: import("@angular/core").WritableSignal<boolean>;
|
|
46
50
|
readonly preparedSignal: import("@angular/core").WritableSignal<boolean>;
|
|
47
|
-
private _service;
|
|
48
51
|
readonly langTextDir: import("@angular/core").WritableSignal<TextDirection>;
|
|
52
|
+
readonly listStyles: import("@angular/core").WritableSignal<{
|
|
53
|
+
perspectiveOrigin: string;
|
|
54
|
+
}>;
|
|
49
55
|
private _scrollBox;
|
|
50
56
|
get host(): HTMLDivElement | undefined;
|
|
51
57
|
private _$scrollbarScroll;
|
|
52
58
|
readonly $scrollbarScroll: import("rxjs").Observable<boolean>;
|
|
53
59
|
private _prepared;
|
|
54
60
|
set prepared(v: boolean);
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
set
|
|
58
|
-
get
|
|
61
|
+
protected setX(x: number, snap?: boolean, normalize?: boolean): void;
|
|
62
|
+
protected setY(y: number, snap?: boolean, normalize?: boolean): void;
|
|
63
|
+
set startLayoutOffset(v: number);
|
|
64
|
+
get startLayoutOffset(): number;
|
|
59
65
|
readonly viewInitialized: import("@angular/core").WritableSignal<boolean>;
|
|
60
66
|
private _isScrollbarUserAction;
|
|
61
67
|
get isScrollbarUserAction(): boolean;
|
|
62
|
-
private _measureVelocityTimestamp;
|
|
63
|
-
private _measureVelocityLastPosition;
|
|
64
|
-
private _measureVelocityAnimationFrameId;
|
|
65
|
-
private _measureVelocityAnimationTimer;
|
|
66
|
-
private _velocities;
|
|
67
|
-
protected _velocity: number;
|
|
68
|
-
get velocity(): number;
|
|
69
|
-
protected _averageVelocity: number;
|
|
70
|
-
get averageVelocity(): number;
|
|
71
|
-
private _measureVelocityHandler;
|
|
72
68
|
protected _$resizeViewport: Subject<ISize>;
|
|
73
69
|
readonly $resizeViewport: import("rxjs").Observable<ISize>;
|
|
74
70
|
protected _$resizeContent: Subject<ISize>;
|
|
75
71
|
readonly $resizeContent: import("rxjs").Observable<ISize>;
|
|
72
|
+
protected _filterId: string;
|
|
73
|
+
protected _filter: string;
|
|
76
74
|
constructor();
|
|
75
|
+
private recalculatePerspective;
|
|
77
76
|
protected onResizeViewport(): void;
|
|
78
|
-
protected onResizeContent(): void;
|
|
79
|
-
private measureVelocity;
|
|
80
|
-
private measureVelocityExecutor;
|
|
81
|
-
stopMeasureVelocity(): void;
|
|
82
|
-
private runMeasureVelocity;
|
|
77
|
+
protected onResizeContent(value?: number | null): void;
|
|
83
78
|
private updateScrollBarHandler;
|
|
84
79
|
ngAfterViewInit(): void;
|
|
85
80
|
tick(): void;
|
|
@@ -88,13 +83,17 @@ export declare class NgScrollerComponent extends NgScrollView implements OnDestr
|
|
|
88
83
|
protected onDragStart(): void;
|
|
89
84
|
reset(): void;
|
|
90
85
|
refresh(fireUpdate?: boolean, updateScrollbar?: boolean): void;
|
|
86
|
+
snapIfNeed(animated?: boolean): void;
|
|
87
|
+
startScrollTo(): void;
|
|
88
|
+
finishedScrollTo(): void;
|
|
91
89
|
scrollTo(params: IScrollToParams): void;
|
|
92
90
|
stopScrollbar(): void;
|
|
91
|
+
private dropVelocity;
|
|
92
|
+
protected stopMoving(): void;
|
|
93
93
|
protected onAnimationComplete(position: number): void;
|
|
94
94
|
onScrollBarDragHandler(event: IScrollBarDragEvent): void;
|
|
95
95
|
onScrollBarDragEndHandler(event: IScrollBarDragEvent): void;
|
|
96
96
|
private fireUpdateIfEdgesDetected;
|
|
97
|
-
ngOnDestroy(): void;
|
|
98
97
|
static ɵfac: i0.ɵɵFactoryDeclaration<NgScrollerComponent, never>;
|
|
99
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<NgScrollerComponent, "ng-scroller", never, { "scrollbarEnabled": { "alias": "scrollbarEnabled"; "required": false; "isSignal": true; }; "scrollbarInteractive": { "alias": "scrollbarInteractive"; "required": false; "isSignal": true; }; "focusedElement": { "alias": "focusedElement"; "required": false; "isSignal": true; }; "content": { "alias": "content"; "required": false; "isSignal": true; }; "loading": { "alias": "loading"; "required": false; "isSignal": true; }; "classes": { "alias": "classes"; "required": false; "isSignal": true; }; "scrollbarMinSize": { "alias": "scrollbarMinSize"; "required": false; "isSignal": true; }; "scrollbarThickness": { "alias": "scrollbarThickness"; "required": false; "isSignal": true; }; "scrollbarThumbRenderer": { "alias": "scrollbarThumbRenderer"; "required": false; "isSignal": true; }; "scrollbarThumbParams": { "alias": "scrollbarThumbParams"; "required": false; "isSignal": true; }; }, { "onScrollbarVisible": "onScrollbarVisible"; }, never, ["*"], false, never>;
|
|
98
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<NgScrollerComponent, "ng-scroller", never, { "scrollbarEnabled": { "alias": "scrollbarEnabled"; "required": false; "isSignal": true; }; "scrollbarInteractive": { "alias": "scrollbarInteractive"; "required": false; "isSignal": true; }; "focusedElement": { "alias": "focusedElement"; "required": false; "isSignal": true; }; "overlappingScrollbar": { "alias": "overlappingScrollbar"; "required": false; "isSignal": true; }; "content": { "alias": "content"; "required": false; "isSignal": true; }; "loading": { "alias": "loading"; "required": false; "isSignal": true; }; "classes": { "alias": "classes"; "required": false; "isSignal": true; }; "scrollbarMinSize": { "alias": "scrollbarMinSize"; "required": false; "isSignal": true; }; "scrollbarThickness": { "alias": "scrollbarThickness"; "required": false; "isSignal": true; }; "scrollbarThumbRenderer": { "alias": "scrollbarThumbRenderer"; "required": false; "isSignal": true; }; "scrollbarThumbParams": { "alias": "scrollbarThumbParams"; "required": false; "isSignal": true; }; "motionBlur": { "alias": "motionBlur"; "required": false; "isSignal": true; }; "maxMotionBlur": { "alias": "maxMotionBlur"; "required": false; "isSignal": true; }; "motionBlurEnabled": { "alias": "motionBlurEnabled"; "required": false; "isSignal": true; }; }, { "onScrollbarVisible": "onScrollbarVisible"; }, never, ["*"], false, never>;
|
|
100
99
|
}
|
package/lib/const/index.d.ts
CHANGED
|
@@ -1,8 +1,16 @@
|
|
|
1
|
-
import { CollectionModes,
|
|
1
|
+
import { CollapsingModes, CollectionModes, SelectingModes, SnappingMethods, TextDirections } from "../enums";
|
|
2
2
|
import { Directions } from "../enums/directions";
|
|
3
3
|
import { IAnimationParams, IScrollingSettings } from '../interfaces';
|
|
4
|
+
import { SpreadingMode } from "../types";
|
|
5
|
+
import { Alignment, SnappingDistance, SnapToItemAlign } from "../types";
|
|
6
|
+
export declare const SERVICE_PROP_DUMMY_ID = "__service-dummy-id__";
|
|
7
|
+
export declare const SERVICE_PROP_DUMMY = "__service-dummy__";
|
|
8
|
+
export declare const SERVICE_TYPE_DUMMY = "__service-type-dummy__";
|
|
9
|
+
export declare const SERVICE_PROP_DUMMY_ENABLED: unique symbol;
|
|
4
10
|
export declare const MAX_REGULAR_SNAPED_COMPONENTS = 2;
|
|
5
11
|
export declare const DEFAULT_ITEM_SIZE = 24;
|
|
12
|
+
export declare const DEFAULT_MIN_ITEM_SIZE = 1;
|
|
13
|
+
export declare const DEFAULT_MAX_ITEM_SIZE: number;
|
|
6
14
|
export declare const DEFAULT_BUFFER_SIZE = 2;
|
|
7
15
|
export declare const DEFAULT_MAX_BUFFER_SIZE = 10;
|
|
8
16
|
export declare const DEFAULT_LIST_SIZE = 400;
|
|
@@ -10,13 +18,25 @@ export declare const DEFAULT_CLICK_DISTANCE = 40;
|
|
|
10
18
|
export declare const DEFAULT_WAIT_FOR_PREPARATION = true;
|
|
11
19
|
export declare const DEFAULT_SCROLLBAR_ENABLED = true;
|
|
12
20
|
export declare const DEFAULT_SCROLLBAR_INTERACTIVE = true;
|
|
21
|
+
export declare const DEFAULT_OVERLAPPING_SCROLLBAR = false;
|
|
13
22
|
export declare const DEFAULT_SCROLL_BEHAVIOR: ScrollBehavior;
|
|
14
23
|
export declare const NAVIGATION_BY_KEYBOARD_TIMER = 50;
|
|
24
|
+
export declare const DEFAULT_SNAP_TO_ITEM = false;
|
|
25
|
+
export declare const DEFAULT_SNAP_TO_ITEM_ALIGN: SnapToItemAlign;
|
|
26
|
+
export declare const DEFAULT_SNAPPING_DISTANCE: SnappingDistance;
|
|
27
|
+
export declare const DEFAULT_SCROLLING_ONE_BY_ONE = false;
|
|
28
|
+
export declare const DEFAULT_ALIGNMENT: Alignment;
|
|
29
|
+
export declare const DEFAULT_SPREADING_MODE: SpreadingMode;
|
|
30
|
+
export declare const DEFAULT_DIVIDES = 1;
|
|
31
|
+
export declare const DEFAULT_MOTION_BLUR = 0.15;
|
|
32
|
+
export declare const DEFAULT_MOTION_BLUR_ENABLED = false;
|
|
33
|
+
export declare const DEFAULT_MAX_MOTION_BLUR = 0.5;
|
|
15
34
|
export declare const DEFAULT_ANIMATION_PARAMS: IAnimationParams;
|
|
16
35
|
export declare const DEFAULT_SCROLLING_SETTINGS: IScrollingSettings;
|
|
17
36
|
export declare const DEFAULT_OVERSCROLL_ENABLED = true;
|
|
18
|
-
export declare const
|
|
37
|
+
export declare const DEFAULT_STICKY_ENABLED = false;
|
|
19
38
|
export declare const DEFAULT_SELECT_BY_CLICK = true;
|
|
39
|
+
export declare const DEFAULT_ZINDEX_WHEN_SELECTING: null;
|
|
20
40
|
export declare const DEFAULT_COLLAPSE_BY_CLICK = true;
|
|
21
41
|
export declare const DEFAULT_ENABLED_BUFFER_OPTIMIZATION = false;
|
|
22
42
|
export declare const DEFAULT_DYNAMIC_SIZE = true;
|
|
@@ -29,7 +49,8 @@ export declare const DEFAULT_COLLECTION_MODE = CollectionModes.NORMAL;
|
|
|
29
49
|
export declare const DISPLAY_OBJECTS_LENGTH_MESUREMENT_ERROR = 1;
|
|
30
50
|
export declare const MAX_SCROLL_TO_ITERATIONS = 5;
|
|
31
51
|
export declare const DEFAULT_SNAPPING_METHOD = SnappingMethods.STANDART;
|
|
32
|
-
export declare const
|
|
52
|
+
export declare const DEFAULT_COLLAPSING_MODES = CollapsingModes.MULTI_COLLAPSE;
|
|
53
|
+
export declare const DEFAULT_SELECTING_MODES = SelectingModes.NONE;
|
|
33
54
|
export declare const DEFAULT_SCREEN_READER_MESSAGE = "Showing items $1 to $2";
|
|
34
55
|
export declare const DEFAULT_LANG_TEXT_DIR = TextDirections.LTR;
|
|
35
56
|
export declare const DEFAULT_SCROLLBAR_THICKNESS: number;
|
|
@@ -37,6 +58,8 @@ export declare const DEFAULT_SCROLLBAR_MIN_SIZE: number;
|
|
|
37
58
|
export declare const BEHAVIOR_AUTO: ScrollBehavior;
|
|
38
59
|
export declare const BEHAVIOR_INSTANT: ScrollBehavior;
|
|
39
60
|
export declare const BEHAVIOR_SMOOTH: ScrollBehavior;
|
|
61
|
+
export declare const DISABLED = "disabled";
|
|
62
|
+
export declare const VIEWPORT = "viewport";
|
|
40
63
|
export declare const DISPLAY_BLOCK = "block";
|
|
41
64
|
export declare const DISPLAY_NONE = "none";
|
|
42
65
|
export declare const OPACITY_0 = "0";
|
|
@@ -45,6 +68,11 @@ export declare const VISIBILITY_VISIBLE = "visible";
|
|
|
45
68
|
export declare const VISIBILITY_HIDDEN = "hidden";
|
|
46
69
|
export declare const SIZE_100_PERSENT = "100%";
|
|
47
70
|
export declare const SIZE_AUTO = "auto";
|
|
71
|
+
export declare const UNSET = "unset";
|
|
72
|
+
export declare const LEFT = "left";
|
|
73
|
+
export declare const RIGHT = "right";
|
|
74
|
+
export declare const POSITION = "position";
|
|
75
|
+
export declare const POSITION_RELATIVE = "relative";
|
|
48
76
|
export declare const POSITION_ABSOLUTE = "absolute";
|
|
49
77
|
export declare const TRANSLATE_3D = "translate3d";
|
|
50
78
|
export declare const ZEROS_TRANSLATE_3D = "translate3d(0,0,0)";
|
|
@@ -90,13 +118,24 @@ export declare const PART_DEFAULT_ITEM = "item";
|
|
|
90
118
|
export declare const PART_ITEM_NEW = " item-new";
|
|
91
119
|
export declare const PART_ITEM_ODD = " item-odd";
|
|
92
120
|
export declare const PART_ITEM_EVEN = " item-even";
|
|
121
|
+
export declare const PART_ITEM_ROW_ODD = " item-row-odd";
|
|
122
|
+
export declare const PART_ITEM_ROW_EVEN = " item-row-even";
|
|
93
123
|
export declare const PART_ITEM_SNAPPED = " item-snapped";
|
|
94
124
|
export declare const PART_ITEM_SELECTED = " item-selected";
|
|
95
125
|
export declare const PART_ITEM_COLLAPSED = " item-collapsed";
|
|
96
126
|
export declare const PART_ITEM_FOCUSED = " item-focused";
|
|
127
|
+
export declare const PART_DEFAULT_ITEM_FX = "item-fx";
|
|
128
|
+
export declare const PART_ITEM_FX_NEW = " item-fx-new";
|
|
129
|
+
export declare const PART_ITEM_FX_ODD = " item-fx-odd";
|
|
130
|
+
export declare const PART_ITEM_FX_EVEN = " item-fx-even";
|
|
131
|
+
export declare const PART_ITEM_ROW_FX_ODD = " item-row-fx-odd";
|
|
132
|
+
export declare const PART_ITEM_ROW_FX_EVEN = " item-row-fx-even";
|
|
133
|
+
export declare const PART_ITEM_FX_SNAPPED = " item-fx-snapped";
|
|
134
|
+
export declare const PART_ITEM_FX_SELECTED = " item-fx-selected";
|
|
135
|
+
export declare const PART_ITEM_FX_COLLAPSED = " item-fx-collapsed";
|
|
136
|
+
export declare const PART_ITEM_FX_FOCUSED = " item-fx-focused";
|
|
97
137
|
export declare const MIN_PIXELS_FOR_PREVENT_SNAPPING = 10;
|
|
98
138
|
export declare const MAX_VELOCITY_FOR_SCROLL_QUALITY_OPTIMIZATION_LVL1 = 74;
|
|
99
|
-
export declare const MAX_VELOCITY_FOR_SCROLL_QUALITY_OPTIMIZATION_LVL2 = 500;
|
|
100
139
|
export declare const MAX_NUMBERS_OF_SKIPS_FOR_QUALITY_OPTIMIZATION_LVL1 = 4;
|
|
101
140
|
export declare const RANGE_DISPLAY_ITEMS_END_OFFSET = 20;
|
|
102
141
|
export declare const PREPARE_ITERATIONS = 1;
|
|
@@ -109,4 +148,6 @@ export declare const EMPTY_SCROLL_STATE_VERSION = "-1";
|
|
|
109
148
|
export declare const ROLE_LIST = "list";
|
|
110
149
|
export declare const ROLE_LIST_BOX = "listbox";
|
|
111
150
|
export declare const ITEM_ID = "item-id";
|
|
112
|
-
export declare const ITEM_CONTAINER = "ngvl-
|
|
151
|
+
export declare const ITEM_CONTAINER = "ngvl-item";
|
|
152
|
+
export declare const PERCENTAGE_VALUE_PATTERN: RegExp;
|
|
153
|
+
export declare const Z_INDEX_NONE = "-1", Z_INDEX_0 = "0", Z_INDEX_1 = "1", Z_INDEX_2 = "2", Z_INDEX_3 = "3";
|
package/lib/core/cache-map.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { ScrollDirection } from "../types";
|
|
2
1
|
import { EventEmitter } from "../utils/event-emitter";
|
|
3
2
|
import { CMap } from "../utils/cmap";
|
|
4
3
|
export interface ICacheMap<I = any, B = any> {
|
|
@@ -27,22 +26,13 @@ export declare class CacheMap<I = string | number, B = any, E = CacheMapEvents,
|
|
|
27
26
|
protected _lifeCircleId: any;
|
|
28
27
|
protected _delta: number;
|
|
29
28
|
get delta(): number;
|
|
30
|
-
protected _deltaDirection: ScrollDirection;
|
|
31
|
-
set deltaDirection(v: ScrollDirection);
|
|
32
|
-
get deltaDirection(): ScrollDirection;
|
|
33
|
-
private _scrollDirectionCache;
|
|
34
|
-
private _scrollDirection;
|
|
35
|
-
get scrollDirection(): ScrollDirection;
|
|
36
29
|
get version(): number;
|
|
37
|
-
private _clearScrollDirectionDebounce;
|
|
38
30
|
constructor();
|
|
39
31
|
protected changesDetected(): boolean;
|
|
40
32
|
protected stopLifeCircle(): void;
|
|
41
33
|
protected nextTick(cb: () => void): any;
|
|
42
34
|
protected lifeCircle(): void;
|
|
43
35
|
protected lifeCircleDo(): void;
|
|
44
|
-
clearScrollDirectionCache(async?: boolean): void;
|
|
45
|
-
private calcScrollDirection;
|
|
46
36
|
protected bumpVersion(): void;
|
|
47
37
|
protected fireChangeIfNeed(): void;
|
|
48
38
|
set(id: I, bounds: B): CMap<I, B>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const START_COLLECTION_PREFIX_ID = "n", END_COLLECTION_PREFIX_ID = "p", DEFAULT_BUFFER_EXTREMUM_THRESHOLD = 15, DEFAULT_MAX_BUFFER_SEQUENCE_LENGTH = 30, DEFAULT_RESET_BUFFER_SIZE_TIMEOUT = 10000, IS_NEW = "n";
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ItemDisplayMethods
|
|
3
|
+
* @link https://github.com/DjonnyX/ng-virtual-list/blob/19.x/projects/ng-virtual-list/src/lib/core/enums/item-display-methods.ts
|
|
4
|
+
* @author Evgenii Alexandrovich Grebennikov
|
|
5
|
+
* @email djonnyx@gmail.com
|
|
6
|
+
*/
|
|
7
|
+
export declare enum ItemDisplayMethods {
|
|
8
|
+
CREATE = 0,
|
|
9
|
+
UPDATE = 1,
|
|
10
|
+
DELETE = 2,
|
|
11
|
+
NOT_CHANGED = 3
|
|
12
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TrackBoxEvents
|
|
3
|
+
* @link https://github.com/DjonnyX/ng-virtual-list/blob/19.x/projects/ng-virtual-list/src/lib/core/events/track-box-events.ts
|
|
4
|
+
* @author Evgenii Alexandrovich Grebennikov
|
|
5
|
+
* @email djonnyx@gmail.com
|
|
6
|
+
*/
|
|
7
|
+
export declare enum TrackBoxEvents {
|
|
8
|
+
CHANGE = "change",
|
|
9
|
+
TICK = "tick"
|
|
10
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { IItem } from "./item";
|
|
2
|
+
import { IRecalculateMetricsOptions } from "./recalculate-metrics-options";
|
|
3
|
+
/**
|
|
4
|
+
* IGetItemPositionOptions
|
|
5
|
+
* @link https://github.com/DjonnyX/ng-virtual-list/blob/19.x/projects/ng-virtual-list/src/lib/core/interfaces/get-item-position-options.ts
|
|
6
|
+
* @author Evgenii Alexandrovich Grebennikov
|
|
7
|
+
* @email djonnyx@gmail.com
|
|
8
|
+
*/
|
|
9
|
+
export interface IGetItemPositionOptions<I extends IItem, C extends Array<I>> extends Omit<IRecalculateMetricsOptions<I, C>, 'previousTotalSize' | 'crudDetected' | 'deletedItemsMap'> {
|
|
10
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* IGetMetricsReturns
|
|
3
|
+
* @link https://github.com/DjonnyX/ng-virtual-list/blob/19.x/projects/ng-virtual-list/src/lib/core/interfaces/get-metrics-returns.ts
|
|
4
|
+
* @author Evgenii Alexandrovich Grebennikov
|
|
5
|
+
* @email djonnyx@gmail.com
|
|
6
|
+
*/
|
|
7
|
+
export interface IGetMetricsReturns {
|
|
8
|
+
totalSize: number;
|
|
9
|
+
delta: number;
|
|
10
|
+
crudDetected: boolean;
|
|
11
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { IMetrics } from "./metrics";
|
|
2
|
+
import { IItem } from './item';
|
|
3
|
+
import { IGetItemPositionOptions } from './get-item-position-options';
|
|
4
|
+
import { IRecalculateMetricsOptions } from './recalculate-metrics-options';
|
|
5
|
+
import { IUpdateCollectionOptions } from './update-collection-options';
|
|
6
|
+
import { IGetMetricsReturns } from './get-metrics-returns';
|
|
7
|
+
import { IUpdateCollectionReturns } from "./update-collection-returns";
|
|
8
|
+
export type { IMetrics, IItem, IGetItemPositionOptions, IGetMetricsReturns, IRecalculateMetricsOptions, IUpdateCollectionOptions, IUpdateCollectionReturns, };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* IItem
|
|
3
|
+
* @link https://github.com/DjonnyX/ng-virtual-list/blob/19.x/projects/ng-virtual-list/src/lib/core/interfaces/item.ts
|
|
4
|
+
* @author Evgenii Alexandrovich Grebennikov
|
|
5
|
+
* @email djonnyx@gmail.com
|
|
6
|
+
*/
|
|
7
|
+
export interface IItem<I = any> {
|
|
8
|
+
[prop: string]: I;
|
|
9
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { HEIGHT_PROP_NAME, WIDTH_PROP_NAME } from "../../const";
|
|
2
|
+
import { ItemTransform, SnapToItemAlign } from "../../types";
|
|
3
|
+
import { IItem } from "./item";
|
|
4
|
+
/**
|
|
5
|
+
* IMetrics
|
|
6
|
+
* @link https://github.com/DjonnyX/ng-virtual-list/blob/19.x/projects/ng-virtual-list/src/lib/core/interfaces/metrics.ts
|
|
7
|
+
* @author Evgenii Alexandrovich Grebennikov
|
|
8
|
+
* @email djonnyx@gmail.com
|
|
9
|
+
*/
|
|
10
|
+
export interface IMetrics<I extends IItem> {
|
|
11
|
+
delta: number;
|
|
12
|
+
normalizedItemWidth: number;
|
|
13
|
+
normalizedItemHeight: number;
|
|
14
|
+
width: number;
|
|
15
|
+
height: number;
|
|
16
|
+
dynamicSize: boolean;
|
|
17
|
+
divides: number;
|
|
18
|
+
itemSize: number;
|
|
19
|
+
minItemSize: number;
|
|
20
|
+
maxItemSize: number;
|
|
21
|
+
items: Array<I>;
|
|
22
|
+
itemsFromStartToScrollEnd: number;
|
|
23
|
+
itemsFromStartToDisplayEnd: number;
|
|
24
|
+
itemsOnDisplayWeight: number;
|
|
25
|
+
itemsOnDisplayLength: number;
|
|
26
|
+
isVertical: boolean;
|
|
27
|
+
leftHiddenItemsWeight: number;
|
|
28
|
+
leftItemLength: number;
|
|
29
|
+
leftItemsWeight: number;
|
|
30
|
+
leftLayoutOffset: number;
|
|
31
|
+
leftLayoutIndexOffset: number;
|
|
32
|
+
renderItems: number;
|
|
33
|
+
rightItemLength: number;
|
|
34
|
+
rightItemsWeight: number;
|
|
35
|
+
scrollSize: number;
|
|
36
|
+
leftSizeOfAddedItems: number;
|
|
37
|
+
sizeProperty: typeof HEIGHT_PROP_NAME | typeof WIDTH_PROP_NAME;
|
|
38
|
+
stickyEnabled: boolean;
|
|
39
|
+
stickyPos: number;
|
|
40
|
+
startIndex: number;
|
|
41
|
+
startPosition: number;
|
|
42
|
+
totalItemsToDisplayEndWeight: number;
|
|
43
|
+
totalLength: number;
|
|
44
|
+
totalSize: number;
|
|
45
|
+
typicalItemSize: number;
|
|
46
|
+
isFromItemIdFound: boolean;
|
|
47
|
+
isUpdating: boolean;
|
|
48
|
+
snapToItem: boolean;
|
|
49
|
+
snapToItemAlign: SnapToItemAlign;
|
|
50
|
+
itemTransform: ItemTransform | null;
|
|
51
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { ISize } from "../../interfaces";
|
|
2
|
+
import { Id, ItemTransform, SnapToItemAlign } from "../../types";
|
|
3
|
+
import { IItem } from "./item";
|
|
4
|
+
/**
|
|
5
|
+
* IRecalculateMetricsOptions
|
|
6
|
+
* @link https://github.com/DjonnyX/ng-virtual-list/blob/19.x/projects/ng-virtual-list/src/lib/core/interfaces/recalculate-metrics-options.ts
|
|
7
|
+
* @author Evgenii Alexandrovich Grebennikov
|
|
8
|
+
* @email djonnyx@gmail.com
|
|
9
|
+
*/
|
|
10
|
+
export interface IRecalculateMetricsOptions<I extends IItem, C extends Array<I>> {
|
|
11
|
+
bounds: ISize;
|
|
12
|
+
collection: C;
|
|
13
|
+
isVertical: boolean;
|
|
14
|
+
itemSize: number;
|
|
15
|
+
minItemSize: number;
|
|
16
|
+
maxItemSize: number;
|
|
17
|
+
bufferSize: number;
|
|
18
|
+
maxBufferSize: number;
|
|
19
|
+
dynamicSize: boolean;
|
|
20
|
+
scrollSize: number;
|
|
21
|
+
stickyEnabled: boolean;
|
|
22
|
+
enabledBufferOptimization: boolean;
|
|
23
|
+
fromItemId?: Id;
|
|
24
|
+
previousTotalSize: number;
|
|
25
|
+
crudDetected: boolean;
|
|
26
|
+
deletedItemsMap: {
|
|
27
|
+
[index: number]: ISize;
|
|
28
|
+
};
|
|
29
|
+
snapToItem: boolean;
|
|
30
|
+
snapToItemAlign: SnapToItemAlign;
|
|
31
|
+
itemTransform: ItemTransform | null;
|
|
32
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { IItem } from "./item";
|
|
2
|
+
import { IRecalculateMetricsOptions } from "./recalculate-metrics-options";
|
|
3
|
+
/**
|
|
4
|
+
* IUpdateCollectionOptions
|
|
5
|
+
* @link https://github.com/DjonnyX/ng-virtual-list/blob/19.x/projects/ng-virtual-list/src/lib/core/interfaces/update-collection-options.ts
|
|
6
|
+
* @author Evgenii Alexandrovich Grebennikov
|
|
7
|
+
* @email djonnyx@gmail.com
|
|
8
|
+
*/
|
|
9
|
+
export interface IUpdateCollectionOptions<I extends IItem, C extends Array<I>> extends Omit<IRecalculateMetricsOptions<I, C>, 'collection' | 'previousTotalSize' | 'crudDetected' | 'deletedItemsMap'> {
|
|
10
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { IRenderVirtualListCollection } from "../../models/render-collection.model";
|
|
2
|
+
/**
|
|
3
|
+
* IUpdateCollectionReturns
|
|
4
|
+
* @link https://github.com/DjonnyX/ng-virtual-list/blob/19.x/projects/ng-virtual-list/src/lib/core/interfaces/update-collection-returns.ts
|
|
5
|
+
* @author Evgenii Alexandrovich Grebennikov
|
|
6
|
+
* @email djonnyx@gmail.com
|
|
7
|
+
*/
|
|
8
|
+
export interface IUpdateCollectionReturns {
|
|
9
|
+
displayItems: IRenderVirtualListCollection;
|
|
10
|
+
totalSize: number;
|
|
11
|
+
leftLayoutOffset: number;
|
|
12
|
+
delta: number;
|
|
13
|
+
crudDetected: boolean;
|
|
14
|
+
}
|
package/lib/core/track-box.d.ts
CHANGED
|
@@ -3,98 +3,14 @@ import { IRenderVirtualListCollection } from "../models/render-collection.model"
|
|
|
3
3
|
import { Id } from "../types/id";
|
|
4
4
|
import { CacheMap } from "./cache-map";
|
|
5
5
|
import { Tracker } from "./tracker";
|
|
6
|
-
import { ISize } from "../interfaces";
|
|
7
|
-
import { HEIGHT_PROP_NAME, WIDTH_PROP_NAME } from "../const";
|
|
6
|
+
import { IRect, ISize } from "../interfaces";
|
|
8
7
|
import { IVirtualListItemConfigMap } from "../models";
|
|
9
8
|
import { CMap } from '../utils/cmap';
|
|
10
9
|
import { BaseVirtualListItemComponent } from "../components/ng-list-item/base";
|
|
11
10
|
import { PrerenderCache } from "../components/ng-prerender-container/types/cache";
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}
|
|
16
|
-
export interface IMetrics {
|
|
17
|
-
delta: number;
|
|
18
|
-
normalizedItemWidth: number;
|
|
19
|
-
normalizedItemHeight: number;
|
|
20
|
-
width: number;
|
|
21
|
-
height: number;
|
|
22
|
-
dynamicSize: boolean;
|
|
23
|
-
itemSize: number;
|
|
24
|
-
itemsFromStartToScrollEnd: number;
|
|
25
|
-
itemsFromStartToDisplayEnd: number;
|
|
26
|
-
itemsOnDisplayWeight: number;
|
|
27
|
-
itemsOnDisplayLength: number;
|
|
28
|
-
isVertical: boolean;
|
|
29
|
-
leftHiddenItemsWeight: number;
|
|
30
|
-
leftItemLength: number;
|
|
31
|
-
leftItemsWeight: number;
|
|
32
|
-
renderItems: number;
|
|
33
|
-
rightItemLength: number;
|
|
34
|
-
rightItemsWeight: number;
|
|
35
|
-
scrollSize: number;
|
|
36
|
-
leftSizeOfAddedItems: number;
|
|
37
|
-
sizeProperty: typeof HEIGHT_PROP_NAME | typeof WIDTH_PROP_NAME;
|
|
38
|
-
snap: boolean;
|
|
39
|
-
snipedPos: number;
|
|
40
|
-
startIndex: number;
|
|
41
|
-
startPosition: number;
|
|
42
|
-
totalItemsToDisplayEndWeight: number;
|
|
43
|
-
totalLength: number;
|
|
44
|
-
totalSize: number;
|
|
45
|
-
typicalItemSize: number;
|
|
46
|
-
isFromItemIdFound: boolean;
|
|
47
|
-
isUpdating: boolean;
|
|
48
|
-
}
|
|
49
|
-
export interface IRecalculateMetricsOptions<I extends IItem, C extends Array<I>> {
|
|
50
|
-
bounds: ISize;
|
|
51
|
-
collection: C;
|
|
52
|
-
isVertical: boolean;
|
|
53
|
-
itemSize: number;
|
|
54
|
-
bufferSize: number;
|
|
55
|
-
maxBufferSize: number;
|
|
56
|
-
dynamicSize: boolean;
|
|
57
|
-
scrollSize: number;
|
|
58
|
-
snap: boolean;
|
|
59
|
-
enabledBufferOptimization: boolean;
|
|
60
|
-
fromItemId?: Id;
|
|
61
|
-
previousTotalSize: number;
|
|
62
|
-
crudDetected: boolean;
|
|
63
|
-
deletedItemsMap: {
|
|
64
|
-
[index: number]: ISize;
|
|
65
|
-
};
|
|
66
|
-
}
|
|
67
|
-
export interface IGetItemPositionOptions<I extends IItem, C extends Array<I>> extends Omit<IRecalculateMetricsOptions<I, C>, 'previousTotalSize' | 'crudDetected' | 'deletedItemsMap'> {
|
|
68
|
-
}
|
|
69
|
-
export interface IUpdateCollectionOptions<I extends IItem, C extends Array<I>> extends Omit<IRecalculateMetricsOptions<I, C>, 'collection' | 'previousTotalSize' | 'crudDetected' | 'deletedItemsMap'> {
|
|
70
|
-
}
|
|
71
|
-
export type CacheMapEvents = TrackBoxEvents;
|
|
72
|
-
export type OnChangeEventListener = (version: number) => void;
|
|
73
|
-
export type OnTickEventListener = () => void;
|
|
74
|
-
export type CacheMapListeners = OnChangeEventListener | OnTickEventListener;
|
|
75
|
-
export declare enum ItemDisplayMethods {
|
|
76
|
-
CREATE = 0,
|
|
77
|
-
UPDATE = 1,
|
|
78
|
-
DELETE = 2,
|
|
79
|
-
NOT_CHANGED = 3
|
|
80
|
-
}
|
|
81
|
-
export interface IUpdateCollectionReturns {
|
|
82
|
-
displayItems: IRenderVirtualListCollection;
|
|
83
|
-
totalSize: number;
|
|
84
|
-
delta: number;
|
|
85
|
-
crudDetected: boolean;
|
|
86
|
-
}
|
|
87
|
-
export interface IGetMetricsReturns {
|
|
88
|
-
totalSize: number;
|
|
89
|
-
delta: number;
|
|
90
|
-
crudDetected: boolean;
|
|
91
|
-
}
|
|
92
|
-
interface IItem<I = any> {
|
|
93
|
-
[prop: string]: I;
|
|
94
|
-
}
|
|
95
|
-
type Cache = ISize & {
|
|
96
|
-
method?: ItemDisplayMethods;
|
|
97
|
-
} & IItem;
|
|
11
|
+
import { ScrollDirection } from "../types";
|
|
12
|
+
import { IGetItemPositionOptions, IGetMetricsReturns, IItem, IMetrics, IRecalculateMetricsOptions, IUpdateCollectionOptions, IUpdateCollectionReturns } from "./interfaces";
|
|
13
|
+
import { Cache, CacheMapEvents, CacheMapListeners } from "./types";
|
|
98
14
|
/**
|
|
99
15
|
* An object that performs tracking, calculations and caching.
|
|
100
16
|
* @link https://github.com/DjonnyX/ng-virtual-list/blob/19.x/projects/ng-virtual-list/src/lib/core/track-box.ts
|
|
@@ -109,6 +25,16 @@ export declare class TrackBox<C extends BaseVirtualListItemComponent = any> exte
|
|
|
109
25
|
set displayComponents(v: Array<ComponentRef<C>> | null | undefined);
|
|
110
26
|
protected _snappedDisplayComponents: Array<ComponentRef<C>> | null | undefined;
|
|
111
27
|
set snappedDisplayComponents(v: Array<ComponentRef<C>> | null | undefined);
|
|
28
|
+
protected _scrollDirection: ScrollDirection;
|
|
29
|
+
set scrollDirection(v: ScrollDirection);
|
|
30
|
+
get scrollDirection(): ScrollDirection;
|
|
31
|
+
protected _trackBy: string;
|
|
32
|
+
set trackBy(v: string);
|
|
33
|
+
get trackBy(): string;
|
|
34
|
+
protected _divides: number;
|
|
35
|
+
set divides(v: number);
|
|
36
|
+
protected _isInfinity: boolean;
|
|
37
|
+
set isInfinity(v: boolean);
|
|
112
38
|
protected _isSnappingMethodAdvanced: boolean;
|
|
113
39
|
set isSnappingMethodAdvanced(v: boolean);
|
|
114
40
|
protected _isLazy: boolean;
|
|
@@ -118,10 +44,10 @@ export declare class TrackBox<C extends BaseVirtualListItemComponent = any> exte
|
|
|
118
44
|
*/
|
|
119
45
|
set trackingPropertyName(v: string);
|
|
120
46
|
protected _trackingPropertyName: string;
|
|
121
|
-
set isScrollStart(v: boolean);
|
|
122
47
|
protected _isScrollStart: boolean;
|
|
123
|
-
set
|
|
48
|
+
set isScrollStart(v: boolean);
|
|
124
49
|
protected _isScrollEnd: boolean;
|
|
50
|
+
set isScrollEnd(v: boolean);
|
|
125
51
|
protected _isScrollSnapToStart: boolean;
|
|
126
52
|
get isSnappedToStart(): boolean;
|
|
127
53
|
protected _isScrollSnapToEnd: boolean;
|
|
@@ -182,7 +108,7 @@ export declare class TrackBox<C extends BaseVirtualListItemComponent = any> exte
|
|
|
182
108
|
*/
|
|
183
109
|
updateCollection<I extends IItem, C extends Array<I>>(items: C, itemConfigMap: IVirtualListItemConfigMap, options: IUpdateCollectionOptions<I, C>): IUpdateCollectionReturns;
|
|
184
110
|
protected _previousScrollSize: number;
|
|
185
|
-
protected updateAdaptiveBufferParams(metrics: IMetrics
|
|
111
|
+
protected updateAdaptiveBufferParams<I extends IItem>(metrics: IMetrics<I>, totalItemsLength: number): void;
|
|
186
112
|
protected startResetBufferSizeTimer(): void;
|
|
187
113
|
protected disposeClearBufferSizeTimer(): void;
|
|
188
114
|
/**
|
|
@@ -195,15 +121,15 @@ export declare class TrackBox<C extends BaseVirtualListItemComponent = any> exte
|
|
|
195
121
|
/**
|
|
196
122
|
* Calculates list metrics
|
|
197
123
|
*/
|
|
198
|
-
protected recalculateMetrics<I extends IItem, C extends Array<I>>(options: IRecalculateMetricsOptions<I, C>): IMetrics
|
|
124
|
+
protected recalculateMetrics<I extends IItem, C extends Array<I>>(options: IRecalculateMetricsOptions<I, C>): IMetrics<I>;
|
|
199
125
|
refreshCache(cache: PrerenderCache): void;
|
|
200
|
-
clearDelta(
|
|
126
|
+
clearDelta(): void;
|
|
201
127
|
changes(immediately?: boolean, force?: boolean): void;
|
|
202
128
|
/**
|
|
203
129
|
* Returns true if the bounds of at least one screen object have changed.
|
|
204
130
|
*/
|
|
205
131
|
checkBoundsOfElements(): boolean;
|
|
206
|
-
protected generateDisplayCollection<I extends IItem, C extends Array<I>>(items: C, itemConfigMap: IVirtualListItemConfigMap, metrics: IMetrics): IRenderVirtualListCollection;
|
|
132
|
+
protected generateDisplayCollection<I extends IItem, C extends Array<I>>(items: C, actualItems: C, itemConfigMap: IVirtualListItemConfigMap, metrics: IMetrics<I>): IRenderVirtualListCollection;
|
|
207
133
|
resetPositions(): void;
|
|
208
134
|
/**
|
|
209
135
|
* tracking by propName
|
|
@@ -214,10 +140,14 @@ export declare class TrackBox<C extends BaseVirtualListItemComponent = any> exte
|
|
|
214
140
|
}): void;
|
|
215
141
|
untrackComponentByIdProperty(component?: C | undefined): void;
|
|
216
142
|
getItemBounds(id: Id): ISize | null;
|
|
143
|
+
getComponentBoundsByIntersectionPosition(position: number, maxPosition?: number | null): (IRect & {
|
|
144
|
+
id: Id | null;
|
|
145
|
+
isFirst: boolean;
|
|
146
|
+
isLast: boolean;
|
|
147
|
+
}) | null;
|
|
217
148
|
private _debouncedIsScrollStartOff;
|
|
218
149
|
protected cacheElements(isVertical: boolean, itemSize: number): void;
|
|
219
150
|
resetCacheChunkInfo(): void;
|
|
220
151
|
cacheClean(): void;
|
|
221
152
|
dispose(): void;
|
|
222
153
|
}
|
|
223
|
-
export {};
|
package/lib/core/tracker.d.ts
CHANGED
|
@@ -47,7 +47,7 @@ export declare class Tracker<C extends BaseVirtualListItemComponent = any> {
|
|
|
47
47
|
/**
|
|
48
48
|
* tracking by propName
|
|
49
49
|
*/
|
|
50
|
-
track(items: IRenderVirtualListCollection, components: Array<ComponentRef<C>>, snappedComponents: Array<ComponentRef<C>> | null | undefined, direction: ScrollDirection): void;
|
|
50
|
+
track(items: IRenderVirtualListCollection, components: Array<ComponentRef<C>>, snappedComponents: Array<ComponentRef<C>> | null | undefined, direction: ScrollDirection, trackBy: string): void;
|
|
51
51
|
untrackComponentByIdProperty(component?: C): void;
|
|
52
52
|
clearTrackMap(): void;
|
|
53
53
|
dispose(): void;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { TrackBoxEvents } from "../events";
|
|
2
|
+
/**
|
|
3
|
+
* CacheMapEvents
|
|
4
|
+
* @link https://github.com/DjonnyX/ng-virtual-list/blob/19.x/projects/ng-virtual-list/src/lib/core/types/cache-map-events.ts
|
|
5
|
+
* @author Evgenii Alexandrovich Grebennikov
|
|
6
|
+
* @email djonnyx@gmail.com
|
|
7
|
+
*/
|
|
8
|
+
export type CacheMapEvents = TrackBoxEvents;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { OnChangeEventListener } from "./on-change-event-listener";
|
|
2
|
+
import { OnTickEventListener } from "./on-tick-event-listener";
|
|
3
|
+
/**
|
|
4
|
+
* CacheMapListeners
|
|
5
|
+
* @link https://github.com/DjonnyX/ng-virtual-list/blob/19.x/projects/ng-virtual-list/src/lib/core/types/cache-map-listeners.ts
|
|
6
|
+
* @author Evgenii Alexandrovich Grebennikov
|
|
7
|
+
* @email djonnyx@gmail.com
|
|
8
|
+
*/
|
|
9
|
+
export type CacheMapListeners = OnChangeEventListener | OnTickEventListener;
|