vlist-vue 3.0.1-next.1 → 3.0.1
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 +4 -3
- package/dist/index.js +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -32,7 +32,7 @@ const { containerRef, instance } = useVList({
|
|
|
32
32
|
## API
|
|
33
33
|
|
|
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
|
-
- **`useVListEvent(instance, event, handler)`** — Subscribe to vlist events
|
|
35
|
+
- **`useVListEvent(instance, event, handler)`** — Subscribe to vlist events; the subscription ends when the component unmounts (fixed in 3.0.1).
|
|
36
36
|
|
|
37
37
|
Config accepts all [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 resolved into plugins automatically.
|
|
38
38
|
|
|
@@ -42,17 +42,18 @@ Full usage guide, feature config examples, and TypeScript types: **[Framework Ad
|
|
|
42
42
|
|
|
43
43
|
## Synthetic input
|
|
44
44
|
|
|
45
|
-
|
|
45
|
+
Requires `vlist ^3.0.0`. Pass the synthetic entry as `factory` to opt in; the adapter forwards it unchanged through `vlist/config`. `VListFactory` is re-exported for typed custom factories. The factory is selected at mount; remount to change it.
|
|
46
46
|
|
|
47
47
|
```vue
|
|
48
48
|
<script setup lang="ts">
|
|
49
49
|
import { useVList } from "vlist-vue";
|
|
50
|
+
import { createVList } from "vlist/synthetic";
|
|
50
51
|
|
|
51
52
|
const items = Array.from({ length: 1000 }, (_, id) => ({ id }));
|
|
52
53
|
const { containerRef } = useVList({
|
|
54
|
+
factory: createVList,
|
|
53
55
|
items,
|
|
54
56
|
item: { height: 48, template: item => String(item.id) },
|
|
55
|
-
scroll: { mode: "synthetic" },
|
|
56
57
|
});
|
|
57
58
|
</script>
|
|
58
59
|
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ref as
|
|
1
|
+
import{ref as D,shallowRef as K,onMounted as N,onBeforeUnmount as E,watch as G,isRef as O,unref as P}from"vue";import{createVListFromConfig as Q}from"vlist/config";function W(z){let A=D(null),j=K(null);if(N(()=>{let q=A.value;if(!q)return;let x=P(z);j.value=Q({...x,container:q})}),E(()=>{j.value?.destroy(),j.value=null}),O(z))G(()=>z.value.items,(q)=>{if(j.value&&q)j.value.setItems(q)});return{containerRef:A,instance:j}}function X(z,A,j){let q=D(j),x;G(()=>z.value,(H)=>{x?.(),x=H?.on(A,(J)=>q.value(J))},{immediate:!0}),E(()=>{x?.(),x=void 0})}export{X as useVListEvent,W as useVList};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vlist-vue",
|
|
3
|
-
"version": "3.0.1
|
|
3
|
+
"version": "3.0.1",
|
|
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
|
-
"vlist": "^3.0.0
|
|
35
|
+
"vlist": "^3.0.0",
|
|
36
36
|
"vue": ">=3.0.0"
|
|
37
37
|
},
|
|
38
38
|
"files": [
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"@types/bun": "^1.0.0",
|
|
53
53
|
"bun": "^1.0.0",
|
|
54
54
|
"typescript": "^5.0.0",
|
|
55
|
-
"vlist": "^3.0.
|
|
55
|
+
"vlist": "^3.0.0",
|
|
56
56
|
"vue": "^3.5.28"
|
|
57
57
|
}
|
|
58
58
|
}
|