@tanstack/lit-virtual 3.13.37 → 3.14.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/index.cjs +6 -0
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/cjs/index.d.cts +1 -1
- package/dist/esm/index.d.ts +1 -1
- package/dist/esm/index.js +1 -0
- package/dist/esm/index.js.map +1 -1
- package/package.json +2 -2
- package/src/index.ts +2 -0
package/dist/cjs/index.cjs
CHANGED
|
@@ -53,4 +53,10 @@ class WindowVirtualizerController extends VirtualizerControllerBase {
|
|
|
53
53
|
}
|
|
54
54
|
exports.VirtualizerController = VirtualizerController;
|
|
55
55
|
exports.WindowVirtualizerController = WindowVirtualizerController;
|
|
56
|
+
Object.keys(virtualCore).forEach((k) => {
|
|
57
|
+
if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
58
|
+
enumerable: true,
|
|
59
|
+
get: () => virtualCore[k]
|
|
60
|
+
});
|
|
61
|
+
});
|
|
56
62
|
//# sourceMappingURL=index.cjs.map
|
package/dist/cjs/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../../src/index.ts"],"sourcesContent":["import {\n Virtualizer,\n elementScroll,\n observeElementOffset,\n observeElementRect,\n observeWindowOffset,\n observeWindowRect,\n windowScroll,\n} from '@tanstack/virtual-core'\nimport type { ReactiveController, ReactiveControllerHost } from 'lit'\nimport type { PartialKeys, VirtualizerOptions } from '@tanstack/virtual-core'\n\nclass VirtualizerControllerBase<\n TScrollElement extends Element | Window,\n TItemElement extends Element,\n> implements ReactiveController {\n host: ReactiveControllerHost\n\n private readonly virtualizer: Virtualizer<TScrollElement, TItemElement>\n\n private cleanup: () => void = () => {}\n\n constructor(\n host: ReactiveControllerHost,\n options: VirtualizerOptions<TScrollElement, TItemElement>,\n ) {\n const resolvedOptions: VirtualizerOptions<TScrollElement, TItemElement> = {\n ...options,\n onChange: (instance, sync) => {\n this.host.updateComplete.then(() => this.host.requestUpdate())\n options.onChange?.(instance, sync)\n },\n }\n this.virtualizer = new Virtualizer(resolvedOptions)\n ;(this.host = host).addController(this)\n }\n\n public getVirtualizer() {\n return this.virtualizer\n }\n\n hostConnected() {\n this.cleanup = this.virtualizer._didMount()\n }\n\n hostUpdated() {\n this.virtualizer._willUpdate()\n }\n\n hostDisconnected() {\n this.cleanup()\n }\n}\n\nexport class VirtualizerController<\n TScrollElement extends Element,\n TItemElement extends Element,\n> extends VirtualizerControllerBase<TScrollElement, TItemElement> {\n constructor(\n host: ReactiveControllerHost,\n options: PartialKeys<\n VirtualizerOptions<TScrollElement, TItemElement>,\n 'observeElementRect' | 'observeElementOffset' | 'scrollToFn'\n >,\n ) {\n super(host, {\n observeElementRect: observeElementRect,\n observeElementOffset: observeElementOffset,\n scrollToFn: elementScroll,\n ...options,\n })\n }\n}\n\nexport class WindowVirtualizerController<\n TItemElement extends Element,\n> extends VirtualizerControllerBase<Window, TItemElement> {\n constructor(\n host: ReactiveControllerHost,\n options: PartialKeys<\n VirtualizerOptions<Window, TItemElement>,\n | 'getScrollElement'\n | 'observeElementRect'\n | 'observeElementOffset'\n | 'scrollToFn'\n >,\n ) {\n super(host, {\n getScrollElement: () => (typeof document !== 'undefined' ? window : null),\n observeElementRect: observeWindowRect,\n observeElementOffset: observeWindowOffset,\n scrollToFn: windowScroll,\n initialOffset: () =>\n typeof document !== 'undefined' ? window.scrollY : 0,\n ...options,\n })\n }\n}\n"],"names":["Virtualizer","observeElementRect","observeElementOffset","elementScroll","observeWindowRect","observeWindowOffset","windowScroll"],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../src/index.ts"],"sourcesContent":["import {\n Virtualizer,\n elementScroll,\n observeElementOffset,\n observeElementRect,\n observeWindowOffset,\n observeWindowRect,\n windowScroll,\n} from '@tanstack/virtual-core'\nimport type { ReactiveController, ReactiveControllerHost } from 'lit'\nimport type { PartialKeys, VirtualizerOptions } from '@tanstack/virtual-core'\n\nexport * from '@tanstack/virtual-core'\n\nclass VirtualizerControllerBase<\n TScrollElement extends Element | Window,\n TItemElement extends Element,\n> implements ReactiveController {\n host: ReactiveControllerHost\n\n private readonly virtualizer: Virtualizer<TScrollElement, TItemElement>\n\n private cleanup: () => void = () => {}\n\n constructor(\n host: ReactiveControllerHost,\n options: VirtualizerOptions<TScrollElement, TItemElement>,\n ) {\n const resolvedOptions: VirtualizerOptions<TScrollElement, TItemElement> = {\n ...options,\n onChange: (instance, sync) => {\n this.host.updateComplete.then(() => this.host.requestUpdate())\n options.onChange?.(instance, sync)\n },\n }\n this.virtualizer = new Virtualizer(resolvedOptions)\n ;(this.host = host).addController(this)\n }\n\n public getVirtualizer() {\n return this.virtualizer\n }\n\n hostConnected() {\n this.cleanup = this.virtualizer._didMount()\n }\n\n hostUpdated() {\n this.virtualizer._willUpdate()\n }\n\n hostDisconnected() {\n this.cleanup()\n }\n}\n\nexport class VirtualizerController<\n TScrollElement extends Element,\n TItemElement extends Element,\n> extends VirtualizerControllerBase<TScrollElement, TItemElement> {\n constructor(\n host: ReactiveControllerHost,\n options: PartialKeys<\n VirtualizerOptions<TScrollElement, TItemElement>,\n 'observeElementRect' | 'observeElementOffset' | 'scrollToFn'\n >,\n ) {\n super(host, {\n observeElementRect: observeElementRect,\n observeElementOffset: observeElementOffset,\n scrollToFn: elementScroll,\n ...options,\n })\n }\n}\n\nexport class WindowVirtualizerController<\n TItemElement extends Element,\n> extends VirtualizerControllerBase<Window, TItemElement> {\n constructor(\n host: ReactiveControllerHost,\n options: PartialKeys<\n VirtualizerOptions<Window, TItemElement>,\n | 'getScrollElement'\n | 'observeElementRect'\n | 'observeElementOffset'\n | 'scrollToFn'\n >,\n ) {\n super(host, {\n getScrollElement: () => (typeof document !== 'undefined' ? window : null),\n observeElementRect: observeWindowRect,\n observeElementOffset: observeWindowOffset,\n scrollToFn: windowScroll,\n initialOffset: () =>\n typeof document !== 'undefined' ? window.scrollY : 0,\n ...options,\n })\n }\n}\n"],"names":["Virtualizer","observeElementRect","observeElementOffset","elementScroll","observeWindowRect","observeWindowOffset","windowScroll"],"mappings":";;;AAcA,MAAM,0BAG0B;AAAA,EAO9B,YACE,MACA,SACA;AALF,SAAQ,UAAsB,MAAM;AAAA,IAAC;AAMnC,UAAM,kBAAoE;AAAA,MACxE,GAAG;AAAA,MACH,UAAU,CAAC,UAAU,SAAS;;AAC5B,aAAK,KAAK,eAAe,KAAK,MAAM,KAAK,KAAK,eAAe;AAC7D,sBAAQ,aAAR,iCAAmB,UAAU;AAAA,MAC/B;AAAA,IAAA;AAEF,SAAK,cAAc,IAAIA,YAAAA,YAAY,eAAe;AACjD,KAAC,KAAK,OAAO,MAAM,cAAc,IAAI;AAAA,EACxC;AAAA,EAEO,iBAAiB;AACtB,WAAO,KAAK;AAAA,EACd;AAAA,EAEA,gBAAgB;AACd,SAAK,UAAU,KAAK,YAAY,UAAA;AAAA,EAClC;AAAA,EAEA,cAAc;AACZ,SAAK,YAAY,YAAA;AAAA,EACnB;AAAA,EAEA,mBAAmB;AACjB,SAAK,QAAA;AAAA,EACP;AACF;AAEO,MAAM,8BAGH,0BAAwD;AAAA,EAChE,YACE,MACA,SAIA;AACA,UAAM,MAAM;AAAA,MAAA,oBACVC,YAAAA;AAAAA,MAAA,sBACAC,YAAAA;AAAAA,MACA,YAAYC,YAAAA;AAAAA,MACZ,GAAG;AAAA,IAAA,CACJ;AAAA,EACH;AACF;AAEO,MAAM,oCAEH,0BAAgD;AAAA,EACxD,YACE,MACA,SAOA;AACA,UAAM,MAAM;AAAA,MACV,kBAAkB,MAAO,OAAO,aAAa,cAAc,SAAS;AAAA,MACpE,oBAAoBC,YAAAA;AAAAA,MACpB,sBAAsBC,YAAAA;AAAAA,MACtB,YAAYC,YAAAA;AAAAA,MACZ,eAAe,MACb,OAAO,aAAa,cAAc,OAAO,UAAU;AAAA,MACrD,GAAG;AAAA,IAAA,CACJ;AAAA,EACH;AACF;;;;;;;;;"}
|
package/dist/cjs/index.d.cts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Virtualizer, PartialKeys, VirtualizerOptions } from '@tanstack/virtual-core';
|
|
2
2
|
import { ReactiveController, ReactiveControllerHost } from 'lit';
|
|
3
|
+
export * from '@tanstack/virtual-core';
|
|
3
4
|
declare class VirtualizerControllerBase<TScrollElement extends Element | Window, TItemElement extends Element> implements ReactiveController {
|
|
4
5
|
host: ReactiveControllerHost;
|
|
5
6
|
private readonly virtualizer;
|
|
@@ -16,4 +17,3 @@ export declare class VirtualizerController<TScrollElement extends Element, TItem
|
|
|
16
17
|
export declare class WindowVirtualizerController<TItemElement extends Element> extends VirtualizerControllerBase<Window, TItemElement> {
|
|
17
18
|
constructor(host: ReactiveControllerHost, options: PartialKeys<VirtualizerOptions<Window, TItemElement>, 'getScrollElement' | 'observeElementRect' | 'observeElementOffset' | 'scrollToFn'>);
|
|
18
19
|
}
|
|
19
|
-
export {};
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Virtualizer, PartialKeys, VirtualizerOptions } from '@tanstack/virtual-core';
|
|
2
2
|
import { ReactiveController, ReactiveControllerHost } from 'lit';
|
|
3
|
+
export * from '@tanstack/virtual-core';
|
|
3
4
|
declare class VirtualizerControllerBase<TScrollElement extends Element | Window, TItemElement extends Element> implements ReactiveController {
|
|
4
5
|
host: ReactiveControllerHost;
|
|
5
6
|
private readonly virtualizer;
|
|
@@ -16,4 +17,3 @@ export declare class VirtualizerController<TScrollElement extends Element, TItem
|
|
|
16
17
|
export declare class WindowVirtualizerController<TItemElement extends Element> extends VirtualizerControllerBase<Window, TItemElement> {
|
|
17
18
|
constructor(host: ReactiveControllerHost, options: PartialKeys<VirtualizerOptions<Window, TItemElement>, 'getScrollElement' | 'observeElementRect' | 'observeElementOffset' | 'scrollToFn'>);
|
|
18
19
|
}
|
|
19
|
-
export {};
|
package/dist/esm/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { elementScroll, observeElementOffset, observeElementRect, windowScroll, observeWindowOffset, observeWindowRect, Virtualizer } from "@tanstack/virtual-core";
|
|
2
|
+
export * from "@tanstack/virtual-core";
|
|
2
3
|
class VirtualizerControllerBase {
|
|
3
4
|
constructor(host, options) {
|
|
4
5
|
this.cleanup = () => {
|
package/dist/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../src/index.ts"],"sourcesContent":["import {\n Virtualizer,\n elementScroll,\n observeElementOffset,\n observeElementRect,\n observeWindowOffset,\n observeWindowRect,\n windowScroll,\n} from '@tanstack/virtual-core'\nimport type { ReactiveController, ReactiveControllerHost } from 'lit'\nimport type { PartialKeys, VirtualizerOptions } from '@tanstack/virtual-core'\n\nclass VirtualizerControllerBase<\n TScrollElement extends Element | Window,\n TItemElement extends Element,\n> implements ReactiveController {\n host: ReactiveControllerHost\n\n private readonly virtualizer: Virtualizer<TScrollElement, TItemElement>\n\n private cleanup: () => void = () => {}\n\n constructor(\n host: ReactiveControllerHost,\n options: VirtualizerOptions<TScrollElement, TItemElement>,\n ) {\n const resolvedOptions: VirtualizerOptions<TScrollElement, TItemElement> = {\n ...options,\n onChange: (instance, sync) => {\n this.host.updateComplete.then(() => this.host.requestUpdate())\n options.onChange?.(instance, sync)\n },\n }\n this.virtualizer = new Virtualizer(resolvedOptions)\n ;(this.host = host).addController(this)\n }\n\n public getVirtualizer() {\n return this.virtualizer\n }\n\n hostConnected() {\n this.cleanup = this.virtualizer._didMount()\n }\n\n hostUpdated() {\n this.virtualizer._willUpdate()\n }\n\n hostDisconnected() {\n this.cleanup()\n }\n}\n\nexport class VirtualizerController<\n TScrollElement extends Element,\n TItemElement extends Element,\n> extends VirtualizerControllerBase<TScrollElement, TItemElement> {\n constructor(\n host: ReactiveControllerHost,\n options: PartialKeys<\n VirtualizerOptions<TScrollElement, TItemElement>,\n 'observeElementRect' | 'observeElementOffset' | 'scrollToFn'\n >,\n ) {\n super(host, {\n observeElementRect: observeElementRect,\n observeElementOffset: observeElementOffset,\n scrollToFn: elementScroll,\n ...options,\n })\n }\n}\n\nexport class WindowVirtualizerController<\n TItemElement extends Element,\n> extends VirtualizerControllerBase<Window, TItemElement> {\n constructor(\n host: ReactiveControllerHost,\n options: PartialKeys<\n VirtualizerOptions<Window, TItemElement>,\n | 'getScrollElement'\n | 'observeElementRect'\n | 'observeElementOffset'\n | 'scrollToFn'\n >,\n ) {\n super(host, {\n getScrollElement: () => (typeof document !== 'undefined' ? window : null),\n observeElementRect: observeWindowRect,\n observeElementOffset: observeWindowOffset,\n scrollToFn: windowScroll,\n initialOffset: () =>\n typeof document !== 'undefined' ? window.scrollY : 0,\n ...options,\n })\n }\n}\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../src/index.ts"],"sourcesContent":["import {\n Virtualizer,\n elementScroll,\n observeElementOffset,\n observeElementRect,\n observeWindowOffset,\n observeWindowRect,\n windowScroll,\n} from '@tanstack/virtual-core'\nimport type { ReactiveController, ReactiveControllerHost } from 'lit'\nimport type { PartialKeys, VirtualizerOptions } from '@tanstack/virtual-core'\n\nexport * from '@tanstack/virtual-core'\n\nclass VirtualizerControllerBase<\n TScrollElement extends Element | Window,\n TItemElement extends Element,\n> implements ReactiveController {\n host: ReactiveControllerHost\n\n private readonly virtualizer: Virtualizer<TScrollElement, TItemElement>\n\n private cleanup: () => void = () => {}\n\n constructor(\n host: ReactiveControllerHost,\n options: VirtualizerOptions<TScrollElement, TItemElement>,\n ) {\n const resolvedOptions: VirtualizerOptions<TScrollElement, TItemElement> = {\n ...options,\n onChange: (instance, sync) => {\n this.host.updateComplete.then(() => this.host.requestUpdate())\n options.onChange?.(instance, sync)\n },\n }\n this.virtualizer = new Virtualizer(resolvedOptions)\n ;(this.host = host).addController(this)\n }\n\n public getVirtualizer() {\n return this.virtualizer\n }\n\n hostConnected() {\n this.cleanup = this.virtualizer._didMount()\n }\n\n hostUpdated() {\n this.virtualizer._willUpdate()\n }\n\n hostDisconnected() {\n this.cleanup()\n }\n}\n\nexport class VirtualizerController<\n TScrollElement extends Element,\n TItemElement extends Element,\n> extends VirtualizerControllerBase<TScrollElement, TItemElement> {\n constructor(\n host: ReactiveControllerHost,\n options: PartialKeys<\n VirtualizerOptions<TScrollElement, TItemElement>,\n 'observeElementRect' | 'observeElementOffset' | 'scrollToFn'\n >,\n ) {\n super(host, {\n observeElementRect: observeElementRect,\n observeElementOffset: observeElementOffset,\n scrollToFn: elementScroll,\n ...options,\n })\n }\n}\n\nexport class WindowVirtualizerController<\n TItemElement extends Element,\n> extends VirtualizerControllerBase<Window, TItemElement> {\n constructor(\n host: ReactiveControllerHost,\n options: PartialKeys<\n VirtualizerOptions<Window, TItemElement>,\n | 'getScrollElement'\n | 'observeElementRect'\n | 'observeElementOffset'\n | 'scrollToFn'\n >,\n ) {\n super(host, {\n getScrollElement: () => (typeof document !== 'undefined' ? window : null),\n observeElementRect: observeWindowRect,\n observeElementOffset: observeWindowOffset,\n scrollToFn: windowScroll,\n initialOffset: () =>\n typeof document !== 'undefined' ? window.scrollY : 0,\n ...options,\n })\n }\n}\n"],"names":[],"mappings":";;AAcA,MAAM,0BAG0B;AAAA,EAO9B,YACE,MACA,SACA;AALF,SAAQ,UAAsB,MAAM;AAAA,IAAC;AAMnC,UAAM,kBAAoE;AAAA,MACxE,GAAG;AAAA,MACH,UAAU,CAAC,UAAU,SAAS;;AAC5B,aAAK,KAAK,eAAe,KAAK,MAAM,KAAK,KAAK,eAAe;AAC7D,sBAAQ,aAAR,iCAAmB,UAAU;AAAA,MAC/B;AAAA,IAAA;AAEF,SAAK,cAAc,IAAI,YAAY,eAAe;AACjD,KAAC,KAAK,OAAO,MAAM,cAAc,IAAI;AAAA,EACxC;AAAA,EAEO,iBAAiB;AACtB,WAAO,KAAK;AAAA,EACd;AAAA,EAEA,gBAAgB;AACd,SAAK,UAAU,KAAK,YAAY,UAAA;AAAA,EAClC;AAAA,EAEA,cAAc;AACZ,SAAK,YAAY,YAAA;AAAA,EACnB;AAAA,EAEA,mBAAmB;AACjB,SAAK,QAAA;AAAA,EACP;AACF;AAEO,MAAM,8BAGH,0BAAwD;AAAA,EAChE,YACE,MACA,SAIA;AACA,UAAM,MAAM;AAAA,MACV;AAAA,MACA;AAAA,MACA,YAAY;AAAA,MACZ,GAAG;AAAA,IAAA,CACJ;AAAA,EACH;AACF;AAEO,MAAM,oCAEH,0BAAgD;AAAA,EACxD,YACE,MACA,SAOA;AACA,UAAM,MAAM;AAAA,MACV,kBAAkB,MAAO,OAAO,aAAa,cAAc,SAAS;AAAA,MACpE,oBAAoB;AAAA,MACpB,sBAAsB;AAAA,MACtB,YAAY;AAAA,MACZ,eAAe,MACb,OAAO,aAAa,cAAc,OAAO,UAAU;AAAA,MACrD,GAAG;AAAA,IAAA,CACJ;AAAA,EACH;AACF;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tanstack/lit-virtual",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.14.0",
|
|
4
4
|
"description": "Headless UI for virtualizing scrollable elements in Lit",
|
|
5
5
|
"author": "Tanner Linsley",
|
|
6
6
|
"license": "MIT",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"src"
|
|
44
44
|
],
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@tanstack/virtual-core": "3.17.
|
|
46
|
+
"@tanstack/virtual-core": "3.17.9"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
49
|
"@open-wc/testing": "^4.0.0",
|
package/src/index.ts
CHANGED
|
@@ -10,6 +10,8 @@ import {
|
|
|
10
10
|
import type { ReactiveController, ReactiveControllerHost } from 'lit'
|
|
11
11
|
import type { PartialKeys, VirtualizerOptions } from '@tanstack/virtual-core'
|
|
12
12
|
|
|
13
|
+
export * from '@tanstack/virtual-core'
|
|
14
|
+
|
|
13
15
|
class VirtualizerControllerBase<
|
|
14
16
|
TScrollElement extends Element | Window,
|
|
15
17
|
TItemElement extends Element,
|