@tanstack/vue-virtual
Advanced tools
Comparing version 3.0.0-beta.63 to 3.0.0-beta.64
import { PartialKeys, Virtualizer, VirtualizerOptions } from '@tanstack/virtual-core'; | ||
import { Ref } from 'vue'; | ||
export * from '@tanstack/virtual-core'; | ||
type MaybeRef<T> = T | Ref<T>; | ||
export declare function useVirtualizer<TScrollElement extends Element, TItemElement extends Element>(options: MaybeRef<PartialKeys<VirtualizerOptions<TScrollElement, TItemElement>, 'observeElementRect' | 'observeElementOffset' | 'scrollToFn'>>): Ref<Virtualizer<TScrollElement, TItemElement>>; | ||
export declare function useWindowVirtualizer<TItemElement extends Element>(options: MaybeRef<PartialKeys<VirtualizerOptions<Window, TItemElement>, 'observeElementRect' | 'observeElementOffset' | 'scrollToFn' | 'getScrollElement'>>): Ref<Virtualizer<Window, TItemElement>>; | ||
export {}; |
@@ -13,2 +13,3 @@ /** | ||
import { observeElementRect, observeElementOffset, elementScroll, observeWindowRect, observeWindowOffset, windowScroll, Virtualizer } from '@tanstack/virtual-core'; | ||
export * from '@tanstack/virtual-core'; | ||
import { computed, unref, shallowRef, watch, triggerRef, onScopeDispose } from 'vue'; | ||
@@ -15,0 +16,0 @@ |
@@ -74,2 +74,8 @@ /** | ||
exports.useWindowVirtualizer = useWindowVirtualizer; | ||
Object.keys(virtualCore).forEach(function (k) { | ||
if (k !== 'default' && !exports.hasOwnProperty(k)) Object.defineProperty(exports, k, { | ||
enumerable: true, | ||
get: function () { return virtualCore[k]; } | ||
}); | ||
}); | ||
//# sourceMappingURL=index.js.map |
@@ -87,2 +87,8 @@ /** | ||
exports.useWindowVirtualizer = useWindowVirtualizer; | ||
Object.keys(virtualCore).forEach(function (k) { | ||
if (k !== 'default' && !exports.hasOwnProperty(k)) Object.defineProperty(exports, k, { | ||
enumerable: true, | ||
get: function () { return virtualCore[k]; } | ||
}); | ||
}); | ||
@@ -89,0 +95,0 @@ Object.defineProperty(exports, '__esModule', { value: true }); |
@@ -11,3 +11,3 @@ /** | ||
*/ | ||
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("@tanstack/virtual-core"),require("vue")):"function"==typeof define&&define.amd?define(["exports","@tanstack/virtual-core","vue"],n):n((e="undefined"!=typeof globalThis?globalThis:e||self).VueVirtual={},e.VirtualCore,e.Vue)}(this,(function(e,n,t){"use strict";function o(){return o=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},o.apply(this,arguments)}function r(e){var r=new n.Virtualizer(t.unref(e)),i=t.shallowRef(r),u=r._didMount();return t.watch((function(){return t.unref(e).getScrollElement()}),(function(e){e&&r._willUpdate()}),{immediate:!0}),t.watch((function(){return t.unref(e)}),(function(e){r.setOptions(o({},e,{onChange:function(n){t.triggerRef(i),null==e.onChange||e.onChange(n)}})),r._willUpdate(),t.triggerRef(i)}),{immediate:!0}),t.onScopeDispose(u),i}e.useVirtualizer=function(e){return r(t.computed((function(){return o({observeElementRect:n.observeElementRect,observeElementOffset:n.observeElementOffset,scrollToFn:n.elementScroll},t.unref(e))})))},e.useWindowVirtualizer=function(e){return r(t.computed((function(){return o({getScrollElement:function(){return"undefined"!=typeof document?window:null},observeElementRect:n.observeWindowRect,observeElementOffset:n.observeWindowOffset,scrollToFn:n.windowScroll,initialOffset:"undefined"!=typeof document?window.scrollY:void 0},t.unref(e))})))},Object.defineProperty(e,"__esModule",{value:!0})})); | ||
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("@tanstack/virtual-core"),require("vue")):"function"==typeof define&&define.amd?define(["exports","@tanstack/virtual-core","vue"],n):n((e="undefined"!=typeof globalThis?globalThis:e||self).VueVirtual={},e.VirtualCore,e.Vue)}(this,(function(e,n,t){"use strict";function r(){return r=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},r.apply(this,arguments)}function o(e){var o=new n.Virtualizer(t.unref(e)),i=t.shallowRef(o),u=o._didMount();return t.watch((function(){return t.unref(e).getScrollElement()}),(function(e){e&&o._willUpdate()}),{immediate:!0}),t.watch((function(){return t.unref(e)}),(function(e){o.setOptions(r({},e,{onChange:function(n){t.triggerRef(i),null==e.onChange||e.onChange(n)}})),o._willUpdate(),t.triggerRef(i)}),{immediate:!0}),t.onScopeDispose(u),i}e.useVirtualizer=function(e){return o(t.computed((function(){return r({observeElementRect:n.observeElementRect,observeElementOffset:n.observeElementOffset,scrollToFn:n.elementScroll},t.unref(e))})))},e.useWindowVirtualizer=function(e){return o(t.computed((function(){return r({getScrollElement:function(){return"undefined"!=typeof document?window:null},observeElementRect:n.observeWindowRect,observeElementOffset:n.observeWindowOffset,scrollToFn:n.windowScroll,initialOffset:"undefined"!=typeof document?window.scrollY:void 0},t.unref(e))})))},Object.keys(n).forEach((function(t){"default"===t||e.hasOwnProperty(t)||Object.defineProperty(e,t,{enumerable:!0,get:function(){return n[t]}})})),Object.defineProperty(e,"__esModule",{value:!0})})); | ||
//# sourceMappingURL=index.production.js.map |
{ | ||
"name": "@tanstack/vue-virtual", | ||
"author": "Tanner Linsley", | ||
"version": "3.0.0-beta.63", | ||
"version": "3.0.0-beta.64", | ||
"description": "Headless UI for virtualizing scrollable elements in Vue", | ||
@@ -6,0 +6,0 @@ "license": "MIT", |
@@ -21,2 +21,3 @@ import { | ||
} from 'vue' | ||
export * from '@tanstack/virtual-core' | ||
@@ -23,0 +24,0 @@ type MaybeRef<T> = T | Ref<T> |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
43895
514