lazy-render-virtual-scroll 1.3.0 → 1.5.0
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 +42 -11
- package/backend-helpers/README.md +233 -0
- package/backend-helpers/example.ts +114 -0
- package/backend-helpers/frontend-example.tsx +122 -0
- package/backend-helpers/pagination.ts +159 -0
- package/dist/cjs/adapters/react/adapters/vanilla/LazyScrollElement.d.ts +370 -0
- package/dist/cjs/adapters/react/adapters/vanilla/LazyScrollElement.d.ts.map +1 -0
- package/dist/cjs/adapters/react/index.d.ts +12 -1
- package/dist/cjs/adapters/react/index.d.ts.map +1 -1
- package/dist/cjs/adapters/vanilla/LazyScrollElement.d.ts +370 -0
- package/dist/cjs/adapters/vanilla/LazyScrollElement.d.ts.map +1 -0
- package/dist/cjs/angular/adapters/vanilla/LazyScrollElement.d.ts +370 -0
- package/dist/cjs/angular/adapters/vanilla/LazyScrollElement.d.ts.map +1 -0
- package/dist/cjs/angular/index.d.ts +12 -1
- package/dist/cjs/angular/index.d.ts.map +1 -1
- package/dist/cjs/index.d.ts +12 -1
- package/dist/cjs/index.d.ts.map +1 -1
- package/dist/cjs/index.js +13 -153
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/svelte/adapters/vanilla/LazyScrollElement.d.ts +370 -0
- package/dist/cjs/svelte/adapters/vanilla/LazyScrollElement.d.ts.map +1 -0
- package/dist/cjs/svelte/index.d.ts +12 -1
- package/dist/cjs/svelte/index.d.ts.map +1 -1
- package/dist/cjs/vue/adapters/vanilla/LazyScrollElement.d.ts +370 -0
- package/dist/cjs/vue/adapters/vanilla/LazyScrollElement.d.ts.map +1 -0
- package/dist/cjs/vue/index.d.ts +12 -1
- package/dist/cjs/vue/index.d.ts.map +1 -1
- package/dist/esm/adapters/react/adapters/vanilla/LazyScrollElement.d.ts +370 -0
- package/dist/esm/adapters/react/adapters/vanilla/LazyScrollElement.d.ts.map +1 -0
- package/dist/esm/adapters/react/index.d.ts +12 -1
- package/dist/esm/adapters/react/index.d.ts.map +1 -1
- package/dist/esm/adapters/vanilla/LazyScrollElement.d.ts +370 -0
- package/dist/esm/adapters/vanilla/LazyScrollElement.d.ts.map +1 -0
- package/dist/esm/angular/adapters/vanilla/LazyScrollElement.d.ts +370 -0
- package/dist/esm/angular/adapters/vanilla/LazyScrollElement.d.ts.map +1 -0
- package/dist/esm/angular/index.d.ts +12 -1
- package/dist/esm/angular/index.d.ts.map +1 -1
- package/dist/esm/index.d.ts +12 -1
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +13 -153
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/svelte/adapters/vanilla/LazyScrollElement.d.ts +370 -0
- package/dist/esm/svelte/adapters/vanilla/LazyScrollElement.d.ts.map +1 -0
- package/dist/esm/svelte/index.d.ts +12 -1
- package/dist/esm/svelte/index.d.ts.map +1 -1
- package/dist/esm/vue/adapters/vanilla/LazyScrollElement.d.ts +370 -0
- package/dist/esm/vue/adapters/vanilla/LazyScrollElement.d.ts.map +1 -0
- package/dist/esm/vue/index.d.ts +12 -1
- package/dist/esm/vue/index.d.ts.map +1 -1
- package/dist/index.d.ts +12 -153
- package/package.json +6 -6
|
@@ -0,0 +1,370 @@
|
|
|
1
|
+
declare class SSRSafeLazyScrollElement {
|
|
2
|
+
private isServer;
|
|
3
|
+
private itemHeight;
|
|
4
|
+
private viewportHeight;
|
|
5
|
+
private bufferSize;
|
|
6
|
+
private items;
|
|
7
|
+
constructor();
|
|
8
|
+
private createBrowserElement;
|
|
9
|
+
setItems(items: any[]): void;
|
|
10
|
+
refresh(): void;
|
|
11
|
+
getVisibleRange(): any;
|
|
12
|
+
static registerElement(): void;
|
|
13
|
+
}
|
|
14
|
+
declare const _default: typeof SSRSafeLazyScrollElement | {
|
|
15
|
+
new (): {
|
|
16
|
+
accessKey: string;
|
|
17
|
+
readonly accessKeyLabel: string;
|
|
18
|
+
autocapitalize: string;
|
|
19
|
+
autocorrect: boolean;
|
|
20
|
+
dir: string;
|
|
21
|
+
draggable: boolean;
|
|
22
|
+
hidden: boolean;
|
|
23
|
+
inert: boolean;
|
|
24
|
+
innerText: string;
|
|
25
|
+
lang: string;
|
|
26
|
+
readonly offsetHeight: number;
|
|
27
|
+
readonly offsetLeft: number;
|
|
28
|
+
readonly offsetParent: Element | null;
|
|
29
|
+
readonly offsetTop: number;
|
|
30
|
+
readonly offsetWidth: number;
|
|
31
|
+
outerText: string;
|
|
32
|
+
popover: string | null;
|
|
33
|
+
spellcheck: boolean;
|
|
34
|
+
title: string;
|
|
35
|
+
translate: boolean;
|
|
36
|
+
writingSuggestions: string;
|
|
37
|
+
attachInternals(): ElementInternals;
|
|
38
|
+
click(): void;
|
|
39
|
+
hidePopover(): void;
|
|
40
|
+
showPopover(): void;
|
|
41
|
+
togglePopover(options?: boolean): boolean;
|
|
42
|
+
addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
43
|
+
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
44
|
+
removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
45
|
+
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
46
|
+
readonly attributes: NamedNodeMap;
|
|
47
|
+
get classList(): DOMTokenList;
|
|
48
|
+
set classList(value: string);
|
|
49
|
+
className: string;
|
|
50
|
+
readonly clientHeight: number;
|
|
51
|
+
readonly clientLeft: number;
|
|
52
|
+
readonly clientTop: number;
|
|
53
|
+
readonly clientWidth: number;
|
|
54
|
+
readonly currentCSSZoom: number;
|
|
55
|
+
id: string;
|
|
56
|
+
innerHTML: string;
|
|
57
|
+
readonly localName: string;
|
|
58
|
+
readonly namespaceURI: string | null;
|
|
59
|
+
onfullscreenchange: ((this: Element, ev: Event) => any) | null;
|
|
60
|
+
onfullscreenerror: ((this: Element, ev: Event) => any) | null;
|
|
61
|
+
outerHTML: string;
|
|
62
|
+
readonly ownerDocument: Document;
|
|
63
|
+
get part(): DOMTokenList;
|
|
64
|
+
set part(value: string);
|
|
65
|
+
readonly prefix: string | null;
|
|
66
|
+
readonly scrollHeight: number;
|
|
67
|
+
scrollLeft: number;
|
|
68
|
+
scrollTop: number;
|
|
69
|
+
readonly scrollWidth: number;
|
|
70
|
+
readonly shadowRoot: ShadowRoot | null;
|
|
71
|
+
slot: string;
|
|
72
|
+
readonly tagName: string;
|
|
73
|
+
attachShadow(init: ShadowRootInit): ShadowRoot;
|
|
74
|
+
checkVisibility(options?: CheckVisibilityOptions): boolean;
|
|
75
|
+
closest<K extends keyof HTMLElementTagNameMap>(selector: K): HTMLElementTagNameMap[K] | null;
|
|
76
|
+
closest<K extends keyof SVGElementTagNameMap>(selector: K): SVGElementTagNameMap[K] | null;
|
|
77
|
+
closest<K extends keyof MathMLElementTagNameMap>(selector: K): MathMLElementTagNameMap[K] | null;
|
|
78
|
+
closest<E extends Element = Element>(selectors: string): E | null;
|
|
79
|
+
computedStyleMap(): StylePropertyMapReadOnly;
|
|
80
|
+
getAttribute(qualifiedName: string): string | null;
|
|
81
|
+
getAttributeNS(namespace: string | null, localName: string): string | null;
|
|
82
|
+
getAttributeNames(): string[];
|
|
83
|
+
getAttributeNode(qualifiedName: string): Attr | null;
|
|
84
|
+
getAttributeNodeNS(namespace: string | null, localName: string): Attr | null;
|
|
85
|
+
getBoundingClientRect(): DOMRect;
|
|
86
|
+
getClientRects(): DOMRectList;
|
|
87
|
+
getElementsByClassName(classNames: string): HTMLCollectionOf<Element>;
|
|
88
|
+
getElementsByTagName<K extends keyof HTMLElementTagNameMap>(qualifiedName: K): HTMLCollectionOf<HTMLElementTagNameMap[K]>;
|
|
89
|
+
getElementsByTagName<K extends keyof SVGElementTagNameMap>(qualifiedName: K): HTMLCollectionOf<SVGElementTagNameMap[K]>;
|
|
90
|
+
getElementsByTagName<K extends keyof MathMLElementTagNameMap>(qualifiedName: K): HTMLCollectionOf<MathMLElementTagNameMap[K]>;
|
|
91
|
+
getElementsByTagName<K extends keyof HTMLElementDeprecatedTagNameMap>(qualifiedName: K): HTMLCollectionOf<HTMLElementDeprecatedTagNameMap[K]>;
|
|
92
|
+
getElementsByTagName(qualifiedName: string): HTMLCollectionOf<Element>;
|
|
93
|
+
getElementsByTagNameNS(namespaceURI: "http://www.w3.org/1999/xhtml", localName: string): HTMLCollectionOf<HTMLElement>;
|
|
94
|
+
getElementsByTagNameNS(namespaceURI: "http://www.w3.org/2000/svg", localName: string): HTMLCollectionOf<SVGElement>;
|
|
95
|
+
getElementsByTagNameNS(namespaceURI: "http://www.w3.org/1998/Math/MathML", localName: string): HTMLCollectionOf<MathMLElement>;
|
|
96
|
+
getElementsByTagNameNS(namespace: string | null, localName: string): HTMLCollectionOf<Element>;
|
|
97
|
+
getHTML(options?: GetHTMLOptions): string;
|
|
98
|
+
hasAttribute(qualifiedName: string): boolean;
|
|
99
|
+
hasAttributeNS(namespace: string | null, localName: string): boolean;
|
|
100
|
+
hasAttributes(): boolean;
|
|
101
|
+
hasPointerCapture(pointerId: number): boolean;
|
|
102
|
+
insertAdjacentElement(where: InsertPosition, element: Element): Element | null;
|
|
103
|
+
insertAdjacentHTML(position: InsertPosition, string: string): void;
|
|
104
|
+
insertAdjacentText(where: InsertPosition, data: string): void;
|
|
105
|
+
matches(selectors: string): boolean;
|
|
106
|
+
releasePointerCapture(pointerId: number): void;
|
|
107
|
+
removeAttribute(qualifiedName: string): void;
|
|
108
|
+
removeAttributeNS(namespace: string | null, localName: string): void;
|
|
109
|
+
removeAttributeNode(attr: Attr): Attr;
|
|
110
|
+
requestFullscreen(options?: FullscreenOptions): Promise<void>;
|
|
111
|
+
requestPointerLock(options?: PointerLockOptions): Promise<void>;
|
|
112
|
+
scroll(options?: ScrollToOptions): void;
|
|
113
|
+
scroll(x: number, y: number): void;
|
|
114
|
+
scrollBy(options?: ScrollToOptions): void;
|
|
115
|
+
scrollBy(x: number, y: number): void;
|
|
116
|
+
scrollIntoView(arg?: boolean | ScrollIntoViewOptions): void;
|
|
117
|
+
scrollTo(options?: ScrollToOptions): void;
|
|
118
|
+
scrollTo(x: number, y: number): void;
|
|
119
|
+
setAttribute(qualifiedName: string, value: string): void;
|
|
120
|
+
setAttributeNS(namespace: string | null, qualifiedName: string, value: string): void;
|
|
121
|
+
setAttributeNode(attr: Attr): Attr | null;
|
|
122
|
+
setAttributeNodeNS(attr: Attr): Attr | null;
|
|
123
|
+
setHTMLUnsafe(html: string): void;
|
|
124
|
+
setPointerCapture(pointerId: number): void;
|
|
125
|
+
toggleAttribute(qualifiedName: string, force?: boolean): boolean;
|
|
126
|
+
webkitMatchesSelector(selectors: string): boolean;
|
|
127
|
+
get textContent(): string;
|
|
128
|
+
set textContent(value: string | null);
|
|
129
|
+
readonly baseURI: string;
|
|
130
|
+
readonly childNodes: NodeListOf<ChildNode>;
|
|
131
|
+
readonly firstChild: ChildNode | null;
|
|
132
|
+
readonly isConnected: boolean;
|
|
133
|
+
readonly lastChild: ChildNode | null;
|
|
134
|
+
readonly nextSibling: ChildNode | null;
|
|
135
|
+
readonly nodeName: string;
|
|
136
|
+
readonly nodeType: number;
|
|
137
|
+
nodeValue: string | null;
|
|
138
|
+
readonly parentElement: HTMLElement | null;
|
|
139
|
+
readonly parentNode: ParentNode | null;
|
|
140
|
+
readonly previousSibling: ChildNode | null;
|
|
141
|
+
appendChild<T extends Node>(node: T): T;
|
|
142
|
+
cloneNode(subtree?: boolean): Node;
|
|
143
|
+
compareDocumentPosition(other: Node): number;
|
|
144
|
+
contains(other: Node | null): boolean;
|
|
145
|
+
getRootNode(options?: GetRootNodeOptions): Node;
|
|
146
|
+
hasChildNodes(): boolean;
|
|
147
|
+
insertBefore<T extends Node>(node: T, child: Node | null): T;
|
|
148
|
+
isDefaultNamespace(namespace: string | null): boolean;
|
|
149
|
+
isEqualNode(otherNode: Node | null): boolean;
|
|
150
|
+
isSameNode(otherNode: Node | null): boolean;
|
|
151
|
+
lookupNamespaceURI(prefix: string | null): string | null;
|
|
152
|
+
lookupPrefix(namespace: string | null): string | null;
|
|
153
|
+
normalize(): void;
|
|
154
|
+
removeChild<T extends Node>(child: T): T;
|
|
155
|
+
replaceChild<T extends Node>(node: Node, child: T): T;
|
|
156
|
+
readonly ELEMENT_NODE: 1;
|
|
157
|
+
readonly ATTRIBUTE_NODE: 2;
|
|
158
|
+
readonly TEXT_NODE: 3;
|
|
159
|
+
readonly CDATA_SECTION_NODE: 4;
|
|
160
|
+
readonly ENTITY_REFERENCE_NODE: 5;
|
|
161
|
+
readonly ENTITY_NODE: 6;
|
|
162
|
+
readonly PROCESSING_INSTRUCTION_NODE: 7;
|
|
163
|
+
readonly COMMENT_NODE: 8;
|
|
164
|
+
readonly DOCUMENT_NODE: 9;
|
|
165
|
+
readonly DOCUMENT_TYPE_NODE: 10;
|
|
166
|
+
readonly DOCUMENT_FRAGMENT_NODE: 11;
|
|
167
|
+
readonly NOTATION_NODE: 12;
|
|
168
|
+
readonly DOCUMENT_POSITION_DISCONNECTED: 1;
|
|
169
|
+
readonly DOCUMENT_POSITION_PRECEDING: 2;
|
|
170
|
+
readonly DOCUMENT_POSITION_FOLLOWING: 4;
|
|
171
|
+
readonly DOCUMENT_POSITION_CONTAINS: 8;
|
|
172
|
+
readonly DOCUMENT_POSITION_CONTAINED_BY: 16;
|
|
173
|
+
readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: 32;
|
|
174
|
+
dispatchEvent(event: Event): boolean;
|
|
175
|
+
ariaActiveDescendantElement: Element | null;
|
|
176
|
+
ariaAtomic: string | null;
|
|
177
|
+
ariaAutoComplete: string | null;
|
|
178
|
+
ariaBrailleLabel: string | null;
|
|
179
|
+
ariaBrailleRoleDescription: string | null;
|
|
180
|
+
ariaBusy: string | null;
|
|
181
|
+
ariaChecked: string | null;
|
|
182
|
+
ariaColCount: string | null;
|
|
183
|
+
ariaColIndex: string | null;
|
|
184
|
+
ariaColIndexText: string | null;
|
|
185
|
+
ariaColSpan: string | null;
|
|
186
|
+
ariaControlsElements: ReadonlyArray<Element> | null;
|
|
187
|
+
ariaCurrent: string | null;
|
|
188
|
+
ariaDescribedByElements: ReadonlyArray<Element> | null;
|
|
189
|
+
ariaDescription: string | null;
|
|
190
|
+
ariaDetailsElements: ReadonlyArray<Element> | null;
|
|
191
|
+
ariaDisabled: string | null;
|
|
192
|
+
ariaErrorMessageElements: ReadonlyArray<Element> | null;
|
|
193
|
+
ariaExpanded: string | null;
|
|
194
|
+
ariaFlowToElements: ReadonlyArray<Element> | null;
|
|
195
|
+
ariaHasPopup: string | null;
|
|
196
|
+
ariaHidden: string | null;
|
|
197
|
+
ariaInvalid: string | null;
|
|
198
|
+
ariaKeyShortcuts: string | null;
|
|
199
|
+
ariaLabel: string | null;
|
|
200
|
+
ariaLabelledByElements: ReadonlyArray<Element> | null;
|
|
201
|
+
ariaLevel: string | null;
|
|
202
|
+
ariaLive: string | null;
|
|
203
|
+
ariaModal: string | null;
|
|
204
|
+
ariaMultiLine: string | null;
|
|
205
|
+
ariaMultiSelectable: string | null;
|
|
206
|
+
ariaOrientation: string | null;
|
|
207
|
+
ariaOwnsElements: ReadonlyArray<Element> | null;
|
|
208
|
+
ariaPlaceholder: string | null;
|
|
209
|
+
ariaPosInSet: string | null;
|
|
210
|
+
ariaPressed: string | null;
|
|
211
|
+
ariaReadOnly: string | null;
|
|
212
|
+
ariaRelevant: string | null;
|
|
213
|
+
ariaRequired: string | null;
|
|
214
|
+
ariaRoleDescription: string | null;
|
|
215
|
+
ariaRowCount: string | null;
|
|
216
|
+
ariaRowIndex: string | null;
|
|
217
|
+
ariaRowIndexText: string | null;
|
|
218
|
+
ariaRowSpan: string | null;
|
|
219
|
+
ariaSelected: string | null;
|
|
220
|
+
ariaSetSize: string | null;
|
|
221
|
+
ariaSort: string | null;
|
|
222
|
+
ariaValueMax: string | null;
|
|
223
|
+
ariaValueMin: string | null;
|
|
224
|
+
ariaValueNow: string | null;
|
|
225
|
+
ariaValueText: string | null;
|
|
226
|
+
role: string | null;
|
|
227
|
+
animate(keyframes: Keyframe[] | PropertyIndexedKeyframes | null, options?: number | KeyframeAnimationOptions): Animation;
|
|
228
|
+
getAnimations(options?: GetAnimationsOptions): Animation[];
|
|
229
|
+
after(...nodes: (Node | string)[]): void;
|
|
230
|
+
before(...nodes: (Node | string)[]): void;
|
|
231
|
+
remove(): void;
|
|
232
|
+
replaceWith(...nodes: (Node | string)[]): void;
|
|
233
|
+
readonly nextElementSibling: Element | null;
|
|
234
|
+
readonly previousElementSibling: Element | null;
|
|
235
|
+
readonly childElementCount: number;
|
|
236
|
+
readonly children: HTMLCollection;
|
|
237
|
+
readonly firstElementChild: Element | null;
|
|
238
|
+
readonly lastElementChild: Element | null;
|
|
239
|
+
append(...nodes: (Node | string)[]): void;
|
|
240
|
+
prepend(...nodes: (Node | string)[]): void;
|
|
241
|
+
querySelector<K extends keyof HTMLElementTagNameMap>(selectors: K): HTMLElementTagNameMap[K] | null;
|
|
242
|
+
querySelector<K extends keyof SVGElementTagNameMap>(selectors: K): SVGElementTagNameMap[K] | null;
|
|
243
|
+
querySelector<K extends keyof MathMLElementTagNameMap>(selectors: K): MathMLElementTagNameMap[K] | null;
|
|
244
|
+
querySelector<K extends keyof HTMLElementDeprecatedTagNameMap>(selectors: K): HTMLElementDeprecatedTagNameMap[K] | null;
|
|
245
|
+
querySelector<E extends Element = Element>(selectors: string): E | null;
|
|
246
|
+
querySelectorAll<K extends keyof HTMLElementTagNameMap>(selectors: K): NodeListOf<HTMLElementTagNameMap[K]>;
|
|
247
|
+
querySelectorAll<K extends keyof SVGElementTagNameMap>(selectors: K): NodeListOf<SVGElementTagNameMap[K]>;
|
|
248
|
+
querySelectorAll<K extends keyof MathMLElementTagNameMap>(selectors: K): NodeListOf<MathMLElementTagNameMap[K]>;
|
|
249
|
+
querySelectorAll<K extends keyof HTMLElementDeprecatedTagNameMap>(selectors: K): NodeListOf<HTMLElementDeprecatedTagNameMap[K]>;
|
|
250
|
+
querySelectorAll<E extends Element = Element>(selectors: string): NodeListOf<E>;
|
|
251
|
+
replaceChildren(...nodes: (Node | string)[]): void;
|
|
252
|
+
readonly assignedSlot: HTMLSlotElement | null;
|
|
253
|
+
readonly attributeStyleMap: StylePropertyMap;
|
|
254
|
+
get style(): CSSStyleDeclaration;
|
|
255
|
+
set style(cssText: string);
|
|
256
|
+
contentEditable: string;
|
|
257
|
+
enterKeyHint: string;
|
|
258
|
+
inputMode: string;
|
|
259
|
+
readonly isContentEditable: boolean;
|
|
260
|
+
onabort: ((this: GlobalEventHandlers, ev: UIEvent) => any) | null;
|
|
261
|
+
onanimationcancel: ((this: GlobalEventHandlers, ev: AnimationEvent) => any) | null;
|
|
262
|
+
onanimationend: ((this: GlobalEventHandlers, ev: AnimationEvent) => any) | null;
|
|
263
|
+
onanimationiteration: ((this: GlobalEventHandlers, ev: AnimationEvent) => any) | null;
|
|
264
|
+
onanimationstart: ((this: GlobalEventHandlers, ev: AnimationEvent) => any) | null;
|
|
265
|
+
onauxclick: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
|
|
266
|
+
onbeforeinput: ((this: GlobalEventHandlers, ev: InputEvent) => any) | null;
|
|
267
|
+
onbeforematch: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
268
|
+
onbeforetoggle: ((this: GlobalEventHandlers, ev: ToggleEvent) => any) | null;
|
|
269
|
+
onblur: ((this: GlobalEventHandlers, ev: FocusEvent) => any) | null;
|
|
270
|
+
oncancel: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
271
|
+
oncanplay: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
272
|
+
oncanplaythrough: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
273
|
+
onchange: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
274
|
+
onclick: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
|
|
275
|
+
onclose: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
276
|
+
oncontextlost: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
277
|
+
oncontextmenu: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
|
|
278
|
+
oncontextrestored: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
279
|
+
oncopy: ((this: GlobalEventHandlers, ev: ClipboardEvent) => any) | null;
|
|
280
|
+
oncuechange: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
281
|
+
oncut: ((this: GlobalEventHandlers, ev: ClipboardEvent) => any) | null;
|
|
282
|
+
ondblclick: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
|
|
283
|
+
ondrag: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null;
|
|
284
|
+
ondragend: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null;
|
|
285
|
+
ondragenter: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null;
|
|
286
|
+
ondragleave: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null;
|
|
287
|
+
ondragover: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null;
|
|
288
|
+
ondragstart: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null;
|
|
289
|
+
ondrop: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null;
|
|
290
|
+
ondurationchange: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
291
|
+
onemptied: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
292
|
+
onended: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
293
|
+
onerror: OnErrorEventHandler;
|
|
294
|
+
onfocus: ((this: GlobalEventHandlers, ev: FocusEvent) => any) | null;
|
|
295
|
+
onformdata: ((this: GlobalEventHandlers, ev: FormDataEvent) => any) | null;
|
|
296
|
+
ongotpointercapture: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
|
|
297
|
+
oninput: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
298
|
+
oninvalid: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
299
|
+
onkeydown: ((this: GlobalEventHandlers, ev: KeyboardEvent) => any) | null;
|
|
300
|
+
onkeypress: ((this: GlobalEventHandlers, ev: KeyboardEvent) => any) | null;
|
|
301
|
+
onkeyup: ((this: GlobalEventHandlers, ev: KeyboardEvent) => any) | null;
|
|
302
|
+
onload: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
303
|
+
onloadeddata: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
304
|
+
onloadedmetadata: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
305
|
+
onloadstart: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
306
|
+
onlostpointercapture: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
|
|
307
|
+
onmousedown: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
|
|
308
|
+
onmouseenter: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
|
|
309
|
+
onmouseleave: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
|
|
310
|
+
onmousemove: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
|
|
311
|
+
onmouseout: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
|
|
312
|
+
onmouseover: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
|
|
313
|
+
onmouseup: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
|
|
314
|
+
onpaste: ((this: GlobalEventHandlers, ev: ClipboardEvent) => any) | null;
|
|
315
|
+
onpause: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
316
|
+
onplay: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
317
|
+
onplaying: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
318
|
+
onpointercancel: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
|
|
319
|
+
onpointerdown: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
|
|
320
|
+
onpointerenter: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
|
|
321
|
+
onpointerleave: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
|
|
322
|
+
onpointermove: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
|
|
323
|
+
onpointerout: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
|
|
324
|
+
onpointerover: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
|
|
325
|
+
onpointerrawupdate: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
326
|
+
onpointerup: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
|
|
327
|
+
onprogress: ((this: GlobalEventHandlers, ev: ProgressEvent) => any) | null;
|
|
328
|
+
onratechange: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
329
|
+
onreset: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
330
|
+
onresize: ((this: GlobalEventHandlers, ev: UIEvent) => any) | null;
|
|
331
|
+
onscroll: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
332
|
+
onscrollend: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
333
|
+
onsecuritypolicyviolation: ((this: GlobalEventHandlers, ev: SecurityPolicyViolationEvent) => any) | null;
|
|
334
|
+
onseeked: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
335
|
+
onseeking: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
336
|
+
onselect: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
337
|
+
onselectionchange: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
338
|
+
onselectstart: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
339
|
+
onslotchange: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
340
|
+
onstalled: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
341
|
+
onsubmit: ((this: GlobalEventHandlers, ev: SubmitEvent) => any) | null;
|
|
342
|
+
onsuspend: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
343
|
+
ontimeupdate: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
344
|
+
ontoggle: ((this: GlobalEventHandlers, ev: ToggleEvent) => any) | null;
|
|
345
|
+
ontouchcancel?: ((this: GlobalEventHandlers, ev: TouchEvent) => any) | null | undefined;
|
|
346
|
+
ontouchend?: ((this: GlobalEventHandlers, ev: TouchEvent) => any) | null | undefined;
|
|
347
|
+
ontouchmove?: ((this: GlobalEventHandlers, ev: TouchEvent) => any) | null | undefined;
|
|
348
|
+
ontouchstart?: ((this: GlobalEventHandlers, ev: TouchEvent) => any) | null | undefined;
|
|
349
|
+
ontransitioncancel: ((this: GlobalEventHandlers, ev: TransitionEvent) => any) | null;
|
|
350
|
+
ontransitionend: ((this: GlobalEventHandlers, ev: TransitionEvent) => any) | null;
|
|
351
|
+
ontransitionrun: ((this: GlobalEventHandlers, ev: TransitionEvent) => any) | null;
|
|
352
|
+
ontransitionstart: ((this: GlobalEventHandlers, ev: TransitionEvent) => any) | null;
|
|
353
|
+
onvolumechange: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
354
|
+
onwaiting: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
355
|
+
onwebkitanimationend: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
356
|
+
onwebkitanimationiteration: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
357
|
+
onwebkitanimationstart: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
358
|
+
onwebkittransitionend: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
359
|
+
onwheel: ((this: GlobalEventHandlers, ev: WheelEvent) => any) | null;
|
|
360
|
+
autofocus: boolean;
|
|
361
|
+
readonly dataset: DOMStringMap;
|
|
362
|
+
nonce?: string;
|
|
363
|
+
tabIndex: number;
|
|
364
|
+
blur(): void;
|
|
365
|
+
focus(options?: FocusOptions): void;
|
|
366
|
+
};
|
|
367
|
+
};
|
|
368
|
+
export default _default;
|
|
369
|
+
export declare function createLazyScrollElement(): HTMLElement | SSRSafeLazyScrollElement;
|
|
370
|
+
//# sourceMappingURL=LazyScrollElement.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LazyScrollElement.d.ts","sourceRoot":"","sources":["../../../src/adapters/vanilla/LazyScrollElement.ts"],"names":[],"mappings":"AACA,cAAM,wBAAwB;IAC5B,OAAO,CAAC,QAAQ,CAAU;IAC1B,OAAO,CAAC,UAAU,CAAS;IAC3B,OAAO,CAAC,cAAc,CAAS;IAC/B,OAAO,CAAC,UAAU,CAAS;IAC3B,OAAO,CAAC,KAAK,CAAQ;;IAkBrB,OAAO,CAAC,oBAAoB;IA8L5B,QAAQ,CAAC,KAAK,EAAE,GAAG,EAAE;IAMrB,OAAO;IAMP,eAAe;IAOf,MAAM,CAAC,eAAe;CAKvB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGD,wBAE6B;AAG7B,wBAAgB,uBAAuB,IAAI,WAAW,GAAG,wBAAwB,CAQhF"}
|
package/dist/esm/vue/index.d.ts
CHANGED
|
@@ -17,7 +17,18 @@ export { ScrollObserver } from './platform/browser/ScrollObserver';
|
|
|
17
17
|
export { useLazyList } from './adapters/react/useLazyList';
|
|
18
18
|
export { LazyList } from './adapters/react/LazyList';
|
|
19
19
|
export { LazyScroll, createLazyScroll } from './adapters/vanilla/lazyScroll';
|
|
20
|
-
|
|
20
|
+
declare class LazyScrollElementClass {
|
|
21
|
+
constructor();
|
|
22
|
+
setItems(items: any[]): void;
|
|
23
|
+
refresh(): void;
|
|
24
|
+
getVisibleRange(): {
|
|
25
|
+
start: number;
|
|
26
|
+
end: number;
|
|
27
|
+
};
|
|
28
|
+
static registerElement(): void;
|
|
29
|
+
}
|
|
30
|
+
declare const LazyScrollElement: typeof LazyScrollElementClass;
|
|
31
|
+
export { LazyScrollElement };
|
|
21
32
|
export { debounce } from './utils/debounce';
|
|
22
33
|
export { throttle } from './utils/throttle';
|
|
23
34
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,yBAAyB,EAAE,MAAM,kCAAkC,CAAC;AAC7E,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AACnE,OAAO,EAAE,2BAA2B,EAAE,MAAM,oCAAoC,CAAC;AACjF,OAAO,EAAE,wBAAwB,EAAE,MAAM,iCAAiC,CAAC;AAC3E,OAAO,EAAE,wBAAwB,EAAE,MAAM,iCAAiC,CAAC;AAC3E,OAAO,EAAE,wBAAwB,EAAE,MAAM,iCAAiC,CAAC;AAC3E,OAAO,EAAE,yBAAyB,EAAE,MAAM,kCAAkC,CAAC;AAC7E,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AACnE,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,iBAAiB,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAG/G,OAAO,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AAGnE,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAC3D,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAGrD,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,yBAAyB,EAAE,MAAM,kCAAkC,CAAC;AAC7E,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AACnE,OAAO,EAAE,2BAA2B,EAAE,MAAM,oCAAoC,CAAC;AACjF,OAAO,EAAE,wBAAwB,EAAE,MAAM,iCAAiC,CAAC;AAC3E,OAAO,EAAE,wBAAwB,EAAE,MAAM,iCAAiC,CAAC;AAC3E,OAAO,EAAE,wBAAwB,EAAE,MAAM,iCAAiC,CAAC;AAC3E,OAAO,EAAE,yBAAyB,EAAE,MAAM,kCAAkC,CAAC;AAC7E,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AACnE,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,iBAAiB,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAG/G,OAAO,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AAGnE,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAC3D,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAGrD,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAK7E,cAAM,sBAAsB;;IAE1B,QAAQ,CAAC,KAAK,EAAE,GAAG,EAAE;IACrB,OAAO;IACP,eAAe;;;;IACf,MAAM,CAAC,eAAe;CACvB;AAGD,QAAA,MAAM,iBAAiB,+BAEG,CAAC;AAE3B,OAAO,EAAE,iBAAiB,EAAE,CAAC;AAG7B,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -565,159 +565,6 @@ function createLazyScroll(container, config) {
|
|
|
565
565
|
return new LazyScroll(container, config);
|
|
566
566
|
}
|
|
567
567
|
|
|
568
|
-
class LazyScrollElement extends HTMLElement {
|
|
569
|
-
constructor() {
|
|
570
|
-
super();
|
|
571
|
-
this.shadow = this.attachShadow({ mode: 'open' });
|
|
572
|
-
|
|
573
|
-
// Default values
|
|
574
|
-
this.itemHeight = 50;
|
|
575
|
-
this.viewportHeight = 400;
|
|
576
|
-
this.bufferSize = 5;
|
|
577
|
-
this.items = [];
|
|
578
|
-
|
|
579
|
-
// Styles
|
|
580
|
-
const style = document.createElement('style');
|
|
581
|
-
style.textContent = `
|
|
582
|
-
:host {
|
|
583
|
-
display: block;
|
|
584
|
-
}
|
|
585
|
-
|
|
586
|
-
.lazy-scroll-container {
|
|
587
|
-
position: relative;
|
|
588
|
-
overflow-y: auto;
|
|
589
|
-
}
|
|
590
|
-
|
|
591
|
-
.lazy-item {
|
|
592
|
-
width: 100%;
|
|
593
|
-
}
|
|
594
|
-
|
|
595
|
-
.lazy-loading {
|
|
596
|
-
text-align: center;
|
|
597
|
-
padding: 20px;
|
|
598
|
-
color: #666;
|
|
599
|
-
}
|
|
600
|
-
`;
|
|
601
|
-
|
|
602
|
-
this.shadow.appendChild(style);
|
|
603
|
-
}
|
|
604
|
-
|
|
605
|
-
static get observedAttributes() {
|
|
606
|
-
return ['item-height', 'viewport-height', 'buffer-size'];
|
|
607
|
-
}
|
|
608
|
-
|
|
609
|
-
attributeChangedCallback(name, oldValue, newValue) {
|
|
610
|
-
switch (name) {
|
|
611
|
-
case 'item-height':
|
|
612
|
-
this.itemHeight = parseInt(newValue) || 50;
|
|
613
|
-
break;
|
|
614
|
-
case 'viewport-height':
|
|
615
|
-
this.viewportHeight = parseInt(newValue) || 400;
|
|
616
|
-
break;
|
|
617
|
-
case 'buffer-size':
|
|
618
|
-
this.bufferSize = parseInt(newValue) || 5;
|
|
619
|
-
break;
|
|
620
|
-
}
|
|
621
|
-
|
|
622
|
-
if (this.lazyScrollInstance) {
|
|
623
|
-
this.lazyScrollInstance.updateConfig({
|
|
624
|
-
itemHeight: this.itemHeight,
|
|
625
|
-
viewportHeight: this.viewportHeight,
|
|
626
|
-
bufferSize: this.bufferSize
|
|
627
|
-
});
|
|
628
|
-
}
|
|
629
|
-
}
|
|
630
|
-
|
|
631
|
-
connectedCallback() {
|
|
632
|
-
// Create container
|
|
633
|
-
this.container = document.createElement('div');
|
|
634
|
-
this.container.className = 'lazy-scroll-container';
|
|
635
|
-
this.container.style.height = `${this.viewportHeight}px`;
|
|
636
|
-
this.container.style.overflowY = 'auto';
|
|
637
|
-
|
|
638
|
-
this.shadow.appendChild(this.container);
|
|
639
|
-
|
|
640
|
-
// Get fetchMore function from attribute or slot
|
|
641
|
-
const fetchMoreAttr = this.getAttribute('fetch-more');
|
|
642
|
-
let fetchMoreFn = () => Promise.resolve([]);
|
|
643
|
-
|
|
644
|
-
if (fetchMoreAttr) {
|
|
645
|
-
try {
|
|
646
|
-
// If fetchMore is a function name in global scope
|
|
647
|
-
fetchMoreFn = window[fetchMoreAttr] || (() => Promise.resolve([]));
|
|
648
|
-
} catch (e) {
|
|
649
|
-
console.warn('Could not find fetchMore function:', fetchMoreAttr);
|
|
650
|
-
}
|
|
651
|
-
}
|
|
652
|
-
|
|
653
|
-
// Initialize lazy scroll
|
|
654
|
-
this.lazyScrollInstance = createLazyScroll(this.container, {
|
|
655
|
-
itemHeight: this.itemHeight,
|
|
656
|
-
viewportHeight: this.viewportHeight,
|
|
657
|
-
bufferSize: this.bufferSize,
|
|
658
|
-
fetchMore: fetchMoreFn
|
|
659
|
-
});
|
|
660
|
-
|
|
661
|
-
// Handle items from light DOM
|
|
662
|
-
this.updateItemsFromSlot();
|
|
663
|
-
|
|
664
|
-
// Observe child changes
|
|
665
|
-
this.mutationObserver = new MutationObserver(() => {
|
|
666
|
-
this.updateItemsFromSlot();
|
|
667
|
-
});
|
|
668
|
-
|
|
669
|
-
this.mutationObserver.observe(this, { childList: true, subtree: true });
|
|
670
|
-
}
|
|
671
|
-
|
|
672
|
-
disconnectedCallback() {
|
|
673
|
-
if (this.lazyScrollInstance) {
|
|
674
|
-
this.lazyScrollInstance.destroy();
|
|
675
|
-
}
|
|
676
|
-
|
|
677
|
-
if (this.mutationObserver) {
|
|
678
|
-
this.mutationObserver.disconnect();
|
|
679
|
-
}
|
|
680
|
-
}
|
|
681
|
-
|
|
682
|
-
updateItemsFromSlot() {
|
|
683
|
-
// Get items from light DOM or data attribute
|
|
684
|
-
const itemsData = this.getAttribute('items');
|
|
685
|
-
if (itemsData) {
|
|
686
|
-
try {
|
|
687
|
-
const items = JSON.parse(itemsData);
|
|
688
|
-
if (this.lazyScrollInstance) {
|
|
689
|
-
this.lazyScrollInstance.setItems(items);
|
|
690
|
-
}
|
|
691
|
-
} catch (e) {
|
|
692
|
-
console.warn('Could not parse items data:', itemsData);
|
|
693
|
-
}
|
|
694
|
-
}
|
|
695
|
-
}
|
|
696
|
-
|
|
697
|
-
// Public methods
|
|
698
|
-
setItems(items) {
|
|
699
|
-
if (this.lazyScrollInstance) {
|
|
700
|
-
this.lazyScrollInstance.setItems(items);
|
|
701
|
-
}
|
|
702
|
-
}
|
|
703
|
-
|
|
704
|
-
refresh() {
|
|
705
|
-
if (this.lazyScrollInstance) {
|
|
706
|
-
this.lazyScrollInstance.refresh();
|
|
707
|
-
}
|
|
708
|
-
}
|
|
709
|
-
|
|
710
|
-
getVisibleRange() {
|
|
711
|
-
if (this.lazyScrollInstance) {
|
|
712
|
-
return this.lazyScrollInstance.getVisibleRange();
|
|
713
|
-
}
|
|
714
|
-
return { start: 0, end: 0 };
|
|
715
|
-
}
|
|
716
|
-
}
|
|
717
|
-
|
|
718
|
-
// Register the custom element
|
|
719
|
-
customElements.define('lazy-scroll-element', LazyScrollElement);
|
|
720
|
-
|
|
721
568
|
/**
|
|
722
569
|
* Debounce function to limit the rate at which a function is called
|
|
723
570
|
*/
|
|
@@ -728,5 +575,17 @@ declare function debounce<T extends (...args: any[]) => any>(func: T, wait: numb
|
|
|
728
575
|
*/
|
|
729
576
|
declare function throttle<T extends (...args: any[]) => any>(func: T, limit: number): (...args: Parameters<T>) => void;
|
|
730
577
|
|
|
578
|
+
declare class LazyScrollElementClass {
|
|
579
|
+
constructor();
|
|
580
|
+
setItems(items: any[]): void;
|
|
581
|
+
refresh(): void;
|
|
582
|
+
getVisibleRange(): {
|
|
583
|
+
start: number;
|
|
584
|
+
end: number;
|
|
585
|
+
};
|
|
586
|
+
static registerElement(): void;
|
|
587
|
+
}
|
|
588
|
+
declare const LazyScrollElement: typeof LazyScrollElementClass;
|
|
589
|
+
|
|
731
590
|
export { AdaptiveBufferCalculator, ContentComplexityAnalyzer, DevicePerformanceMonitor, Engine, GPUAccelerator, IntelligentScrollDetector, LazyList, LazyScroll, LazyScrollElement, MemoryManager, NetworkAwarePrefetchManager, NetworkAwareRequestQueue, NetworkSpeedDetector, PerformanceOptimizer, PrefetchManager, RequestQueue, ScrollObserver, WindowManager, createLazyScroll, debounce, throttle, useLazyList };
|
|
732
591
|
export type { EngineConfig, EngineState, FetchMoreCallback, ScrollAnalysis, VisibleRange };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "lazy-render-virtual-scroll",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.5.0",
|
|
4
4
|
"description": "A framework-agnostic virtual scrolling and lazy rendering solution",
|
|
5
5
|
"main": "dist/cjs/index.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -32,16 +32,16 @@
|
|
|
32
32
|
"require": "./dist/cjs/svelte/index.js",
|
|
33
33
|
"types": "./dist/svelte/index.d.ts"
|
|
34
34
|
},
|
|
35
|
-
"./
|
|
36
|
-
"import": "./
|
|
37
|
-
"require": "./
|
|
38
|
-
"types": "./dist/vanilla/index.d.ts"
|
|
35
|
+
"./backend-helpers": {
|
|
36
|
+
"import": "./backend-helpers/pagination.ts",
|
|
37
|
+
"require": "./backend-helpers/pagination.ts"
|
|
39
38
|
}
|
|
40
39
|
},
|
|
41
40
|
"files": [
|
|
42
41
|
"dist/",
|
|
43
42
|
"README.md",
|
|
44
|
-
"LICENSE"
|
|
43
|
+
"LICENSE",
|
|
44
|
+
"backend-helpers/"
|
|
45
45
|
],
|
|
46
46
|
"scripts": {
|
|
47
47
|
"build": "rollup -c",
|