ng-virtual-list 20.4.1 → 20.4.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.
Files changed (123) hide show
  1. package/fesm2022/ng-virtual-list.mjs +202 -193
  2. package/fesm2022/ng-virtual-list.mjs.map +1 -1
  3. package/index.d.ts +201 -451
  4. package/package.json +1 -1
  5. package/esm2020/lib/components/ng-virtual-list-item.component.mjs +0 -131
  6. package/esm2020/lib/const/index.mjs +0 -44
  7. package/esm2020/lib/enums/direction.mjs +0 -2
  8. package/esm2020/lib/enums/directions.mjs +0 -18
  9. package/esm2020/lib/enums/index.mjs +0 -4
  10. package/esm2020/lib/enums/snapping-method.mjs +0 -2
  11. package/esm2020/lib/enums/snapping-methods.mjs +0 -18
  12. package/esm2020/lib/models/base-virtual-list-item-component.mjs +0 -9
  13. package/esm2020/lib/models/collection.model.mjs +0 -3
  14. package/esm2020/lib/models/component.model.mjs +0 -2
  15. package/esm2020/lib/models/index.mjs +0 -3
  16. package/esm2020/lib/models/item.model.mjs +0 -2
  17. package/esm2020/lib/models/render-collection.model.mjs +0 -3
  18. package/esm2020/lib/models/render-item-config.model.mjs +0 -2
  19. package/esm2020/lib/models/render-item.model.mjs +0 -3
  20. package/esm2020/lib/models/scroll-direction.model.mjs +0 -2
  21. package/esm2020/lib/models/scroll-event.model.mjs +0 -2
  22. package/esm2020/lib/models/sticky-map.model.mjs +0 -2
  23. package/esm2020/lib/ng-virtual-list.component.mjs +0 -677
  24. package/esm2020/lib/ng-virtual-list.module.mjs +0 -20
  25. package/esm2020/lib/types/id.mjs +0 -2
  26. package/esm2020/lib/types/index.mjs +0 -2
  27. package/esm2020/lib/types/rect.mjs +0 -2
  28. package/esm2020/lib/types/size.mjs +0 -2
  29. package/esm2020/lib/utils/browser.mjs +0 -3
  30. package/esm2020/lib/utils/buffer-interpolation.mjs +0 -27
  31. package/esm2020/lib/utils/cacheMap.mjs +0 -167
  32. package/esm2020/lib/utils/debounce.mjs +0 -31
  33. package/esm2020/lib/utils/disposableComponent.mjs +0 -29
  34. package/esm2020/lib/utils/eventEmitter.mjs +0 -106
  35. package/esm2020/lib/utils/index.mjs +0 -9
  36. package/esm2020/lib/utils/isDirection.mjs +0 -15
  37. package/esm2020/lib/utils/scrollEvent.mjs +0 -42
  38. package/esm2020/lib/utils/snapping-method.mjs +0 -9
  39. package/esm2020/lib/utils/toggleClassName.mjs +0 -15
  40. package/esm2020/lib/utils/trackBox.mjs +0 -745
  41. package/esm2020/lib/utils/tracker.mjs +0 -134
  42. package/esm2020/ng-virtual-list.mjs +0 -5
  43. package/esm2020/public-api.mjs +0 -10
  44. package/esm2022/lib/components/ng-virtual-list-item.component.mjs +0 -136
  45. package/esm2022/lib/const/index.mjs +0 -44
  46. package/esm2022/lib/enums/direction.mjs +0 -2
  47. package/esm2022/lib/enums/directions.mjs +0 -18
  48. package/esm2022/lib/enums/index.mjs +0 -4
  49. package/esm2022/lib/enums/snapping-method.mjs +0 -2
  50. package/esm2022/lib/enums/snapping-methods.mjs +0 -18
  51. package/esm2022/lib/models/base-virtual-list-item-component.mjs +0 -9
  52. package/esm2022/lib/models/collection.model.mjs +0 -3
  53. package/esm2022/lib/models/component.model.mjs +0 -2
  54. package/esm2022/lib/models/index.mjs +0 -3
  55. package/esm2022/lib/models/item.model.mjs +0 -2
  56. package/esm2022/lib/models/render-collection.model.mjs +0 -3
  57. package/esm2022/lib/models/render-item-config.model.mjs +0 -2
  58. package/esm2022/lib/models/render-item.model.mjs +0 -3
  59. package/esm2022/lib/models/scroll-direction.model.mjs +0 -2
  60. package/esm2022/lib/models/scroll-event.model.mjs +0 -2
  61. package/esm2022/lib/models/sticky-map.model.mjs +0 -2
  62. package/esm2022/lib/ng-virtual-list.component.mjs +0 -685
  63. package/esm2022/lib/ng-virtual-list.module.mjs +0 -20
  64. package/esm2022/lib/types/id.mjs +0 -2
  65. package/esm2022/lib/types/index.mjs +0 -2
  66. package/esm2022/lib/types/rect.mjs +0 -2
  67. package/esm2022/lib/types/size.mjs +0 -2
  68. package/esm2022/lib/utils/browser.mjs +0 -3
  69. package/esm2022/lib/utils/buffer-interpolation.mjs +0 -27
  70. package/esm2022/lib/utils/cacheMap.mjs +0 -168
  71. package/esm2022/lib/utils/debounce.mjs +0 -31
  72. package/esm2022/lib/utils/eventEmitter.mjs +0 -105
  73. package/esm2022/lib/utils/index.mjs +0 -9
  74. package/esm2022/lib/utils/isDirection.mjs +0 -15
  75. package/esm2022/lib/utils/scrollEvent.mjs +0 -42
  76. package/esm2022/lib/utils/snapping-method.mjs +0 -9
  77. package/esm2022/lib/utils/toggleClassName.mjs +0 -15
  78. package/esm2022/lib/utils/trackBox.mjs +0 -751
  79. package/esm2022/lib/utils/tracker.mjs +0 -135
  80. package/esm2022/ng-virtual-list.mjs +0 -5
  81. package/esm2022/public-api.mjs +0 -10
  82. package/fesm2015/ng-virtual-list.mjs +0 -2216
  83. package/fesm2015/ng-virtual-list.mjs.map +0 -1
  84. package/fesm2020/ng-virtual-list.mjs +0 -2221
  85. package/fesm2020/ng-virtual-list.mjs.map +0 -1
  86. package/lib/components/ng-virtual-list-item.component.d.ts +0 -35
  87. package/lib/const/index.d.ts +0 -42
  88. package/lib/enums/direction.d.ts +0 -8
  89. package/lib/enums/directions.d.ts +0 -16
  90. package/lib/enums/index.d.ts +0 -7
  91. package/lib/enums/snapping-method.d.ts +0 -10
  92. package/lib/enums/snapping-methods.d.ts +0 -16
  93. package/lib/models/base-virtual-list-item-component.d.ts +0 -25
  94. package/lib/models/collection.model.d.ts +0 -9
  95. package/lib/models/component.model.d.ts +0 -3
  96. package/lib/models/index.d.ts +0 -9
  97. package/lib/models/item.model.d.ts +0 -14
  98. package/lib/models/render-collection.model.d.ts +0 -9
  99. package/lib/models/render-item-config.model.d.ts +0 -41
  100. package/lib/models/render-item.model.d.ts +0 -33
  101. package/lib/models/scroll-direction.model.d.ts +0 -5
  102. package/lib/models/scroll-event.model.d.ts +0 -50
  103. package/lib/models/sticky-map.model.d.ts +0 -14
  104. package/lib/ng-virtual-list.component.d.ts +0 -208
  105. package/lib/ng-virtual-list.module.d.ts +0 -9
  106. package/lib/types/id.d.ts +0 -7
  107. package/lib/types/index.d.ts +0 -4
  108. package/lib/types/rect.d.ts +0 -17
  109. package/lib/types/size.d.ts +0 -16
  110. package/lib/utils/browser.d.ts +0 -2
  111. package/lib/utils/buffer-interpolation.d.ts +0 -5
  112. package/lib/utils/cacheMap.d.ts +0 -60
  113. package/lib/utils/debounce.d.ts +0 -16
  114. package/lib/utils/disposableComponent.d.ts +0 -15
  115. package/lib/utils/eventEmitter.d.ts +0 -40
  116. package/lib/utils/index.d.ts +0 -9
  117. package/lib/utils/isDirection.d.ts +0 -8
  118. package/lib/utils/scrollEvent.d.ts +0 -39
  119. package/lib/utils/snapping-method.d.ts +0 -3
  120. package/lib/utils/toggleClassName.d.ts +0 -7
  121. package/lib/utils/trackBox.d.ts +0 -204
  122. package/lib/utils/tracker.d.ts +0 -46
  123. package/public-api.d.ts +0 -6
@@ -1,16 +0,0 @@
1
- /**
2
- * Snapping method.
3
- * @link https://github.com/DjonnyX/ng-virtual-list/blob/15.x/projects/ng-virtual-list/src/lib/enums/snapping-method.ts
4
- * @author Evgenii Grebennikov
5
- * @email djonnyx@gmail.com
6
- */
7
- export declare enum SnappingMethods {
8
- /**
9
- * Normal group rendering.
10
- */
11
- NORMAL = "normal",
12
- /**
13
- * The group is rendered on a transparent background. List items below the group are not rendered.
14
- */
15
- ADVANCED = "advanced"
16
- }
@@ -1,25 +0,0 @@
1
- import { TemplateRef } from '@angular/core';
2
- import { Id, ISize } from '../types';
3
- import { IRenderVirtualListItem } from './render-item.model';
4
- /**
5
- * Virtual List Item Interface
6
- * @link https://github.com/DjonnyX/ng-virtual-list/blob/15.x/projects/ng-virtual-list/src/lib/models/base-virtual-list-item-component.ts
7
- * @author Evgenii Grebennikov
8
- * @email djonnyx@gmail.com
9
- */
10
- export declare abstract class BaseVirtualListItemComponent {
11
- abstract get id(): number;
12
- abstract data: IRenderVirtualListItem | undefined;
13
- abstract regular: boolean;
14
- abstract set regularLength(v: string);
15
- abstract set item(v: IRenderVirtualListItem | null | undefined);
16
- abstract get item(): IRenderVirtualListItem | null | undefined;
17
- abstract get itemId(): Id | undefined;
18
- abstract itemRenderer: TemplateRef<any> | undefined;
19
- abstract set renderer(v: TemplateRef<any> | undefined);
20
- abstract get element(): HTMLElement;
21
- protected abstract update(): void;
22
- abstract getBounds(): ISize;
23
- abstract show(): void;
24
- abstract hide(): void;
25
- }
@@ -1,9 +0,0 @@
1
- import { IVirtualListItem } from "./item.model";
2
- /**
3
- * Virtual list elements collection interface
4
- * @link https://github.com/DjonnyX/ng-virtual-list/blob/15.x/projects/ng-virtual-list/src/lib/models/collection.model.ts
5
- * @author Evgenii Grebennikov
6
- * @email djonnyx@gmail.com
7
- */
8
- export interface IVirtualListCollection<E = Object> extends Array<IVirtualListItem<E>> {
9
- }
@@ -1,3 +0,0 @@
1
- export interface Component$1<T> extends Function {
2
- new (...args: any[]): T;
3
- }
@@ -1,9 +0,0 @@
1
- import { ScrollDirection } from './scroll-direction.model';
2
- import { IScrollEvent } from './scroll-event.model';
3
- import { IVirtualListItem } from './item.model';
4
- import { IVirtualListStickyMap } from './sticky-map.model';
5
- import { IVirtualListCollection } from './collection.model';
6
- import { BaseVirtualListItemComponent } from './base-virtual-list-item-component';
7
- import { Component$1 } from './component.model';
8
- export type { ScrollDirection, IScrollEvent, IVirtualListItem, IVirtualListStickyMap, IVirtualListCollection, Component$1, };
9
- export { BaseVirtualListItemComponent, };
@@ -1,14 +0,0 @@
1
- import { Id } from "../types/id";
2
- /**
3
- * Virtual list element model
4
- * @link https://github.com/DjonnyX/ng-virtual-list/blob/15.x/projects/ng-virtual-list/src/lib/models/item.model.ts
5
- * @author Evgenii Grebennikov
6
- * @email djonnyx@gmail.com
7
- */
8
- export type IVirtualListItem<E = Object> = E & {
9
- /**
10
- * Unique identifier of the element.
11
- */
12
- id: Id;
13
- [x: string]: any;
14
- };
@@ -1,9 +0,0 @@
1
- import { IRenderVirtualListItem } from "./render-item.model";
2
- /**
3
- * Virtual list screen elements collection interface
4
- * @link https://github.com/DjonnyX/ng-virtual-list/blob/15.x/projects/ng-virtual-list/src/lib/models/render-collection.model.ts
5
- * @author Evgenii Grebennikov
6
- * @email djonnyx@gmail.com
7
- */
8
- export interface IRenderVirtualListCollection extends Array<IRenderVirtualListItem> {
9
- }
@@ -1,41 +0,0 @@
1
- /**
2
- * Object with configuration parameters for IRenderVirtualListItem
3
- * @link https://github.com/DjonnyX/ng-virtual-list/blob/15.x/projects/ng-virtual-list/src/lib/models/render-item-config.model.ts
4
- * @author Evgenii Grebennikov
5
- * @email djonnyx@gmail.com
6
- *
7
- */
8
- export interface IRenderVirtualListItemConfig {
9
- /**
10
- * If greater than 0, the element will have a sticky position with the given zIndex.
11
- */
12
- sticky: number;
13
- /**
14
- * Specifies whether the element will snap.
15
- */
16
- snap: boolean;
17
- /**
18
- * Indicates that the element is snapped.
19
- */
20
- snapped: boolean;
21
- /**
22
- * Indicates that the element is being shifted by another snap element.
23
- */
24
- snappedOut: boolean;
25
- /**
26
- * Indicates that the element is a vertical list item.
27
- */
28
- isVertical: boolean;
29
- /**
30
- * Specifies that the element adapts to the size of its content.
31
- */
32
- dynamic: boolean;
33
- /**
34
- * Returns true if the snapping method is advanced
35
- */
36
- isSnappingMethodAdvanced: boolean;
37
- /**
38
- * z-index
39
- */
40
- zIndex: string;
41
- }
@@ -1,33 +0,0 @@
1
- import { IRect } from "../types";
2
- import { Id } from "../types/id";
3
- import { IVirtualListItem } from "./item.model";
4
- import { IRenderVirtualListItemConfig } from "./render-item-config.model";
5
- /**
6
- * List screen element model
7
- * @link https://github.com/DjonnyX/ng-virtual-list/blob/15.x/projects/ng-virtual-list/src/lib/models/render-item.model.ts
8
- * @author Evgenii Grebennikov
9
- * @email djonnyx@gmail.com
10
- */
11
- export interface IRenderVirtualListItem {
12
- /**
13
- * Unique identifier of the element.
14
- */
15
- id: Id;
16
- /**
17
- * Element metrics.
18
- */
19
- measures: IRect & {
20
- /**
21
- * Delta is calculated for Snapping Method.ADVANCED
22
- */
23
- delta: number;
24
- };
25
- /**
26
- * Element data.
27
- */
28
- data: IVirtualListItem;
29
- /**
30
- * Object with configuration parameters for IRenderVirtualListItem.
31
- */
32
- config: IRenderVirtualListItemConfig;
33
- }
@@ -1,5 +0,0 @@
1
- /**
2
- * A value of -1 indicates the direction is up or left (if the list direction is horizontal).
3
- * A value of 1 indicates the direction is down or right (if the list direction is horizontal).
4
- */
5
- export type ScrollDirection = -1 | 1 | 0;
@@ -1,50 +0,0 @@
1
- import { ScrollDirection } from "./scroll-direction.model";
2
- /**
3
- * Interface IScrollEvent.
4
- * @link https://github.com/DjonnyX/ng-virtual-list/blob/15.x/projects/ng-virtual-list/src/lib/models/scroll-event.model.ts
5
- * @author Evgenii Grebennikov
6
- * @email djonnyx@gmail.com
7
- */
8
- export interface IScrollEvent {
9
- /**
10
- * Scroll area offset
11
- */
12
- scrollSize: number;
13
- /**
14
- * Full size of the scroll area
15
- */
16
- scrollWeight: number;
17
- /**
18
- * Viewport size
19
- */
20
- size: number;
21
- /**
22
- * Size of the list of elements
23
- */
24
- listSize: number;
25
- /**
26
- * Specifies whether the list orientation is vertical.
27
- */
28
- isVertical: boolean;
29
- /**
30
- * A value of -1 indicates the direction is up or left (if the list direction is horizontal).
31
- * A value of 1 indicates the direction is down or right (if the list direction is horizontal).
32
- */
33
- direction: ScrollDirection;
34
- /**
35
- * If true then indicates that the list has been scrolled to the end.
36
- */
37
- isStart: boolean;
38
- /**
39
- * If true then indicates that the list has been scrolled to the end.
40
- */
41
- isEnd: boolean;
42
- /**
43
- * Delta of marked and unmarked area
44
- */
45
- delta: number;
46
- /**
47
- * Scroll delta
48
- */
49
- scrollDelta: number;
50
- }
@@ -1,14 +0,0 @@
1
- /**
2
- * Dictionary zIndex by id of the list element. If the value is not set or equal to 0, then a simple element is displayed,
3
- * if the value is greater than 0, then the sticky position mode is enabled for the element. 1 - position start, 2 - position end.
4
- * @link https://github.com/DjonnyX/ng-virtual-list/blob/15.x/projects/ng-virtual-list/src/lib/models/sticky-map.model.ts
5
- * @author Evgenii Grebennikov
6
- * @email djonnyx@gmail.com
7
- */
8
- export interface IVirtualListStickyMap {
9
- /**
10
- * Sets zIndex for the element ID. If zIndex is greater than 0, then sticky position is applied.
11
- * 1 - position start, 2 - position end.
12
- */
13
- [id: string]: 0 | 1 | 2;
14
- }
@@ -1,208 +0,0 @@
1
- import { AfterViewInit, ChangeDetectorRef, ComponentRef, ElementRef, EventEmitter, OnDestroy, OnInit, TemplateRef, ViewContainerRef } from '@angular/core';
2
- import { BehaviorSubject, Observable } from 'rxjs';
3
- import { BaseVirtualListItemComponent, Component$1, IScrollEvent, IVirtualListCollection, IVirtualListStickyMap } from './models';
4
- import { Id, ISize } from './types';
5
- import { IRenderVirtualListCollection } from './models/render-collection.model';
6
- import { Direction, SnappingMethod } from './enums';
7
- import { TrackBox } from './utils';
8
- import { DisposableComponent } from './utils/disposableComponent';
9
- import * as i0 from "@angular/core";
10
- /**
11
- * Virtual list component.
12
- * Maximum performance for extremely large lists.
13
- * It is based on algorithms for virtualization of screen objects.
14
- * @link https://github.com/DjonnyX/ng-virtual-list/blob/15.x/projects/ng-virtual-list/src/lib/ng-virtual-list.component.ts
15
- * @author Evgenii Grebennikov
16
- * @email djonnyx@gmail.com
17
- */
18
- export declare class NgVirtualListComponent extends DisposableComponent implements AfterViewInit, OnInit, OnDestroy {
19
- protected _cdr: ChangeDetectorRef;
20
- protected _elementRef: ElementRef<HTMLDivElement>;
21
- protected static __nextId: number;
22
- protected _id: number;
23
- /**
24
- * Readonly. Returns the unique identifier of the component.
25
- */
26
- get id(): number;
27
- protected _listContainerRef: ViewContainerRef | undefined;
28
- protected _container: ElementRef<HTMLDivElement> | undefined;
29
- protected _list: ElementRef<HTMLUListElement> | undefined;
30
- protected _snapContainerRef: ViewContainerRef | undefined;
31
- protected _snappedContainer: ViewContainerRef | undefined;
32
- /**
33
- * Fires when the list has been scrolled.
34
- */
35
- onScroll: EventEmitter<IScrollEvent>;
36
- /**
37
- * Fires when the list has completed scrolling.
38
- */
39
- onScrollEnd: EventEmitter<IScrollEvent>;
40
- protected _$items: BehaviorSubject<IVirtualListCollection<Object> | undefined>;
41
- readonly $items: Observable<IVirtualListCollection<Object> | undefined>;
42
- protected _itemsTransform: (v: IVirtualListCollection | undefined) => IVirtualListCollection<Object> | undefined;
43
- /**
44
- * Collection of list items.
45
- */
46
- set items(v: IVirtualListCollection);
47
- get items(): IVirtualListCollection;
48
- protected _$snap: BehaviorSubject<boolean>;
49
- readonly $snap: Observable<boolean>;
50
- /**
51
- * Determines whether elements will snap. Default value is "true".
52
- */
53
- set snap(v: boolean);
54
- get snap(): boolean;
55
- protected _$enabledBufferOptimization: BehaviorSubject<boolean>;
56
- readonly $enabledBufferOptimization: Observable<boolean>;
57
- /**
58
- * Experimental!
59
- * Enables buffer optimization.
60
- * 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.
61
- * Works only if the property dynamic = true
62
- */
63
- set enabledBufferOptimization(v: boolean);
64
- get enabledBufferOptimization(): boolean;
65
- protected _$itemRenderer: BehaviorSubject<TemplateRef<any> | undefined>;
66
- readonly $itemRenderer: Observable<TemplateRef<any> | undefined>;
67
- protected _$renderer: BehaviorSubject<TemplateRef<any> | undefined>;
68
- /**
69
- * Rendering element template.
70
- */
71
- set itemRenderer(v: TemplateRef<any>);
72
- get itemRenderer(): TemplateRef<any>;
73
- protected _$stickyMap: BehaviorSubject<IVirtualListStickyMap>;
74
- readonly $stickyMap: Observable<IVirtualListStickyMap>;
75
- /**
76
- * Dictionary zIndex by id of the list element. If the value is not set or equal to 0,
77
- * then a simple element is displayed, if the value is greater than 0, then the sticky position mode is enabled for the element.
78
- */
79
- set stickyMap(v: IVirtualListStickyMap);
80
- get stickyMap(): IVirtualListStickyMap;
81
- protected _itemSizeOptions: (v: number | undefined) => number;
82
- protected _$itemSize: BehaviorSubject<number>;
83
- readonly $itemSize: Observable<number>;
84
- /**
85
- * If direction = 'vertical', then the height of a typical element. If direction = 'horizontal', then the width of a typical element.
86
- * Ignored if the dynamicSize property is true.
87
- */
88
- set itemSize(v: number);
89
- get itemSize(): number;
90
- protected _$dynamicSize: BehaviorSubject<boolean>;
91
- readonly $dynamicSize: Observable<boolean>;
92
- /**
93
- * If true then the items in the list can have different sizes and the itemSize property is ignored.
94
- * If false then the items in the list have a fixed size specified by the itemSize property. The default value is false.
95
- */
96
- set dynamicSize(v: boolean);
97
- get dynamicSize(): boolean;
98
- protected _$direction: BehaviorSubject<Direction>;
99
- readonly $direction: Observable<Direction>;
100
- /**
101
- * Determines the direction in which elements are placed. Default value is "vertical".
102
- */
103
- set direction(v: Direction);
104
- get direction(): Direction;
105
- /**
106
- * @deprecated "itemOffset" parameter is deprecated. Use "bufferSize" and "maxBufferSize".
107
- */
108
- set itemsOffset(v: number);
109
- protected _$bufferSize: BehaviorSubject<number>;
110
- readonly $bufferSize: Observable<number>;
111
- /**
112
- * Number of elements outside the scope of visibility. Default value is 2.
113
- */
114
- set bufferSize(v: number);
115
- get bufferSize(): number;
116
- private _maxBufferSizeTransform;
117
- protected _$maxBufferSize: BehaviorSubject<number>;
118
- readonly $maxBufferSize: Observable<number>;
119
- /**
120
- * Maximum number of elements outside the scope of visibility. Default value is 100.
121
- * If maxBufferSize is set to be greater than bufferSize, then adaptive buffer mode is enabled.
122
- * The greater the scroll size, the more elements are allocated for rendering.
123
- */
124
- set maxBufferSize(v: number);
125
- get maxBufferSize(): number;
126
- protected _$trackBy: BehaviorSubject<string>;
127
- readonly $trackBy: Observable<string>;
128
- /**
129
- * The name of the property by which tracking is performed
130
- */
131
- set trackBy(v: string);
132
- get trackBy(): string;
133
- protected _isVertical: boolean;
134
- protected _$snappingMethod: BehaviorSubject<SnappingMethod>;
135
- readonly $snappingMethod: Observable<SnappingMethod>;
136
- /**
137
- * Snapping method.
138
- * 'default' - Normal group rendering.
139
- * 'advanced' - The group is rendered on a transparent background. List items below the group are not rendered.
140
- */
141
- set snappingMethod(v: SnappingMethod);
142
- get snappingMethod(): SnappingMethod;
143
- protected _isSnappingMethodAdvanced: boolean;
144
- get isSnappingMethodAdvanced(): boolean;
145
- protected _displayComponents: Array<ComponentRef<BaseVirtualListItemComponent>>;
146
- protected _snapedDisplayComponent: ComponentRef<BaseVirtualListItemComponent> | undefined;
147
- protected _$bounds: BehaviorSubject<ISize | null>;
148
- protected _$scrollSize: BehaviorSubject<number>;
149
- protected _resizeObserver: ResizeObserver | null;
150
- protected _resizeSnappedComponentHandler: () => void;
151
- protected _resizeSnappedObserver: ResizeObserver | null;
152
- protected _onResizeHandler: () => void;
153
- protected _onScrollHandler: (e?: Event) => void;
154
- protected _$initialized: BehaviorSubject<boolean>;
155
- readonly $initialized: Observable<boolean>;
156
- /**
157
- * Base class of the element component
158
- */
159
- protected _itemComponentClass: Component$1<BaseVirtualListItemComponent>;
160
- /**
161
- * Base class trackBox
162
- */
163
- protected _trackBoxClass: Component$1<TrackBox>;
164
- /**
165
- * Dictionary of element sizes by their id
166
- */
167
- protected _trackBox: TrackBox;
168
- protected _onTrackBoxChangeHandler: (v: number) => void;
169
- protected _$cacheVersion: BehaviorSubject<number>;
170
- get $cacheVersion(): Observable<number>;
171
- constructor(_cdr: ChangeDetectorRef, _elementRef: ElementRef<HTMLDivElement>);
172
- protected setupRenderer(): void;
173
- protected onInit(): void;
174
- protected listenCacheChangesIfNeed(value: boolean): void;
175
- protected getIsSnappingMethodAdvanced(m?: SnappingMethod): boolean;
176
- protected getIsVertical(d?: Direction): boolean;
177
- protected _componentsResizeObserver: ResizeObserver;
178
- protected createDisplayComponentsIfNeed(displayItems: IRenderVirtualListCollection | null): void;
179
- protected updateRegularRenderer(): void;
180
- protected resetRenderers(itemRenderer?: TemplateRef<HTMLElement>): void;
181
- /**
182
- * Tracking by id
183
- */
184
- protected tracking(): void;
185
- protected resetBoundsSize(isVertical: boolean, totalSize: number): void;
186
- /**
187
- * Returns the bounds of an element with a given id
188
- */
189
- getItemBounds(id: Id): ISize | undefined;
190
- /**
191
- * The method scrolls the list to the element with the given id and returns the value of the scrolled area.
192
- * Behavior accepts the values ​​"auto", "instant" and "smooth".
193
- */
194
- scrollTo(id: Id, behavior?: ScrollBehavior): void;
195
- protected _scrollToRepeatExecutionTimeout: any;
196
- protected clearScrollToRepeatExecutionTimeout(): void;
197
- protected scrollToExecutor(id: Id, behavior: ScrollBehavior, iteration?: number, isLastIteration?: boolean): void;
198
- /**
199
- * Scrolls the scroll area to the desired element with the specified ID.
200
- */
201
- scrollToEnd(behavior?: ScrollBehavior): void;
202
- protected _onContainerScrollHandler: (e: Event) => void;
203
- protected _onContainerScrollEndHandler: (e: Event) => void;
204
- protected afterViewInit(): void;
205
- protected dispose(): void;
206
- static ɵfac: i0.ɵɵFactoryDeclaration<NgVirtualListComponent, never>;
207
- 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"; "bufferSize": "bufferSize"; "maxBufferSize": "maxBufferSize"; "trackBy": "trackBy"; "snappingMethod": "snappingMethod"; }, { "onScroll": "onScroll"; "onScrollEnd": "onScrollEnd"; }, never, never, false, never>;
208
- }
@@ -1,9 +0,0 @@
1
- import * as i0 from "@angular/core";
2
- import * as i1 from "./ng-virtual-list.component";
3
- import * as i2 from "./components/ng-virtual-list-item.component";
4
- import * as i3 from "@angular/common";
5
- export declare class NgVirtualListModule {
6
- static ɵfac: i0.ɵɵFactoryDeclaration<NgVirtualListModule, never>;
7
- static ɵmod: i0.ɵɵNgModuleDeclaration<NgVirtualListModule, [typeof i1.NgVirtualListComponent, typeof i2.NgVirtualListItemComponent], [typeof i3.CommonModule], [typeof i1.NgVirtualListComponent]>;
8
- static ɵinj: i0.ɵɵInjectorDeclaration<NgVirtualListModule>;
9
- }
package/lib/types/id.d.ts DELETED
@@ -1,7 +0,0 @@
1
- /**
2
- * Identifier type
3
- * @link https://github.com/DjonnyX/ng-virtual-list/blob/15.x/projects/ng-virtual-list/src/lib/types/id.ts
4
- * @author Evgenii Grebennikov
5
- * @email djonnyx@gmail.com
6
- */
7
- export type Id = string | number;
@@ -1,4 +0,0 @@
1
- import { Id } from './id';
2
- import { ISize } from './size';
3
- import { IRect } from './rect';
4
- export type { Id, ISize, IRect, };
@@ -1,17 +0,0 @@
1
- import { ISize } from "./size";
2
- /**
3
- * Rectangular area interface
4
- * @link https://github.com/DjonnyX/ng-virtual-list/blob/15.x/projects/ng-virtual-list/src/lib/types/rect.ts
5
- * @author Evgenii Grebennikov
6
- * @email djonnyx@gmail.com
7
- */
8
- export interface IRect extends ISize {
9
- /**
10
- * X coordinate.
11
- */
12
- x: number;
13
- /**
14
- * Y coordinate.
15
- */
16
- y: number;
17
- }
@@ -1,16 +0,0 @@
1
- /**
2
- * Area area Interface
3
- * @link https://github.com/DjonnyX/ng-virtual-list/blob/15.x/projects/ng-virtual-list/src/lib/types/size.ts
4
- * @author Evgenii Grebennikov
5
- * @email djonnyx@gmail.com
6
- */
7
- export interface ISize {
8
- /**
9
- * Width value.
10
- */
11
- width: number;
12
- /**
13
- * Height value.
14
- */
15
- height: number;
16
- }
@@ -1,2 +0,0 @@
1
- export declare const IS_FIREFOX: boolean;
2
- export declare const FIREFOX_SCROLLBAR_OVERLAP_SIZE = 12;
@@ -1,5 +0,0 @@
1
- export interface IExtraOptions {
2
- extremumThreshold?: number;
3
- bufferSize?: number;
4
- }
5
- export declare const bufferInterpolation: (currentBufferValue: number, array: Array<number>, value: number, extra?: IExtraOptions) => number;
@@ -1,60 +0,0 @@
1
- import { ScrollDirection } from "../models";
2
- import { EventEmitter, TEventHandler } from "./eventEmitter";
3
- export declare class CMap<K = string, V = any> {
4
- private _dict;
5
- constructor(dict?: CMap<K, V>);
6
- get(key: K): V;
7
- set(key: K, value: V): this;
8
- has(key: K): boolean;
9
- delete(key: K): void;
10
- clear(): void;
11
- }
12
- export interface ICacheMap<I = any, B = any> {
13
- set: (id: I, bounds: B) => CMap<I, B>;
14
- has: (id: I) => boolean;
15
- get: (id: I) => B | undefined;
16
- }
17
- export declare const CACHE_BOX_CHANGE_EVENT_NAME = "change";
18
- type CacheMapEvents = typeof CACHE_BOX_CHANGE_EVENT_NAME;
19
- type OnChangeEventListener = (version: number) => void;
20
- type CacheMapListeners = OnChangeEventListener;
21
- /**
22
- * Cache map.
23
- * Emits a change event on each mutation.
24
- * @link https://github.com/DjonnyX/ng-virtual-list/blob/15.x/projects/ng-virtual-list/src/lib/utils/cacheMap.ts
25
- * @author Evgenii Grebennikov
26
- * @email djonnyx@gmail.com
27
- */
28
- export declare class CacheMap<I = string | number, B = any, E extends string = CacheMapEvents, L extends TEventHandler = CacheMapListeners> extends EventEmitter<E, L> implements ICacheMap {
29
- protected _map: CMap<I, B>;
30
- protected _snapshot: CMap<I, B>;
31
- protected _version: number;
32
- protected _previousVersion: number;
33
- protected _lifeCircleTimeout: any;
34
- protected _delta: number;
35
- get delta(): number;
36
- protected _deltaDirection: ScrollDirection;
37
- set deltaDirection(v: ScrollDirection);
38
- get deltaDirection(): ScrollDirection;
39
- private _scrollDirectionCache;
40
- private _scrollDirection;
41
- get scrollDirection(): ScrollDirection;
42
- get version(): number;
43
- private _clearScrollDirectionDebounce;
44
- constructor();
45
- protected changesDetected(): boolean;
46
- protected stopLifeCircle(): void;
47
- protected nextTick(cb: () => void): any;
48
- protected lifeCircle(): void;
49
- protected lifeCircleDo(): void;
50
- clearScrollDirectionCache(): void;
51
- private calcScrollDirection;
52
- protected bumpVersion(): void;
53
- protected fireChangeIfNeed(): void;
54
- set(id: I, bounds: B): CMap<I, B>;
55
- has(id: I): boolean;
56
- get(id: I): B | undefined;
57
- snapshot(): void;
58
- dispose(): void;
59
- }
60
- export {};
@@ -1,16 +0,0 @@
1
- /**
2
- * Simple debounce function.
3
- * @link https://github.com/DjonnyX/ng-virtual-list/blob/15.x/projects/ng-virtual-list/src/lib/utils/debounce.ts
4
- * @author Evgenii Grebennikov
5
- * @email djonnyx@gmail.com
6
- */
7
- export declare const debounce: (cb: (...args: Array<any>) => void, debounceTime?: number) => {
8
- /**
9
- * Call handling method
10
- */
11
- execute: (...args: Array<any>) => void;
12
- /**
13
- * Method of destroying handlers
14
- */
15
- dispose: () => void;
16
- };
@@ -1,15 +0,0 @@
1
- import { OnDestroy } from '@angular/core';
2
- import { Subject } from 'rxjs';
3
- import * as i0 from "@angular/core";
4
- /**
5
- * Base disposable component
6
- * @link https://github.com/DjonnyX/ng-virtual-list/blob/15.x/projects/ng-virtual-list/src/lib/utils/disposableComponent.ts
7
- * @author Evgenii Grebennikov
8
- * @email djonnyx@gmail.com
9
- */
10
- export declare class DisposableComponent implements OnDestroy {
11
- protected _$unsubscribe: Subject<void>;
12
- ngOnDestroy(): void;
13
- static ɵfac: i0.ɵɵFactoryDeclaration<DisposableComponent, never>;
14
- static ɵcmp: i0.ɵɵComponentDeclaration<DisposableComponent, "ng-component", never, {}, {}, never, never, false, never>;
15
- }
@@ -1,40 +0,0 @@
1
- export type TEventHandler = (...args: Array<any>) => void;
2
- /**
3
- * Simple event emitter
4
- * @link https://github.com/DjonnyX/ng-virtual-list/blob/15.x/projects/ng-virtual-list/src/lib/utils/eventEmitter.ts
5
- * @author Evgenii Grebennikov
6
- * @email djonnyx@gmail.com
7
- */
8
- export declare class EventEmitter<E = string, H = TEventHandler> {
9
- private _listeners;
10
- protected _disposed: boolean;
11
- constructor();
12
- /**
13
- * Emits the event
14
- */
15
- dispatch(event: E, ...args: Array<any>): void;
16
- /**
17
- * Emits the event async
18
- */
19
- dispatchAsync(event: E, ...args: Array<any>): void;
20
- /**
21
- * Returns true if the event listener is already subscribed.
22
- */
23
- hasEventListener(eventName: E, handler: H): boolean;
24
- /**
25
- * Add event listener
26
- */
27
- addEventListener(eventName: E, handler: H): void;
28
- /**
29
- * Remove event listener
30
- */
31
- removeEventListener(eventName: E, handler: H): void;
32
- /**
33
- * Remove all listeners
34
- */
35
- removeAllListeners(): void;
36
- /**
37
- * Method of destroying handlers
38
- */
39
- dispose(): void;
40
- }