ng-virtual-list 14.11.2 → 14.11.4

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 (24) hide show
  1. package/README.md +1 -0
  2. package/esm2020/lib/components/ng-list-item/base/base-virtual-list-item-component.mjs +7 -1
  3. package/esm2020/lib/components/ng-list-item/ng-virtual-list-item.component.mjs +2 -7
  4. package/esm2020/lib/components/ng-list-item/ng-virtual-list-item.module.mjs +3 -3
  5. package/esm2020/lib/components/ng-prerender-container/components/ng-prerender-list-item/ng-prerender-list-item.module.mjs +3 -3
  6. package/esm2020/lib/components/ng-scroll-bar/ng-scroll-bar.module.mjs +3 -3
  7. package/esm2020/lib/components/ng-scroll-view/ng-scroll-view.component.mjs +19 -8
  8. package/esm2020/lib/components/ng-scroller/ng-scroller.module.mjs +3 -3
  9. package/esm2020/lib/const/index.mjs +9 -1
  10. package/esm2020/lib/interfaces/index.mjs +1 -1
  11. package/esm2020/lib/interfaces/scrolling-settings.mjs +2 -0
  12. package/esm2020/lib/ng-virtual-list.component.mjs +92 -29
  13. package/fesm2015/ng-virtual-list.mjs +128 -43
  14. package/fesm2015/ng-virtual-list.mjs.map +1 -1
  15. package/fesm2020/ng-virtual-list.mjs +123 -41
  16. package/fesm2020/ng-virtual-list.mjs.map +1 -1
  17. package/lib/components/ng-list-item/base/base-virtual-list-item-component.d.ts +2 -0
  18. package/lib/components/ng-list-item/ng-virtual-list-item.component.d.ts +0 -2
  19. package/lib/components/ng-scroll-view/ng-scroll-view.component.d.ts +6 -1
  20. package/lib/const/index.d.ts +2 -1
  21. package/lib/interfaces/index.d.ts +2 -1
  22. package/lib/interfaces/scrolling-settings.d.ts +38 -0
  23. package/lib/ng-virtual-list.component.d.ts +16 -2
  24. package/package.json +1 -1
@@ -6,6 +6,7 @@ import { ITemplateContext } from '../interfaces';
6
6
  import { TextDirection } from '../../../enums';
7
7
  import { BehaviorSubject } from 'rxjs';
8
8
  import { DisposableComponent } from '../../../utils/disposable-component';
9
+ import { NgVirtualListService } from '../../../ng-virtual-list.service';
9
10
  /**
10
11
  * BaseVirtualListItemComponent
11
12
  * @link https://github.com/DjonnyX/ng-virtual-list/blob/14.x/projects/ng-virtual-list/src/lib/components/list-item/base/base-virtual-list-item-component.ts
@@ -14,6 +15,7 @@ import { DisposableComponent } from '../../../utils/disposable-component';
14
15
  */
15
16
  export declare class BaseVirtualListItemComponent extends DisposableComponent {
16
17
  private _apiService;
18
+ protected readonly _service: NgVirtualListService;
17
19
  protected _cdr: ChangeDetectorRef;
18
20
  protected _id: number;
19
21
  get id(): number;
@@ -2,7 +2,6 @@ import { Injector, OnInit } from '@angular/core';
2
2
  import { Observable } from 'rxjs';
3
3
  import { IRenderVirtualListItem } from '../../models/render-item.model';
4
4
  import { BaseVirtualListItemComponent } from './base';
5
- import { NgVirtualListService } from '../../ng-virtual-list.service';
6
5
  import * as i0 from "@angular/core";
7
6
  /**
8
7
  * Virtual list component.
@@ -13,7 +12,6 @@ import * as i0 from "@angular/core";
13
12
  * @email djonnyx@gmail.com
14
13
  */
15
14
  export declare class NgVirtualListItemComponent extends BaseVirtualListItemComponent implements OnInit {
16
- protected readonly _service: NgVirtualListService;
17
15
  private _$maxClickDistance;
18
16
  $maxClickDistance: Observable<number>;
19
17
  protected _injector: Injector;
@@ -3,6 +3,7 @@ import { BehaviorSubject, Subject } from 'rxjs';
3
3
  import { Animator, Easing } from '../../utils/animator';
4
4
  import { IScrollToParams } from './interfaces';
5
5
  import { BaseScrollView } from './base/base-scroll-view.component';
6
+ import { IScrollingSettings } from '../../interfaces';
6
7
  import * as i0 from "@angular/core";
7
8
  /**
8
9
  * NgScrollView
@@ -22,6 +23,10 @@ export declare class NgScrollView extends BaseScrollView {
22
23
  readonly $overscrollEnabled: import("rxjs").Observable<boolean>;
23
24
  set overscrollEnabled(v: boolean);
24
25
  get overscrollEnabled(): boolean;
26
+ protected _$scrollingSettings: BehaviorSubject<IScrollingSettings>;
27
+ readonly $scrollingSettings: import("rxjs").Observable<IScrollingSettings>;
28
+ set scrollingSettings(v: IScrollingSettings);
29
+ get scrollingSettings(): IScrollingSettings;
25
30
  protected _normalizeValueFromZero: boolean;
26
31
  protected _$scroll: Subject<boolean>;
27
32
  readonly $scroll: import("rxjs").Observable<boolean>;
@@ -57,5 +62,5 @@ export declare class NgScrollView extends BaseScrollView {
57
62
  reset(offset?: number): void;
58
63
  ngOnDestroy(): void;
59
64
  static ɵfac: i0.ɵɵFactoryDeclaration<NgScrollView, never>;
60
- static ɵcmp: i0.ɵɵComponentDeclaration<NgScrollView, "ng-scroll-view", never, { "scrollBehavior": "scrollBehavior"; "overscrollEnabled": "overscrollEnabled"; }, {}, never, never, false>;
65
+ static ɵcmp: i0.ɵɵComponentDeclaration<NgScrollView, "ng-scroll-view", never, { "scrollBehavior": "scrollBehavior"; "overscrollEnabled": "overscrollEnabled"; "scrollingSettings": "scrollingSettings"; }, {}, never, never, false>;
61
66
  }
@@ -1,6 +1,6 @@
1
1
  import { CollectionModes, MethodsForSelecting, SnappingMethods, TextDirections } from "../enums";
2
2
  import { Directions } from "../enums/directions";
3
- import { IAnimationParams } from '../interfaces';
3
+ import { IAnimationParams, IScrollingSettings } from '../interfaces';
4
4
  export declare const MAX_REGULAR_SNAPED_COMPONENTS = 2;
5
5
  export declare const DEFAULT_ITEM_SIZE = 24;
6
6
  export declare const DEFAULT_BUFFER_SIZE = 2;
@@ -13,6 +13,7 @@ export declare const DEFAULT_SCROLLBAR_INTERACTIVE = true;
13
13
  export declare const DEFAULT_SCROLL_BEHAVIOR: ScrollBehavior;
14
14
  export declare const NAVIGATION_BY_KEYBOARD_TIMER = 50;
15
15
  export declare const DEFAULT_ANIMATION_PARAMS: IAnimationParams;
16
+ export declare const DEFAULT_SCROLLING_SETTINGS: IScrollingSettings;
16
17
  export declare const DEFAULT_OVERSCROLL_ENABLED = true;
17
18
  export declare const DEFAULT_SNAP = false;
18
19
  export declare const DEFAULT_SELECT_BY_CLICK = true;
@@ -6,4 +6,5 @@ import { IScrollEvent } from './scroll-event';
6
6
  import { IScrollOptions } from './scroll-options';
7
7
  import { IScrollParams } from './scroll-params';
8
8
  import { ISize } from './size';
9
- export type { IAnimationParams, BaseVirtualListItemComponent, IRect, IRenderStabilizerOptions, IScrollEvent, IScrollOptions, IScrollParams, ISize, };
9
+ import { IScrollingSettings } from './scrolling-settings';
10
+ export type { IAnimationParams, BaseVirtualListItemComponent, IRect, IRenderStabilizerOptions, IScrollEvent, IScrollOptions, IScrollParams, ISize, IScrollingSettings, };
@@ -0,0 +1,38 @@
1
+ /**
2
+ * Interface IScrollingSettings.
3
+ * - frictionalForce - Frictional force. Default value is `0.035`.
4
+ * - mass - Mass. Default value is `0.005`.
5
+ * - maxDistance - Maximum scrolling distance. Default value is `12500`.
6
+ * - maxDuration - Maximum animation duration. Default value is `4000`.
7
+ * - speedScale - Speed scale. Default value is `15`.
8
+ * - optimization - Enables scrolling performance optimization. Default value is `true`.
9
+ * @link https://github.com/DjonnyX/ng-virtual-list/blob/14.x/projects/ng-virtual-list/src/lib/interfaces/scrolling-settings.ts
10
+ * @author Evgenii Alexandrovich Grebennikov
11
+ * @email djonnyx@gmail.com
12
+ */
13
+ export interface IScrollingSettings {
14
+ /**
15
+ * Frictional force. Default value is `0.035`.
16
+ */
17
+ frictionalForce?: number;
18
+ /**
19
+ * Maximum animation duration. Default value is `4000`.
20
+ */
21
+ maxDuration?: number;
22
+ /**
23
+ * Mass. Default value is `0.005`.
24
+ */
25
+ mass?: number;
26
+ /**
27
+ * Maximum scrolling distance. Default value is `12500`.
28
+ */
29
+ maxDistance?: number;
30
+ /**
31
+ * Speed scale. Default value is `15`.
32
+ */
33
+ speedScale?: number;
34
+ /**
35
+ * Enables scrolling performance optimization. Default value is `true`.
36
+ */
37
+ optimization?: boolean;
38
+ }
@@ -1,7 +1,7 @@
1
1
  import { ElementRef, EventEmitter, OnDestroy, TemplateRef } from '@angular/core';
2
2
  import { Observable } from 'rxjs';
3
3
  import { IRenderVirtualListItem, IVirtualListCollection, IVirtualListItem, IVirtualListItemConfigMap } from './models';
4
- import { IScrollEvent, IScrollOptions, IAnimationParams, ISize } from './interfaces';
4
+ import { IScrollEvent, IScrollOptions, IAnimationParams, ISize, IScrollingSettings } from './interfaces';
5
5
  import { FocusAlignment, Id } from './types';
6
6
  import { CollectionMode, Direction, MethodForSelecting, SnappingMethod, TextDirection } from './enums';
7
7
  import { BaseVirtualListItemComponent } from './components/ng-list-item/base';
@@ -264,6 +264,20 @@ export declare class NgVirtualListComponent extends DisposableComponent implemen
264
264
  */
265
265
  set scrollBehavior(v: ScrollBehavior);
266
266
  get scrollBehavior(): ScrollBehavior;
267
+ private _$scrollingSettings;
268
+ protected readonly $scrollingSettings: Observable<IScrollingSettings>;
269
+ private _scrollingSettingsTransform;
270
+ /**
271
+ * Scrolling settings.
272
+ * - frictionalForce - Frictional force. Default value is 0.035.
273
+ * - mass - Mass. Default value is 0.005.
274
+ * - maxDistance - Maximum scrolling distance. Default value is 12500.
275
+ * - maxDuration - Maximum animation duration. Default value is 4000.
276
+ * - speedScale - Speed scale. Default value is 15.
277
+ * - optimization - Enables scrolling performance optimization. Default value is `true`.
278
+ */
279
+ set scrollingSettings(v: IScrollingSettings);
280
+ get scrollingSettings(): IScrollingSettings;
267
281
  private _$animationParams;
268
282
  protected readonly $animationParams: Observable<IAnimationParams>;
269
283
  private _animationParamsTransform;
@@ -554,5 +568,5 @@ export declare class NgVirtualListComponent extends DisposableComponent implemen
554
568
  ngOnDestroy(): void;
555
569
  private dispose;
556
570
  static ɵfac: i0.ɵɵFactoryDeclaration<NgVirtualListComponent, never>;
557
- static ɵcmp: i0.ɵɵComponentDeclaration<NgVirtualListComponent, "ng-virtual-list", never, { "scrollbarThickness": "scrollbarThickness"; "scrollbarMinSize": "scrollbarMinSize"; "scrollbarThumbRenderer": "scrollbarThumbRenderer"; "scrollbarThumbParams": "scrollbarThumbParams"; "loading": "loading"; "waitForPreparation": "waitForPreparation"; "clickDistance": "clickDistance"; "snapToEndTransitionInstantOffset": "snapToEndTransitionInstantOffset"; "items": "items"; "defaultItemValue": "defaultItemValue"; "selectedIds": "selectedIds"; "collapsedIds": "collapsedIds"; "selectByClick": "selectByClick"; "collapseByClick": "collapseByClick"; "snap": "snap"; "scrollStartOffset": "scrollStartOffset"; "scrollEndOffset": "scrollEndOffset"; "snapScrollToStart": "snapScrollToStart"; "snapScrollToEnd": "snapScrollToEnd"; "snapScrollToBottom": "snapScrollToBottom"; "scrollbarEnabled": "scrollbarEnabled"; "scrollbarInteractive": "scrollbarInteractive"; "scrollBehavior": "scrollBehavior"; "animationParams": "animationParams"; "overscrollEnabled": "overscrollEnabled"; "enabledBufferOptimization": "enabledBufferOptimization"; "itemRenderer": "itemRenderer"; "itemConfigMap": "itemConfigMap"; "itemSize": "itemSize"; "dynamicSize": "dynamicSize"; "direction": "direction"; "collectionMode": "collectionMode"; "bufferSize": "bufferSize"; "maxBufferSize": "maxBufferSize"; "snappingMethod": "snappingMethod"; "methodForSelecting": "methodForSelecting"; "trackBy": "trackBy"; "screenReaderMessage": "screenReaderMessage"; "langTextDir": "langTextDir"; }, { "onScroll": "onScroll"; "onScrollEnd": "onScrollEnd"; "onViewportChange": "onViewportChange"; "onItemClick": "onItemClick"; "onSelect": "onSelect"; "onCollapse": "onCollapse"; "onScrollReachStart": "onScrollReachStart"; "onScrollReachEnd": "onScrollReachEnd"; }, never, never, false>;
571
+ static ɵcmp: i0.ɵɵComponentDeclaration<NgVirtualListComponent, "ng-virtual-list", never, { "scrollbarThickness": "scrollbarThickness"; "scrollbarMinSize": "scrollbarMinSize"; "scrollbarThumbRenderer": "scrollbarThumbRenderer"; "scrollbarThumbParams": "scrollbarThumbParams"; "loading": "loading"; "waitForPreparation": "waitForPreparation"; "clickDistance": "clickDistance"; "snapToEndTransitionInstantOffset": "snapToEndTransitionInstantOffset"; "items": "items"; "defaultItemValue": "defaultItemValue"; "selectedIds": "selectedIds"; "collapsedIds": "collapsedIds"; "selectByClick": "selectByClick"; "collapseByClick": "collapseByClick"; "snap": "snap"; "scrollStartOffset": "scrollStartOffset"; "scrollEndOffset": "scrollEndOffset"; "snapScrollToStart": "snapScrollToStart"; "snapScrollToEnd": "snapScrollToEnd"; "snapScrollToBottom": "snapScrollToBottom"; "scrollbarEnabled": "scrollbarEnabled"; "scrollbarInteractive": "scrollbarInteractive"; "scrollBehavior": "scrollBehavior"; "scrollingSettings": "scrollingSettings"; "animationParams": "animationParams"; "overscrollEnabled": "overscrollEnabled"; "enabledBufferOptimization": "enabledBufferOptimization"; "itemRenderer": "itemRenderer"; "itemConfigMap": "itemConfigMap"; "itemSize": "itemSize"; "dynamicSize": "dynamicSize"; "direction": "direction"; "collectionMode": "collectionMode"; "bufferSize": "bufferSize"; "maxBufferSize": "maxBufferSize"; "snappingMethod": "snappingMethod"; "methodForSelecting": "methodForSelecting"; "trackBy": "trackBy"; "screenReaderMessage": "screenReaderMessage"; "langTextDir": "langTextDir"; }, { "onScroll": "onScroll"; "onScrollEnd": "onScrollEnd"; "onViewportChange": "onViewportChange"; "onItemClick": "onItemClick"; "onSelect": "onSelect"; "onCollapse": "onCollapse"; "onScrollReachStart": "onScrollReachStart"; "onScrollReachEnd": "onScrollReachEnd"; }, never, never, false>;
558
572
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ng-virtual-list",
3
- "version": "14.11.2",
3
+ "version": "14.11.4",
4
4
  "author": {
5
5
  "name": "Evgenii Alexandrovich Grebennikov",
6
6
  "email": "djonnyx@gmail.com"