ng-virtual-list 20.2.0 → 20.3.1

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 (38) hide show
  1. package/README.md +10 -10
  2. package/fesm2022/ng-virtual-list.mjs +54 -19
  3. package/fesm2022/ng-virtual-list.mjs.map +1 -1
  4. package/index.d.ts +802 -3
  5. package/package.json +1 -1
  6. package/lib/components/ng-virtual-list-item.component.d.ts +0 -34
  7. package/lib/const/index.d.ts +0 -41
  8. package/lib/enums/direction.d.ts +0 -8
  9. package/lib/enums/directions.d.ts +0 -16
  10. package/lib/enums/index.d.ts +0 -7
  11. package/lib/enums/snapping-method.d.ts +0 -10
  12. package/lib/enums/snapping-methods.d.ts +0 -16
  13. package/lib/models/collection.model.d.ts +0 -9
  14. package/lib/models/index.d.ts +0 -6
  15. package/lib/models/item.model.d.ts +0 -14
  16. package/lib/models/render-collection.model.d.ts +0 -9
  17. package/lib/models/render-item-config.model.d.ts +0 -41
  18. package/lib/models/render-item.model.d.ts +0 -33
  19. package/lib/models/scroll-direction.model.d.ts +0 -5
  20. package/lib/models/scroll-event.model.d.ts +0 -50
  21. package/lib/models/sticky-map.model.d.ts +0 -14
  22. package/lib/ng-virtual-list.component.d.ts +0 -144
  23. package/lib/types/id.d.ts +0 -7
  24. package/lib/types/index.d.ts +0 -4
  25. package/lib/types/rect.d.ts +0 -17
  26. package/lib/types/size.d.ts +0 -16
  27. package/lib/utils/browser.d.ts +0 -2
  28. package/lib/utils/cacheMap.d.ts +0 -60
  29. package/lib/utils/debounce.d.ts +0 -16
  30. package/lib/utils/eventEmitter.d.ts +0 -40
  31. package/lib/utils/index.d.ts +0 -7
  32. package/lib/utils/isDirection.d.ts +0 -8
  33. package/lib/utils/scrollEvent.d.ts +0 -39
  34. package/lib/utils/snapping-method.d.ts +0 -3
  35. package/lib/utils/toggleClassName.d.ts +0 -7
  36. package/lib/utils/trackBox.d.ts +0 -180
  37. package/lib/utils/tracker.d.ts +0 -44
  38. package/public-api.d.ts +0 -4
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ng-virtual-list",
3
- "version": "20.2.0",
3
+ "version": "20.3.1",
4
4
  "author": {
5
5
  "name": "Evgenii Grebennikov",
6
6
  "email": "djonnyx@gmail.com"
@@ -1,34 +0,0 @@
1
- import { TemplateRef } from '@angular/core';
2
- import { IRenderVirtualListItem } from '../models/render-item.model';
3
- import { ISize } from '../types';
4
- import * as i0 from "@angular/core";
5
- /**
6
- * Virtual list item component
7
- * @link https://github.com/DjonnyX/ng-virtual-list/blob/20.x/projects/ng-virtual-list/src/lib/components/ng-virtual-list-item.component.ts
8
- * @author Evgenii Grebennikov
9
- * @email djonnyx@gmail.com
10
- */
11
- export declare class NgVirtualListItemComponent {
12
- private static __nextId;
13
- private _id;
14
- get id(): number;
15
- regular: boolean;
16
- data: import("@angular/core").WritableSignal<IRenderVirtualListItem | undefined>;
17
- private _data;
18
- set item(v: IRenderVirtualListItem | undefined);
19
- private _regularLength;
20
- set regularLength(v: string);
21
- get item(): IRenderVirtualListItem | undefined;
22
- get itemId(): import("ng-virtual-list").Id | undefined;
23
- itemRenderer: import("@angular/core").WritableSignal<TemplateRef<any> | undefined>;
24
- set renderer(v: TemplateRef<any> | undefined);
25
- private _elementRef;
26
- get element(): HTMLElement;
27
- constructor();
28
- protected update(): void;
29
- getBounds(): ISize;
30
- show(): void;
31
- hide(): void;
32
- static ɵfac: i0.ɵɵFactoryDeclaration<NgVirtualListItemComponent, never>;
33
- static ɵcmp: i0.ɵɵComponentDeclaration<NgVirtualListItemComponent, "ng-virtual-list-item", never, {}, {}, never, never, true, never>;
34
- }
@@ -1,41 +0,0 @@
1
- import { SnappingMethods } from "../enums";
2
- import { Directions } from "../enums/directions";
3
- export declare const DEFAULT_ITEM_SIZE = 24;
4
- export declare const DEFAULT_ITEMS_OFFSET = 2;
5
- export declare const DEFAULT_LIST_SIZE = 400;
6
- export declare const DEFAULT_SNAP = false;
7
- export declare const DEFAULT_ENABLED_BUFFER_OPTIMIZATION = false;
8
- export declare const DEFAULT_DYNAMIC_SIZE = false;
9
- export declare const TRACK_BY_PROPERTY_NAME = "id";
10
- export declare const DEFAULT_DIRECTION = Directions.VERTICAL;
11
- export declare const DISPLAY_OBJECTS_LENGTH_MESUREMENT_ERROR = 1;
12
- export declare const MAX_SCROLL_TO_ITERATIONS = 5;
13
- export declare const DEFAULT_SNAPPING_METHOD = SnappingMethods.NORMAL;
14
- export declare const BEHAVIOR_AUTO = "auto";
15
- export declare const BEHAVIOR_INSTANT = "instant";
16
- export declare const BEHAVIOR_SMOOTH = "smooth";
17
- export declare const DISPLAY_BLOCK = "block";
18
- export declare const DISPLAY_NONE = "none";
19
- export declare const OPACITY_0 = "0";
20
- export declare const OPACITY_100 = "100";
21
- export declare const VISIBILITY_VISIBLE = "visible";
22
- export declare const VISIBILITY_HIDDEN = "hidden";
23
- export declare const SIZE_100_PERSENT = "100%";
24
- export declare const SIZE_AUTO = "auto";
25
- export declare const POSITION_ABSOLUTE = "absolute";
26
- export declare const POSITION_STICKY = "sticky";
27
- export declare const TRANSLATE_3D = "translate3d";
28
- export declare const ZEROS_TRANSLATE_3D = "translate3d(0,0,0)";
29
- export declare const HIDDEN_ZINDEX = "-1";
30
- export declare const DEFAULT_ZINDEX = "0";
31
- export declare const TOP_PROP_NAME = "top";
32
- export declare const LEFT_PROP_NAME = "left";
33
- export declare const X_PROP_NAME = "x";
34
- export declare const Y_PROP_NAME = "y";
35
- export declare const WIDTH_PROP_NAME = "width";
36
- export declare const HEIGHT_PROP_NAME = "height";
37
- export declare const PX = "px";
38
- export declare const SCROLL = "scroll";
39
- export declare const SCROLL_END = "scrollend";
40
- export declare const CLASS_LIST_VERTICAL = "vertical";
41
- export declare const CLASS_LIST_HORIZONTAL = "horizontal";
@@ -1,8 +0,0 @@
1
- import { Directions } from "./directions";
2
- /**
3
- * Axis of the arrangement of virtual list elements.
4
- * @link https://github.com/DjonnyX/ng-virtual-list/blob/20.x/projects/ng-virtual-list/src/lib/enums/direction.ts
5
- * @author Evgenii Grebennikov
6
- * @email djonnyx@gmail.com
7
- */
8
- export type Direction = Directions | 'hotizontal' | 'vertical';
@@ -1,16 +0,0 @@
1
- /**
2
- * Axis of the arrangement of virtual list elements.
3
- * @link https://github.com/DjonnyX/ng-virtual-list/blob/20.x/projects/ng-virtual-list/src/lib/enums/directions.ts
4
- * @author Evgenii Grebennikov
5
- * @email djonnyx@gmail.com
6
- */
7
- export declare enum Directions {
8
- /**
9
- * Horizontal axis.
10
- */
11
- HORIZONTAL = "horizontal",
12
- /**
13
- * Vertical axis.
14
- */
15
- VERTICAL = "vertical"
16
- }
@@ -1,7 +0,0 @@
1
- import { Directions } from "./directions";
2
- import { Direction } from "./direction";
3
- import { SnappingMethods } from "./snapping-methods";
4
- import { SnappingMethod } from "./snapping-method";
5
- export { Directions, SnappingMethods, };
6
- export type { Direction };
7
- export type { SnappingMethod };
@@ -1,10 +0,0 @@
1
- import { SnappingMethods } from "./snapping-methods";
2
- /**
3
- * Snapping method.
4
- * 'normal' - Normal group rendering.
5
- * 'advanced' - The group is rendered on a transparent background. List items below the group are not rendered.
6
- * @link https://github.com/DjonnyX/ng-virtual-list/blob/20.x/projects/ng-virtual-list/src/lib/enums/snapping-method.ts
7
- * @author Evgenii Grebennikov
8
- * @email djonnyx@gmail.com
9
- */
10
- export type SnappingMethod = SnappingMethods | 'normal' | 'advanced';
@@ -1,16 +0,0 @@
1
- /**
2
- * Snapping method.
3
- * @link https://github.com/DjonnyX/ng-virtual-list/blob/20.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,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/20.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 extends Array<IVirtualListItem> {
9
- }
@@ -1,6 +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
- export type { ScrollDirection, IScrollEvent, IVirtualListItem, IVirtualListStickyMap, IVirtualListCollection, };
@@ -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/20.x/projects/ng-virtual-list/src/lib/models/item.model.ts
5
- * @author Evgenii Grebennikov
6
- * @email djonnyx@gmail.com
7
- */
8
- export interface IVirtualListItem {
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/20.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/20.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/20.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/20.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/20.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,144 +0,0 @@
1
- import { AfterViewInit, ComponentRef, ElementRef, OnDestroy, OnInit, TemplateRef, ViewContainerRef, WritableSignal } from '@angular/core';
2
- import { Observable } from 'rxjs';
3
- import { NgVirtualListItemComponent } from './components/ng-virtual-list-item.component';
4
- import { IScrollEvent, IVirtualListCollection, IVirtualListStickyMap } from './models';
5
- import { Id, ISize } from './types';
6
- import { Direction, SnappingMethod } from './enums';
7
- import * as i0 from "@angular/core";
8
- /**
9
- * Virtual list component.
10
- * Maximum performance for extremely large lists.
11
- * It is based on algorithms for virtualization of screen objects.
12
- * @link https://github.com/DjonnyX/ng-virtual-list/blob/20.x/projects/ng-virtual-list/src/lib/ng-virtual-list.component.ts
13
- * @author Evgenii Grebennikov
14
- * @email djonnyx@gmail.com
15
- */
16
- export declare class NgVirtualListComponent implements AfterViewInit, OnInit, OnDestroy {
17
- private static __nextId;
18
- private _id;
19
- /**
20
- * Readonly. Returns the unique identifier of the component.
21
- */
22
- get id(): number;
23
- protected _listContainerRef: ViewContainerRef | undefined;
24
- protected _snapContainerRef: ViewContainerRef | undefined;
25
- protected _snappedContainer: import("@angular/core").Signal<ElementRef<HTMLDivElement> | undefined>;
26
- protected _container: import("@angular/core").Signal<ElementRef<HTMLDivElement> | undefined>;
27
- protected _list: import("@angular/core").Signal<ElementRef<HTMLUListElement> | undefined>;
28
- /**
29
- * Fires when the list has been scrolled.
30
- */
31
- onScroll: import("@angular/core").OutputEmitterRef<IScrollEvent>;
32
- /**
33
- * Fires when the list has completed scrolling.
34
- */
35
- onScrollEnd: import("@angular/core").OutputEmitterRef<IScrollEvent>;
36
- private _itemsOptions;
37
- /**
38
- * Collection of list items.
39
- */
40
- items: import("@angular/core").InputSignal<IVirtualListCollection>;
41
- /**
42
- * Determines whether elements will snap. Default value is "true".
43
- */
44
- snap: import("@angular/core").InputSignal<boolean>;
45
- /**
46
- * Experimental!
47
- * Enables buffer optimization.
48
- * 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.
49
- * Works only if the property dynamic = true
50
- */
51
- enabledBufferOptimization: import("@angular/core").InputSignal<boolean>;
52
- /**
53
- * Rendering element template.
54
- */
55
- itemRenderer: import("@angular/core").InputSignal<TemplateRef<any>>;
56
- /**
57
- * Dictionary zIndex by id of the list element. If the value is not set or equal to 0,
58
- * then a simple element is displayed, if the value is greater than 0, then the sticky position mode is enabled for the element.
59
- */
60
- stickyMap: import("@angular/core").InputSignal<IVirtualListStickyMap>;
61
- private _itemSizeOptions;
62
- /**
63
- * If direction = 'vertical', then the height of a typical element. If direction = 'horizontal', then the width of a typical element.
64
- * Ignored if the dynamicSize property is true.
65
- */
66
- itemSize: import("@angular/core").InputSignal<number>;
67
- /**
68
- * If true then the items in the list can have different sizes and the itemSize property is ignored.
69
- * If false then the items in the list have a fixed size specified by the itemSize property. The default value is false.
70
- */
71
- dynamicSize: import("@angular/core").InputSignal<boolean>;
72
- /**
73
- * Determines the direction in which elements are placed. Default value is "vertical".
74
- */
75
- direction: import("@angular/core").InputSignal<Direction>;
76
- /**
77
- * Number of elements outside the scope of visibility. Default value is 2.
78
- */
79
- itemsOffset: import("@angular/core").InputSignal<number>;
80
- /**
81
- * Snapping method.
82
- * 'default' - Normal group rendering.
83
- * 'advanced' - The group is rendered on a transparent background. List items below the group are not rendered.
84
- */
85
- snappingMethod: import("@angular/core").InputSignal<SnappingMethod>;
86
- protected _isSnappingMethodAdvanced: boolean;
87
- get isSnappingMethodAdvanced(): boolean;
88
- protected _isVertical: boolean;
89
- protected _displayComponents: Array<ComponentRef<NgVirtualListItemComponent>>;
90
- protected _snapedDisplayComponent: ComponentRef<NgVirtualListItemComponent> | undefined;
91
- protected _bounds: WritableSignal<ISize | null>;
92
- protected _scrollSize: WritableSignal<number>;
93
- private _resizeObserver;
94
- private _resizeSnappedComponentHandler;
95
- private _resizeSnappedObserver;
96
- private _componentsResizeObserver;
97
- private _onResizeHandler;
98
- private _onScrollHandler;
99
- private _elementRef;
100
- private _initialized;
101
- readonly $initialized: Observable<boolean>;
102
- /**
103
- * The name of the property by which tracking is performed
104
- */
105
- trackBy: import("@angular/core").InputSignal<string>;
106
- /**
107
- * Dictionary of element sizes by their id
108
- */
109
- private _trackBox;
110
- private _onTrackBoxChangeHandler;
111
- protected _cacheVersion: WritableSignal<number>;
112
- constructor();
113
- private listenCacheChangesIfNeed;
114
- private getIsSnappingMethodAdvanced;
115
- private getIsVertical;
116
- private createDisplayComponentsIfNeed;
117
- private updateRegularRenderer;
118
- private resetRenderers;
119
- /**
120
- * Tracking by id
121
- */
122
- protected tracking(): void;
123
- private resetBoundsSize;
124
- /**
125
- * Returns the bounds of an element with a given id
126
- */
127
- getItemBounds(id: Id): ISize | undefined;
128
- /**
129
- * The method scrolls the list to the element with the given id and returns the value of the scrolled area.
130
- * Behavior accepts the values ​​"auto", "instant" and "smooth".
131
- */
132
- scrollTo(id: Id, behavior?: ScrollBehavior): void;
133
- private _scrollToRepeatExecutionTimeout;
134
- private clearScrollToRepeatExecutionTimeout;
135
- protected scrollToExecutor(id: Id, behavior: ScrollBehavior, iteration?: number, isLastIteration?: boolean): void;
136
- /**
137
- * Scrolls the scroll area to the desired element with the specified ID.
138
- */
139
- scrollToEnd(behavior?: ScrollBehavior): void;
140
- private _onContainerScrollHandler;
141
- private _onContainerScrollEndHandler;
142
- static ɵfac: i0.ɵɵFactoryDeclaration<NgVirtualListComponent, never>;
143
- static ɵcmp: i0.ɵɵComponentDeclaration<NgVirtualListComponent, "ng-virtual-list", never, { "items": { "alias": "items"; "required": true; "isSignal": true; }; "snap": { "alias": "snap"; "required": false; "isSignal": true; }; "enabledBufferOptimization": { "alias": "enabledBufferOptimization"; "required": false; "isSignal": true; }; "itemRenderer": { "alias": "itemRenderer"; "required": true; "isSignal": true; }; "stickyMap": { "alias": "stickyMap"; "required": false; "isSignal": true; }; "itemSize": { "alias": "itemSize"; "required": false; "isSignal": true; }; "dynamicSize": { "alias": "dynamicSize"; "required": false; "isSignal": true; }; "direction": { "alias": "direction"; "required": false; "isSignal": true; }; "itemsOffset": { "alias": "itemsOffset"; "required": false; "isSignal": true; }; "snappingMethod": { "alias": "snappingMethod"; "required": false; "isSignal": true; }; "trackBy": { "alias": "trackBy"; "required": false; "isSignal": true; }; }, { "onScroll": "onScroll"; "onScrollEnd": "onScrollEnd"; }, never, never, true, never>;
144
- }
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/20.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/20.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/20.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,60 +0,0 @@
1
- import { ScrollDirection } from "../models";
2
- import { EventEmitter } 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/20.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 = CacheMapEvents, L = 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/20.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,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/20.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
- }