lazy-render-virtual-scroll 1.2.0 → 1.4.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/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 +1 -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"}
|
|
@@ -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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CAAmC,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/cjs/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
|
package/dist/cjs/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA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kBAAkB,CAAC"}
|
package/dist/cjs/index.js
CHANGED
|
@@ -1711,159 +1711,6 @@ function createLazyScroll(container, config) {
|
|
|
1711
1711
|
return new LazyScroll(container, config);
|
|
1712
1712
|
}
|
|
1713
1713
|
|
|
1714
|
-
class LazyScrollElement extends HTMLElement {
|
|
1715
|
-
constructor() {
|
|
1716
|
-
super();
|
|
1717
|
-
this.shadow = this.attachShadow({ mode: 'open' });
|
|
1718
|
-
|
|
1719
|
-
// Default values
|
|
1720
|
-
this.itemHeight = 50;
|
|
1721
|
-
this.viewportHeight = 400;
|
|
1722
|
-
this.bufferSize = 5;
|
|
1723
|
-
this.items = [];
|
|
1724
|
-
|
|
1725
|
-
// Styles
|
|
1726
|
-
const style = document.createElement('style');
|
|
1727
|
-
style.textContent = `
|
|
1728
|
-
:host {
|
|
1729
|
-
display: block;
|
|
1730
|
-
}
|
|
1731
|
-
|
|
1732
|
-
.lazy-scroll-container {
|
|
1733
|
-
position: relative;
|
|
1734
|
-
overflow-y: auto;
|
|
1735
|
-
}
|
|
1736
|
-
|
|
1737
|
-
.lazy-item {
|
|
1738
|
-
width: 100%;
|
|
1739
|
-
}
|
|
1740
|
-
|
|
1741
|
-
.lazy-loading {
|
|
1742
|
-
text-align: center;
|
|
1743
|
-
padding: 20px;
|
|
1744
|
-
color: #666;
|
|
1745
|
-
}
|
|
1746
|
-
`;
|
|
1747
|
-
|
|
1748
|
-
this.shadow.appendChild(style);
|
|
1749
|
-
}
|
|
1750
|
-
|
|
1751
|
-
static get observedAttributes() {
|
|
1752
|
-
return ['item-height', 'viewport-height', 'buffer-size'];
|
|
1753
|
-
}
|
|
1754
|
-
|
|
1755
|
-
attributeChangedCallback(name, oldValue, newValue) {
|
|
1756
|
-
switch (name) {
|
|
1757
|
-
case 'item-height':
|
|
1758
|
-
this.itemHeight = parseInt(newValue) || 50;
|
|
1759
|
-
break;
|
|
1760
|
-
case 'viewport-height':
|
|
1761
|
-
this.viewportHeight = parseInt(newValue) || 400;
|
|
1762
|
-
break;
|
|
1763
|
-
case 'buffer-size':
|
|
1764
|
-
this.bufferSize = parseInt(newValue) || 5;
|
|
1765
|
-
break;
|
|
1766
|
-
}
|
|
1767
|
-
|
|
1768
|
-
if (this.lazyScrollInstance) {
|
|
1769
|
-
this.lazyScrollInstance.updateConfig({
|
|
1770
|
-
itemHeight: this.itemHeight,
|
|
1771
|
-
viewportHeight: this.viewportHeight,
|
|
1772
|
-
bufferSize: this.bufferSize
|
|
1773
|
-
});
|
|
1774
|
-
}
|
|
1775
|
-
}
|
|
1776
|
-
|
|
1777
|
-
connectedCallback() {
|
|
1778
|
-
// Create container
|
|
1779
|
-
this.container = document.createElement('div');
|
|
1780
|
-
this.container.className = 'lazy-scroll-container';
|
|
1781
|
-
this.container.style.height = `${this.viewportHeight}px`;
|
|
1782
|
-
this.container.style.overflowY = 'auto';
|
|
1783
|
-
|
|
1784
|
-
this.shadow.appendChild(this.container);
|
|
1785
|
-
|
|
1786
|
-
// Get fetchMore function from attribute or slot
|
|
1787
|
-
const fetchMoreAttr = this.getAttribute('fetch-more');
|
|
1788
|
-
let fetchMoreFn = () => Promise.resolve([]);
|
|
1789
|
-
|
|
1790
|
-
if (fetchMoreAttr) {
|
|
1791
|
-
try {
|
|
1792
|
-
// If fetchMore is a function name in global scope
|
|
1793
|
-
fetchMoreFn = window[fetchMoreAttr] || (() => Promise.resolve([]));
|
|
1794
|
-
} catch (e) {
|
|
1795
|
-
console.warn('Could not find fetchMore function:', fetchMoreAttr);
|
|
1796
|
-
}
|
|
1797
|
-
}
|
|
1798
|
-
|
|
1799
|
-
// Initialize lazy scroll
|
|
1800
|
-
this.lazyScrollInstance = createLazyScroll(this.container, {
|
|
1801
|
-
itemHeight: this.itemHeight,
|
|
1802
|
-
viewportHeight: this.viewportHeight,
|
|
1803
|
-
bufferSize: this.bufferSize,
|
|
1804
|
-
fetchMore: fetchMoreFn
|
|
1805
|
-
});
|
|
1806
|
-
|
|
1807
|
-
// Handle items from light DOM
|
|
1808
|
-
this.updateItemsFromSlot();
|
|
1809
|
-
|
|
1810
|
-
// Observe child changes
|
|
1811
|
-
this.mutationObserver = new MutationObserver(() => {
|
|
1812
|
-
this.updateItemsFromSlot();
|
|
1813
|
-
});
|
|
1814
|
-
|
|
1815
|
-
this.mutationObserver.observe(this, { childList: true, subtree: true });
|
|
1816
|
-
}
|
|
1817
|
-
|
|
1818
|
-
disconnectedCallback() {
|
|
1819
|
-
if (this.lazyScrollInstance) {
|
|
1820
|
-
this.lazyScrollInstance.destroy();
|
|
1821
|
-
}
|
|
1822
|
-
|
|
1823
|
-
if (this.mutationObserver) {
|
|
1824
|
-
this.mutationObserver.disconnect();
|
|
1825
|
-
}
|
|
1826
|
-
}
|
|
1827
|
-
|
|
1828
|
-
updateItemsFromSlot() {
|
|
1829
|
-
// Get items from light DOM or data attribute
|
|
1830
|
-
const itemsData = this.getAttribute('items');
|
|
1831
|
-
if (itemsData) {
|
|
1832
|
-
try {
|
|
1833
|
-
const items = JSON.parse(itemsData);
|
|
1834
|
-
if (this.lazyScrollInstance) {
|
|
1835
|
-
this.lazyScrollInstance.setItems(items);
|
|
1836
|
-
}
|
|
1837
|
-
} catch (e) {
|
|
1838
|
-
console.warn('Could not parse items data:', itemsData);
|
|
1839
|
-
}
|
|
1840
|
-
}
|
|
1841
|
-
}
|
|
1842
|
-
|
|
1843
|
-
// Public methods
|
|
1844
|
-
setItems(items) {
|
|
1845
|
-
if (this.lazyScrollInstance) {
|
|
1846
|
-
this.lazyScrollInstance.setItems(items);
|
|
1847
|
-
}
|
|
1848
|
-
}
|
|
1849
|
-
|
|
1850
|
-
refresh() {
|
|
1851
|
-
if (this.lazyScrollInstance) {
|
|
1852
|
-
this.lazyScrollInstance.refresh();
|
|
1853
|
-
}
|
|
1854
|
-
}
|
|
1855
|
-
|
|
1856
|
-
getVisibleRange() {
|
|
1857
|
-
if (this.lazyScrollInstance) {
|
|
1858
|
-
return this.lazyScrollInstance.getVisibleRange();
|
|
1859
|
-
}
|
|
1860
|
-
return { start: 0, end: 0 };
|
|
1861
|
-
}
|
|
1862
|
-
}
|
|
1863
|
-
|
|
1864
|
-
// Register the custom element
|
|
1865
|
-
customElements.define('lazy-scroll-element', LazyScrollElement);
|
|
1866
|
-
|
|
1867
1714
|
/**
|
|
1868
1715
|
* Debounce function to limit the rate at which a function is called
|
|
1869
1716
|
*/
|
|
@@ -1895,6 +1742,19 @@ function throttle(func, limit) {
|
|
|
1895
1742
|
};
|
|
1896
1743
|
}
|
|
1897
1744
|
|
|
1745
|
+
// Core exports
|
|
1746
|
+
class LazyScrollElementClass {
|
|
1747
|
+
constructor() { }
|
|
1748
|
+
setItems(items) { }
|
|
1749
|
+
refresh() { }
|
|
1750
|
+
getVisibleRange() { return { start: 0, end: 0 }; }
|
|
1751
|
+
static registerElement() { }
|
|
1752
|
+
}
|
|
1753
|
+
// Use dynamic import for browser-specific functionality
|
|
1754
|
+
const LazyScrollElement = typeof window !== 'undefined' && typeof HTMLElement !== 'undefined'
|
|
1755
|
+
? LazyScrollElementClass // Will be replaced with actual element in browser
|
|
1756
|
+
: LazyScrollElementClass; // SSR-safe fallback
|
|
1757
|
+
|
|
1898
1758
|
exports.AdaptiveBufferCalculator = AdaptiveBufferCalculator;
|
|
1899
1759
|
exports.ContentComplexityAnalyzer = ContentComplexityAnalyzer;
|
|
1900
1760
|
exports.DevicePerformanceMonitor = DevicePerformanceMonitor;
|