ng-virtual-list 16.7.11 → 16.7.13
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.
- package/README.md +28 -9
- package/esm2022/lib/components/ng-virtual-list-item.component.mjs +43 -27
- package/esm2022/lib/const/index.mjs +3 -2
- package/esm2022/lib/enums/collection-mode.mjs +2 -0
- package/esm2022/lib/enums/collection-modes.mjs +18 -0
- package/esm2022/lib/enums/focus-alignments.mjs +14 -0
- package/esm2022/lib/enums/index.mjs +4 -2
- package/esm2022/lib/models/display-object-config.model.mjs +2 -0
- package/esm2022/lib/models/display-object-measures.model.mjs +2 -0
- package/esm2022/lib/models/index.mjs +1 -1
- package/esm2022/lib/ng-virtual-list.component.mjs +108 -19
- package/esm2022/lib/ng-virtual-list.service.mjs +4 -3
- package/esm2022/lib/types/focus-alignment.mjs +2 -0
- package/esm2022/lib/types/index.mjs +1 -1
- package/esm2022/lib/utils/isCollectionMode.mjs +15 -0
- package/esm2022/lib/utils/trackBox.mjs +45 -16
- package/fesm2022/ng-virtual-list.mjs +237 -59
- package/fesm2022/ng-virtual-list.mjs.map +1 -1
- package/lib/components/ng-virtual-list-item.component.d.ts +9 -39
- package/lib/const/index.d.ts +2 -1
- package/lib/enums/collection-mode.d.ts +8 -0
- package/lib/enums/collection-modes.d.ts +16 -0
- package/lib/enums/focus-alignments.d.ts +12 -0
- package/lib/enums/index.d.ts +5 -2
- package/lib/models/display-object-config.model.d.ts +35 -0
- package/lib/models/display-object-measures.model.d.ts +13 -0
- package/lib/models/index.d.ts +3 -1
- package/lib/ng-virtual-list.component.d.ts +19 -3
- package/lib/ng-virtual-list.service.d.ts +4 -4
- package/lib/types/focus-alignment.d.ts +8 -0
- package/lib/types/index.d.ts +2 -1
- package/lib/utils/isCollectionMode.d.ts +8 -0
- package/lib/utils/trackBox.d.ts +17 -9
- package/package.json +1 -1
|
@@ -1,35 +1,11 @@
|
|
|
1
1
|
import { ChangeDetectorRef, ElementRef, TemplateRef } from '@angular/core';
|
|
2
2
|
import { IRenderVirtualListItem } from '../models/render-item.model';
|
|
3
|
-
import { Id,
|
|
3
|
+
import { Id, ISize } from '../types';
|
|
4
4
|
import { BaseVirtualListItemComponent } from '../models/base-virtual-list-item-component';
|
|
5
5
|
import { NgVirtualListService } from '../ng-virtual-list.service';
|
|
6
|
-
import { BehaviorSubject
|
|
7
|
-
import {
|
|
6
|
+
import { BehaviorSubject } from 'rxjs';
|
|
7
|
+
import { IDisplayObjectConfig, IDisplayObjectMeasures } from '../models';
|
|
8
8
|
import * as i0 from "@angular/core";
|
|
9
|
-
interface IItemConfig extends IRenderVirtualListItemConfig {
|
|
10
|
-
/**
|
|
11
|
-
* Determines whether the element has focus or not.
|
|
12
|
-
*/
|
|
13
|
-
focus: boolean;
|
|
14
|
-
/**
|
|
15
|
-
* Determines whether the element is selected or not.
|
|
16
|
-
*/
|
|
17
|
-
selected: boolean;
|
|
18
|
-
/**
|
|
19
|
-
* Determines whether the element is collapsed or not.
|
|
20
|
-
*/
|
|
21
|
-
collapsed: boolean;
|
|
22
|
-
/**
|
|
23
|
-
* Selects a list item
|
|
24
|
-
* @param selected - If the value is undefined, then the toggle method is executed, if false or true, then the selection/deselection is performed.
|
|
25
|
-
*/
|
|
26
|
-
select: (selected: boolean | undefined) => void;
|
|
27
|
-
/**
|
|
28
|
-
* Collapse list items
|
|
29
|
-
* @param collapsed - If the value is undefined, then the toggle method is executed, if false or true, then the collapse/expand is performed.
|
|
30
|
-
*/
|
|
31
|
-
collapse: (collapsed: boolean | undefined) => void;
|
|
32
|
-
}
|
|
33
9
|
/**
|
|
34
10
|
* Virtual list item component
|
|
35
11
|
* @link https://github.com/DjonnyX/ng-virtual-list/blob/16.x/projects/ng-virtual-list/src/lib/components/ng-virtual-list-item.component.ts
|
|
@@ -40,7 +16,6 @@ export declare class NgVirtualListItemComponent extends BaseVirtualListItemCompo
|
|
|
40
16
|
private _cdr;
|
|
41
17
|
private _elementRef;
|
|
42
18
|
private _service;
|
|
43
|
-
protected _$unsubscribe: Subject<void>;
|
|
44
19
|
private _id;
|
|
45
20
|
get id(): number;
|
|
46
21
|
private _part;
|
|
@@ -48,15 +23,10 @@ export declare class NgVirtualListItemComponent extends BaseVirtualListItemCompo
|
|
|
48
23
|
private _isSelected;
|
|
49
24
|
private _isCollapsed;
|
|
50
25
|
private _$config;
|
|
51
|
-
$config: import("rxjs").Observable<
|
|
52
|
-
measures: BehaviorSubject<
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
*/
|
|
56
|
-
delta: number;
|
|
57
|
-
}) | undefined>;
|
|
58
|
-
private _$focus;
|
|
59
|
-
$focus: import("rxjs").Observable<boolean>;
|
|
26
|
+
$config: import("rxjs").Observable<IDisplayObjectConfig>;
|
|
27
|
+
measures: BehaviorSubject<IDisplayObjectMeasures | undefined>;
|
|
28
|
+
private _$focused;
|
|
29
|
+
$focused: import("rxjs").Observable<boolean>;
|
|
60
30
|
private _$part;
|
|
61
31
|
$part: import("rxjs").Observable<string>;
|
|
62
32
|
regular: boolean;
|
|
@@ -73,9 +43,11 @@ export declare class NgVirtualListItemComponent extends BaseVirtualListItemCompo
|
|
|
73
43
|
get element(): HTMLElement;
|
|
74
44
|
private _selectHandler;
|
|
75
45
|
private _collapseHandler;
|
|
46
|
+
private _focusHandler;
|
|
76
47
|
constructor(_cdr: ChangeDetectorRef, _elementRef: ElementRef<HTMLElement>, _service: NgVirtualListService);
|
|
77
48
|
private focusNext;
|
|
78
49
|
private focusPrev;
|
|
50
|
+
private focus;
|
|
79
51
|
private updateMeasures;
|
|
80
52
|
private updateConfig;
|
|
81
53
|
private update;
|
|
@@ -84,8 +56,6 @@ export declare class NgVirtualListItemComponent extends BaseVirtualListItemCompo
|
|
|
84
56
|
show(): void;
|
|
85
57
|
hide(): void;
|
|
86
58
|
onClickHandler(): void;
|
|
87
|
-
ngOnDestroy(): void;
|
|
88
59
|
static ɵfac: i0.ɵɵFactoryDeclaration<NgVirtualListItemComponent, never>;
|
|
89
60
|
static ɵcmp: i0.ɵɵComponentDeclaration<NgVirtualListItemComponent, "ng-virtual-list-item", never, {}, {}, never, never, false, never>;
|
|
90
61
|
}
|
|
91
|
-
export {};
|
package/lib/const/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { MethodsForSelecting, SnappingMethods } from "../enums";
|
|
1
|
+
import { CollectionModes, MethodsForSelecting, SnappingMethods } from "../enums";
|
|
2
2
|
import { Directions } from "../enums/directions";
|
|
3
3
|
export declare const DEFAULT_ITEM_SIZE = 24;
|
|
4
4
|
export declare const DEFAULT_BUFFER_SIZE = 2;
|
|
@@ -11,6 +11,7 @@ export declare const DEFAULT_ENABLED_BUFFER_OPTIMIZATION = false;
|
|
|
11
11
|
export declare const DEFAULT_DYNAMIC_SIZE = false;
|
|
12
12
|
export declare const TRACK_BY_PROPERTY_NAME = "id";
|
|
13
13
|
export declare const DEFAULT_DIRECTION = Directions.VERTICAL;
|
|
14
|
+
export declare const DEFAULT_COLLECTION_MODE = CollectionModes.NORMAL;
|
|
14
15
|
export declare const DISPLAY_OBJECTS_LENGTH_MESUREMENT_ERROR = 1;
|
|
15
16
|
export declare const MAX_SCROLL_TO_ITERATIONS = 5;
|
|
16
17
|
export declare const DEFAULT_SNAPPING_METHOD = SnappingMethods.NORMAL;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { CollectionModes } from "./collection-modes";
|
|
2
|
+
/**
|
|
3
|
+
* Action modes for collection elements.
|
|
4
|
+
* @link https://github.com/DjonnyX/ng-virtual-list/blob/16.x/projects/ng-virtual-list/src/lib/enums/collection-mode.ts
|
|
5
|
+
* @author Evgenii Grebennikov
|
|
6
|
+
* @email djonnyx@gmail.com
|
|
7
|
+
*/
|
|
8
|
+
export type CollectionMode = CollectionModes | 'normal' | 'lazy';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Action modes for collection elements.
|
|
3
|
+
* @link https://github.com/DjonnyX/ng-virtual-list/blob/16.x/projects/ng-virtual-list/src/lib/enums/collection-modes.ts
|
|
4
|
+
* @author Evgenii Grebennikov
|
|
5
|
+
* @email djonnyx@gmail.com
|
|
6
|
+
*/
|
|
7
|
+
export declare enum CollectionModes {
|
|
8
|
+
/**
|
|
9
|
+
* When adding elements to the beginning of the collection, the scroll remains at the current position.
|
|
10
|
+
*/
|
|
11
|
+
NORMAL = "normal",
|
|
12
|
+
/**
|
|
13
|
+
* When adding elements to the beginning of the collection, the scroll is shifted by the sum of the sizes of the new elements.
|
|
14
|
+
*/
|
|
15
|
+
LAZY = "lazy"
|
|
16
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Focus Alignments.
|
|
3
|
+
* @link https://github.com/DjonnyX/ng-virtual-list/blob/16.x/projects/ng-virtual-list/src/lib/enums/focus-alignments.ts
|
|
4
|
+
* @author Evgenii Grebennikov
|
|
5
|
+
* @email djonnyx@gmail.com
|
|
6
|
+
*/
|
|
7
|
+
export declare enum FocusAlignments {
|
|
8
|
+
NONE = "none",
|
|
9
|
+
START = "start",
|
|
10
|
+
CENTER = "center",
|
|
11
|
+
END = "end"
|
|
12
|
+
}
|
package/lib/enums/index.d.ts
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
|
+
import { CollectionMode } from "./collection-mode";
|
|
2
|
+
import { CollectionModes } from "./collection-modes";
|
|
1
3
|
import { Directions } from "./directions";
|
|
2
4
|
import { Direction } from "./direction";
|
|
3
5
|
import { MethodsForSelecting } from "./methods-for-selecting";
|
|
4
6
|
import { MethodForSelecting } from "./method-for-selecting";
|
|
5
7
|
import { SnappingMethods } from "./snapping-methods";
|
|
6
8
|
import { SnappingMethod } from "./snapping-method";
|
|
7
|
-
|
|
8
|
-
export
|
|
9
|
+
import { FocusAlignments } from "./focus-alignments";
|
|
10
|
+
export { CollectionModes, Directions, MethodsForSelecting, SnappingMethods, FocusAlignments, };
|
|
11
|
+
export type { CollectionMode, Direction, MethodForSelecting, SnappingMethod, };
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { IRenderVirtualListItemConfig } from "./render-item-config.model";
|
|
2
|
+
/**
|
|
3
|
+
* Display object configuration. A set of `select`, `collapse`, and `focus` methods are also provided.
|
|
4
|
+
* @link https://github.com/DjonnyX/ng-virtual-list/blob/16.x/projects/ng-virtual-list/src/lib/models/display-object-config.model.ts
|
|
5
|
+
* @author Evgenii Grebennikov
|
|
6
|
+
* @email djonnyx@gmail.com
|
|
7
|
+
*/
|
|
8
|
+
export interface IDisplayObjectConfig extends IRenderVirtualListItemConfig {
|
|
9
|
+
/**
|
|
10
|
+
* Determines whether the element has focused or not.
|
|
11
|
+
*/
|
|
12
|
+
focused: boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Determines whether the element is selected or not.
|
|
15
|
+
*/
|
|
16
|
+
selected: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Determines whether the element is collapsed or not.
|
|
19
|
+
*/
|
|
20
|
+
collapsed: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Focus a list item
|
|
23
|
+
*/
|
|
24
|
+
focus: () => void;
|
|
25
|
+
/**
|
|
26
|
+
* Selects a list item
|
|
27
|
+
* @param selected - If the value is undefined, then the toggle method is executed, if false or true, then the selection/deselection is performed.
|
|
28
|
+
*/
|
|
29
|
+
select: (selected: boolean | undefined) => void;
|
|
30
|
+
/**
|
|
31
|
+
* Collapse list items
|
|
32
|
+
* @param collapsed - If the value is undefined, then the toggle method is executed, if false or true, then the collapse/expand is performed.
|
|
33
|
+
*/
|
|
34
|
+
collapse: (collapsed: boolean | undefined) => void;
|
|
35
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { IRect } from "../types";
|
|
2
|
+
/**
|
|
3
|
+
* Display object metrics.
|
|
4
|
+
* @link https://github.com/DjonnyX/ng-virtual-list/blob/16.x/projects/ng-virtual-list/src/lib/models/display-object-measures.model.ts
|
|
5
|
+
* @author Evgenii Grebennikov
|
|
6
|
+
* @email djonnyx@gmail.com
|
|
7
|
+
*/
|
|
8
|
+
export interface IDisplayObjectMeasures extends IRect {
|
|
9
|
+
/**
|
|
10
|
+
* Delta is calculated for Snapping Method.ADVANCED
|
|
11
|
+
*/
|
|
12
|
+
delta: number;
|
|
13
|
+
}
|
package/lib/models/index.d.ts
CHANGED
|
@@ -4,4 +4,6 @@ import { IVirtualListItem } from './item.model';
|
|
|
4
4
|
import { IVirtualListItemConfigMap } from './item-config-map.model';
|
|
5
5
|
import { IVirtualListCollection } from './collection.model';
|
|
6
6
|
import { IRenderVirtualListItem } from './render-item.model';
|
|
7
|
-
|
|
7
|
+
import { IDisplayObjectConfig } from './display-object-config.model';
|
|
8
|
+
import { IDisplayObjectMeasures } from './display-object-measures.model';
|
|
9
|
+
export type { IDisplayObjectConfig, IDisplayObjectMeasures, IScrollEvent, IVirtualListItem, IVirtualListItemConfigMap, IVirtualListCollection, IRenderVirtualListItem, ScrollDirection, };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AfterViewInit, ChangeDetectorRef, ElementRef, EventEmitter, OnDestroy, OnInit, TemplateRef } from '@angular/core';
|
|
2
2
|
import { IRenderVirtualListItem, IScrollEvent, IVirtualListCollection, IVirtualListItemConfigMap } from './models';
|
|
3
|
-
import { Id, ISize } from './types';
|
|
4
|
-
import { Direction, Directions, MethodForSelecting, SnappingMethod } from './enums';
|
|
3
|
+
import { FocusAlignment, Id, ISize } from './types';
|
|
4
|
+
import { CollectionMode, Direction, Directions, MethodForSelecting, SnappingMethod } from './enums';
|
|
5
5
|
import { NgVirtualListService } from './ng-virtual-list.service';
|
|
6
6
|
import * as i0 from "@angular/core";
|
|
7
7
|
/**
|
|
@@ -169,6 +169,14 @@ export declare class NgVirtualListComponent implements AfterViewInit, OnInit, On
|
|
|
169
169
|
*/
|
|
170
170
|
set direction(v: Direction);
|
|
171
171
|
get direction(): Direction;
|
|
172
|
+
private _$collectionMode;
|
|
173
|
+
readonly $collectionMode: import("rxjs").Observable<CollectionMode>;
|
|
174
|
+
private _collectionModeTransform;
|
|
175
|
+
/**
|
|
176
|
+
* Determines the action modes for collection elements. Default value is "normal".
|
|
177
|
+
*/
|
|
178
|
+
set collectionMode(v: CollectionMode);
|
|
179
|
+
get collectionMode(): CollectionMode;
|
|
172
180
|
private _$bufferSize;
|
|
173
181
|
readonly $bufferSize: import("rxjs").Observable<number>;
|
|
174
182
|
private _bufferSizeTransform;
|
|
@@ -217,6 +225,7 @@ export declare class NgVirtualListComponent implements AfterViewInit, OnInit, On
|
|
|
217
225
|
set trackBy(v: string);
|
|
218
226
|
get trackBy(): string;
|
|
219
227
|
private _isVertical;
|
|
228
|
+
private _isLazy;
|
|
220
229
|
get orientation(): Directions;
|
|
221
230
|
private _$focusedElement;
|
|
222
231
|
readonly $focusedElement: import("rxjs").Observable<Id | undefined>;
|
|
@@ -261,6 +270,8 @@ export declare class NgVirtualListComponent implements AfterViewInit, OnInit, On
|
|
|
261
270
|
private _onTrackBoxChangeHandler;
|
|
262
271
|
private _$cacheVersion;
|
|
263
272
|
get $cacheVersion(): import("rxjs").Observable<number>;
|
|
273
|
+
private _isResetedReachStart;
|
|
274
|
+
private _onTrackBoxResetHandler;
|
|
264
275
|
constructor(_cdr: ChangeDetectorRef, _elementRef: ElementRef<HTMLDivElement>, _service: NgVirtualListService);
|
|
265
276
|
ngOnInit(): void;
|
|
266
277
|
private onInit;
|
|
@@ -270,6 +281,7 @@ export declare class NgVirtualListComponent implements AfterViewInit, OnInit, On
|
|
|
270
281
|
private getIsSingleSelecting;
|
|
271
282
|
private getIsMultiSelecting;
|
|
272
283
|
private getIsVertical;
|
|
284
|
+
private getIsLazy;
|
|
273
285
|
private _componentsResizeObserver;
|
|
274
286
|
private createDisplayComponentsIfNeed;
|
|
275
287
|
private updateRegularRenderer;
|
|
@@ -283,6 +295,10 @@ export declare class NgVirtualListComponent implements AfterViewInit, OnInit, On
|
|
|
283
295
|
* Returns the bounds of an element with a given id
|
|
284
296
|
*/
|
|
285
297
|
getItemBounds(id: Id): ISize | undefined;
|
|
298
|
+
/**
|
|
299
|
+
* Focus an list item by a given id.
|
|
300
|
+
*/
|
|
301
|
+
focus(id: Id, align?: FocusAlignment): void;
|
|
286
302
|
/**
|
|
287
303
|
* The method scrolls the list to the element with the given id and returns the value of the scrolled area.
|
|
288
304
|
* Behavior accepts the values "auto", "instant" and "smooth".
|
|
@@ -302,5 +318,5 @@ export declare class NgVirtualListComponent implements AfterViewInit, OnInit, On
|
|
|
302
318
|
ngOnDestroy(): void;
|
|
303
319
|
private dispose;
|
|
304
320
|
static ɵfac: i0.ɵɵFactoryDeclaration<NgVirtualListComponent, never>;
|
|
305
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<NgVirtualListComponent, "ng-virtual-list", never, { "items": { "alias": "items"; "required": false; }; "selectedIds": { "alias": "selectedIds"; "required": false; }; "collapsedIds": { "alias": "collapsedIds"; "required": false; }; "selectByClick": { "alias": "selectByClick"; "required": false; }; "collapseByClick": { "alias": "collapseByClick"; "required": false; }; "snap": { "alias": "snap"; "required": false; }; "enabledBufferOptimization": { "alias": "enabledBufferOptimization"; "required": false; }; "itemRenderer": { "alias": "itemRenderer"; "required": false; }; "itemConfigMap": { "alias": "itemConfigMap"; "required": false; }; "itemSize": { "alias": "itemSize"; "required": false; }; "dynamicSize": { "alias": "dynamicSize"; "required": false; }; "direction": { "alias": "direction"; "required": false; }; "bufferSize": { "alias": "bufferSize"; "required": false; }; "maxBufferSize": { "alias": "maxBufferSize"; "required": false; }; "snappingMethod": { "alias": "snappingMethod"; "required": false; }; "methodForSelecting": { "alias": "methodForSelecting"; "required": false; }; "trackBy": { "alias": "trackBy"; "required": false; }; }, { "onScroll": "onScroll"; "onScrollEnd": "onScrollEnd"; "onViewportChange": "onViewportChange"; "onItemClick": "onItemClick"; "onSelect": "onSelect"; "onCollapse": "onCollapse"; "onScrollReachStart": "onScrollReachStart"; "onScrollReachEnd": "onScrollReachEnd"; }, never, never, false, never>;
|
|
321
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<NgVirtualListComponent, "ng-virtual-list", never, { "items": { "alias": "items"; "required": false; }; "selectedIds": { "alias": "selectedIds"; "required": false; }; "collapsedIds": { "alias": "collapsedIds"; "required": false; }; "selectByClick": { "alias": "selectByClick"; "required": false; }; "collapseByClick": { "alias": "collapseByClick"; "required": false; }; "snap": { "alias": "snap"; "required": false; }; "enabledBufferOptimization": { "alias": "enabledBufferOptimization"; "required": false; }; "itemRenderer": { "alias": "itemRenderer"; "required": false; }; "itemConfigMap": { "alias": "itemConfigMap"; "required": false; }; "itemSize": { "alias": "itemSize"; "required": false; }; "dynamicSize": { "alias": "dynamicSize"; "required": false; }; "direction": { "alias": "direction"; "required": false; }; "collectionMode": { "alias": "collectionMode"; "required": false; }; "bufferSize": { "alias": "bufferSize"; "required": false; }; "maxBufferSize": { "alias": "maxBufferSize"; "required": false; }; "snappingMethod": { "alias": "snappingMethod"; "required": false; }; "methodForSelecting": { "alias": "methodForSelecting"; "required": false; }; "trackBy": { "alias": "trackBy"; "required": false; }; }, { "onScroll": "onScroll"; "onScrollEnd": "onScrollEnd"; "onViewportChange": "onViewportChange"; "onItemClick": "onItemClick"; "onSelect": "onSelect"; "onCollapse": "onCollapse"; "onScrollReachStart": "onScrollReachStart"; "onScrollReachEnd": "onScrollReachEnd"; }, never, never, false, never>;
|
|
306
322
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { TrackBox } from './utils/trackBox';
|
|
2
2
|
import { IRenderVirtualListItem } from './models';
|
|
3
|
-
import { Id } from './types';
|
|
4
|
-
import { MethodsForSelectingTypes } from './enums/method-for-selecting-types';
|
|
5
3
|
import { IRenderVirtualListCollection } from './models/render-collection.model';
|
|
4
|
+
import { MethodsForSelectingTypes } from './enums/method-for-selecting-types';
|
|
5
|
+
import { FocusAlignment, Id } from './types';
|
|
6
6
|
import * as i0 from "@angular/core";
|
|
7
7
|
export declare class NgVirtualListService {
|
|
8
8
|
private _nextComponentId;
|
|
@@ -41,8 +41,8 @@ export declare class NgVirtualListService {
|
|
|
41
41
|
*/
|
|
42
42
|
collapse(data: IRenderVirtualListItem | undefined, collapsed?: boolean | undefined): void;
|
|
43
43
|
initialize(trackBox: TrackBox): void;
|
|
44
|
-
itemToFocus: ((element: HTMLElement, position: number) => void) | undefined;
|
|
45
|
-
focus(element: HTMLElement): void;
|
|
44
|
+
itemToFocus: ((element: HTMLElement, position: number, align: FocusAlignment) => void) | undefined;
|
|
45
|
+
focus(element: HTMLElement, align?: FocusAlignment): void;
|
|
46
46
|
areaFocus(id: Id | null): void;
|
|
47
47
|
generateComponentId(): number;
|
|
48
48
|
static ɵfac: i0.ɵɵFactoryDeclaration<NgVirtualListService, never>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { FocusAlignments } from "../enums";
|
|
2
|
+
/**
|
|
3
|
+
* Focus Alignment
|
|
4
|
+
* @link https://github.com/DjonnyX/ng-virtual-list/blob/16.x/projects/ng-virtual-list/src/lib/types/focus-alignment.ts
|
|
5
|
+
* @author Evgenii Grebennikov
|
|
6
|
+
* @email djonnyx@gmail.com
|
|
7
|
+
*/
|
|
8
|
+
export type FocusAlignment = FocusAlignments | 'none' | 'start' | 'center' | 'end';
|
package/lib/types/index.d.ts
CHANGED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { CollectionMode } from "../enums";
|
|
2
|
+
/**
|
|
3
|
+
* Determines the axis membership of a virtual list
|
|
4
|
+
* @link https://github.com/DjonnyX/ng-virtual-list/blob/16.x/projects/ng-virtual-list/src/lib/utils/isCollectionMode.ts
|
|
5
|
+
* @author Evgenii Grebennikov
|
|
6
|
+
* @email djonnyx@gmail.com
|
|
7
|
+
*/
|
|
8
|
+
export declare const isCollectionMode: (src: CollectionMode, expected: CollectionMode) => boolean;
|
package/lib/utils/trackBox.d.ts
CHANGED
|
@@ -7,7 +7,10 @@ import { ISize } from "../types";
|
|
|
7
7
|
import { HEIGHT_PROP_NAME, WIDTH_PROP_NAME } from "../const";
|
|
8
8
|
import { IVirtualListItemConfigMap } from "../models";
|
|
9
9
|
import { BaseVirtualListItemComponent } from "../models/base-virtual-list-item-component";
|
|
10
|
-
export declare
|
|
10
|
+
export declare enum TrackBoxEvents {
|
|
11
|
+
CHANGE = "change",
|
|
12
|
+
RESET = "reset"
|
|
13
|
+
}
|
|
11
14
|
export interface IMetrics {
|
|
12
15
|
delta: number;
|
|
13
16
|
normalizedItemWidth: number;
|
|
@@ -68,9 +71,10 @@ export interface IUpdateCollectionOptions<I extends {
|
|
|
68
71
|
id: Id;
|
|
69
72
|
}, C extends Array<I>> extends Omit<IRecalculateMetricsOptions<I, C>, 'collection' | 'previousTotalSize' | 'crudDetected' | 'deletedItemsMap'> {
|
|
70
73
|
}
|
|
71
|
-
export type CacheMapEvents =
|
|
74
|
+
export type CacheMapEvents = TrackBoxEvents.CHANGE | TrackBoxEvents.RESET;
|
|
72
75
|
export type OnChangeEventListener = (version: number) => void;
|
|
73
|
-
export type
|
|
76
|
+
export type OnResetEventListener = (reseted: boolean) => void;
|
|
77
|
+
export type CacheMapListeners = OnChangeEventListener | OnResetEventListener;
|
|
74
78
|
export declare enum ItemDisplayMethods {
|
|
75
79
|
CREATE = 0,
|
|
76
80
|
UPDATE = 1,
|
|
@@ -83,17 +87,18 @@ export interface IUpdateCollectionReturns {
|
|
|
83
87
|
delta: number;
|
|
84
88
|
crudDetected: boolean;
|
|
85
89
|
}
|
|
90
|
+
type Cache = ISize & {
|
|
91
|
+
method?: ItemDisplayMethods;
|
|
92
|
+
} & {
|
|
93
|
+
[prop: string]: any;
|
|
94
|
+
};
|
|
86
95
|
/**
|
|
87
96
|
* An object that performs tracking, calculations and caching.
|
|
88
97
|
* @link https://github.com/DjonnyX/ng-virtual-list/blob/16.x/projects/ng-virtual-list/src/lib/utils/trackBox.ts
|
|
89
98
|
* @author Evgenii Grebennikov
|
|
90
99
|
* @email djonnyx@gmail.com
|
|
91
100
|
*/
|
|
92
|
-
export declare class TrackBox<C extends BaseVirtualListItemComponent = any> extends CacheMap<Id,
|
|
93
|
-
method?: ItemDisplayMethods;
|
|
94
|
-
} & {
|
|
95
|
-
[prop: string]: any;
|
|
96
|
-
}, CacheMapEvents, CacheMapListeners> {
|
|
101
|
+
export declare class TrackBox<C extends BaseVirtualListItemComponent = any> extends CacheMap<Id, Cache, CacheMapEvents, CacheMapListeners> {
|
|
97
102
|
protected _tracker: Tracker<C>;
|
|
98
103
|
protected _items: IRenderVirtualListCollection | null | undefined;
|
|
99
104
|
set items(v: IRenderVirtualListCollection | null | undefined);
|
|
@@ -103,6 +108,8 @@ export declare class TrackBox<C extends BaseVirtualListItemComponent = any> exte
|
|
|
103
108
|
set snapedDisplayComponent(v: ComponentRef<C> | null | undefined);
|
|
104
109
|
protected _isSnappingMethodAdvanced: boolean;
|
|
105
110
|
set isSnappingMethodAdvanced(v: boolean);
|
|
111
|
+
protected _isLazy: boolean;
|
|
112
|
+
set isLazy(v: boolean);
|
|
106
113
|
/**
|
|
107
114
|
* Set the trackBy property
|
|
108
115
|
*/
|
|
@@ -133,7 +140,7 @@ export declare class TrackBox<C extends BaseVirtualListItemComponent = any> exte
|
|
|
133
140
|
protected _maxBufferSize: number;
|
|
134
141
|
protected _resetBufferSizeTimeout: number;
|
|
135
142
|
protected _resetBufferSizeTimer: number | undefined;
|
|
136
|
-
protected
|
|
143
|
+
protected isReseted: boolean;
|
|
137
144
|
protected lifeCircle(): void;
|
|
138
145
|
/**
|
|
139
146
|
* Scans the collection for deleted items and flushes the deleted item cache.
|
|
@@ -208,3 +215,4 @@ export declare class TrackBox<C extends BaseVirtualListItemComponent = any> exte
|
|
|
208
215
|
protected cacheElements(): void;
|
|
209
216
|
dispose(): void;
|
|
210
217
|
}
|
|
218
|
+
export {};
|