ngx-vflow 1.8.0 → 1.8.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.
- package/esm2022/lib/vflow/components/edge/edge.component.mjs +3 -3
- package/esm2022/lib/vflow/components/vflow/vflow.component.mjs +5 -3
- package/esm2022/lib/vflow/directives/lazy-for.directive.mjs +243 -0
- package/fesm2022/ngx-vflow.mjs +246 -6
- package/fesm2022/ngx-vflow.mjs.map +1 -1
- package/lib/vflow/directives/lazy-for.directive.d.ts +94 -0
- package/package.json +1 -1
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { DoCheck, NgIterable, TemplateRef, TrackByFunction } from '@angular/core';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
/**
|
|
4
|
+
* Context for an element in lazyFor
|
|
5
|
+
*/
|
|
6
|
+
declare class LazyForContextModel<T, U extends NgIterable<T> = NgIterable<T>> {
|
|
7
|
+
$implicit: T;
|
|
8
|
+
lazyFor: U;
|
|
9
|
+
index: number;
|
|
10
|
+
count: number;
|
|
11
|
+
/** Whether the element is first */
|
|
12
|
+
get first(): boolean;
|
|
13
|
+
/** Whether the element is last */
|
|
14
|
+
get last(): boolean;
|
|
15
|
+
/** Whether the element is even */
|
|
16
|
+
get even(): boolean;
|
|
17
|
+
/** Whether the element is odd */
|
|
18
|
+
get odd(): boolean;
|
|
19
|
+
constructor($implicit: T, lazyFor: U, index: number, count: number);
|
|
20
|
+
}
|
|
21
|
+
export declare class LazyForDirective<T, U extends NgIterable<T> = NgIterable<T>> implements DoCheck {
|
|
22
|
+
private _template;
|
|
23
|
+
private _viewContainer;
|
|
24
|
+
private _differs;
|
|
25
|
+
private _cdr;
|
|
26
|
+
private _destroyRef$;
|
|
27
|
+
/**
|
|
28
|
+
* Asserts the correct type of the context for the template that `lazyFor` will render.
|
|
29
|
+
*
|
|
30
|
+
* The presence of this method is a signal to the Ivy template type-check compiler that the
|
|
31
|
+
* `lazyFor` structural directive renders its template with a specific context type.
|
|
32
|
+
*/
|
|
33
|
+
static ngTemplateContextGuard<T, U extends NgIterable<T>>(dir: LazyForDirective<T, U>, ctx: any): ctx is LazyForContextModel<T, U>;
|
|
34
|
+
/** Setter for the array to be rendered by the directive */
|
|
35
|
+
set lazyForOf(lazyFor: (U & NgIterable<T>) | undefined | null);
|
|
36
|
+
/**
|
|
37
|
+
* Input - setter for TrackBy function
|
|
38
|
+
* @description is required
|
|
39
|
+
*/
|
|
40
|
+
set lazyForTrackBy(fn: TrackByFunction<T>);
|
|
41
|
+
/**
|
|
42
|
+
* Setter for the number of items that will be rendered per frame
|
|
43
|
+
* @param value number of items that will be rendered per frame
|
|
44
|
+
*/
|
|
45
|
+
set lazyForItemsPerFrame(value: number);
|
|
46
|
+
/** Setter for array item template */
|
|
47
|
+
set lazyForTemplate(value: TemplateRef<LazyForContextModel<T, U>>);
|
|
48
|
+
/** Getter for TrackBy function */
|
|
49
|
+
get lazyForTrackBy(): TrackByFunction<T>;
|
|
50
|
+
/** Array for rendering */
|
|
51
|
+
private _lazyFor;
|
|
52
|
+
/** lazyFor initialization flag */
|
|
53
|
+
private _lazyForDirty;
|
|
54
|
+
/** Differ for tracking changes in input array */
|
|
55
|
+
private _differ;
|
|
56
|
+
/** trackBy function */
|
|
57
|
+
private _trackByFn;
|
|
58
|
+
/** Number of items to be rendered per frame */
|
|
59
|
+
private _itemsPerFrame;
|
|
60
|
+
/** Directive state */
|
|
61
|
+
private _lazyForState;
|
|
62
|
+
/** Private subject for stopping dynamic render process */
|
|
63
|
+
private readonly _rerenderUnsub$;
|
|
64
|
+
constructor();
|
|
65
|
+
/** ngDoCheck hook */
|
|
66
|
+
ngDoCheck(): void;
|
|
67
|
+
/**
|
|
68
|
+
* Apply changes detected by differ
|
|
69
|
+
* @param changes changes
|
|
70
|
+
*/
|
|
71
|
+
private applyChanges;
|
|
72
|
+
/**
|
|
73
|
+
* Perform lazy rendering
|
|
74
|
+
* @param itemDataListToRender list of items to render
|
|
75
|
+
* @param changes changes
|
|
76
|
+
*/
|
|
77
|
+
private performLazyRender;
|
|
78
|
+
/** Update context (without implicit$) for elements inside view */
|
|
79
|
+
private updateViewContext;
|
|
80
|
+
/**
|
|
81
|
+
* Apply implicit$ context
|
|
82
|
+
* @param view view
|
|
83
|
+
* @param record data
|
|
84
|
+
*/
|
|
85
|
+
private applyViewChange;
|
|
86
|
+
/**
|
|
87
|
+
* Update directive state
|
|
88
|
+
* @param stateToSet state to set
|
|
89
|
+
*/
|
|
90
|
+
private updateLazyForState;
|
|
91
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<LazyForDirective<any, any>, never>;
|
|
92
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<LazyForDirective<any, any>, "[lazyFor][lazyForOf]", never, { "lazyForOf": { "alias": "lazyForOf"; "required": false; }; "lazyForTrackBy": { "alias": "lazyForTrackBy"; "required": true; }; "lazyForItemsPerFrame": { "alias": "lazyForItemsPerFrame"; "required": false; }; "lazyForTemplate": { "alias": "lazyForTemplate"; "required": false; }; }, {}, never, never, true, never>;
|
|
93
|
+
}
|
|
94
|
+
export {};
|