@vueuse/integrations 12.3.0 → 12.4.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.
@@ -10,20 +10,20 @@
10
10
  }
11
11
  };
12
12
  const start = () => {
13
- const target = typeof el === "string" ? document == null ? void 0 : document.querySelector(el) : core.unrefElement(el);
14
- if (!target || sortable !== void 0)
13
+ const target = typeof el === "string" ? document == null ? undefined : document.querySelector(el) : core.unrefElement(el);
14
+ if (!target || sortable !== undefined)
15
15
  return;
16
16
  sortable = new Sortable(target, { ...defaultOptions, ...resetOptions });
17
17
  };
18
18
  const stop = () => {
19
- sortable == null ? void 0 : sortable.destroy();
20
- sortable = void 0;
19
+ sortable == null ? undefined : sortable.destroy();
20
+ sortable = undefined;
21
21
  };
22
22
  const option = (name, value) => {
23
- if (value !== void 0)
24
- sortable == null ? void 0 : sortable.option(name, value);
23
+ if (value !== undefined)
24
+ sortable == null ? undefined : sortable.option(name, value);
25
25
  else
26
- return sortable == null ? void 0 : sortable.option(name);
26
+ return sortable == null ? undefined : sortable.option(name);
27
27
  };
28
28
  core.tryOnMounted(start);
29
29
  core.tryOnScopeDispose(stop);
@@ -1 +1 @@
1
- (function(l,u,N,d){"use strict";function V(t,i,o={}){let e;const{document:s=u.defaultDocument,...r}=o,c={onUpdate:n=>{m(i,n.oldIndex,n.newIndex,n)}},p=()=>{const n=typeof t=="string"?s?.querySelector(t):u.unrefElement(t);!n||e!==void 0||(e=new N(n,{...c,...r}))},v=()=>{e?.destroy(),e=void 0},h=(n,y)=>{if(y!==void 0)e?.option(n,y);else return e?.option(n)};return u.tryOnMounted(p),u.tryOnScopeDispose(v),{stop:v,start:p,option:h}}function f(t,i,o){const e=t.children[o];t.insertBefore(i,e)}function a(t){t.parentNode&&t.parentNode.removeChild(t)}function m(t,i,o,e=null){e!=null&&(a(e.item),f(e.from,e.item,i));const s=d.isRef(t),r=s?[...d.toValue(t)]:d.toValue(t);if(o>=0&&o<r.length){const c=r.splice(i,1)[0];d.nextTick(()=>{r.splice(o,0,c),s&&(t.value=r)})}}l.insertNodeAt=f,l.moveArrayElement=m,l.removeNode=a,l.useSortable=V})(this.VueUse=this.VueUse||{},VueUse,Sortable,Vue);
1
+ (function(s,d,V,l){"use strict";function h(n,i,o={}){let e;const{document:r=d.defaultDocument,...u}=o,f={onUpdate:t=>{m(i,t.oldIndex,t.newIndex,t)}},p=()=>{const t=typeof n=="string"?r?.querySelector(n):d.unrefElement(n);!t||e!==void 0||(e=new V(t,{...f,...u}))},y=()=>{e?.destroy(),e=void 0},S=(t,N)=>{if(N!==void 0)e?.option(t,N);else return e?.option(t)};return d.tryOnMounted(p),d.tryOnScopeDispose(y),{stop:y,start:p,option:S}}function c(n,i,o){const e=n.children[o];n.insertBefore(i,e)}function a(n){n.parentNode&&n.parentNode.removeChild(n)}function m(n,i,o,e=null){e!=null&&(a(e.item),c(e.from,e.item,i));const r=l.isRef(n),u=r?[...l.toValue(n)]:l.toValue(n);if(o>=0&&o<u.length){const f=u.splice(i,1)[0];l.nextTick(()=>{u.splice(o,0,f),r&&(n.value=u)})}}s.insertNodeAt=c,s.moveArrayElement=m,s.removeNode=a,s.useSortable=h})(this.VueUse=this.VueUse||{},VueUse,Sortable,Vue);
package/useSortable.mjs CHANGED
@@ -11,20 +11,20 @@ function useSortable(el, list, options = {}) {
11
11
  }
12
12
  };
13
13
  const start = () => {
14
- const target = typeof el === "string" ? document == null ? void 0 : document.querySelector(el) : unrefElement(el);
15
- if (!target || sortable !== void 0)
14
+ const target = typeof el === "string" ? document == null ? undefined : document.querySelector(el) : unrefElement(el);
15
+ if (!target || sortable !== undefined)
16
16
  return;
17
17
  sortable = new Sortable(target, { ...defaultOptions, ...resetOptions });
18
18
  };
19
19
  const stop = () => {
20
- sortable == null ? void 0 : sortable.destroy();
21
- sortable = void 0;
20
+ sortable == null ? undefined : sortable.destroy();
21
+ sortable = undefined;
22
22
  };
23
23
  const option = (name, value) => {
24
- if (value !== void 0)
25
- sortable == null ? void 0 : sortable.option(name, value);
24
+ if (value !== undefined)
25
+ sortable == null ? undefined : sortable.option(name, value);
26
26
  else
27
- return sortable == null ? void 0 : sortable.option(name);
27
+ return sortable == null ? undefined : sortable.option(name);
28
28
  };
29
29
  tryOnMounted(start);
30
30
  tryOnScopeDispose(stop);