@vueuse/integrations 10.0.0-beta.2 → 10.0.0-beta.3
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 +93 -58
- package/index.d.ts +2 -22
- package/index.iife.js +93 -58
- package/index.iife.min.js +1 -1
- package/index.mjs +94 -59
- package/package.json +5 -5
- package/useAsyncValidator/component.cjs +5 -1
- package/useAsyncValidator/component.mjs +5 -1
- package/useAsyncValidator.cjs +5 -1
- package/useAsyncValidator.iife.js +5 -1
- package/useAsyncValidator.iife.min.js +1 -1
- package/useAsyncValidator.mjs +5 -1
- package/useAxios.cjs +0 -4
- package/useAxios.d.ts +2 -22
- package/useAxios.iife.js +0 -4
- package/useAxios.iife.min.js +1 -1
- package/useAxios.mjs +0 -4
- package/useChangeCase.iife.min.js +1 -1
- package/useCookies.cjs +11 -1
- package/useCookies.iife.js +11 -1
- package/useCookies.iife.min.js +1 -1
- package/useCookies.mjs +11 -1
- package/useDrauu.cjs +22 -18
- package/useDrauu.iife.js +22 -18
- package/useDrauu.iife.min.js +1 -1
- package/useDrauu.mjs +22 -18
- package/useFocusTrap/component.cjs +10 -6
- package/useFocusTrap/component.mjs +10 -6
- package/useFocusTrap.cjs +22 -18
- package/useFocusTrap.iife.js +22 -18
- package/useFocusTrap.iife.min.js +1 -1
- package/useFocusTrap.mjs +22 -18
- package/useFuse.cjs +21 -10
- package/useFuse.iife.js +21 -10
- package/useFuse.iife.min.js +1 -1
- package/useFuse.mjs +21 -10
- package/useIDBKeyval.iife.min.js +1 -1
- package/useJwt.iife.min.js +1 -1
- package/useNProgress.iife.min.js +1 -1
- package/useQRCode.cjs +8 -4
- package/useQRCode.iife.js +8 -4
- package/useQRCode.iife.min.js +1 -1
- package/useQRCode.mjs +8 -4
- package/useSortable/component.cjs +5 -2
- package/useSortable/component.mjs +6 -3
- package/useSortable.cjs +5 -2
- package/useSortable.iife.js +6 -4
- package/useSortable.iife.min.js +1 -1
- package/useSortable.mjs +5 -2
package/useSortable.cjs
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
var core = require('@vueuse/core');
|
|
4
4
|
var Sortable = require('sortablejs');
|
|
5
|
+
var vueDemi = require('vue-demi');
|
|
5
6
|
|
|
6
7
|
var __defProp = Object.defineProperty;
|
|
7
8
|
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
@@ -52,8 +53,10 @@ function useSortable(el, list, options = {}) {
|
|
|
52
53
|
}
|
|
53
54
|
function moveArrayElement(list, from, to) {
|
|
54
55
|
const array = core.resolveUnref(list);
|
|
55
|
-
if (to >= 0 && to < array.length)
|
|
56
|
-
|
|
56
|
+
if (to >= 0 && to < array.length) {
|
|
57
|
+
const element = array.splice(from, 1)[0];
|
|
58
|
+
vueDemi.nextTick(() => array.splice(to, 0, element));
|
|
59
|
+
}
|
|
57
60
|
}
|
|
58
61
|
|
|
59
62
|
exports.moveArrayElement = moveArrayElement;
|
package/useSortable.iife.js
CHANGED
|
@@ -112,7 +112,7 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
|
|
|
112
112
|
this.VueCompositionAPI || (typeof VueCompositionAPI !== 'undefined' ? VueCompositionAPI : undefined)
|
|
113
113
|
);
|
|
114
114
|
;
|
|
115
|
-
;(function (exports, core, Sortable) {
|
|
115
|
+
;(function (exports, core, Sortable, vueDemi) {
|
|
116
116
|
'use strict';
|
|
117
117
|
|
|
118
118
|
var __defProp = Object.defineProperty;
|
|
@@ -164,11 +164,13 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
|
|
|
164
164
|
}
|
|
165
165
|
function moveArrayElement(list, from, to) {
|
|
166
166
|
const array = core.resolveUnref(list);
|
|
167
|
-
if (to >= 0 && to < array.length)
|
|
168
|
-
|
|
167
|
+
if (to >= 0 && to < array.length) {
|
|
168
|
+
const element = array.splice(from, 1)[0];
|
|
169
|
+
vueDemi.nextTick(() => array.splice(to, 0, element));
|
|
170
|
+
}
|
|
169
171
|
}
|
|
170
172
|
|
|
171
173
|
exports.moveArrayElement = moveArrayElement;
|
|
172
174
|
exports.useSortable = useSortable;
|
|
173
175
|
|
|
174
|
-
})(this.VueUse = this.VueUse || {}, VueUse, Sortable);
|
|
176
|
+
})(this.VueUse = this.VueUse || {}, VueUse, Sortable, VueDemi);
|
package/useSortable.iife.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var VueDemi=function(r,n,
|
|
1
|
+
var VueDemi=function(r,n,p){if(r.install)return r;if(!n)return console.error("[vue-demi] no Vue instance found, please be sure to import `vue` before `vue-demi`."),r;if(n.version.slice(0,4)==="2.7."){let o=function(f,d){var l,u={},b={config:n.config,use:n.use.bind(n),mixin:n.mixin.bind(n),component:n.component.bind(n),provide:function(v,c){return u[v]=c,this},directive:function(v,c){return c?(n.directive(v,c),b):n.directive(v)},mount:function(v,c){return l||(l=new n(Object.assign({propsData:d},f,{provide:Object.assign(u,f.provide)})),l.$mount(v,c),l)},unmount:function(){l&&(l.$destroy(),l=void 0)}};return b};var A=o;for(var a in n)r[a]=n[a];r.isVue2=!0,r.isVue3=!1,r.install=function(){},r.Vue=n,r.Vue2=n,r.version=n.version,r.warn=n.util.warn,r.createApp=o}else if(n.version.slice(0,2)==="2.")if(p){for(var a in p)r[a]=p[a];r.isVue2=!0,r.isVue3=!1,r.install=function(){},r.Vue=n,r.Vue2=n,r.version=n.version}else console.error("[vue-demi] no VueCompositionAPI instance found, please be sure to import `@vue/composition-api` before `vue-demi`.");else if(n.version.slice(0,2)==="3."){for(var a in n)r[a]=n[a];r.isVue2=!1,r.isVue3=!0,r.install=function(){},r.Vue=n,r.Vue2=void 0,r.version=n.version,r.set=function(o,f,d){return Array.isArray(o)?(o.length=Math.max(o.length,f),o.splice(f,1,d),d):(o[f]=d,d)},r.del=function(o,f){if(Array.isArray(o)){o.splice(f,1);return}delete o[f]}}else console.error("[vue-demi] Vue version "+n.version+" is unsupported.");return r}(this.VueDemi=this.VueDemi||(typeof VueDemi<"u"?VueDemi:{}),this.Vue||(typeof Vue<"u"?Vue:void 0),this.VueCompositionAPI||(typeof VueCompositionAPI<"u"?VueCompositionAPI:void 0));(function(r,n,p,a){"use strict";var A=Object.defineProperty,o=Object.getOwnPropertySymbols,f=Object.prototype.hasOwnProperty,d=Object.prototype.propertyIsEnumerable,l=(e,i,t)=>i in e?A(e,i,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[i]=t,u=(e,i)=>{for(var t in i||(i={}))f.call(i,t)&&l(e,t,i[t]);if(o)for(var t of o(i))d.call(i,t)&&l(e,t,i[t]);return e},b=(e,i)=>{var t={};for(var s in e)f.call(e,s)&&i.indexOf(s)<0&&(t[s]=e[s]);if(e!=null&&o)for(var s of o(e))i.indexOf(s)<0&&d.call(e,s)&&(t[s]=e[s]);return t};function v(e,i,t={}){let s;const O=t,{document:_=n.defaultDocument}=O,P=b(O,["document"]),g={onUpdate:y=>{c(i,y.oldIndex,y.newIndex)}},h=()=>{const y=typeof e=="string"?_?.querySelector(e):n.unrefElement(e);y&&(s=new p(y,u(u({},g),P)))},w=()=>s?.destroy();return n.tryOnMounted(h),n.tryOnScopeDispose(w),{stop:w,start:h}}function c(e,i,t){const s=n.resolveUnref(e);if(t>=0&&t<s.length){const O=s.splice(i,1)[0];a.nextTick(()=>s.splice(t,0,O))}}r.moveArrayElement=c,r.useSortable=v})(this.VueUse=this.VueUse||{},VueUse,Sortable,VueDemi);
|
package/useSortable.mjs
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { tryOnMounted, tryOnScopeDispose, resolveUnref, unrefElement, defaultDocument } from '@vueuse/core';
|
|
2
2
|
import Sortable from 'sortablejs';
|
|
3
|
+
import { nextTick } from 'vue-demi';
|
|
3
4
|
|
|
4
5
|
var __defProp = Object.defineProperty;
|
|
5
6
|
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
@@ -50,8 +51,10 @@ function useSortable(el, list, options = {}) {
|
|
|
50
51
|
}
|
|
51
52
|
function moveArrayElement(list, from, to) {
|
|
52
53
|
const array = resolveUnref(list);
|
|
53
|
-
if (to >= 0 && to < array.length)
|
|
54
|
-
|
|
54
|
+
if (to >= 0 && to < array.length) {
|
|
55
|
+
const element = array.splice(from, 1)[0];
|
|
56
|
+
nextTick(() => array.splice(to, 0, element));
|
|
57
|
+
}
|
|
55
58
|
}
|
|
56
59
|
|
|
57
60
|
export { moveArrayElement, useSortable };
|