vlist-vue 3.1.0-next.2 → 3.1.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
@@ -2,6 +2,21 @@
2
2
 
3
3
  Vue composable for [vlist](https://github.com/floor/vlist) — lightweight, zero-dependency virtual scrolling.
4
4
 
5
+ > **Deprecated.** Use [`vlist/vue`](https://github.com/floor/vlist#frameworks) from the `vlist` package instead. Change the import path, and pass features as plugins:
6
+ >
7
+ > ```ts
8
+ > // before
9
+ > import { useVList } from "vlist-vue";
10
+ > useVList({ items, item, selection: { mode: "single" } });
11
+ >
12
+ > // after
13
+ > import { useVList } from "vlist/vue";
14
+ > import { selection } from "vlist";
15
+ > useVList({ items, item }, [selection({ mode: "single" })]);
16
+ > ```
17
+ >
18
+ > From 3.1 this package is built on `vlist/vue` and keeps its config-based API, so existing code keeps working while you migrate. It needs `vlist ^3.1.0`; on vlist 3.0.x, stay on `vlist-vue` 3.0.x.
19
+
5
20
  ## Install
6
21
 
7
22
  ```bash
@@ -42,7 +57,7 @@ Full usage guide, feature config examples, and TypeScript types: **[Framework Ad
42
57
 
43
58
  ## Synthetic input
44
59
 
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.
60
+ 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`. A carousel honours `"synthetic"` too. `VListFactory` is re-exported for typed custom factories.
46
61
 
47
62
  ```vue
48
63
  <script setup lang="ts">
package/dist/index.d.ts CHANGED
@@ -1,10 +1,17 @@
1
1
  /**
2
2
  * Vue composable for vlist - lightweight virtual scrolling
3
+ *
4
+ * Deprecated: use `vlist/vue` from the vlist package, which takes features as
5
+ * plugins (`useVList({ items, item }, [selection()])`). This package keeps the
6
+ * config-based API on top of it: the composables are `vlist/vue`'s, building
7
+ * the list with `createVListFromConfig` so feature fields still resolve to
8
+ * plugins.
3
9
  */
4
- import { type Ref, type ShallowRef } from "vue";
5
- import type { VListItem, VListEvents, EventHandler } from "vlist";
6
- import type { VList } from "vlist";
10
+ import type { Ref, ShallowRef } from "vue";
11
+ import type { VListItem, VList } from "vlist";
7
12
  import { type VListConfig } from "vlist/config";
13
+ import { useVListEvent } from "vlist/vue";
14
+ export { useVListEvent };
8
15
  export type { VListItem, VListEvents, VList, CreateVListConfig, ItemConfig, ItemTemplate, EventHandler, Unsubscribe, } from "vlist";
9
16
  export type { VListConfig, VListFactory } from "vlist/config";
10
17
  /**
@@ -18,4 +25,3 @@ export interface UseVListReturn<T extends VListItem = VListItem> {
18
25
  instance: ShallowRef<VList<T> | null>;
19
26
  }
20
27
  export declare function useVList<T extends VListItem = VListItem>(configInput: UseVListConfig<T> | Ref<UseVListConfig<T>>): UseVListReturn<T>;
21
- export declare function useVListEvent<T extends VListItem, K extends keyof VListEvents<T>>(instanceRef: Ref<VList<T> | null> | ShallowRef<VList<T> | null>, event: K, handler: EventHandler<VListEvents<T>[K]>): void;
package/dist/index.js CHANGED
@@ -1 +1 @@
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};
1
+ import{createVListFromConfig as k}from"vlist/config";import{useVList as q,useVListEvent as B}from"vlist/vue";var x=k;function D(j){return q(j,[],x)}export{B as useVListEvent,D as useVList};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vlist-vue",
3
- "version": "3.1.0-next.2",
3
+ "version": "3.1.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
- "vlist": "^3.0.0 || ^3.1.0-next.2",
35
+ "vlist": "^3.1.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.1.0-next.2",
55
+ "vlist": "3.1.0",
56
56
  "vue": "^3.5.28"
57
57
  }
58
58
  }