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 +1 -1
- package/dist/index.js +1 -1
- package/package.json +2 -2
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 `
|
|
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
|
|
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.
|
|
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.
|
|
35
|
+
"@floor/vlist": "^1.5.0",
|
|
36
36
|
"vue": ">=3.0.0"
|
|
37
37
|
},
|
|
38
38
|
"files": [
|