vlist-vue 1.2.0 → 1.5.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/README.md CHANGED
@@ -34,7 +34,7 @@ const { containerRef, instance } = useVList({
34
34
  - **`useVList(config)`** — Creates a virtual list. Returns `{ containerRef, instance }`. Config can be a plain object or a reactive `Ref` for automatic updates.
35
35
  - **`useVListEvent(instance, event, handler)`** — Subscribe to vlist events with automatic cleanup.
36
36
 
37
- Config accepts all [@floor/vlist options](https://vlist.dev/docs/api/reference) minus `container` (handled by the ref). Feature fields like `adapter`, `grid`, `groups`, `selection`, and `scrollbar` are translated into `.use(withX())` calls automatically.
37
+ Config accepts all [@floor/vlist options](https://vlist.dev/docs/api/reference) minus `container` (handled by the ref). Feature fields like `adapter`, `grid`, `groups`, `selection`, `scrollbar`, and `estimatedHeight` are translated into `.use(withX())` calls automatically.
38
38
 
39
39
  ## Documentation
40
40
 
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- import{ref as f,shallowRef as p,onMounted as h,onBeforeUnmount as c,watch as d,isRef as L,unref as V}from"vue";import{vlist as v}from"@floor/vlist";import{withAsync as g,withGrid as T,withMasonry as y,withGroups as w,withSelection as u,withScrollbar as b,withScale as R,withSnapshots as x,withPage as E}from"@floor/vlist";function C(o){let r=f(null),s=p(null);if(h(()=>{let n=r.value;if(!n)return;let t=V(o),e=v({...t,container:n});if(t.scroll?.element===window)e=e.use(E());if(t.adapter)e=e.use(g({adapter:t.adapter,...t.loading&&{loading:t.loading}}));if(t.layout==="grid"&&t.grid)e=e.use(T(t.grid));if(t.layout==="masonry"&&t.masonry)e=e.use(y(t.masonry));if(t.groups){let i=t.groups,m=typeof i.headerHeight==="function"?i.headerHeight("",0):i.headerHeight;e=e.use(w({getGroupForIndex:i.getGroupForIndex,headerHeight:m,headerTemplate:i.headerTemplate,...i.sticky!==void 0&&{sticky:i.sticky}}))}if((t.selection?.mode||"none")!=="none")e=e.use(u(t.selection));else e=e.use(u({mode:"none"}));e=e.use(R());let l=t.scroll?.scrollbar||t.scrollbar;if(l!=="none"){let i=typeof l==="object"?l:{};e=e.use(b(i))}e=e.use(x()),s.value=e.build()}),c(()=>{s.value?.destroy(),s.value=null}),L(o))d(()=>o.value.items,(n)=>{if(s.value&&n)s.value.setItems(n)});return{containerRef:r,instance:s}}function S(o,r,s){let n=f(s);d(()=>o.value,(t)=>{if(!t)return;let e=(l)=>{n.value(l)},a=t.on(r,e);c(()=>{a()})},{immediate:!0})}export{S as useVListEvent,C as useVList};
1
+ import{ref as V,shallowRef as O,onMounted as P,onBeforeUnmount as X,watch as Y,isRef as W,unref as x}from"vue";import{vlist as E}from"@floor/vlist";import{withAsync as G,withAutoSize as U,withGrid as A,withMasonry as B,withGroups as M,withSelection as T,withScrollbar as y,withScale as z,withSnapshots as H,withPage as v}from"@floor/vlist";function m(K){let L=V(null),D=O(null);if(P(()=>{let F=L.value;if(!F)return;let k=x(K),j=E({...k,container:F});if(k.scroll?.element===window)j=j.use(v());let J=k.item,N=k.orientation==="horizontal",Z=N?J.width!=null:J.height!=null,_=N?J.estimatedWidth!=null:J.estimatedHeight!=null;if(!Z&&_)j=j.use(U());if(k.adapter)j=j.use(G({adapter:k.adapter,...k.loading&&{loading:k.loading}}));if(k.layout==="grid"&&k.grid)j=j.use(A(k.grid));if(k.layout==="masonry"&&k.masonry)j=j.use(B(k.masonry));if(k.groups){let q=k.groups,$=typeof q.headerHeight==="function"?q.headerHeight("",0):q.headerHeight;j=j.use(M({getGroupForIndex:q.getGroupForIndex,headerHeight:$,headerTemplate:q.headerTemplate,...q.sticky!==void 0&&{sticky:q.sticky}}))}if((k.selection?.mode||"none")!=="none")j=j.use(T(k.selection));else j=j.use(T({mode:"none"}));j=j.use(z());let Q=k.scroll?.scrollbar||k.scrollbar;if(Q!=="none"){let q=typeof Q==="object"?Q:{};j=j.use(y(q))}j=j.use(H()),D.value=j.build()}),X(()=>{D.value?.destroy(),D.value=null}),W(K))Y(()=>K.value.items,(F)=>{if(D.value&&F)D.value.setItems(F)});return{containerRef:L,instance:D}}function w(K,L,D){let F=V(D);Y(()=>K.value,(k)=>{if(!k)return;let j=(N)=>{F.value(N)},J=k.on(L,j);X(()=>{J()})},{immediate:!0})}export{w as useVListEvent,m as useVList};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vlist-vue",
3
- "version": "1.2.0",
3
+ "version": "1.5.0",
4
4
  "description": "Vue composable for vlist - lightweight virtual scrolling",
5
5
  "author": {
6
6
  "name": "Floor IO",
@@ -32,7 +32,7 @@
32
32
  "./package.json": "./package.json"
33
33
  },
34
34
  "peerDependencies": {
35
- "@floor/vlist": "^1.2.0",
35
+ "@floor/vlist": "^1.5.0",
36
36
  "vue": ">=3.0.0"
37
37
  },
38
38
  "files": [