vlist-vue 0.1.2 → 1.2.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.
Files changed (2) hide show
  1. package/dist/index.js +1 -1
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- import{ref as f,shallowRef as p,onMounted as L,onBeforeUnmount as c,watch as d,isRef as h,unref as V}from"vue";import{vlist as v}from"@floor/vlist";import{withAsync as g,withGrid as T,withSections as w,withSelection as u,withScrollbar as b,withScale as y,withSnapshots as R,withPage as x}from"@floor/vlist";function S(o){let r=f(null),n=p(null);if(L(()=>{let s=r.value;if(!s)return;let t=V(o),e=v({...t,container:s});if(t.scroll?.element===window)e=e.use(x());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.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(y());let l=t.scroll?.scrollbar||t.scrollbar;if(l!=="none"){let i=typeof l==="object"?l:{};e=e.use(b(i))}e=e.use(R()),n.value=e.build()}),c(()=>{n.value?.destroy(),n.value=null}),h(o))d(()=>o.value.items,(s)=>{if(n.value&&s)n.value.setItems(s)});return{containerRef:r,instance:n}}function U(o,r,n){let s=f(n);d(()=>o.value,(t)=>{if(!t)return;let e=(l)=>{s.value(l)},a=t.on(r,e);c(()=>{a()})},{immediate:!0})}export{U as useVListEvent,S as useVList};
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};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vlist-vue",
3
- "version": "0.1.2",
3
+ "version": "1.2.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.1.2",
35
+ "@floor/vlist": "^1.2.0",
36
36
  "vue": ">=3.0.0"
37
37
  },
38
38
  "files": [