@nuxt/devtools-nightly 2.0.0-beta.1-28945928.8db1f2a → 2.0.0-beta.1-28950256.38779d3
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/.discoveryrc.cjs +13 -0
- package/dist/chunks/module-main.mjs +52 -5
- package/dist/client/200.html +15 -15
- package/dist/client/404.html +15 -15
- package/dist/client/_nuxt/__blank-mzki7hds.js +1 -0
- package/dist/client/_nuxt/{analyze-build-dhl902y9.js → analyze-build-ghe65cn6.js} +1 -1
- package/dist/client/_nuxt/{assets-tdu15xdh.js → assets-k0ndvv1a.js} +1 -1
- package/dist/client/_nuxt/builds/latest.json +1 -1
- package/dist/client/_nuxt/builds/meta/a88d4cff-62d2-4670-874e-e2429c78835d.json +1 -0
- package/dist/client/_nuxt/{client-c9f80qsp.js → client-bnemmvey.js} +1 -1
- package/dist/client/_nuxt/{code-diff.vue-i6ai5lst.js → code-diff.vue-hqwbzb3q.js} +1 -1
- package/dist/client/_nuxt/{code-snippets.vue-hvapgodh.js → code-snippets.vue-hqr9klt9.js} +1 -1
- package/dist/client/_nuxt/{components-flcxjbpi.js → components-dsgi3ihf.js} +1 -1
- package/dist/client/_nuxt/{composable-item.vue-nf0lmc00.js → composable-item.vue-ilrg33c4.js} +1 -1
- package/dist/client/_nuxt/{custom-_name_-gctvnum9.js → custom-_name_-n3cz2y9w.js} +1 -1
- package/dist/client/_nuxt/{default-etxkwzb2.js → default-jn8wnrvh.js} +1 -1
- package/dist/client/_nuxt/duration-display.vue-jvaccd8v.js +1 -0
- package/dist/client/_nuxt/entry.css-egk2z7qr.css +1 -0
- package/dist/client/_nuxt/{error-404-n2bv7ov9.js → error-404-i2buvj3s.js} +1 -1
- package/dist/client/_nuxt/error-404.css-lmmxplpx.css +1 -0
- package/dist/client/_nuxt/{error-500-luh9fo24.js → error-500-k74q7w5h.js} +1 -1
- package/dist/client/_nuxt/error-500.css-u0boq89r.css +1 -0
- package/dist/client/_nuxt/{error-fut0s14b.js → error-ff6vide3.js} +1 -1
- package/dist/client/_nuxt/{filepath-item.vue-ldc0cd59.js → filepath-item.vue-bso7cqek.js} +1 -1
- package/dist/client/_nuxt/full-eekoob6r.js +1 -0
- package/dist/client/_nuxt/{help-fab.vue-hhv95xvg.js → help-fab.vue-cowvqwc1.js} +1 -1
- package/dist/client/_nuxt/{hooks-nnc2743y.js → hooks-laqqkw83.js} +1 -1
- package/dist/client/_nuxt/{imports-fknrz1re.js → imports-ntnu5him.js} +1 -1
- package/dist/client/_nuxt/index-b4du1scz.js +2 -0
- package/dist/client/_nuxt/{index-bbxva40i.js → index-lmte2pii.js} +1 -1
- package/dist/client/_nuxt/launch-page.vue-pbaeebzu.js +1 -0
- package/dist/client/_nuxt/modules-gqe1sjca.js +1 -0
- package/dist/client/_nuxt/nbadge-hnjub4bk.js +1 -0
- package/dist/client/_nuxt/{ncheckbox.vue-ktnsaj70.js → ncheckbox.vue-mno28fx4.js} +1 -1
- package/dist/client/_nuxt/ncode-block.css-lvdc77tw.css +1 -0
- package/dist/client/_nuxt/ncode-block.vue-c2t0anp9.js +2 -0
- package/dist/client/_nuxt/ndrawer.vue-oqbba0fs.js +1 -0
- package/dist/client/_nuxt/{ndropdown.vue-c5jsbp5v.js → ndropdown.vue-gv8gb8aa.js} +1 -1
- package/dist/client/_nuxt/{nicon-title.vue-ouqsubn7.js → nicon-title.vue-hch1agon.js} +1 -1
- package/dist/client/_nuxt/{nlink.vue-k9k5hsy4.js → nlink.vue-gjb2rfu0.js} +1 -1
- package/dist/client/_nuxt/{nmarkdown.vue-hygash5x.js → nmarkdown.vue-lym2fx3e.js} +1 -1
- package/dist/client/_nuxt/{nnavbar.vue-f0vufq5s.js → nnavbar.vue-f156b01p.js} +1 -1
- package/dist/client/_nuxt/none-cm6nomrh.js +1 -0
- package/dist/client/_nuxt/{nsection-block-lalufadl.js → nsection-block-nukjv0nc.js} +1 -1
- package/dist/client/_nuxt/nselect-tabs.vue-h1wnt8mw.js +1 -0
- package/dist/client/_nuxt/nselect.vue-d6reg5bh.js +1 -0
- package/dist/client/_nuxt/nsy6o4py.js +17 -0
- package/dist/client/_nuxt/{open-graph-i9tuqyq7.js → open-graph-dttiooz8.js} +1 -1
- package/dist/client/_nuxt/{overview-bn3nhi98.js → overview-n6xpmtqm.js} +1 -1
- package/dist/client/_nuxt/{pages-o7b83d0d.js → pages-d06db48z.js} +1 -1
- package/dist/client/_nuxt/{payload-hlgnscsj.js → payload-np085qa8.js} +1 -1
- package/dist/client/_nuxt/pinia-l28sk0i2.js +1 -0
- package/dist/client/_nuxt/{plugins-n4on0a1j.js → plugins-gq5gfl4o.js} +1 -1
- package/dist/client/_nuxt/{render-tree-o6m99mru.js → render-tree-pc8geeyh.js} +1 -1
- package/dist/client/_nuxt/{runtime-configs-k5mmw4ae.js → runtime-configs-jvo5lq01.js} +1 -1
- package/dist/client/_nuxt/server-discovery-j144ett3.js +1 -0
- package/dist/client/_nuxt/{server-route-inputs.vue-c9toxo7z.js → server-route-inputs.vue-n27kne49.js} +1 -1
- package/dist/client/_nuxt/{server-routes-oywm7hej.js → server-routes-ob5gn5vp.js} +2 -2
- package/dist/client/_nuxt/{server-tasks-y2pcd9w0.js → server-tasks-obuipdyp.js} +1 -1
- package/dist/client/_nuxt/{settings-l6ourgt3.js → settings-gr5j2kwu.js} +1 -1
- package/dist/client/_nuxt/{stacktrace-list.vue-i6sjgftd.js → stacktrace-list.vue-ey3dm2vd.js} +1 -1
- package/dist/client/_nuxt/{state-components-h4h7ppgm.js → state-components-js8jrart.js} +1 -1
- package/dist/client/_nuxt/state-editor.vue-drye4i73.js +1 -0
- package/dist/client/_nuxt/{state-modules-mgqjnewh.js → state-modules-mxw0ztdq.js} +1 -1
- package/dist/client/_nuxt/{storage-ihktoh6o.js → storage-bn3wbmx8.js} +1 -1
- package/dist/client/_nuxt/{terminals-mm1zdy29.js → terminals-cojz3vs5.js} +1 -1
- package/dist/client/_nuxt/{timeline-n6lmb3xx.js → timeline-bsqnc3c0.js} +2 -2
- package/dist/client/_nuxt/{unocss-runtime-lxpmsgjb.js → unocss-runtime-eltx4hvu.js} +1 -1
- package/dist/client/_nuxt/vendor/{json-editor-vue-gi2fewby.js → json-editor-vue-fw81xiot.js} +100 -100
- package/dist/client/_nuxt/vendor/shiki-j4jbxo4i.js +148 -0
- package/dist/client/_nuxt/vendor/{unocss-fae7bffg.js → unocss-dypm4cev.js} +2 -2
- package/dist/client/_nuxt/vendor/{vis-dlwijd5n.js → vis-fzckz0r6.js} +12 -12
- package/dist/client/_nuxt/vendor/{xterm-dbpzgj7s.js → xterm-b1jefe3j.js} +7 -7
- package/dist/client/_nuxt/{virtual-files-mvim6jfj.js → virtual-files-ip4j3v03.js} +1 -1
- package/dist/client/_nuxt/{vue-virtual-scroller.esm-hx1s7s1b.js → vue-virtual-scroller.esm-luvj44av.js} +1 -1
- package/dist/client/discovery/index.html +611 -0
- package/dist/client/index.html +15 -15
- package/dist/module.json +2 -2
- package/package.json +18 -12
- package/dist/client/_nuxt/__blank-n15vnpb5.js +0 -1
- package/dist/client/_nuxt/builds/meta/d3cc6080-b1af-4518-8c18-051df89d9c28.json +0 -1
- package/dist/client/_nuxt/duration-display.vue-kqe6a4wx.js +0 -1
- package/dist/client/_nuxt/entry.css-nqz5coc9.css +0 -1
- package/dist/client/_nuxt/error-404.css-gakauvtn.css +0 -1
- package/dist/client/_nuxt/error-500.css-nt5emrt3.css +0 -1
- package/dist/client/_nuxt/full-l6aaq3cv.js +0 -1
- package/dist/client/_nuxt/index-lty6c7e5.js +0 -2
- package/dist/client/_nuxt/launch-page.vue-n4iqorpj.js +0 -1
- package/dist/client/_nuxt/modules-j9u2l2km.js +0 -1
- package/dist/client/_nuxt/nbadge-ixgsh96g.js +0 -1
- package/dist/client/_nuxt/ncode-block.css-c9cb29at.css +0 -1
- package/dist/client/_nuxt/ncode-block.vue-gy1ero5j.js +0 -2
- package/dist/client/_nuxt/ndrawer.vue-oeawm3h0.js +0 -1
- package/dist/client/_nuxt/none-liasomf8.js +0 -1
- package/dist/client/_nuxt/nselect-tabs.vue-kz2aw76p.js +0 -1
- package/dist/client/_nuxt/nselect.vue-mgxbszb3.js +0 -1
- package/dist/client/_nuxt/oqehn934.js +0 -17
- package/dist/client/_nuxt/pinia-ds7jhuvv.js +0 -1
- package/dist/client/_nuxt/state-editor.vue-f0he07j5.js +0 -1
- package/dist/client/_nuxt/vendor/shiki-bnvxb5wv.js +0 -147
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as V}from"./nnavbar.vue-
|
|
1
|
+
import{_ as V}from"./nnavbar.vue-f156b01p.js";import{_ as D}from"./ncode-block.vue-c2t0anp9.js";import{bl as S,bm as B,N as U,q as j,U as P,d as E}from"./nsy6o4py.js";import{Q as i,S as c,U as a,k as I,b as f,w as W,l as d,a0 as l,$ as u,F as _,ab as q,a5 as v,Y as z,M as G}from"./vendor/json-editor-vue-fw81xiot.js";import{_ as H}from"./help-fab.vue-cowvqwc1.js";import"./client-bnemmvey.js";import"./vendor/unocss-dypm4cev.js";import"./vendor/shiki-j4jbxo4i.js";const L={class:"markdown-body"},M={__name:"virtual-files",setup(h,{expose:r}){return r({frontmatter:{}}),(p,o)=>(i(),c("div",L,o[0]||(o[0]=[a("h1",null,"Virtual Files",-1),a("p",null,"Virtual files are generated on the fly to support the conventions of the framework, and to provide a better developer experience.",-1)])))}},Q=["onClick"],R={key:0,"h-full":"","of-hidden":"",flex:"~ col"},Y={border:"b base","flex-none":"",px4:"",py2:"","text-sm":"",op75:""},oe=I({__name:"virtual-files",setup(h){const r=f(""),n=S(),p=B(),o=f();W(()=>{if(!p.value)return;const e=`/_vfs.json/${encodeURIComponent(p.value)}`;fetch(e,{headers:{accept:"application/json"}}).then(t=>t.json()).then(t=>o.value=t.current)});function x(e){if(n.value?.rootDir)return e.startsWith(n.value?.rootDir)?e.slice(n.value.rootDir.length):e}const m=d(()=>n.value?n.value.entries.filter(e=>!e.id.startsWith(`${n.value?.rootDir||""}/.nuxt/`)).sort((e,t)=>e.id.localeCompare(t.id)):[]),b=d(()=>new U(m.value,{keys:["id","path"]})),k=d(()=>r.value?b.value.search(r.value).map(e=>e.item):m.value);return(e,t)=>{const y=V,g=D,C=P,$=E,F=j,N=M,w=H;return i(),c(_,null,[l(F,{class:"virtual-files","storage-key":"tab-virtual-files"},{left:u(()=>[l(y,{search:r.value,"onUpdate:search":t[0]||(t[0]=s=>r.value=s),"no-padding":"",p3:""},null,8,["search"]),(i(!0),c(_,null,q(k.value,s=>(i(),c(_,{key:s.id},[a("button",{block:"","w-full":"","select-none":"",truncate:"",px2:"",py1:"","text-start":"","text-sm":"","font-mono":"",class:z(s.id===o.value?.id?"text-primary n-bg-active":"text-secondary hover:n-bg-hover"),onClick:A=>p.value=s.id},v(x(s.id)),11,Q),t[1]||(t[1]=a("div",{"x-divider":""},null,-1))],64))),128))]),right:u(()=>[o.value?.content?(i(),c("div",R,[a("div",Y,[a("code",null,v(o.value.id),1)]),l(g,{"h-full":"","of-auto":"","text-sm":"",code:o.value.content,lang:"typescript"},null,8,["code"])])):(i(),G($,{key:1},{default:u(()=>[l(C,{px6:"",py2:""},{default:u(()=>t[2]||(t[2]=[a("span",{op75:""},"Select a file to start",-1)])),_:1})]),_:1}))]),_:1}),l(w,null,{default:u(()=>[l(N)]),_:1})],64)}}});export{oe as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{O as re,P as ne,n as Q,Q as $,M as L,N as oe,at as le,s as ae,R as ue,ae as ce,a8 as de,S as M,V as A,W,$ as K,F as fe,ab as he,a7 as q,a1 as me,au as pe,X as ye,Y,a0 as ve}from"./vendor/json-editor-vue-
|
|
1
|
+
import{O as re,P as ne,n as Q,Q as $,M as L,N as oe,at as le,s as ae,R as ue,ae as ce,a8 as de,S as M,V as A,W,$ as K,F as fe,ab as he,a7 as q,a1 as me,au as pe,X as ye,Y,a0 as ve}from"./vendor/json-editor-vue-fw81xiot.js";function be(){var e=window.navigator.userAgent,t=e.indexOf("MSIE ");if(t>0)return parseInt(e.substring(t+5,e.indexOf(".",t)),10);var i=e.indexOf("Trident/");if(i>0){var s=e.indexOf("rv:");return parseInt(e.substring(s+3,e.indexOf(".",s)),10)}var r=e.indexOf("Edge/");return r>0?parseInt(e.substring(r+5,e.indexOf(".",r)),10):-1}let R;function H(){H.init||(H.init=!0,R=be()!==-1)}var E={name:"ResizeObserver",props:{emitOnMount:{type:Boolean,default:!1},ignoreWidth:{type:Boolean,default:!1},ignoreHeight:{type:Boolean,default:!1}},emits:["notify"],mounted(){H(),Q(()=>{this._w=this.$el.offsetWidth,this._h=this.$el.offsetHeight,this.emitOnMount&&this.emitSize()});const e=document.createElement("object");this._resizeObject=e,e.setAttribute("aria-hidden","true"),e.setAttribute("tabindex",-1),e.onload=this.addResizeHandlers,e.type="text/html",R&&this.$el.appendChild(e),e.data="about:blank",R||this.$el.appendChild(e)},beforeUnmount(){this.removeResizeHandlers()},methods:{compareAndNotify(){(!this.ignoreWidth&&this._w!==this.$el.offsetWidth||!this.ignoreHeight&&this._h!==this.$el.offsetHeight)&&(this._w=this.$el.offsetWidth,this._h=this.$el.offsetHeight,this.emitSize())},emitSize(){this.$emit("notify",{width:this._w,height:this._h})},addResizeHandlers(){this._resizeObject.contentDocument.defaultView.addEventListener("resize",this.compareAndNotify),this.compareAndNotify()},removeResizeHandlers(){this._resizeObject&&this._resizeObject.onload&&(!R&&this._resizeObject.contentDocument&&this._resizeObject.contentDocument.defaultView.removeEventListener("resize",this.compareAndNotify),this.$el.removeChild(this._resizeObject),this._resizeObject.onload=null,this._resizeObject=null)}}};const ge=oe();re("data-v-b329ee4c");const Se={class:"resize-observer",tabindex:"-1"};ne();const ze=ge((e,t,i,s,r,a)=>($(),L("div",Se)));E.render=ze;E.__scopeId="data-v-b329ee4c";E.__file="src/components/ResizeObserver.vue";function C(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?C=function(t){return typeof t}:C=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},C(e)}function _e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function we(e,t){for(var i=0;i<t.length;i++){var s=t[i];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(e,s.key,s)}}function Ie(e,t,i){return we(e.prototype,t),e}function X(e){return $e(e)||Te(e)||Oe(e)||Ve()}function $e(e){if(Array.isArray(e))return N(e)}function Te(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function Oe(e,t){if(e){if(typeof e=="string")return N(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);if(i==="Object"&&e.constructor&&(i=e.constructor.name),i==="Map"||i==="Set")return Array.from(e);if(i==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return N(e,t)}}function N(e,t){(t==null||t>e.length)&&(t=e.length);for(var i=0,s=new Array(t);i<t;i++)s[i]=e[i];return s}function Ve(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
2
2
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function xe(e){var t;return typeof e=="function"?t={callback:e}:t=e,t}function ke(e,t){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s,r,a,u=function(n){for(var d=arguments.length,p=new Array(d>1?d-1:0),S=1;S<d;S++)p[S-1]=arguments[S];if(a=p,!(s&&n===r)){var w=i.leading;typeof w=="function"&&(w=w(n,r)),(!s||n!==r)&&w&&e.apply(void 0,[n].concat(X(a))),r=n,clearTimeout(s),s=setTimeout(function(){e.apply(void 0,[n].concat(X(a))),s=0},t)}};return u._clear=function(){clearTimeout(s),s=null},u}function J(e,t){if(e===t)return!0;if(C(e)==="object"){for(var i in e)if(!J(e[i],t[i]))return!1;return!0}return!1}var Me=function(){function e(t,i,s){_e(this,e),this.el=t,this.observer=null,this.frozen=!1,this.createObserver(i,s)}return Ie(e,[{key:"createObserver",value:function(i,s){var r=this;if(this.observer&&this.destroyObserver(),!this.frozen){if(this.options=xe(i),this.callback=function(c,n){r.options.callback(c,n),c&&r.options.once&&(r.frozen=!0,r.destroyObserver())},this.callback&&this.options.throttle){var a=this.options.throttleOptions||{},u=a.leading;this.callback=ke(this.callback,this.options.throttle,{leading:function(n){return u==="both"||u==="visible"&&n||u==="hidden"&&!n}})}this.oldResult=void 0,this.observer=new IntersectionObserver(function(c){var n=c[0];if(c.length>1){var d=c.find(function(S){return S.isIntersecting});d&&(n=d)}if(r.callback){var p=n.isIntersecting&&n.intersectionRatio>=r.threshold;if(p===r.oldResult)return;r.oldResult=p,r.callback(p,n)}},this.options.intersection),Q(function(){r.observer&&r.observer.observe(r.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&&typeof this.options.intersection.threshold=="number"?this.options.intersection.threshold:0}}]),e}();function Z(e,t,i){var s=t.value;if(s)if(typeof IntersectionObserver>"u")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 Me(e,s,i);e._vue_visibilityState=r}}function Ae(e,t,i){var s=t.value,r=t.oldValue;if(!J(s,r)){var a=e._vue_visibilityState;if(!s){ee(e);return}a?a.createObserver(s,i):Z(e,{value:s},i)}}function ee(e){var t=e._vue_visibilityState;t&&(t.destroyObserver(),delete e._vue_visibilityState)}var Re={beforeMount:Z,updated:Ae,unmounted:ee},Ce={itemsLimit:1e3},Ee=/(auto|scroll)/;function te(e,t){return e.parentNode===null?t:te(e.parentNode,t.concat([e]))}var P=function(t,i){return getComputedStyle(t,null).getPropertyValue(i)},Pe=function(t){return P(t,"overflow")+P(t,"overflow-y")+P(t,"overflow-x")},Le=function(t){return Ee.test(Pe(t))};function G(e){if(e instanceof HTMLElement||e instanceof SVGElement){for(var t=te(e.parentNode,[]),i=0;i<t.length;i+=1)if(Le(t[i]))return t[i];return document.scrollingElement||document.documentElement}}function j(e){"@babel/helpers - typeof";return j=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},j(e)}var He={items:{type:Array,required:!0},keyField:{type:String,default:"id"},direction:{type:String,default:"vertical",validator:function(t){return["vertical","horizontal"].includes(t)}},listTag:{type:String,default:"div"},itemTag:{type:String,default:"div"}};function Ne(){return this.items.length&&j(this.items[0])!=="object"}var B=!1;if(typeof window<"u"){B=!1;try{var je=Object.defineProperty({},"passive",{get:function(){B=!0}});window.addEventListener("test",null,je)}catch{}}let Be=0;var ie={name:"RecycleScroller",components:{ResizeObserver:E},directives:{ObserveVisibility:Re},props:{...He,itemSize:{type:Number,default:null},gridItems:{type:Number,default:void 0},itemSecondarySize:{type:Number,default:void 0},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},updateInterval:{type:Number,default:0},skipHover:{type:Boolean,default:!1},listTag:{type:String,default:"div"},itemTag:{type:String,default:"div"},listClass:{type:[String,Object,Array],default:""},itemClass:{type:[String,Object,Array],default:""}},emits:["resize","visible","hidden","update","scroll-start","scroll-end"],data(){return{pool:[],totalSize:0,ready:!1,hoverKey:null}},computed:{sizes(){if(this.itemSize===null){const e={"-1":{accumulator:0}},t=this.items,i=this.sizeField,s=this.minItemSize;let r=1e4,a=0,u;for(let c=0,n=t.length;c<n;c++)u=t[c][i]||s,u<r&&(r=u),a+=u,e[c]={accumulator:a,size:u};return this.$_computedMinItemSize=r,e}return[]},simpleArray:Ne,itemIndexByKey(){const{keyField:e,items:t}=this,i={};for(let s=0,r=t.length;s<r;s++)i[t[s][e]]=s;return i}},watch:{items(){this.updateVisibleItems(!0)},pageMode(){this.applyPageMode(),this.updateVisibleItems(!1)},sizes:{handler(){this.updateVisibleItems(!1)},deep:!0},gridItems(){this.updateVisibleItems(!0)},itemSecondarySize(){this.updateVisibleItems(!0)}},created(){this.$_startIndex=0,this.$_endIndex=0,this.$_views=new Map,this.$_unusedViews=new Map,this.$_scrollDirty=!1,this.$_lastUpdateScrollPosition=0,this.prerender&&(this.$_prerender=!0,this.updateVisibleItems(!1)),this.gridItems&&!this.itemSize&&console.error("[vue-recycle-scroller] You must provide an itemSize when using gridItems")},mounted(){this.applyPageMode(),this.$nextTick(()=>{this.$_prerender=!1,this.updateVisibleItems(!0),this.ready=!0})},activated(){const e=this.$_lastUpdateScrollPosition;typeof e=="number"&&this.$nextTick(()=>{this.scrollToPosition(e)})},beforeUnmount(){this.removeListeners()},methods:{addView(e,t,i,s,r){const a=le({id:Be++,index:t,used:!0,key:s,type:r}),u=ae({item:i,position:0,nr:a});return e.push(u),u},unuseView(e,t=!1){const i=this.$_unusedViews,s=e.nr.type;let r=i.get(s);r||(r=[],i.set(s,r)),r.push(e),t||(e.nr.used=!1,e.position=-9999)},handleResize(){this.$emit("resize"),this.ready&&this.updateVisibleItems(!1)},handleScroll(e){if(!this.$_scrollDirty){if(this.$_scrollDirty=!0,this.$_updateTimeout)return;const t=()=>requestAnimationFrame(()=>{this.$_scrollDirty=!1;const{continuous:i}=this.updateVisibleItems(!1,!0);i||(clearTimeout(this.$_refreshTimout),this.$_refreshTimout=setTimeout(this.handleScroll,this.updateInterval+100))});t(),this.updateInterval&&(this.$_updateTimeout=setTimeout(()=>{this.$_updateTimeout=0,this.$_scrollDirty&&t()},this.updateInterval))}},handleVisibilityChange(e,t){this.ready&&(e||t.boundingClientRect.width!==0||t.boundingClientRect.height!==0?(this.$emit("visible"),requestAnimationFrame(()=>{this.updateVisibleItems(!1)})):this.$emit("hidden"))},updateVisibleItems(e,t=!1){const i=this.itemSize,s=this.gridItems||1,r=this.itemSecondarySize||i,a=this.$_computedMinItemSize,u=this.typeField,c=this.simpleArray?null:this.keyField,n=this.items,d=n.length,p=this.sizes,S=this.$_views,w=this.$_unusedViews,V=this.pool,se=this.itemIndexByKey;let y,f,T,g,z;if(!d)y=f=g=z=T=0;else if(this.$_prerender)y=g=0,f=z=Math.min(this.prerender,n.length),T=null;else{const o=this.getScroll();if(t){let m=o.start-this.$_lastUpdateScrollPosition;if(m<0&&(m=-m),i===null&&m<a||m<i)return{continuous:!0}}this.$_lastUpdateScrollPosition=o.start;const v=this.buffer;o.start-=v,o.end+=v;let h=0;if(this.$refs.before&&(h=this.$refs.before.scrollHeight,o.start-=h),this.$refs.after){const m=this.$refs.after.scrollHeight;o.end+=m}if(i===null){let m,O=0,F=d-1,b=~~(d/2),U;do U=b,m=p[b].accumulator,m<o.start?O=b:b<d-1&&p[b+1].accumulator>o.start&&(F=b),b=~~((O+F)/2);while(b!==U);for(b<0&&(b=0),y=b,T=p[d-1].accumulator,f=b;f<d&&p[f].accumulator<o.end;f++);for(f===-1?f=n.length-1:(f++,f>d&&(f=d)),g=y;g<d&&h+p[g].accumulator<o.start;g++);for(z=g;z<d&&h+p[z].accumulator<o.end;z++);}else{y=~~(o.start/i*s);const m=y%s;y-=m,f=Math.ceil(o.end/i*s),g=Math.max(0,Math.floor((o.start-h)/i*s)),z=Math.floor((o.end-h)/i*s),y<0&&(y=0),f>d&&(f=d),g<0&&(g=0),z>d&&(z=d),T=Math.ceil(d/s)*i}}f-y>Ce.itemsLimit&&this.itemsLimitError(),this.totalSize=T;let l;const x=y<=this.$_endIndex&&f>=this.$_startIndex;if(x)for(let o=0,v=V.length;o<v;o++)l=V[o],l.nr.used&&(e&&(l.nr.index=se[l.item[c]]),(l.nr.index==null||l.nr.index<y||l.nr.index>=f)&&this.unuseView(l));const D=x?null:new Map;let I,_,k;for(let o=y;o<f;o++){I=n[o];const v=c?I[c]:I;if(v==null)throw new Error(`Key is ${v} on item (keyField is '${c}')`);if(l=S.get(v),!i&&!p[o].size){l&&this.unuseView(l);continue}_=I[u];let h=w.get(_),m=!1;if(!l)x?h&&h.length?l=h.pop():l=this.addView(V,o,I,v,_):(k=D.get(_)||0,(!h||k>=h.length)&&(l=this.addView(V,o,I,v,_),this.unuseView(l,!0),h=w.get(_)),l=h[k],D.set(_,k+1)),S.delete(l.nr.key),l.nr.used=!0,l.nr.index=o,l.nr.key=v,l.nr.type=_,S.set(v,l),m=!0;else if(!l.nr.used&&(l.nr.used=!0,m=!0,h)){const O=h.indexOf(l);O!==-1&&h.splice(O,1)}l.item=I,m&&(o===n.length-1&&this.$emit("scroll-end"),o===0&&this.$emit("scroll-start")),i===null?(l.position=p[o-1].accumulator,l.offset=0):(l.position=Math.floor(o/s)*i,l.offset=o%s*r)}return this.$_startIndex=y,this.$_endIndex=f,this.emitUpdate&&this.$emit("update",y,f,g,z),clearTimeout(this.$_sortTimer),this.$_sortTimer=setTimeout(this.sortViews,this.updateInterval+300),{continuous:x}},getListenerTarget(){let e=G(this.$el);return window.document&&(e===window.document.documentElement||e===window.document.body)&&(e=window),e},getScroll(){const{$el:e,direction:t}=this,i=t==="vertical";let s;if(this.pageMode){const r=e.getBoundingClientRect(),a=i?r.height:r.width;let u=-(i?r.top:r.left),c=i?window.innerHeight:window.innerWidth;u<0&&(c+=u,u=0),u+c>a&&(c=a-u),s={start:u,end:u+c}}else i?s={start:e.scrollTop,end:e.scrollTop+e.clientHeight}:s={start:e.scrollLeft,end:e.scrollLeft+e.clientWidth};return s},applyPageMode(){this.pageMode?this.addListeners():this.removeListeners()},addListeners(){this.listenerTarget=this.getListenerTarget(),this.listenerTarget.addEventListener("scroll",this.handleScroll,B?{passive:!0}:!1),this.listenerTarget.addEventListener("resize",this.handleResize)},removeListeners(){this.listenerTarget&&(this.listenerTarget.removeEventListener("scroll",this.handleScroll),this.listenerTarget.removeEventListener("resize",this.handleResize),this.listenerTarget=null)},scrollToItem(e){let t;const i=this.gridItems||1;this.itemSize===null?t=e>0?this.sizes[e-1].accumulator:0:t=Math.floor(e/i)*this.itemSize,this.scrollToPosition(t)},scrollToPosition(e){const t=this.direction==="vertical"?{scroll:"scrollTop",start:"top"}:{scroll:"scrollLeft",start:"left"};let i,s,r;if(this.pageMode){const a=G(this.$el),u=a.tagName==="HTML"?0:a[t.scroll],c=a.getBoundingClientRect(),d=this.$el.getBoundingClientRect()[t.start]-c[t.start];i=a,s=t.scroll,r=e+u+d}else i=this.$el,s=t.scroll,r=e;i[s]=r},itemsLimitError(){throw setTimeout(()=>{console.log("It seems the scroller element isn't scrolling, so it tries to render all the items at once.","Scroller:",this.$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")},sortViews(){this.pool.sort((e,t)=>e.nr.index-t.nr.index)}}};const De={key:0,ref:"before",class:"vue-recycle-scroller__slot"},Fe={key:1,ref:"after",class:"vue-recycle-scroller__slot"};function Ue(e,t,i,s,r,a){const u=ue("ResizeObserver"),c=ce("observe-visibility");return de(($(),M("div",{class:Y(["vue-recycle-scroller",{ready:r.ready,"page-mode":i.pageMode,[`direction-${e.direction}`]:!0}]),onScrollPassive:t[0]||(t[0]=(...n)=>a.handleScroll&&a.handleScroll(...n))},[e.$slots.before?($(),M("div",De,[A(e.$slots,"before")],512)):W("v-if",!0),($(),L(q(i.listTag),{ref:"wrapper",style:ye({[e.direction==="vertical"?"minHeight":"minWidth"]:r.totalSize+"px"}),class:Y(["vue-recycle-scroller__item-wrapper",i.listClass])},{default:K(()=>[($(!0),M(fe,null,he(r.pool,n=>($(),L(q(i.itemTag),me({key:n.nr.id,style:r.ready?{transform:`translate${e.direction==="vertical"?"Y":"X"}(${n.position}px) translate${e.direction==="vertical"?"X":"Y"}(${n.offset}px)`,width:i.gridItems?`${e.direction==="vertical"&&i.itemSecondarySize||i.itemSize}px`:void 0,height:i.gridItems?`${e.direction==="horizontal"&&i.itemSecondarySize||i.itemSize}px`:void 0}:null,class:["vue-recycle-scroller__item-view",[i.itemClass,{hover:!i.skipHover&&r.hoverKey===n.nr.key}]]},pe(i.skipHover?{}:{mouseenter:()=>{r.hoverKey=n.nr.key},mouseleave:()=>{r.hoverKey=null}})),{default:K(()=>[A(e.$slots,"default",{item:n.item,index:n.nr.index,active:n.nr.used})]),_:2},1040,["style","class"]))),128)),A(e.$slots,"empty")]),_:3},8,["style","class"])),e.$slots.after?($(),M("div",Fe,[A(e.$slots,"after")],512)):W("v-if",!0),ve(u,{onNotify:a.handleResize},null,8,["onNotify"])],34)),[[c,a.handleVisibilityChange]])}ie.render=Ue;ie.__file="src/components/RecycleScroller.vue";export{ie as s};
|