@tanstack/vue-virtual
Advanced tools
Comparing version 3.0.0-beta.49 to 3.0.0-beta.50
@@ -59,3 +59,3 @@ /** | ||
getScrollElement: function getScrollElement() { | ||
return typeof Window !== 'undefined' ? window : null; | ||
return typeof document !== 'undefined' ? window : null; | ||
}, | ||
@@ -62,0 +62,0 @@ observeElementRect: observeWindowRect, |
@@ -63,3 +63,3 @@ /** | ||
getScrollElement: function getScrollElement() { | ||
return typeof Window !== 'undefined' ? window : null; | ||
return typeof document !== 'undefined' ? window : null; | ||
}, | ||
@@ -66,0 +66,0 @@ observeElementRect: virtualCore.observeWindowRect, |
@@ -76,3 +76,3 @@ /** | ||
getScrollElement: function getScrollElement() { | ||
return typeof Window !== 'undefined' ? window : null; | ||
return typeof document !== 'undefined' ? window : null; | ||
}, | ||
@@ -79,0 +79,0 @@ observeElementRect: virtualCore.observeWindowRect, |
@@ -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 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 Window?window:null},observeElementRect:n.observeWindowRect,observeElementOffset:n.observeWindowOffset,scrollToFn:n.windowScroll},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},t.unref(e))})))},Object.defineProperty(e,"__esModule",{value:!0})})); | ||
//# sourceMappingURL=index.production.js.map |
{ | ||
"name": "@tanstack/vue-virtual", | ||
"author": "Tanner Linsley", | ||
"version": "3.0.0-beta.49", | ||
"version": "3.0.0-beta.50", | ||
"description": "Headless UI for virtualizing scrollable elements in Vue", | ||
@@ -6,0 +6,0 @@ "license": "MIT", |
@@ -106,3 +106,4 @@ import { | ||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion | ||
getScrollElement: () => (typeof Window !== 'undefined' ? window : null!), | ||
getScrollElement: () => | ||
typeof document !== 'undefined' ? window : null!, | ||
observeElementRect: observeWindowRect, | ||
@@ -109,0 +110,0 @@ observeElementOffset: observeWindowOffset, |
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
42315
498