ng-virtual-list 14.2.0 → 14.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.
@@ -1,6 +1,7 @@
1
1
  import { ChangeDetectorRef, ElementRef, TemplateRef } from '@angular/core';
2
2
  import { IRenderVirtualListItem } from '../models/render-item.model';
3
3
  import { ISize } from '../types';
4
+ import { BaseVirtualListItemComponent } from '../models';
4
5
  import * as i0 from "@angular/core";
5
6
  /**
6
7
  * Virtual list item component
@@ -8,16 +9,16 @@ import * as i0 from "@angular/core";
8
9
  * @author Evgenii Grebennikov
9
10
  * @email djonnyx@gmail.com
10
11
  */
11
- export declare class NgVirtualListItemComponent {
12
- private _cdr;
13
- private _elementRef;
14
- private static __nextId;
15
- private _id;
12
+ export declare class NgVirtualListItemComponent extends BaseVirtualListItemComponent {
13
+ protected _cdr: ChangeDetectorRef;
14
+ protected _elementRef: ElementRef<HTMLElement>;
15
+ protected static __nextId: number;
16
+ protected _id: number;
16
17
  get id(): number;
17
18
  regular: boolean;
18
19
  data: IRenderVirtualListItem | undefined;
19
20
  set item(v: IRenderVirtualListItem | undefined);
20
- private _regularLength;
21
+ protected _regularLength: string;
21
22
  set regularLength(v: string);
22
23
  get item(): IRenderVirtualListItem | undefined;
23
24
  get itemId(): import("../types").Id | undefined;
@@ -5,4 +5,4 @@ import { Directions } from "./directions";
5
5
  * @author Evgenii Grebennikov
6
6
  * @email djonnyx@gmail.com
7
7
  */
8
- export declare type Direction = Directions | 'hotizontal' | 'vertical';
8
+ export declare type Direction = Directions | 'horizontal' | 'vertical';
@@ -0,0 +1,25 @@
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/14.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
+ }
@@ -5,5 +5,5 @@ import { IVirtualListItem } from "./item.model";
5
5
  * @author Evgenii Grebennikov
6
6
  * @email djonnyx@gmail.com
7
7
  */
8
- export interface IVirtualListCollection extends Array<IVirtualListItem> {
8
+ export interface IVirtualListCollection<E = Object> extends Array<IVirtualListItem<E>> {
9
9
  }
@@ -0,0 +1,3 @@
1
+ export interface Component$1<T> extends Function {
2
+ new (...args: any[]): T;
3
+ }
@@ -3,4 +3,7 @@ import { IScrollEvent } from './scroll-event.model';
3
3
  import { IVirtualListItem } from './item.model';
4
4
  import { IVirtualListStickyMap } from './sticky-map.model';
5
5
  import { IVirtualListCollection } from './collection.model';
6
- export type { ScrollDirection, IScrollEvent, IVirtualListItem, IVirtualListStickyMap, IVirtualListCollection, };
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, };
@@ -5,10 +5,10 @@ import { Id } from "../types/id";
5
5
  * @author Evgenii Grebennikov
6
6
  * @email djonnyx@gmail.com
7
7
  */
8
- export interface IVirtualListItem {
8
+ export declare type IVirtualListItem<E = Object> = E & {
9
9
  /**
10
10
  * Unique identifier of the element.
11
11
  */
12
12
  id: Id;
13
13
  [x: string]: any;
14
- }
14
+ };
@@ -1,9 +1,10 @@
1
1
  import { AfterViewInit, ChangeDetectorRef, ComponentRef, ElementRef, EventEmitter, OnDestroy, OnInit, TemplateRef, ViewContainerRef } from '@angular/core';
2
2
  import { BehaviorSubject, Observable } from 'rxjs';
3
- import { NgVirtualListItemComponent } from './components/ng-virtual-list-item.component';
4
- import { IScrollEvent, IVirtualListCollection, IVirtualListStickyMap } from './models';
3
+ import { BaseVirtualListItemComponent, Component$1, IScrollEvent, IVirtualListCollection, IVirtualListStickyMap } from './models';
5
4
  import { Id, ISize } from './types';
5
+ import { IRenderVirtualListCollection } from './models/render-collection.model';
6
6
  import { Direction, SnappingMethod } from './enums';
7
+ import { TrackBox } from './utils';
7
8
  import { DisposableComponent } from './utils/disposableComponent';
8
9
  import * as i0 from "@angular/core";
9
10
  /**
@@ -15,10 +16,10 @@ import * as i0 from "@angular/core";
15
16
  * @email djonnyx@gmail.com
16
17
  */
17
18
  export declare class NgVirtualListComponent extends DisposableComponent implements AfterViewInit, OnInit, OnDestroy {
18
- private _cdr;
19
- private _elementRef;
20
- private static __nextId;
21
- private _id;
19
+ protected _cdr: ChangeDetectorRef;
20
+ protected _elementRef: ElementRef<HTMLDivElement>;
21
+ protected static __nextId: number;
22
+ protected _id: number;
22
23
  /**
23
24
  * Readonly. Returns the unique identifier of the component.
24
25
  */
@@ -36,22 +37,22 @@ export declare class NgVirtualListComponent extends DisposableComponent implemen
36
37
  * Fires when the list has completed scrolling.
37
38
  */
38
39
  onScrollEnd: EventEmitter<IScrollEvent>;
39
- private _$items;
40
- readonly $items: Observable<IVirtualListCollection | undefined>;
41
- private _itemsTransform;
40
+ protected _$items: BehaviorSubject<IVirtualListCollection<Object> | undefined>;
41
+ readonly $items: Observable<IVirtualListCollection<Object> | undefined>;
42
+ protected _itemsTransform: (v: IVirtualListCollection | undefined) => IVirtualListCollection<Object> | undefined;
42
43
  /**
43
44
  * Collection of list items.
44
45
  */
45
46
  set items(v: IVirtualListCollection);
46
47
  get items(): IVirtualListCollection;
47
- private _$snap;
48
+ protected _$snap: BehaviorSubject<boolean>;
48
49
  readonly $snap: Observable<boolean>;
49
50
  /**
50
51
  * Determines whether elements will snap. Default value is "true".
51
52
  */
52
53
  set snap(v: boolean);
53
54
  get snap(): boolean;
54
- private _$enabledBufferOptimization;
55
+ protected _$enabledBufferOptimization: BehaviorSubject<boolean>;
55
56
  readonly $enabledBufferOptimization: Observable<boolean>;
56
57
  /**
57
58
  * Experimental!
@@ -61,14 +62,15 @@ export declare class NgVirtualListComponent extends DisposableComponent implemen
61
62
  */
62
63
  set enabledBufferOptimization(v: boolean);
63
64
  get enabledBufferOptimization(): boolean;
64
- private _$itemRenderer;
65
+ protected _$itemRenderer: BehaviorSubject<TemplateRef<any> | undefined>;
65
66
  readonly $itemRenderer: Observable<TemplateRef<any> | undefined>;
67
+ protected _$renderer: BehaviorSubject<TemplateRef<any> | undefined>;
66
68
  /**
67
69
  * Rendering element template.
68
70
  */
69
71
  set itemRenderer(v: TemplateRef<any>);
70
72
  get itemRenderer(): TemplateRef<any>;
71
- private _$stickyMap;
73
+ protected _$stickyMap: BehaviorSubject<IVirtualListStickyMap>;
72
74
  readonly $stickyMap: Observable<IVirtualListStickyMap>;
73
75
  /**
74
76
  * Dictionary zIndex by id of the list element. If the value is not set or equal to 0,
@@ -76,8 +78,8 @@ export declare class NgVirtualListComponent extends DisposableComponent implemen
76
78
  */
77
79
  set stickyMap(v: IVirtualListStickyMap);
78
80
  get stickyMap(): IVirtualListStickyMap;
79
- private _itemSizeOptions;
80
- private _$itemSize;
81
+ protected _itemSizeOptions: (v: number | undefined) => number;
82
+ protected _$itemSize: BehaviorSubject<number>;
81
83
  readonly $itemSize: Observable<number>;
82
84
  /**
83
85
  * If direction = 'vertical', then the height of a typical element. If direction = 'horizontal', then the width of a typical element.
@@ -85,7 +87,7 @@ export declare class NgVirtualListComponent extends DisposableComponent implemen
85
87
  */
86
88
  set itemSize(v: number);
87
89
  get itemSize(): number;
88
- private _$dynamicSize;
90
+ protected _$dynamicSize: BehaviorSubject<boolean>;
89
91
  readonly $dynamicSize: Observable<boolean>;
90
92
  /**
91
93
  * If true then the items in the list can have different sizes and the itemSize property is ignored.
@@ -93,29 +95,29 @@ export declare class NgVirtualListComponent extends DisposableComponent implemen
93
95
  */
94
96
  set dynamicSize(v: boolean);
95
97
  get dynamicSize(): boolean;
96
- private _$direction;
98
+ protected _$direction: BehaviorSubject<Direction>;
97
99
  readonly $direction: Observable<Direction>;
98
100
  /**
99
101
  * Determines the direction in which elements are placed. Default value is "vertical".
100
102
  */
101
103
  set direction(v: Direction);
102
104
  get direction(): Direction;
103
- private _$itemsOffset;
105
+ protected _$itemsOffset: BehaviorSubject<number>;
104
106
  readonly $itemsOffset: Observable<number>;
105
107
  /**
106
108
  * Number of elements outside the scope of visibility. Default value is 2.
107
109
  */
108
110
  set itemsOffset(v: number);
109
111
  get itemsOffset(): number;
110
- private _$trackBy;
112
+ protected _$trackBy: BehaviorSubject<string>;
111
113
  readonly $trackBy: Observable<string>;
112
114
  /**
113
115
  * The name of the property by which tracking is performed
114
116
  */
115
117
  set trackBy(v: string);
116
118
  get trackBy(): string;
117
- private _isVertical;
118
- private _$snappingMethod;
119
+ protected _isVertical: boolean;
120
+ protected _$snappingMethod: BehaviorSubject<SnappingMethod>;
119
121
  readonly $snappingMethod: Observable<SnappingMethod>;
120
122
  /**
121
123
  * Snapping method.
@@ -126,37 +128,47 @@ export declare class NgVirtualListComponent extends DisposableComponent implemen
126
128
  get snappingMethod(): SnappingMethod;
127
129
  protected _isSnappingMethodAdvanced: boolean;
128
130
  get isSnappingMethodAdvanced(): boolean;
129
- protected _displayComponents: Array<ComponentRef<NgVirtualListItemComponent>>;
130
- protected _snapedDisplayComponent: ComponentRef<NgVirtualListItemComponent> | undefined;
131
+ protected _displayComponents: Array<ComponentRef<BaseVirtualListItemComponent>>;
132
+ protected _snapedDisplayComponent: ComponentRef<BaseVirtualListItemComponent> | undefined;
131
133
  protected _$bounds: BehaviorSubject<ISize | null>;
132
134
  protected _$scrollSize: BehaviorSubject<number>;
133
- private _resizeObserver;
134
- private _resizeSnappedComponentHandler;
135
- private _resizeSnappedObserver;
136
- private _onResizeHandler;
137
- private _onScrollHandler;
138
- private _$initialized;
135
+ protected _resizeObserver: ResizeObserver | null;
136
+ protected _resizeSnappedComponentHandler: () => void;
137
+ protected _resizeSnappedObserver: ResizeObserver | null;
138
+ protected _onResizeHandler: () => void;
139
+ protected _onScrollHandler: (e?: Event) => void;
140
+ protected _$initialized: BehaviorSubject<boolean>;
139
141
  readonly $initialized: Observable<boolean>;
142
+ /**
143
+ * Base class of the element component
144
+ */
145
+ protected _itemComponentClass: Component$1<BaseVirtualListItemComponent>;
146
+ /**
147
+ * Base class trackBox
148
+ */
149
+ protected _trackBoxClass: Component$1<TrackBox>;
140
150
  /**
141
151
  * Dictionary of element sizes by their id
142
152
  */
143
- private _trackBox;
144
- private _onTrackBoxChangeHandler;
145
- private _$cacheVersion;
153
+ protected _trackBox: TrackBox;
154
+ protected _onTrackBoxChangeHandler: (v: number) => void;
155
+ protected _$cacheVersion: BehaviorSubject<number>;
146
156
  get $cacheVersion(): Observable<number>;
147
157
  constructor(_cdr: ChangeDetectorRef, _elementRef: ElementRef<HTMLDivElement>);
148
- private listenCacheChangesIfNeed;
149
- private getIsSnappingMethodAdvanced;
150
- private getIsVertical;
151
- private _componentsResizeObserver;
152
- private createDisplayComponentsIfNeed;
153
- private updateRegularRenderer;
154
- private resetRenderers;
158
+ protected setupRenderer(): void;
159
+ protected onInit(): void;
160
+ protected listenCacheChangesIfNeed(value: boolean): void;
161
+ protected getIsSnappingMethodAdvanced(m?: SnappingMethod): boolean;
162
+ protected getIsVertical(d?: Direction): boolean;
163
+ protected _componentsResizeObserver: ResizeObserver;
164
+ protected createDisplayComponentsIfNeed(displayItems: IRenderVirtualListCollection | null): void;
165
+ protected updateRegularRenderer(): void;
166
+ protected resetRenderers(itemRenderer?: TemplateRef<HTMLElement>): void;
155
167
  /**
156
168
  * Tracking by id
157
169
  */
158
170
  protected tracking(): void;
159
- private resetBoundsSize;
171
+ protected resetBoundsSize(isVertical: boolean, totalSize: number): void;
160
172
  /**
161
173
  * Returns the bounds of an element with a given id
162
174
  */
@@ -166,15 +178,17 @@ export declare class NgVirtualListComponent extends DisposableComponent implemen
166
178
  * Behavior accepts the values ​​"auto", "instant" and "smooth".
167
179
  */
168
180
  scrollTo(id: Id, behavior?: ScrollBehavior): void;
169
- private _scrollToRepeatExecutionTimeout;
170
- private clearScrollToRepeatExecutionTimeout;
181
+ protected _scrollToRepeatExecutionTimeout: any;
182
+ protected clearScrollToRepeatExecutionTimeout(): void;
171
183
  protected scrollToExecutor(id: Id, behavior: ScrollBehavior, iteration?: number, isLastIteration?: boolean): void;
172
184
  /**
173
185
  * Scrolls the scroll area to the desired element with the specified ID.
174
186
  */
175
187
  scrollToEnd(behavior?: ScrollBehavior): void;
176
- private _onContainerScrollHandler;
177
- private _onContainerScrollEndHandler;
188
+ protected _onContainerScrollHandler: (e: Event) => void;
189
+ protected _onContainerScrollEndHandler: (e: Event) => void;
190
+ protected afterViewInit(): void;
191
+ protected dispose(): void;
178
192
  static ɵfac: i0.ɵɵFactoryDeclaration<NgVirtualListComponent, never>;
179
193
  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"; "trackBy": "trackBy"; "snappingMethod": "snappingMethod"; }, { "onScroll": "onScroll"; "onScrollEnd": "onScrollEnd"; }, never, never, false>;
180
194
  }
@@ -2,6 +2,8 @@ import { isDirection } from "./isDirection";
2
2
  import { debounce } from "./debounce";
3
3
  import { toggleClassName } from './toggleClassName';
4
4
  import { Tracker } from "./tracker";
5
- import { TrackBox } from "./trackBox";
5
+ import { TrackBox, IUpdateCollectionReturns, TRACK_BOX_CHANGE_EVENT_NAME, IMetrics, IRecalculateMetricsOptions, IGetItemPositionOptions, IUpdateCollectionOptions, CacheMapEvents, OnChangeEventListener, CacheMapListeners, ItemDisplayMethods } from "./trackBox";
6
+ import { CMap, ICacheMap, CACHE_BOX_CHANGE_EVENT_NAME } from './cacheMap';
6
7
  import { ScrollEvent } from "./scrollEvent";
7
- export { isDirection, debounce, toggleClassName, ScrollEvent, TrackBox, Tracker, };
8
+ export { isDirection, debounce, toggleClassName, ScrollEvent, TrackBox, Tracker, TRACK_BOX_CHANGE_EVENT_NAME, CMap, CACHE_BOX_CHANGE_EVENT_NAME, };
9
+ export type { ICacheMap, IUpdateCollectionReturns, IMetrics, IRecalculateMetricsOptions, IGetItemPositionOptions, IUpdateCollectionOptions, CacheMapEvents, OnChangeEventListener, CacheMapListeners, ItemDisplayMethods, };
@@ -1,13 +1,11 @@
1
1
  import { ComponentRef } from "@angular/core";
2
- import { NgVirtualListItemComponent } from "../components/ng-virtual-list-item.component";
3
2
  import { IRenderVirtualListCollection } from "../models/render-collection.model";
4
- import { IRenderVirtualListItem } from "../models/render-item.model";
5
3
  import { Id } from "../types/id";
6
4
  import { CacheMap, CMap } from "./cacheMap";
7
5
  import { Tracker } from "./tracker";
8
6
  import { ISize } from "../types";
9
7
  import { HEIGHT_PROP_NAME, WIDTH_PROP_NAME } from "../const";
10
- import { IVirtualListStickyMap } from "../models";
8
+ import { BaseVirtualListItemComponent, IVirtualListStickyMap } from "../models";
11
9
  export declare const TRACK_BOX_CHANGE_EVENT_NAME = "change";
12
10
  export interface IMetrics {
13
11
  delta: number;
@@ -67,16 +65,16 @@ export interface IUpdateCollectionOptions<I extends {
67
65
  id: Id;
68
66
  }, C extends Array<I>> extends Omit<IRecalculateMetricsOptions<I, C>, 'collection' | 'previousTotalSize' | 'crudDetected' | 'deletedItemsMap'> {
69
67
  }
70
- declare type CacheMapEvents = typeof TRACK_BOX_CHANGE_EVENT_NAME;
71
- declare type OnChangeEventListener = (version: number) => void;
72
- declare type CacheMapListeners = OnChangeEventListener;
73
- declare enum ItemDisplayMethods {
68
+ export declare type CacheMapEvents = typeof TRACK_BOX_CHANGE_EVENT_NAME;
69
+ export declare type OnChangeEventListener = (version: number) => void;
70
+ export declare type CacheMapListeners = OnChangeEventListener;
71
+ export declare enum ItemDisplayMethods {
74
72
  CREATE = 0,
75
73
  UPDATE = 1,
76
74
  DELETE = 2,
77
75
  NOT_CHANGED = 3
78
76
  }
79
- interface IUpdateCollectionReturns {
77
+ export interface IUpdateCollectionReturns {
80
78
  displayItems: IRenderVirtualListCollection;
81
79
  totalSize: number;
82
80
  delta: number;
@@ -88,16 +86,16 @@ interface IUpdateCollectionReturns {
88
86
  * @author Evgenii Grebennikov
89
87
  * @email djonnyx@gmail.com
90
88
  */
91
- export declare class TrackBox extends CacheMap<Id, ISize & {
89
+ export declare class TrackBox<C extends BaseVirtualListItemComponent = any> extends CacheMap<Id, ISize & {
92
90
  method?: ItemDisplayMethods;
93
91
  }, CacheMapEvents, CacheMapListeners> {
94
- protected _tracker: Tracker<IRenderVirtualListItem, NgVirtualListItemComponent>;
92
+ protected _tracker: Tracker<C>;
95
93
  protected _items: IRenderVirtualListCollection | null | undefined;
96
94
  set items(v: IRenderVirtualListCollection | null | undefined);
97
- protected _displayComponents: Array<ComponentRef<NgVirtualListItemComponent>> | null | undefined;
98
- set displayComponents(v: Array<ComponentRef<NgVirtualListItemComponent>> | null | undefined);
99
- protected _snapedDisplayComponent: ComponentRef<NgVirtualListItemComponent> | null | undefined;
100
- set snapedDisplayComponent(v: ComponentRef<NgVirtualListItemComponent> | null | undefined);
95
+ protected _displayComponents: Array<ComponentRef<C>> | null | undefined;
96
+ set displayComponents(v: Array<ComponentRef<C>> | null | undefined);
97
+ protected _snapedDisplayComponent: ComponentRef<C> | null | undefined;
98
+ set snapedDisplayComponent(v: ComponentRef<C> | null | undefined);
101
99
  protected _isSnappingMethodAdvanced: boolean;
102
100
  set isSnappingMethodAdvanced(v: boolean);
103
101
  /**
@@ -106,12 +104,16 @@ export declare class TrackBox extends CacheMap<Id, ISize & {
106
104
  set trackingPropertyName(v: string);
107
105
  constructor(trackingPropertyName: string);
108
106
  set(id: Id, bounds: ISize): CMap<Id, ISize>;
109
- private _previousCollection;
110
- private _deletedItemsMap;
111
- private _crudDetected;
107
+ protected _previousCollection: Array<{
108
+ id: Id;
109
+ }> | null | undefined;
110
+ protected _deletedItemsMap: {
111
+ [index: number]: ISize;
112
+ };
113
+ protected _crudDetected: boolean;
112
114
  get crudDetected(): boolean;
113
115
  protected fireChangeIfNeed(): void;
114
- private _previousTotalSize;
116
+ protected _previousTotalSize: number;
115
117
  protected _scrollDelta: number;
116
118
  get scrollDelta(): number;
117
119
  protected lifeCircle(): void;
@@ -148,11 +150,18 @@ export declare class TrackBox extends CacheMap<Id, ISize & {
148
150
  /**
149
151
  * Calculates the position of an element based on the given scrollSize
150
152
  */
151
- private getElementFromStart;
153
+ protected getElementFromStart<I extends {
154
+ id: Id;
155
+ }, C extends Array<I>>(scrollSize: number, collection: C, map: CMap<Id, ISize>, typicalItemSize: number, isVertical: boolean): I | undefined;
152
156
  /**
153
157
  * Calculates the entry into the overscroll area and returns the number of overscroll elements
154
158
  */
155
- private getElementNumToEnd;
159
+ protected getElementNumToEnd<I extends {
160
+ id: Id;
161
+ }, C extends Array<I>>(i: number, collection: C, map: CMap<Id, ISize>, typicalItemSize: number, size: number, isVertical: boolean, indexOffset?: number): {
162
+ num: number;
163
+ offset: number;
164
+ };
156
165
  /**
157
166
  * Calculates list metrics
158
167
  */
@@ -172,9 +181,8 @@ export declare class TrackBox extends CacheMap<Id, ISize & {
172
181
  setDisplayObjectIndexMapById(v: {
173
182
  [id: number]: number;
174
183
  }): void;
175
- untrackComponentByIdProperty(component?: NgVirtualListItemComponent | undefined): void;
184
+ untrackComponentByIdProperty(component?: C | undefined): void;
176
185
  getItemBounds(id: Id): ISize | undefined;
177
186
  protected cacheElements(): void;
178
187
  dispose(): void;
179
188
  }
180
- export {};
@@ -1,8 +1,11 @@
1
1
  import { ComponentRef } from "@angular/core";
2
- import { ScrollDirection } from "../models";
3
- interface IVirtualListItemComponent<I = any> {
2
+ import { BaseVirtualListItemComponent, ScrollDirection } from "../models";
3
+ import { Id, ISize } from "../types";
4
+ export interface IVirtualListItemComponent<I = any> {
5
+ getBounds(): ISize;
6
+ itemId: Id;
4
7
  id: number;
5
- item: I;
8
+ item: I | null;
6
9
  show: () => void;
7
10
  hide: () => void;
8
11
  }
@@ -12,7 +15,7 @@ interface IVirtualListItemComponent<I = any> {
12
15
  * @author Evgenii Grebennikov
13
16
  * @email djonnyx@gmail.com
14
17
  */
15
- export declare class Tracker<I = any, C extends IVirtualListItemComponent = any> {
18
+ export declare class Tracker<C extends BaseVirtualListItemComponent = any> {
16
19
  /**
17
20
  * display objects dictionary of indexes by id
18
21
  */
@@ -41,4 +44,3 @@ export declare class Tracker<I = any, C extends IVirtualListItemComponent = any>
41
44
  untrackComponentByIdProperty(component?: C): void;
42
45
  dispose(): void;
43
46
  }
44
- export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ng-virtual-list",
3
- "version": "14.2.0",
3
+ "version": "14.3.1",
4
4
  "author": {
5
5
  "name": "Evgenii Grebennikov",
6
6
  "email": "djonnyx@gmail.com"
package/public-api.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ export * from './lib/components/ng-virtual-list-item.component';
1
2
  export * from './lib/ng-virtual-list.module';
2
3
  export * from './lib/ng-virtual-list.component';
3
4
  export * from './lib/enums';