@vueuse/integrations 12.2.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.
- package/index.cjs +46 -46
- package/index.d.cts +20 -14
- package/index.d.mts +20 -14
- package/index.d.ts +20 -14
- package/index.iife.js +46 -46
- package/index.iife.min.js +1 -1
- package/index.mjs +36 -36
- package/package.json +3 -3
- package/useAsyncValidator/component.cjs +1 -1
- package/useAsyncValidator/component.mjs +2 -2
- package/useAsyncValidator.cjs +3 -3
- package/useAsyncValidator.iife.js +3 -3
- package/useAsyncValidator.iife.min.js +1 -1
- package/useAsyncValidator.mjs +4 -4
- package/useAxios.cjs +6 -6
- package/useAxios.d.cts +19 -13
- package/useAxios.d.mts +19 -13
- package/useAxios.d.ts +19 -13
- package/useAxios.iife.js +6 -6
- package/useAxios.iife.min.js +1 -1
- package/useAxios.mjs +6 -6
- package/useChangeCase.cjs +3 -4
- package/useChangeCase.iife.js +5 -5
- package/useChangeCase.iife.min.js +1 -1
- package/useChangeCase.mjs +1 -2
- package/useDrauu.cjs +9 -9
- package/useDrauu.iife.js +9 -9
- package/useDrauu.iife.min.js +1 -1
- package/useDrauu.mjs +9 -9
- package/useFocusTrap.cjs +3 -3
- package/useFocusTrap.d.cts +1 -1
- package/useFocusTrap.d.mts +1 -1
- package/useFocusTrap.d.ts +1 -1
- package/useFocusTrap.iife.js +3 -3
- package/useFocusTrap.iife.min.js +1 -1
- package/useFocusTrap.mjs +4 -4
- package/useFuse.cjs +9 -10
- package/useFuse.iife.js +11 -11
- package/useFuse.iife.min.js +1 -1
- package/useFuse.mjs +6 -7
- package/useIDBKeyval.cjs +1 -2
- package/useIDBKeyval.iife.js +3 -3
- package/useIDBKeyval.iife.min.js +1 -1
- package/useIDBKeyval.mjs +1 -2
- package/useJwt.cjs +3 -4
- package/useJwt.iife.js +5 -5
- package/useJwt.iife.min.js +1 -1
- package/useJwt.mjs +2 -3
- package/useNProgress.cjs +1 -1
- package/useNProgress.d.cts +1 -1
- package/useNProgress.d.mts +1 -1
- package/useNProgress.d.ts +1 -1
- package/useNProgress.iife.js +1 -1
- package/useNProgress.iife.min.js +1 -1
- package/useNProgress.mjs +3 -3
- package/useSortable/component.cjs +4 -4
- package/useSortable/component.mjs +5 -5
- package/useSortable.cjs +8 -8
- package/useSortable.iife.js +8 -8
- package/useSortable.iife.min.js +1 -1
- package/useSortable.mjs +9 -9
package/useSortable.iife.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
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
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { tryOnMounted, tryOnScopeDispose,
|
|
1
|
+
import { tryOnMounted, tryOnScopeDispose, unrefElement, defaultDocument } from '@vueuse/core';
|
|
2
2
|
import Sortable from 'sortablejs';
|
|
3
|
-
import { isRef, nextTick } from 'vue';
|
|
3
|
+
import { isRef, toValue, nextTick } from 'vue';
|
|
4
4
|
|
|
5
5
|
function useSortable(el, list, options = {}) {
|
|
6
6
|
let sortable;
|
|
@@ -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 ?
|
|
15
|
-
if (!target || sortable !==
|
|
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 ?
|
|
21
|
-
sortable =
|
|
20
|
+
sortable == null ? undefined : sortable.destroy();
|
|
21
|
+
sortable = undefined;
|
|
22
22
|
};
|
|
23
23
|
const option = (name, value) => {
|
|
24
|
-
if (value !==
|
|
25
|
-
sortable == null ?
|
|
24
|
+
if (value !== undefined)
|
|
25
|
+
sortable == null ? undefined : sortable.option(name, value);
|
|
26
26
|
else
|
|
27
|
-
return sortable == null ?
|
|
27
|
+
return sortable == null ? undefined : sortable.option(name);
|
|
28
28
|
};
|
|
29
29
|
tryOnMounted(start);
|
|
30
30
|
tryOnScopeDispose(stop);
|