ng-virtual-list 18.12.2 → 18.12.3

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.
Files changed (27) hide show
  1. package/README.md +2 -2
  2. package/esm2022/lib/components/ng-list-item/base/base-virtual-list-item-component.mjs +9 -5
  3. package/esm2022/lib/components/ng-list-item/const/index.mjs +2 -1
  4. package/esm2022/lib/components/ng-list-item/ng-virtual-list-item.component.mjs +14 -8
  5. package/esm2022/lib/components/ng-prerender-container/components/ng-prerender-list-item/ng-prerender-list-item.component.mjs +3 -3
  6. package/esm2022/lib/components/ng-scroll-view/ng-scroll-view.component.mjs +20 -14
  7. package/esm2022/lib/components/ng-scroller/ng-scroller.component.mjs +6 -2
  8. package/esm2022/lib/const/index.mjs +6 -3
  9. package/esm2022/lib/core/track-box.mjs +31 -9
  10. package/esm2022/lib/directives/virtual-click/virtual-click.directive.mjs +35 -16
  11. package/esm2022/lib/models/display-object-config.model.mjs +1 -1
  12. package/esm2022/lib/ng-virtual-list.component.mjs +43 -11
  13. package/esm2022/lib/ng-virtual-list.service.mjs +31 -2
  14. package/esm2022/lib/utils/animator/animator.mjs +31 -8
  15. package/fesm2022/ng-virtual-list.mjs +214 -67
  16. package/fesm2022/ng-virtual-list.mjs.map +1 -1
  17. package/lib/components/ng-list-item/base/base-virtual-list-item-component.d.ts +1 -1
  18. package/lib/components/ng-list-item/ng-virtual-list-item.component.d.ts +3 -1
  19. package/lib/components/ng-scroll-view/ng-scroll-view.component.d.ts +5 -2
  20. package/lib/components/ng-scroller/ng-scroller.component.d.ts +1 -1
  21. package/lib/const/index.d.ts +3 -1
  22. package/lib/directives/virtual-click/virtual-click.directive.d.ts +11 -6
  23. package/lib/models/display-object-config.model.d.ts +4 -0
  24. package/lib/ng-virtual-list.component.d.ts +2 -1
  25. package/lib/ng-virtual-list.service.d.ts +13 -0
  26. package/lib/utils/animator/animator.d.ts +10 -2
  27. package/package.json +1 -1
@@ -71,7 +71,7 @@ export declare class BaseVirtualListItemComponent extends DisposableComponent im
71
71
  get element(): HTMLElement;
72
72
  constructor();
73
73
  protected updateMeasures(v: IRenderVirtualListItem<any> | null): void;
74
- protected updateConfig(v: IRenderVirtualListItem<any> | null): void;
74
+ protected updateConfig(v: IRenderVirtualListItem<any> | null, grabbing: boolean): void;
75
75
  protected update(): void;
76
76
  protected updatePartStr(v: IRenderVirtualListItem | null, isSelected: boolean, isCollapsed: boolean): void;
77
77
  protected hasFocus(): boolean;
@@ -23,8 +23,10 @@ export declare class NgVirtualListItemComponent extends BaseVirtualListItemCompo
23
23
  private toPrevItem;
24
24
  private focusNext;
25
25
  private focusPrev;
26
- protected updateConfig(v: IRenderVirtualListItem<any> | null): void;
26
+ protected updateConfig(v: IRenderVirtualListItem<any> | null, grabbing: boolean): void;
27
27
  onClickHandler(): void;
28
+ onClickPressHandler(): void;
29
+ onClickCancelHandler(): void;
28
30
  static ɵfac: i0.ɵɵFactoryDeclaration<NgVirtualListItemComponent, never>;
29
31
  static ɵcmp: i0.ɵɵComponentDeclaration<NgVirtualListItemComponent, "ng-virtual-list-item", never, {}, {}, never, never, false, never>;
30
32
  }
@@ -87,8 +87,10 @@ export declare class NgScrollView extends BaseScrollView {
87
87
  get startLayoutOffset(): number;
88
88
  protected _intersectionComponentId: Id | null;
89
89
  protected _isAlignmentAnimation: boolean;
90
+ get animated(): boolean;
90
91
  constructor();
91
92
  ngAfterViewInit(): void;
93
+ hasAnimation(id?: number): boolean;
92
94
  protected updateDirection(position: number, prePosition: number): void;
93
95
  protected overrideCoordinates(x: number, y: number): void;
94
96
  protected measureVelocity(): void;
@@ -105,19 +107,20 @@ export declare class NgScrollView extends BaseScrollView {
105
107
  protected move(isVertical: boolean, position: number, blending?: boolean, userAction?: boolean, fireUpdate?: boolean): void;
106
108
  protected moveWithAcceleration(isVertical: boolean, position: number, v0: number, v: number, a0: number, timestamp: number): void;
107
109
  protected normalizeValue(value: number): number;
108
- protected animate(startValue: number, endValue: number, duration?: number, easingFunction?: Easing, userAction?: boolean, alignmentAtComplete?: boolean, skipOverridedCoordinates?: boolean): void;
110
+ protected animate(startValue: number, endValue: number, duration?: number, easingFunction?: Easing, blending?: boolean, userAction?: boolean, alignmentAtComplete?: boolean, skipOverridedCoordinates?: boolean): number;
109
111
  protected getSnappedComponentSize(): number | null;
110
112
  protected alignPosition(animated?: boolean, force?: boolean): boolean;
111
113
  protected checkIntersectionComponent(): void;
112
114
  protected onAnimationComplete(position: number): void;
113
115
  fireScroll(userAction?: boolean): void;
114
116
  scrollLimits(value?: number | undefined, silent?: boolean): boolean;
115
- scroll(params: IScrollToParams): void;
117
+ scroll(params: IScrollToParams): number;
116
118
  protected emitScrollableEvent(): void;
117
119
  refreshCoordinate(x: number, y: number): void;
118
120
  protected fireScrollEvent(userAction: boolean): void;
119
121
  protected onDragStart(): void;
120
122
  reset(offset?: number): void;
123
+ stopAnimation(id: number): void;
121
124
  ngOnDestroy(): void;
122
125
  static ɵfac: i0.ɵɵFactoryDeclaration<NgScrollView, never>;
123
126
  static ɵcmp: i0.ɵɵComponentDeclaration<NgScrollView, "ng-scroll-view", never, { "scrollBehavior": { "alias": "scrollBehavior"; "required": false; }; "overscrollEnabled": { "alias": "overscrollEnabled"; "required": false; }; "scrollingSettings": { "alias": "scrollingSettings"; "required": false; }; "snapToItem": { "alias": "snapToItem"; "required": false; }; "scrollingOneByOne": { "alias": "scrollingOneByOne"; "required": false; }; "snapToItemAlign": { "alias": "snapToItemAlign"; "required": false; }; "snappingDistance": { "alias": "snappingDistance"; "required": false; }; "animationParams": { "alias": "animationParams"; "required": false; }; }, {}, never, never, false, never>;
@@ -151,7 +151,7 @@ export declare class NgScrollerComponent extends NgScrollView {
151
151
  snapIfNeed(animated?: boolean): void;
152
152
  startScrollTo(): void;
153
153
  finishedScrollTo(): void;
154
- scrollTo(params: IScrollToParams): void;
154
+ scrollTo(params: IScrollToParams): number;
155
155
  stopScrollbar(): void;
156
156
  private dropVelocity;
157
157
  protected stopMoving(): void;
@@ -75,13 +75,15 @@ export declare const POSITION = "position";
75
75
  export declare const POSITION_RELATIVE = "relative";
76
76
  export declare const POSITION_ABSOLUTE = "absolute";
77
77
  export declare const TRANSLATE_3D = "translate3d";
78
- export declare const ZEROS_TRANSLATE_3D = "translate3d(0,0,0)";
78
+ export declare const INVISIBLE_TRANSLATE_3D = "translate3d(-10000,-10000,0)";
79
79
  export declare const HIDDEN_ZINDEX = "-1";
80
80
  export declare const DEFAULT_ZINDEX = "0";
81
81
  export declare const TOP_PROP_NAME = "top";
82
82
  export declare const LEFT_PROP_NAME = "left";
83
83
  export declare const X_PROP_NAME = "x";
84
84
  export declare const Y_PROP_NAME = "y";
85
+ export declare const TRANSFORMED_X_PROP_NAME = "transformedX";
86
+ export declare const TRANSFORMED_Y_PROP_NAME = "transformedY";
85
87
  export declare const WIDTH_PROP_NAME = "width";
86
88
  export declare const HEIGHT_PROP_NAME = "height";
87
89
  export declare const MARGIN_TOP = "marginTop";
@@ -1,8 +1,8 @@
1
- import { ElementRef, EventEmitter, OnDestroy } from '@angular/core';
1
+ import { OnDestroy, EventEmitter } from '@angular/core';
2
2
  import { Subject } from 'rxjs';
3
3
  import * as i0 from "@angular/core";
4
4
  /**
5
- * ItemClickDirective
5
+ * VirtualClickDirective
6
6
  * Maximum performance for extremely large lists.
7
7
  * It is based on algorithms for virtualization of screen objects.
8
8
  * @link https://github.com/DjonnyX/ng-virtual-list/blob/18.x/projects/ng-virtual-list/src/lib/directives/item-click/item-click.directive.ts
@@ -10,13 +10,18 @@ import * as i0 from "@angular/core";
10
10
  * @email djonnyx@gmail.com
11
11
  */
12
12
  export declare class VirtualClickDirective implements OnDestroy {
13
- private _elementRef;
14
13
  protected _$unsubscribe: Subject<void>;
14
+ private _$maxDistance;
15
+ protected $maxDistance: import("rxjs").Observable<number | null>;
15
16
  private _maxDistance;
16
- set maxDistance(v: number | null);
17
+ set maxDistance(v: number | string);
17
18
  onVirtualClick: EventEmitter<PointerEvent | TouchEvent>;
18
- constructor(_elementRef: ElementRef);
19
+ onVirtualClickPress: EventEmitter<PointerEvent | TouchEvent>;
20
+ onVirtualClickCancel: EventEmitter<void>;
21
+ private _service;
22
+ private _elementRef;
23
+ constructor();
19
24
  ngOnDestroy(): void;
20
25
  static ɵfac: i0.ɵɵFactoryDeclaration<VirtualClickDirective, never>;
21
- static ɵdir: i0.ɵɵDirectiveDeclaration<VirtualClickDirective, "[virtualClick]", never, { "maxDistance": { "alias": "maxClickDistance"; "required": false; }; }, { "onVirtualClick": "onVirtualClick"; }, never, never, false, never>;
26
+ static ɵdir: i0.ɵɵDirectiveDeclaration<VirtualClickDirective, "[virtualClick]", never, { "maxDistance": { "alias": "maxClickDistance"; "required": false; }; }, { "onVirtualClick": "onVirtualClick"; "onVirtualClickPress": "onVirtualClickPress"; "onVirtualClickCancel": "onVirtualClickCancel"; }, never, never, false, never>;
22
27
  }
@@ -18,4 +18,8 @@ export interface IDisplayObjectConfig extends IRenderVirtualListItemConfig {
18
18
  * Determines whether the element is collapsed or not.
19
19
  */
20
20
  collapsed: boolean;
21
+ /**
22
+ * True if scroll capture occurs.
23
+ */
24
+ grabbing: boolean;
21
25
  }
@@ -406,7 +406,7 @@ export declare class NgVirtualListComponent extends DisposableComponent implemen
406
406
  protected readonly $animationParams: Observable<IAnimationParams>;
407
407
  private _animationParamsTransform;
408
408
  /**
409
- * Animation parameters. The default value is "{ scrollToItem: 50, snapToItem: 150, navigateToItem: 150, navigateByKeyboard: 50 }".
409
+ * Animation parameters. The default value is "{ scrollToItem: 150, snapToItem: 150, navigateToItem: 150, navigateByKeyboard: 50 }".
410
410
  */
411
411
  set animationParams(v: IAnimationParams);
412
412
  get animationParams(): IAnimationParams;
@@ -695,6 +695,7 @@ export declare class NgVirtualListComponent extends DisposableComponent implemen
695
695
  private _readyForShow;
696
696
  private _cached;
697
697
  private _isLoading;
698
+ private _animationId;
698
699
  protected get cachable(): boolean;
699
700
  protected get prerenderable(): boolean;
700
701
  private _$viewInit;
@@ -81,6 +81,19 @@ export declare class NgVirtualListService {
81
81
  get langTextDir(): TextDirection;
82
82
  private _langTextDir;
83
83
  set langTextDir(v: TextDirection);
84
+ private _$grabbing;
85
+ readonly $grabbing: import("rxjs").Observable<boolean>;
86
+ get grabbing(): boolean;
87
+ private _grabbing;
88
+ set grabbing(v: boolean);
89
+ private _$clickPressed;
90
+ readonly $clickPressed: import("rxjs").Observable<boolean>;
91
+ get clickPressed(): boolean;
92
+ private _clickPressed;
93
+ set clickPressed(v: boolean);
94
+ private _$isGrabbing;
95
+ readonly $isGrabbing: import("rxjs").Observable<boolean>;
96
+ get isGrabbing(): boolean;
84
97
  get scrollBarSize(): number;
85
98
  private _scrollBarSize;
86
99
  set scrollBarSize(v: number);
@@ -8,9 +8,17 @@ import { IAnimatorParams } from './interfaces';
8
8
  export declare class Animator {
9
9
  private static _nextId;
10
10
  private _animationId;
11
+ get animated(): boolean;
12
+ get isAnimated(): boolean;
11
13
  private _currentId;
14
+ get id(): number;
12
15
  private generateId;
13
- animate(params: IAnimatorParams): void;
14
- stop(): void;
16
+ private _diff;
17
+ private _startValue;
18
+ private _endValue;
19
+ updateTo(value: number): boolean;
20
+ animate(params: IAnimatorParams): number;
21
+ hasAnimation(id?: number): boolean;
22
+ stop(id?: number): void;
15
23
  dispose(): void;
16
24
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ng-virtual-list",
3
- "version": "18.12.2",
3
+ "version": "18.12.3",
4
4
  "author": {
5
5
  "name": "Evgenii Alexandrovich Grebennikov",
6
6
  "email": "djonnyx@gmail.com"