forked from powerlanguage/guess-my-word
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vue-virtual-scroller.min.js
1 lines (1 loc) · 21.5 KB
/
vue-virtual-scroller.min.js
1
var VueVirtualScroller=function(e,t){"use strict";t=t&&t.hasOwnProperty("default")?t.default:t;var i={itemsLimit:1e3};var n=void 0;function r(){r.init||(r.init=!0,n=-1!==function(){var e=window.navigator.userAgent,t=e.indexOf("MSIE ");if(t>0)return parseInt(e.substring(t+5,e.indexOf(".",t)),10);if(e.indexOf("Trident/")>0){var i=e.indexOf("rv:");return parseInt(e.substring(i+3,e.indexOf(".",i)),10)}var n=e.indexOf("Edge/");return n>0?parseInt(e.substring(n+5,e.indexOf(".",n)),10):-1}())}var o={render:function(){var e=this.$createElement;return(this._self._c||e)("div",{staticClass:"resize-observer",attrs:{tabindex:"-1"}})},staticRenderFns:[],_scopeId:"data-v-b329ee4c",name:"resize-observer",methods:{compareAndNotify:function(){this._w===this.$el.offsetWidth&&this._h===this.$el.offsetHeight||(this._w=this.$el.offsetWidth,this._h=this.$el.offsetHeight,this.$emit("notify"))},addResizeHandlers:function(){this._resizeObject.contentDocument.defaultView.addEventListener("resize",this.compareAndNotify),this.compareAndNotify()},removeResizeHandlers:function(){this._resizeObject&&this._resizeObject.onload&&(!n&&this._resizeObject.contentDocument&&this._resizeObject.contentDocument.defaultView.removeEventListener("resize",this.compareAndNotify),delete this._resizeObject.onload)}},mounted:function(){var e=this;r(),this.$nextTick(function(){e._w=e.$el.offsetWidth,e._h=e.$el.offsetHeight});var t=document.createElement("object");this._resizeObject=t,t.setAttribute("aria-hidden","true"),t.setAttribute("tabindex",-1),t.onload=this.addResizeHandlers,t.type="text/html",n&&this.$el.appendChild(t),t.data="about:blank",n||this.$el.appendChild(t)},beforeDestroy:function(){this.removeResizeHandlers()}};var s={version:"0.4.5",install:function(e){e.component("resize-observer",o),e.component("ResizeObserver",o)}},l=null;"undefined"!=typeof window?l=window.Vue:"undefined"!=typeof global&&(l=global.Vue),l&&l.use(s);var a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},c=(function(){function e(e){this.value=e}function t(t){var i,n;function r(i,n){try{var s=t[i](n),l=s.value;l instanceof e?Promise.resolve(l.value).then(function(e){r("next",e)},function(e){r("throw",e)}):o(s.done?"return":"normal",s.value)}catch(e){o("throw",e)}}function o(e,t){switch(e){case"return":i.resolve({value:t,done:!0});break;case"throw":i.reject(t);break;default:i.resolve({value:t,done:!1})}(i=i.next)?r(i.key,i.arg):n=null}this._invoke=function(e,t){return new Promise(function(o,s){var l={key:e,arg:t,resolve:o,reject:s,next:null};n?n=n.next=l:(i=n=l,r(e,t))})},"function"!=typeof t.return&&(this.return=void 0)}"function"==typeof Symbol&&Symbol.asyncIterator&&(t.prototype[Symbol.asyncIterator]=function(){return this}),t.prototype.next=function(e){return this._invoke("next",e)},t.prototype.throw=function(e){return this._invoke("throw",e)},t.prototype.return=function(e){return this._invoke("return",e)}}(),function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}),u=function(){function e(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,i,n){return i&&e(t.prototype,i),n&&e(t,n),t}}(),d=function(e){if(Array.isArray(e)){for(var t=0,i=Array(e.length);t<e.length;t++)i[t]=e[t];return i}return Array.from(e)};var h=function(){function e(t,i,n){c(this,e),this.el=t,this.observer=null,this.frozen=!1,this.createObserver(i,n)}return u(e,[{key:"createObserver",value:function(e,t){var i,n,r,o,s,l,a,c=this;(this.observer&&this.destroyObserver(),this.frozen)||(this.options="function"==typeof(i=e)?{callback:i}:i,this.callback=this.options.callback,this.callback&&this.options.throttle&&(this.callback=(n=this.callback,r=this.options.throttle,o=void 0,s=void 0,l=void 0,(a=function(e){for(var t=arguments.length,i=Array(t>1?t-1:0),a=1;a<t;a++)i[a-1]=arguments[a];l=i,o&&e===s||(s=e,clearTimeout(o),o=setTimeout(function(){n.apply(void 0,[e].concat(d(l))),o=0},r))})._clear=function(){clearTimeout(o)},a)),this.oldResult=void 0,this.observer=new IntersectionObserver(function(e){var t=e[0];if(c.callback){var i=t.isIntersecting&&t.intersectionRatio>=c.threshold;if(i===c.oldResult)return;c.oldResult=i,c.callback(i,t),i&&c.options.once&&(c.frozen=!0,c.destroyObserver())}},this.options.intersection),t.context.$nextTick(function(){c.observer.observe(c.el)}))}},{key:"destroyObserver",value:function(){this.observer&&(this.observer.disconnect(),this.observer=null),this.callback&&this.callback._clear&&(this.callback._clear(),this.callback=null)}},{key:"threshold",get:function(){return this.options.intersection&&this.options.intersection.threshold||0}}]),e}();function f(e,t,i){var n=t.value;if("undefined"==typeof IntersectionObserver)console.warn("[vue-observe-visibility] IntersectionObserver API is not available in your browser. Please install this polyfill: https://github.com/w3c/IntersectionObserver/tree/master/polyfill");else{var r=new h(e,n,i);e._vue_visibilityState=r}}var v={bind:f,update:function(e,t,i){var n=t.value;if(!function e(t,i){if(t===i)return!0;if("object"===(void 0===t?"undefined":a(t))){for(var n in t)if(!e(t[n],i[n]))return!1;return!0}return!1}(n,t.oldValue)){var r=e._vue_visibilityState;r?r.createObserver(n,i):f(e,{value:n},i)}},unbind:function(e){var t=e._vue_visibilityState;t&&(t.destroyObserver(),delete e._vue_visibilityState)}};var p={version:"0.4.3",install:function(e){e.directive("observe-visibility",v)}},m=null;"undefined"!=typeof window?m=window.Vue:"undefined"!=typeof global&&(m=global.Vue),m&&m.use(p);var y="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};var b,g=(function(e){var t,i;t=y,i=function(){var e=/(auto|scroll)/,t=function(e,i){return null===e.parentNode?i:t(e.parentNode,i.concat([e]))},i=function(e,t){return getComputedStyle(e,null).getPropertyValue(t)},n=function(t){return e.test(function(e){return i(e,"overflow")+i(e,"overflow-y")+i(e,"overflow-x")}(t))};return function(e){if(e instanceof HTMLElement||e instanceof SVGElement){for(var i=t(e.parentNode,[]),r=0;r<i.length;r+=1)if(n(i[r]))return i[r];return document.scrollingElement||document.documentElement}}},e.exports?e.exports=i():t.Scrollparent=i()}(b={exports:{}},b.exports),b.exports),_="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},w=(function(){function e(e){this.value=e}function t(t){var i,n;function r(i,n){try{var s=t[i](n),l=s.value;l instanceof e?Promise.resolve(l.value).then(function(e){r("next",e)},function(e){r("throw",e)}):o(s.done?"return":"normal",s.value)}catch(e){o("throw",e)}}function o(e,t){switch(e){case"return":i.resolve({value:t,done:!0});break;case"throw":i.reject(t);break;default:i.resolve({value:t,done:!1})}(i=i.next)?r(i.key,i.arg):n=null}this._invoke=function(e,t){return new Promise(function(o,s){var l={key:e,arg:t,resolve:o,reject:s,next:null};n?n=n.next=l:(i=n=l,r(e,t))})},"function"!=typeof t.return&&(this.return=void 0)}"function"==typeof Symbol&&Symbol.asyncIterator&&(t.prototype[Symbol.asyncIterator]=function(){return this}),t.prototype.next=function(e){return this._invoke("next",e)},t.prototype.throw=function(e){return this._invoke("throw",e)},t.prototype.return=function(e){return this._invoke("return",e)}}(),function(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}),S=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])}return e},$={items:{type:Array,required:!0},keyField:{type:String,default:"id"},direction:{type:String,default:"vertical",validator:function(e){return["vertical","horizontal"].includes(e)}}};function z(){return this.items.length&&"object"!==_(this.items[0])}var x=!1;if("undefined"!=typeof window){x=!1;try{var k=Object.defineProperty({},"passive",{get:function(){x=!0}});window.addEventListener("test",null,k)}catch(e){}}var I=0,D={render:function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{directives:[{name:"observe-visibility",rawName:"v-observe-visibility",value:e.handleVisibilityChange,expression:"handleVisibilityChange"}],staticClass:"vue-recycle-scroller",class:w({ready:e.ready,"page-mode":e.pageMode},"direction-"+e.direction,!0),on:{"&scroll":function(t){return e.handleScroll(t)}}},[e.$slots.before?i("div",{staticClass:"vue-recycle-scroller__slot"},[e._t("before")],2):e._e(),e._v(" "),i("div",{ref:"wrapper",staticClass:"vue-recycle-scroller__item-wrapper",style:w({},"vertical"===e.direction?"minHeight":"minWidth",e.totalSize+"px")},e._l(e.pool,function(t){return i("div",{key:t.nr.id,staticClass:"vue-recycle-scroller__item-view",class:{hover:e.hoverKey===t.nr.key},style:e.ready?{transform:"translate"+("vertical"===e.direction?"Y":"X")+"("+t.position+"px)"}:null,on:{mouseenter:function(i){e.hoverKey=t.nr.key},mouseleave:function(t){e.hoverKey=null}}},[e._t("default",null,{item:t.item,index:t.nr.index,active:t.nr.used})],2)}),0),e._v(" "),e.$slots.after?i("div",{staticClass:"vue-recycle-scroller__slot"},[e._t("after")],2):e._e(),e._v(" "),i("ResizeObserver",{on:{notify:e.handleResize}})],1)},staticRenderFns:[],name:"RecycleScroller",components:{ResizeObserver:o},directives:{ObserveVisibility:v},props:S({},$,{itemSize:{type:Number,default:null},minItemSize:{type:[Number,String],default:null},sizeField:{type:String,default:"size"},typeField:{type:String,default:"type"},buffer:{type:Number,default:200},pageMode:{type:Boolean,default:!1},prerender:{type:Number,default:0},emitUpdate:{type:Boolean,default:!1}}),data:function(){return{pool:[],totalSize:0,ready:!1,hoverKey:null}},computed:{sizes:function(){if(null===this.itemSize){for(var e={"-1":{accumulator:0}},t=this.items,i=this.sizeField,n=this.minItemSize,r=0,o=void 0,s=0,l=t.length;s<l;s++)r+=o=t[s][i]||n,e[s]={accumulator:r,size:o};return e}return[]},simpleArray:z},watch:{items:function(){this.updateVisibleItems(!0)},pageMode:function(){this.applyPageMode(),this.updateVisibleItems(!1)},sizes:{handler:function(){this.updateVisibleItems(!1)},deep:!0}},created:function(){this.$_startIndex=0,this.$_endIndex=0,this.$_views=new Map,this.$_unusedViews=new Map,this.$_scrollDirty=!1,this.$isServer&&this.updateVisibleItems(!1)},mounted:function(){var e=this;this.applyPageMode(),this.$nextTick(function(){e.updateVisibleItems(!0),e.ready=!0})},beforeDestroy:function(){this.removeListeners()},methods:{addView:function(e,t,i,n,r){var o={item:i,position:0},s={id:I++,index:t,used:!0,key:n,type:r};return Object.defineProperty(o,"nr",{configurable:!1,value:s}),e.push(o),o},unuseView:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=this.$_unusedViews,n=e.nr.type,r=i.get(n);r||(r=[],i.set(n,r)),r.push(e),t||(e.nr.used=!1,e.position=-9999,this.$_views.delete(e.nr.key))},handleResize:function(){this.$emit("resize"),this.ready&&this.updateVisibleItems(!1)},handleScroll:function(e){var t=this;this.$_scrollDirty||(this.$_scrollDirty=!0,requestAnimationFrame(function(){t.$_scrollDirty=!1,t.updateVisibleItems(!1).continuous||(clearTimeout(t.$_refreshTimout),t.$_refreshTimout=setTimeout(t.handleScroll,100))}))},handleVisibilityChange:function(e,t){var i=this;this.ready&&(e||0!==t.boundingClientRect.width||0!==t.boundingClientRect.height?(this.$emit("visible"),requestAnimationFrame(function(){i.updateVisibleItems(!1)})):this.$emit("hidden"))},updateVisibleItems:function(e){var t=this.itemSize,n=this.typeField,r=this.simpleArray?null:this.keyField,o=this.items,s=o.length,l=this.sizes,a=this.$_views,c=this.$_unusedViews,u=this.pool,d=void 0,h=void 0,f=void 0;if(s)if(this.$isServer)d=0,h=this.prerender,f=null;else{var v=this.getScroll(),p=this.buffer;if(v.start-=p,v.end+=p,null===t){var m=0,y=s-1,b=~~(s/2),g=void 0;do{g=b,l[b].accumulator<v.start?m=b:b<s-1&&l[b+1].accumulator>v.start&&(y=b),b=~~((m+y)/2)}while(b!==g);for(b<0&&(b=0),d=b,f=l[s-1].accumulator,h=b;h<s&&l[h].accumulator<v.end;h++);-1===h?h=o.length-1:++h>s&&(h=s)}else d=~~(v.start/t),h=Math.ceil(v.end/t),d<0&&(d=0),h>s&&(h=s),f=s*t}else d=h=f=0;h-d>i.itemsLimit&&this.itemsLimitError(),this.totalSize=f;var _=void 0,w=d<=this.$_endIndex&&h>=this.$_startIndex,S=void 0;if(this.$_continuous!==w){if(w){a.clear(),c.clear();for(var $=0,z=u.length;$<z;$++)_=u[$],this.unuseView(_)}this.$_continuous=w}else if(w)for(var x=0,k=u.length;x<k;x++)(_=u[x]).nr.used&&(e&&(_.nr.index=o.findIndex(function(e){return r?e[r]===_.item[r]:e===_.item})),(-1===_.nr.index||_.nr.index<d||_.nr.index>=h)&&this.unuseView(_));w||(S=new Map);for(var I=void 0,D=void 0,V=void 0,O=void 0,T=d;T<h;T++){I=o[T];var R=r?I[r]:I;_=a.get(R),t||l[T].size?(_?(_.nr.used=!0,_.item=I):(D=I[n],w?(V=c.get(D))&&V.length?((_=V.pop()).item=I,_.nr.used=!0,_.nr.index=T,_.nr.key=R,_.nr.type=D):_=this.addView(u,T,I,R,D):(V=c.get(D),O=S.get(D)||0,V&&O<V.length?((_=V[O]).item=I,_.nr.used=!0,_.nr.index=T,_.nr.key=R,_.nr.type=D,S.set(D,O+1)):(_=this.addView(u,T,I,R,D),this.unuseView(_,!0)),O++),a.set(R,_)),_.position=null===t?l[T-1].accumulator:T*t):_&&this.unuseView(_)}return this.$_startIndex=d,this.$_endIndex=h,this.emitUpdate&&this.$emit("update",d,h),{continuous:w}},getListenerTarget:function(){var e=g(this.$el);return!window.document||e!==window.document.documentElement&&e!==window.document.body||(e=window),e},getScroll:function(){var e=this.$el,t="vertical"===this.direction,i=void 0;if(this.pageMode){var n=e.getBoundingClientRect(),r=t?n.height:n.width,o=-(t?n.top:n.left),s=t?window.innerHeight:window.innerWidth;o<0&&(s+=o,o=0),o+s>r&&(s=r-o),i={start:o,end:o+s}}else i=t?{start:e.scrollTop,end:e.scrollTop+e.clientHeight}:{start:e.scrollLeft,end:e.scrollLeft+e.clientWidth};return i},applyPageMode:function(){this.pageMode?this.addListeners():this.removeListeners()},addListeners:function(){this.listenerTarget=this.getListenerTarget(),this.listenerTarget.addEventListener("scroll",this.handleScroll,!!x&&{passive:!0}),this.listenerTarget.addEventListener("resize",this.handleResize)},removeListeners:function(){this.listenerTarget&&(this.listenerTarget.removeEventListener("scroll",this.handleScroll),this.listenerTarget.removeEventListener("resize",this.handleResize),this.listenerTarget=null)},scrollToItem:function(e){var t=void 0;t=null===this.itemSize?e>0?this.sizes[e-1].accumulator:0:e*this.itemSize,this.scrollToPosition(t)},scrollToPosition:function(e){"vertical"===this.direction?this.$el.scrollTop=e:this.$el.scrollLeft=e},itemsLimitError:function(){var e=this;throw setTimeout(function(){console.log("It seems the scroller element isn't scrolling, so it tries to render all the items at once.","Scroller:",e.$el),console.log("Make sure the scroller has a fixed height (or width) and 'overflow-y' (or 'overflow-x') set to 'auto' so it can scroll correctly and only render the items visible in the scroll viewport.")}),new Error("Rendered items limit reached")}}},V={render:function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("RecycleScroller",e._g(e._b({ref:"scroller",attrs:{items:e.itemsWithSize,"min-item-size":e.minItemSize,direction:e.direction,"key-field":"id"},on:{resize:e.onScrollerResize,visible:e.onScrollerVisible},scopedSlots:e._u([{key:"default",fn:function(t){var i=t.item,n=t.index,r=t.active;return[e._t("default",null,null,{item:i.item,index:n,active:r,itemWithSize:i})]}}])},"RecycleScroller",e.$attrs,!1),e.listeners),[i("template",{slot:"before"},[e._t("before")],2),e._v(" "),i("template",{slot:"after"},[e._t("after")],2)],2)},staticRenderFns:[],name:"DynamicScroller",components:{RecycleScroller:D},inheritAttrs:!1,provide:function(){return{vscrollData:this.vscrollData,vscrollParent:this}},props:S({},$,{minItemSize:{type:[Number,String],required:!0}}),data:function(){return{vscrollData:{active:!0,sizes:{},validSizes:{},keyField:this.keyField,simpleArray:!1}}},computed:{simpleArray:z,itemsWithSize:function(){for(var e=[],t=this.items,i=this.keyField,n=this.simpleArray,r=this.vscrollData.sizes,o=0;o<t.length;o++){var s=t[o],l=n?o:s[i],a=r[l];void 0!==a||this.$_undefinedMap[l]||(this.$_undefinedSizes++,this.$_undefinedMap[l]=!0,a=0),e.push({item:s,id:l,size:a})}return e},listeners:function(){var e={};for(var t in this.$listeners)"resize"!==t&&"visible"!==t&&(e[t]=this.$listeners[t]);return e}},watch:{items:function(){this.forceUpdate(!1)},simpleArray:{handler:function(e){this.vscrollData.simpleArray=e},immediate:!0},direction:function(e){this.forceUpdate(!0)}},created:function(){this.$_updates=[],this.$_undefinedSizes=0,this.$_undefinedMap={}},activated:function(){this.vscrollData.active=!0},deactivated:function(){this.vscrollData.active=!1},methods:{onScrollerResize:function(){this.$refs.scroller&&this.forceUpdate(),this.$emit("resize")},onScrollerVisible:function(){this.$emit("vscroll:update",{force:!1}),this.$emit("visible")},forceUpdate:function(){(!(arguments.length>0&&void 0!==arguments[0])||arguments[0]||this.simpleArray)&&(this.vscrollData.validSizes={}),this.$emit("vscroll:update",{force:!0})},scrollToItem:function(e){var t=this.$refs.scroller;t&&t.scrollToItem(e)},getItemSize:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,i=this.simpleArray?null!=t?t:this.items.indexOf(e):e[this.keyField];return this.vscrollData.sizes[i]||0},scrollToBottom:function(){var e=this;if(!this.$_scrollingToBottom){this.$_scrollingToBottom=!0;var t=this.$el;this.$nextTick(function(){requestAnimationFrame(function i(){t.scrollTop=t.scrollHeight,0===e.$_undefinedSizes?e.$_scrollingToBottom=!1:requestAnimationFrame(i)})})}}}},O={name:"DynamicScrollerItem",inject:["vscrollData","vscrollParent"],props:{item:{required:!0},watchData:{type:Boolean,default:!1},active:{type:Boolean,required:!0},index:{type:Number,default:void 0},sizeDependencies:{type:[Array,Object],default:null},emitResize:{type:Boolean,default:!1},tag:{type:String,default:"div"}},computed:{id:function(){return this.vscrollData.simpleArray?this.index:this.item[this.vscrollData.keyField]},size:function(){return this.vscrollData.validSizes[this.id]&&this.vscrollData.sizes[this.id]||0}},watch:{watchData:"updateWatchData",id:function(){this.size||this.onDataUpdate()},active:function(e){e&&this.$_pendingVScrollUpdate===this.id&&this.updateSize()}},created:function(){var e=this;if(!this.$isServer){this.$_forceNextVScrollUpdate=null,this.updateWatchData();var t=function(t){e.$watch(function(){return e.sizeDependencies[t]},e.onDataUpdate)};for(var i in this.sizeDependencies)t(i);this.vscrollParent.$on("vscroll:update",this.onVscrollUpdate),this.vscrollParent.$on("vscroll:update-size",this.onVscrollUpdateSize)}},mounted:function(){this.vscrollData.active&&this.updateSize()},beforeDestroy:function(){this.vscrollParent.$off("vscroll:update",this.onVscrollUpdate),this.vscrollParent.$off("vscroll:update-size",this.onVscrollUpdateSize)},methods:{updateSize:function(){this.active&&this.vscrollData.active?this.$_pendingSizeUpdate!==this.id&&(this.$_pendingSizeUpdate=this.id,this.$_forceNextVScrollUpdate=null,this.$_pendingVScrollUpdate=null,this.active&&this.vscrollData.active&&this.computeSize(this.id)):this.$_forceNextVScrollUpdate=this.id},getBounds:function(){return this.$el.getBoundingClientRect()},updateWatchData:function(){var e=this;this.watchData?this.$_watchData=this.$watch("data",function(){e.onDataUpdate()},{deep:!0}):this.$_watchData&&(this.$_watchData(),this.$_watchData=null)},onVscrollUpdate:function(e){var t=e.force;!this.active&&t&&(this.$_pendingVScrollUpdate=this.id),this.$_forceNextVScrollUpdate!==this.id&&!t&&this.size||this.updateSize()},onDataUpdate:function(){this.updateSize()},computeSize:function(e){var t=this;this.$nextTick(function(){if(t.id===e){var i=t.getBounds(),n=Math.round("vertical"===t.vscrollParent.direction?i.height:i.width);n&&t.size!==n&&(t.vscrollParent.$_undefinedMap[e]&&(t.vscrollParent.$_undefinedSizes--,t.vscrollParent.$_undefinedMap[e]=void 0),t.$set(t.vscrollData.sizes,t.id,n),t.$set(t.vscrollData.validSizes,t.id,!0),t.emitResize&&t.$emit("resize",t.id))}t.$_pendingSizeUpdate=null})}},render:function(e){return e(this.tag,this.$slots.default)}};var T={version:"1.0.0-rc.2",install:function(e,t){var n=Object.assign({},{installComponents:!0,componentsPrefix:""},t);for(var r in n)void 0!==n[r]&&(i[r]=n[r]);n.installComponents&&function(e,t){e.component(t+"recycle-scroller",D),e.component(t+"RecycleScroller",D),e.component(t+"dynamic-scroller",V),e.component(t+"DynamicScroller",V),e.component(t+"dynamic-scroller-item",O),e.component(t+"DynamicScrollerItem",O)}(e,n.componentsPrefix)}},R=null;return"undefined"!=typeof window?R=window.Vue:"undefined"!=typeof global&&(R=global.Vue),R&&R.use(T),e.RecycleScroller=D,e.DynamicScroller=V,e.DynamicScrollerItem=O,e.default=T,e.IdState=function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).idProp,i=void 0===e?function(e){return e.item.id}:e,n={},r=new t({data:function(){return{store:n}}});return{data:function(){return{idState:null}},created:function(){var e=this;this.$_id=null,this.$_getId="function"==typeof i?function(){return i.call(e,e)}:function(){return e[i]},this.$watch(this.$_getId,{handler:function(e){var t=this;this.$nextTick(function(){t.$_id=e})},immediate:!0}),this.$_updateIdState()},beforeUpdate:function(){this.$_updateIdState()},methods:{$_idStateInit:function(e){var t=this.$options.idState;if("function"==typeof t){var i=t.call(this,this);return r.$set(n,e,i),this.$_id=e,i}throw new Error("[mixin IdState] Missing `idState` function on component definition.")},$_updateIdState:function(){var e=this.$_getId();null==e&&console.warn("No id found for IdState with idProp: '"+i+"'."),e!==this.$_id&&(n[e]||this.$_idStateInit(e),this.idState=n[e])}}}},e}({},Vue);