ng-virtual-list 18.12.0 → 18.12.2
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 +1 -11
- package/esm2022/lib/components/ng-scroll-bar/ng-scroll-bar.component.mjs +6 -6
- package/esm2022/lib/components/ng-scroll-view/const/index.mjs +2 -2
- package/esm2022/lib/components/ng-scroll-view/ng-scroll-view.component.mjs +9 -11
- package/esm2022/lib/components/ng-scroller/utils/interfaces/calculate-scroll-metrics.mjs +2 -0
- package/esm2022/lib/components/ng-scroller/utils/interfaces/calculate-scroll-params.mjs +2 -0
- package/esm2022/lib/components/ng-scroller/utils/interfaces/calculate-scroll-position-params.mjs +2 -0
- package/esm2022/lib/components/ng-scroller/utils/interfaces/index.mjs +2 -0
- package/esm2022/lib/components/ng-scroller/utils/scroll-box.mjs +1 -1
- package/esm2022/lib/core/interfaces/recalculate-metrics-options.mjs +1 -1
- package/esm2022/lib/core/track-box.mjs +24 -19
- package/esm2022/lib/core/tracker.mjs +12 -9
- package/esm2022/lib/ng-virtual-list.component.mjs +49 -35
- package/esm2022/lib/utils/animator/animator.mjs +2 -2
- package/esm2022/lib/utils/animator/interfaces/animator-params.mjs +1 -1
- package/esm2022/lib/utils/animator/interfaces/animator-update-data.mjs +1 -1
- package/esm2022/lib/utils/animator/types/easing.mjs +1 -1
- package/esm2022/lib/utils/event-emitter/event-emitter.mjs +2 -2
- package/esm2022/lib/utils/event-emitter/interfaces/event-emitter.mjs +1 -1
- package/fesm2022/ng-virtual-list.mjs +96 -77
- package/fesm2022/ng-virtual-list.mjs.map +1 -1
- package/lib/components/ng-scroll-view/const/index.d.ts +1 -1
- package/lib/components/ng-scroller/utils/interfaces/calculate-scroll-metrics.d.ts +11 -0
- package/lib/components/ng-scroller/utils/interfaces/calculate-scroll-params.d.ts +19 -0
- package/lib/components/ng-scroller/utils/interfaces/calculate-scroll-position-params.d.ts +10 -0
- package/lib/components/ng-scroller/utils/interfaces/index.d.ts +4 -0
- package/lib/components/ng-scroller/utils/scroll-box.d.ts +1 -18
- package/lib/core/interfaces/recalculate-metrics-options.d.ts +2 -1
- package/lib/ng-virtual-list.component.d.ts +1 -0
- package/lib/utils/animator/animator.d.ts +1 -1
- package/lib/utils/animator/interfaces/animator-params.d.ts +1 -1
- package/lib/utils/animator/interfaces/animator-update-data.d.ts +1 -1
- package/lib/utils/animator/types/easing.d.ts +1 -1
- package/lib/utils/event-emitter/event-emitter.d.ts +1 -1
- package/lib/utils/event-emitter/interfaces/event-emitter.d.ts +1 -1
- package/package.json +1 -1
|
@@ -2,6 +2,6 @@ import { InjectionToken } from "@angular/core";
|
|
|
2
2
|
export declare const SCROLL_VIEW_INVERSION: InjectionToken<boolean>;
|
|
3
3
|
export declare const SCROLL_VIEW_OVERSCROLL_ENABLED: InjectionToken<boolean>;
|
|
4
4
|
export declare const SCROLL_VIEW_NORMALIZE_VALUE_FROM_ZERO: InjectionToken<boolean>;
|
|
5
|
-
export declare const TOP = "top", LEFT = "left", INSTANT = "instant", AUTO = "auto", SMOOTH = "smooth", DURATION = 2000, FRICTION_FORCE = 0.035, MAX_DURATION = 4000, ANIMATION_DURATION = 50, MASS = 0.005, MAX_DIST = 12500, MAX_VELOCITY_TIMESTAMP = 100, SPEED_SCALE = 15, OVERSCROLL_START_ITERATION = 2
|
|
5
|
+
export declare const TOP = "top", LEFT = "left", INSTANT = "instant", AUTO = "auto", SMOOTH = "smooth", DURATION = 2000, FRICTION_FORCE = 0.035, MAX_DURATION = 4000, ANIMATION_DURATION = 50, MASS = 0.005, ACCELERATION_SCALE = 40, MAX_DIST = 12500, MAX_VELOCITY_TIMESTAMP = 100, SPEED_SCALE = 15, OVERSCROLL_START_ITERATION = 2;
|
|
6
6
|
export declare const MAX_ITERATIONS_FOR_AVERAGE_CALCULATIONS = 5, INSTANT_VELOCITY_SCALE = 1000;
|
|
7
7
|
export declare const SCROLL_EVENT: Event;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ICalculateScrollMetrics
|
|
3
|
+
* @link https://github.com/DjonnyX/ng-virtual-list/blob/18.x/projects/ng-virtual-list/src/lib/components/scroller/utils/interfaces/calculate-scroll-metrics.ts
|
|
4
|
+
* @author Evgenii Alexandrovich Grebennikov
|
|
5
|
+
* @email djonnyx@gmail.com
|
|
6
|
+
*/
|
|
7
|
+
export interface ICalculateScrollMetrics {
|
|
8
|
+
gradientPos: [number, number];
|
|
9
|
+
size: number;
|
|
10
|
+
pos: number;
|
|
11
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ScrollerDirections } from "../../enums";
|
|
2
|
+
/**
|
|
3
|
+
* ICalculateScrollMetrics
|
|
4
|
+
* @link https://github.com/DjonnyX/ng-virtual-list/blob/18.x/projects/ng-virtual-list/src/lib/components/scroller/utils/interfaces/calculate-scroll-params.ts
|
|
5
|
+
* @author Evgenii Alexandrovich Grebennikov
|
|
6
|
+
* @email djonnyx@gmail.com
|
|
7
|
+
*/
|
|
8
|
+
export interface ICalculateScrollParams {
|
|
9
|
+
direction: ScrollerDirections;
|
|
10
|
+
viewportWidth: number;
|
|
11
|
+
viewportHeight: number;
|
|
12
|
+
contentWidth: number;
|
|
13
|
+
contentHeight: number;
|
|
14
|
+
startOffset: number;
|
|
15
|
+
endOffset: number;
|
|
16
|
+
positionX: number;
|
|
17
|
+
positionY: number;
|
|
18
|
+
minSize: number;
|
|
19
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ICalculateScrollPositionParams
|
|
3
|
+
* @link https://github.com/DjonnyX/ng-virtual-list/blob/18.x/projects/ng-virtual-list/src/lib/components/scroller/utils/interfaces/calculate-scroll-position-params.ts
|
|
4
|
+
* @author Evgenii Alexandrovich Grebennikov
|
|
5
|
+
* @email djonnyx@gmail.com
|
|
6
|
+
*/
|
|
7
|
+
export interface ICalculateScrollPositionParams {
|
|
8
|
+
scrollSize: number;
|
|
9
|
+
position: number;
|
|
10
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { ICalculateScrollParams } from './calculate-scroll-params';
|
|
2
|
+
import { ICalculateScrollPositionParams } from './calculate-scroll-position-params';
|
|
3
|
+
import { ICalculateScrollMetrics } from './calculate-scroll-metrics';
|
|
4
|
+
export type { ICalculateScrollParams, ICalculateScrollPositionParams, ICalculateScrollMetrics, };
|
|
@@ -1,21 +1,5 @@
|
|
|
1
1
|
import { GradientColorPositions } from "../../../types/gradient-color-positions";
|
|
2
|
-
import {
|
|
3
|
-
interface ICalculateScrollParams {
|
|
4
|
-
direction: ScrollerDirections;
|
|
5
|
-
viewportWidth: number;
|
|
6
|
-
viewportHeight: number;
|
|
7
|
-
contentWidth: number;
|
|
8
|
-
contentHeight: number;
|
|
9
|
-
startOffset: number;
|
|
10
|
-
endOffset: number;
|
|
11
|
-
positionX: number;
|
|
12
|
-
positionY: number;
|
|
13
|
-
minSize: number;
|
|
14
|
-
}
|
|
15
|
-
interface ICalculateScrollPositionParams {
|
|
16
|
-
scrollSize: number;
|
|
17
|
-
position: number;
|
|
18
|
-
}
|
|
2
|
+
import { ICalculateScrollParams, ICalculateScrollPositionParams } from "./interfaces";
|
|
19
3
|
/**
|
|
20
4
|
* ScrollBox
|
|
21
5
|
* Maximum performance for extremely large lists.
|
|
@@ -37,4 +21,3 @@ export declare class ScrollBox {
|
|
|
37
21
|
position: number;
|
|
38
22
|
};
|
|
39
23
|
}
|
|
40
|
-
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ISize } from "../../interfaces";
|
|
2
|
-
import { Id, ItemTransform, SnapToItemAlign } from "../../types";
|
|
2
|
+
import { Alignment, Id, ItemTransform, SnapToItemAlign } from "../../types";
|
|
3
3
|
import { IItem } from "./item";
|
|
4
4
|
/**
|
|
5
5
|
* IRecalculateMetricsOptions
|
|
@@ -8,6 +8,7 @@ import { IItem } from "./item";
|
|
|
8
8
|
* @email djonnyx@gmail.com
|
|
9
9
|
*/
|
|
10
10
|
export interface IRecalculateMetricsOptions<I extends IItem, C extends Array<I>> {
|
|
11
|
+
alignment: Alignment;
|
|
11
12
|
bounds: ISize;
|
|
12
13
|
collection: C;
|
|
13
14
|
isVertical: boolean;
|
|
@@ -717,6 +717,7 @@ export declare class NgVirtualListComponent extends DisposableComponent implemen
|
|
|
717
717
|
private getIsVertical;
|
|
718
718
|
private getIsLazy;
|
|
719
719
|
private createDisplayComponentsIfNeed;
|
|
720
|
+
private updateOffsetsByAllignment;
|
|
720
721
|
private updateRegularRenderer;
|
|
721
722
|
/**
|
|
722
723
|
* Tracking by id
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { IAnimatorParams } from './interfaces';
|
|
2
2
|
/**
|
|
3
3
|
* Animator
|
|
4
|
-
* @link https://github.com/DjonnyX/
|
|
4
|
+
* @link https://github.com/DjonnyX/ng-virtual-list/blob/main/library/src/utils/animator/animator.ts
|
|
5
5
|
* @author Evgenii Alexandrovich Grebennikov
|
|
6
6
|
* @email djonnyx@gmail.com
|
|
7
7
|
*/
|
|
@@ -2,7 +2,7 @@ import { Easing } from "../types";
|
|
|
2
2
|
import { IAnimatorUpdateData } from "./animator-update-data";
|
|
3
3
|
/**
|
|
4
4
|
* IAnimatorParams
|
|
5
|
-
* @link https://github.com/DjonnyX/
|
|
5
|
+
* @link https://github.com/DjonnyX/ng-virtual-list/blob/main/library/src/utils/animator/interfaces/animator-params.ts
|
|
6
6
|
* @author Evgenii Alexandrovich Grebennikov
|
|
7
7
|
* @email djonnyx@gmail.com
|
|
8
8
|
*/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* IAnimatorUpdateData
|
|
3
|
-
* @link https://github.com/DjonnyX/
|
|
3
|
+
* @link https://github.com/DjonnyX/ng-virtual-list/blob/main/library/src/utils/animator/interfaces/animator-update-data.ts
|
|
4
4
|
* @author Evgenii Alexandrovich Grebennikov
|
|
5
5
|
* @email djonnyx@gmail.com
|
|
6
6
|
*/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Easing
|
|
3
|
-
* @link https://github.com/DjonnyX/
|
|
3
|
+
* @link https://github.com/DjonnyX/ng-virtual-list/blob/main/library/src/utils/animator/types/easing.ts
|
|
4
4
|
* @author Evgenii Alexandrovich Grebennikov
|
|
5
5
|
* @email djonnyx@gmail.com
|
|
6
6
|
*/
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export type TEventHandler = (...args: Array<any>) => void;
|
|
2
2
|
/**
|
|
3
3
|
* Event emitter
|
|
4
|
-
* @link https://github.com/DjonnyX/
|
|
4
|
+
* @link https://github.com/DjonnyX/ng-virtual-list/blob/main/library/src/utils/event-emitter/event-emitter.ts
|
|
5
5
|
* @author Evgenii Alexandrovich Grebennikov
|
|
6
6
|
* @email djonnyx@gmail.com
|
|
7
7
|
*/
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export type TEventHandler = (...args: Array<any>) => void;
|
|
2
2
|
/**
|
|
3
3
|
* Event emitter interface
|
|
4
|
-
* @link https://github.com/DjonnyX/
|
|
4
|
+
* @link https://github.com/DjonnyX/ng-virtual-list/blob/main/library/src/utils/event-emitter/interfaces/IEventEmitter.ts
|
|
5
5
|
* @author Evgenii Alexandrovich Grebennikov
|
|
6
6
|
* @email djonnyx@gmail.com
|
|
7
7
|
*/
|