vlist-vue 3.0.1 → 3.1.0-next.2
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 +3 -4
- 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 with automatic cleanup.
|
|
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,18 +42,17 @@ Full usage guide, feature config examples, and TypeScript types: **[Framework Ad
|
|
|
42
42
|
|
|
43
43
|
## Synthetic input
|
|
44
44
|
|
|
45
|
-
|
|
45
|
+
Every list scrolls natively by default, and hands itself to synthetic input past the browser's element size limit: `scroll.mode` is `"auto"`. Pass `scroll: { mode: "synthetic" }` for synthetic input from the start, or `"native"` to stay native; the adapter forwards `scroll` unchanged through `vlist/config`. A synthetic list draws its own scrollbar. Requires `vlist ^3.1.0-next.2`; on 3.0.0, pass `factory: createVList` from the deprecated `vlist/synthetic`. A carousel honours `"synthetic"` too. `VListFactory` is re-exported for typed custom factories.
|
|
46
46
|
|
|
47
47
|
```vue
|
|
48
48
|
<script setup lang="ts">
|
|
49
49
|
import { useVList } from "vlist-vue";
|
|
50
|
-
import { createVList } from "vlist/synthetic";
|
|
51
50
|
|
|
52
51
|
const items = Array.from({ length: 1000 }, (_, id) => ({ id }));
|
|
53
52
|
const { containerRef } = useVList({
|
|
54
|
-
factory: createVList,
|
|
55
53
|
items,
|
|
56
54
|
item: { height: 48, template: item => String(item.id) },
|
|
55
|
+
scroll: { mode: "synthetic" },
|
|
57
56
|
});
|
|
58
57
|
</script>
|
|
59
58
|
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ref as
|
|
1
|
+
import{ref as A,shallowRef as N,onMounted as O,onBeforeUnmount as D,watch as E,isRef as P,unref as Q}from"vue";import{createVListFromConfig as S}from"vlist/config";function X(q){let x=A(null),j=N(null);if(O(()=>{let k=x.value;if(!k)return;let z=Q(q);j.value=S({...z,container:k})}),D(()=>{j.value?.destroy(),j.value=null}),P(q))E(()=>q.value.items,(k)=>{if(j.value&&k)j.value.setItems(k)});return{containerRef:x,instance:j}}function Y(q,x,j){let k=A(j);E(()=>q.value,(z)=>{if(!z)return;let G=(K)=>{k.value(K)},J=z.on(x,G);D(()=>{J()})},{immediate:!0})}export{Y as useVListEvent,X as useVList};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vlist-vue",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.1.0-next.2",
|
|
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 || ^3.1.0-next.2",
|
|
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.1.0-next.2",
|
|
56
56
|
"vue": "^3.5.28"
|
|
57
57
|
}
|
|
58
58
|
}
|