@vueuse/integrations 11.3.0 → 12.0.0-beta.1

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 (98) hide show
  1. package/index.cjs +47 -47
  2. package/index.d.cts +3 -3
  3. package/index.d.mts +3 -3
  4. package/index.d.ts +3 -3
  5. package/index.iife.js +48 -175
  6. package/index.iife.min.js +1 -1
  7. package/index.mjs +1 -1
  8. package/package.json +4 -4
  9. package/useAsyncValidator/component.cjs +10 -10
  10. package/useAsyncValidator/component.d.cts +1 -1
  11. package/useAsyncValidator/component.d.mts +1 -1
  12. package/useAsyncValidator/component.d.ts +1 -1
  13. package/useAsyncValidator/component.mjs +1 -1
  14. package/useAsyncValidator.cjs +8 -8
  15. package/useAsyncValidator.d.cts +1 -1
  16. package/useAsyncValidator.d.mts +1 -1
  17. package/useAsyncValidator.d.ts +1 -1
  18. package/useAsyncValidator.iife.js +9 -136
  19. package/useAsyncValidator.iife.min.js +1 -1
  20. package/useAsyncValidator.mjs +1 -1
  21. package/useAxios.cjs +7 -7
  22. package/useAxios.d.cts +1 -1
  23. package/useAxios.d.mts +1 -1
  24. package/useAxios.d.ts +1 -1
  25. package/useAxios.iife.js +8 -135
  26. package/useAxios.iife.min.js +1 -1
  27. package/useAxios.mjs +1 -1
  28. package/useChangeCase.cjs +5 -5
  29. package/useChangeCase.d.cts +1 -1
  30. package/useChangeCase.d.mts +1 -1
  31. package/useChangeCase.d.ts +1 -1
  32. package/useChangeCase.iife.js +6 -133
  33. package/useChangeCase.iife.min.js +1 -1
  34. package/useChangeCase.mjs +1 -1
  35. package/useCookies.cjs +2 -2
  36. package/useCookies.iife.js +3 -130
  37. package/useCookies.iife.min.js +1 -1
  38. package/useCookies.mjs +1 -1
  39. package/useDrauu.cjs +9 -9
  40. package/useDrauu.d.cts +1 -1
  41. package/useDrauu.d.mts +1 -1
  42. package/useDrauu.d.ts +1 -1
  43. package/useDrauu.iife.js +10 -137
  44. package/useDrauu.iife.min.js +1 -1
  45. package/useDrauu.mjs +1 -1
  46. package/useFocusTrap/component.cjs +6 -6
  47. package/useFocusTrap/component.mjs +1 -1
  48. package/useFocusTrap.cjs +5 -5
  49. package/useFocusTrap.d.cts +1 -1
  50. package/useFocusTrap.d.mts +1 -1
  51. package/useFocusTrap.d.ts +1 -1
  52. package/useFocusTrap.iife.js +6 -133
  53. package/useFocusTrap.iife.min.js +1 -1
  54. package/useFocusTrap.mjs +1 -1
  55. package/useFuse.cjs +5 -5
  56. package/useFuse.d.cts +2 -2
  57. package/useFuse.d.mts +2 -2
  58. package/useFuse.d.ts +2 -2
  59. package/useFuse.iife.js +6 -133
  60. package/useFuse.iife.min.js +1 -1
  61. package/useFuse.mjs +1 -1
  62. package/useIDBKeyval.cjs +4 -4
  63. package/useIDBKeyval.d.cts +1 -1
  64. package/useIDBKeyval.d.mts +1 -1
  65. package/useIDBKeyval.d.ts +1 -1
  66. package/useIDBKeyval.iife.js +5 -132
  67. package/useIDBKeyval.iife.min.js +1 -1
  68. package/useIDBKeyval.mjs +1 -1
  69. package/useJwt.cjs +3 -3
  70. package/useJwt.d.cts +1 -1
  71. package/useJwt.d.mts +1 -1
  72. package/useJwt.d.ts +1 -1
  73. package/useJwt.iife.js +4 -131
  74. package/useJwt.iife.min.js +1 -1
  75. package/useJwt.mjs +1 -1
  76. package/useNProgress.cjs +4 -4
  77. package/useNProgress.d.cts +2 -2
  78. package/useNProgress.d.mts +2 -2
  79. package/useNProgress.d.ts +2 -2
  80. package/useNProgress.iife.js +5 -132
  81. package/useNProgress.iife.min.js +1 -1
  82. package/useNProgress.mjs +1 -1
  83. package/useQRCode.cjs +3 -3
  84. package/useQRCode.d.cts +1 -1
  85. package/useQRCode.d.mts +1 -1
  86. package/useQRCode.d.ts +1 -1
  87. package/useQRCode.iife.js +4 -131
  88. package/useQRCode.iife.min.js +1 -1
  89. package/useQRCode.mjs +1 -1
  90. package/useSortable/component.cjs +7 -12
  91. package/useSortable/component.d.cts +1 -1
  92. package/useSortable/component.d.mts +1 -1
  93. package/useSortable/component.d.ts +1 -1
  94. package/useSortable/component.mjs +1 -6
  95. package/useSortable.cjs +3 -3
  96. package/useSortable.iife.js +4 -131
  97. package/useSortable.iife.min.js +1 -1
  98. package/useSortable.mjs +1 -1
package/useQRCode.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import { toRef, isClient } from '@vueuse/shared';
2
2
  import QRCode from 'qrcode';
3
- import { ref, watch } from 'vue-demi';
3
+ import { ref, watch } from 'vue';
4
4
 
5
5
  function useQRCode(text, options) {
6
6
  const src = toRef(text);
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  var core = require('@vueuse/core');
4
- var vueDemi = require('vue-demi');
4
+ var vue = require('vue');
5
5
  var Sortable = require('sortablejs');
6
6
 
7
7
  function useSortable(el, list, options = {}) {
@@ -49,11 +49,11 @@ function moveArrayElement(list, from, to, e = null) {
49
49
  removeNode(e.item);
50
50
  insertNodeAt(e.from, e.item, from);
51
51
  }
52
- const _valueIsRef = vueDemi.isRef(list);
52
+ const _valueIsRef = vue.isRef(list);
53
53
  const array = _valueIsRef ? [...core.toValue(list)] : core.toValue(list);
54
54
  if (to >= 0 && to < array.length) {
55
55
  const element = array.splice(from, 1)[0];
56
- vueDemi.nextTick(() => {
56
+ vue.nextTick(() => {
57
57
  array.splice(to, 0, element);
58
58
  if (_valueIsRef)
59
59
  list.value = array;
@@ -61,13 +61,8 @@ function moveArrayElement(list, from, to, e = null) {
61
61
  }
62
62
  }
63
63
 
64
- const UseSortable = /* @__PURE__ */ /* #__PURE__ */ vueDemi.defineComponent({
64
+ const UseSortable = /* @__PURE__ */ /* #__PURE__ */ vue.defineComponent({
65
65
  name: "UseSortable",
66
- model: {
67
- // Compatible with vue2
68
- prop: "modelValue",
69
- event: "update:modelValue"
70
- },
71
66
  props: {
72
67
  modelValue: {
73
68
  type: Array,
@@ -84,11 +79,11 @@ const UseSortable = /* @__PURE__ */ /* #__PURE__ */ vueDemi.defineComponent({
84
79
  },
85
80
  setup(props, { slots }) {
86
81
  const list = core.useVModel(props, "modelValue");
87
- const target = vueDemi.ref();
88
- const data = vueDemi.reactive(useSortable(target, list, props.options));
82
+ const target = vue.ref();
83
+ const data = vue.reactive(useSortable(target, list, props.options));
89
84
  return () => {
90
85
  if (slots.default)
91
- return vueDemi.h(props.tag, { ref: target }, slots.default(data));
86
+ return vue.h(props.tag, { ref: target }, slots.default(data));
92
87
  };
93
88
  }
94
89
  });
@@ -1,5 +1,5 @@
1
1
  import * as vue from 'vue';
2
- import { PropType } from 'vue-demi';
2
+ import { PropType } from 'vue';
3
3
  import { ConfigurableDocument } from '@vueuse/core';
4
4
  import { Options } from 'sortablejs';
5
5
 
@@ -1,5 +1,5 @@
1
1
  import * as vue from 'vue';
2
- import { PropType } from 'vue-demi';
2
+ import { PropType } from 'vue';
3
3
  import { ConfigurableDocument } from '@vueuse/core';
4
4
  import { Options } from 'sortablejs';
5
5
 
@@ -1,5 +1,5 @@
1
1
  import * as vue from 'vue';
2
- import { PropType } from 'vue-demi';
2
+ import { PropType } from 'vue';
3
3
  import { ConfigurableDocument } from '@vueuse/core';
4
4
  import { Options } from 'sortablejs';
5
5
 
@@ -1,5 +1,5 @@
1
1
  import { tryOnMounted, tryOnScopeDispose, unrefElement, defaultDocument, toValue, useVModel } from '@vueuse/core';
2
- import { isRef, nextTick, defineComponent, ref, reactive, h } from 'vue-demi';
2
+ import { isRef, nextTick, defineComponent, ref, reactive, h } from 'vue';
3
3
  import Sortable from 'sortablejs';
4
4
 
5
5
  function useSortable(el, list, options = {}) {
@@ -61,11 +61,6 @@ function moveArrayElement(list, from, to, e = null) {
61
61
 
62
62
  const UseSortable = /* @__PURE__ */ /* #__PURE__ */ defineComponent({
63
63
  name: "UseSortable",
64
- model: {
65
- // Compatible with vue2
66
- prop: "modelValue",
67
- event: "update:modelValue"
68
- },
69
64
  props: {
70
65
  modelValue: {
71
66
  type: Array,
package/useSortable.cjs CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  var core = require('@vueuse/core');
4
4
  var Sortable = require('sortablejs');
5
- var vueDemi = require('vue-demi');
5
+ var vue = require('vue');
6
6
 
7
7
  function useSortable(el, list, options = {}) {
8
8
  let sortable;
@@ -49,11 +49,11 @@ function moveArrayElement(list, from, to, e = null) {
49
49
  removeNode(e.item);
50
50
  insertNodeAt(e.from, e.item, from);
51
51
  }
52
- const _valueIsRef = vueDemi.isRef(list);
52
+ const _valueIsRef = vue.isRef(list);
53
53
  const array = _valueIsRef ? [...core.toValue(list)] : core.toValue(list);
54
54
  if (to >= 0 && to < array.length) {
55
55
  const element = array.splice(from, 1)[0];
56
- vueDemi.nextTick(() => {
56
+ vue.nextTick(() => {
57
57
  array.splice(to, 0, element);
58
58
  if (_valueIsRef)
59
59
  list.value = array;
@@ -1,131 +1,4 @@
1
- var _VueDemiGlobal = typeof globalThis !== 'undefined'
2
- ? globalThis
3
- : typeof global !== 'undefined'
4
- ? global
5
- : typeof self !== 'undefined'
6
- ? self
7
- : this
8
- var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
9
- if (VueDemi.install) {
10
- return VueDemi
11
- }
12
- if (!Vue) {
13
- console.error('[vue-demi] no Vue instance found, please be sure to import `vue` before `vue-demi`.')
14
- return VueDemi
15
- }
16
-
17
- // Vue 2.7
18
- if (Vue.version.slice(0, 4) === '2.7.') {
19
- for (var key in Vue) {
20
- VueDemi[key] = Vue[key]
21
- }
22
- VueDemi.isVue2 = true
23
- VueDemi.isVue3 = false
24
- VueDemi.install = function () {}
25
- VueDemi.Vue = Vue
26
- VueDemi.Vue2 = Vue
27
- VueDemi.version = Vue.version
28
- VueDemi.warn = Vue.util.warn
29
- VueDemi.hasInjectionContext = function() {
30
- return !!VueDemi.getCurrentInstance()
31
- }
32
- function createApp(rootComponent, rootProps) {
33
- var vm
34
- var provide = {}
35
- var app = {
36
- config: Vue.config,
37
- use: Vue.use.bind(Vue),
38
- mixin: Vue.mixin.bind(Vue),
39
- component: Vue.component.bind(Vue),
40
- provide: function (key, value) {
41
- provide[key] = value
42
- return this
43
- },
44
- directive: function (name, dir) {
45
- if (dir) {
46
- Vue.directive(name, dir)
47
- return app
48
- } else {
49
- return Vue.directive(name)
50
- }
51
- },
52
- mount: function (el, hydrating) {
53
- if (!vm) {
54
- vm = new Vue(Object.assign({ propsData: rootProps }, rootComponent, { provide: Object.assign(provide, rootComponent.provide) }))
55
- vm.$mount(el, hydrating)
56
- return vm
57
- } else {
58
- return vm
59
- }
60
- },
61
- unmount: function () {
62
- if (vm) {
63
- vm.$destroy()
64
- vm = undefined
65
- }
66
- },
67
- }
68
- return app
69
- }
70
- VueDemi.createApp = createApp
71
- }
72
- // Vue 2.6.x
73
- else if (Vue.version.slice(0, 2) === '2.') {
74
- if (VueCompositionAPI) {
75
- for (var key in VueCompositionAPI) {
76
- VueDemi[key] = VueCompositionAPI[key]
77
- }
78
- VueDemi.isVue2 = true
79
- VueDemi.isVue3 = false
80
- VueDemi.install = function () {}
81
- VueDemi.Vue = Vue
82
- VueDemi.Vue2 = Vue
83
- VueDemi.version = Vue.version
84
- VueDemi.hasInjectionContext = function() {
85
- return !!VueDemi.getCurrentInstance()
86
- }
87
- } else {
88
- console.error('[vue-demi] no VueCompositionAPI instance found, please be sure to import `@vue/composition-api` before `vue-demi`.')
89
- }
90
- }
91
- // Vue 3
92
- else if (Vue.version.slice(0, 2) === '3.') {
93
- for (var key in Vue) {
94
- VueDemi[key] = Vue[key]
95
- }
96
- VueDemi.isVue2 = false
97
- VueDemi.isVue3 = true
98
- VueDemi.install = function () {}
99
- VueDemi.Vue = Vue
100
- VueDemi.Vue2 = undefined
101
- VueDemi.version = Vue.version
102
- VueDemi.set = function (target, key, val) {
103
- if (Array.isArray(target)) {
104
- target.length = Math.max(target.length, key)
105
- target.splice(key, 1, val)
106
- return val
107
- }
108
- target[key] = val
109
- return val
110
- }
111
- VueDemi.del = function (target, key) {
112
- if (Array.isArray(target)) {
113
- target.splice(key, 1)
114
- return
115
- }
116
- delete target[key]
117
- }
118
- } else {
119
- console.error('[vue-demi] Vue version ' + Vue.version + ' is unsupported.')
120
- }
121
- return VueDemi
122
- })(
123
- (_VueDemiGlobal.VueDemi = _VueDemiGlobal.VueDemi || (typeof VueDemi !== 'undefined' ? VueDemi : {})),
124
- _VueDemiGlobal.Vue || (typeof Vue !== 'undefined' ? Vue : undefined),
125
- _VueDemiGlobal.VueCompositionAPI || (typeof VueCompositionAPI !== 'undefined' ? VueCompositionAPI : undefined)
126
- );
127
- ;
128
- ;(function (exports, core, Sortable, vueDemi) {
1
+ (function (exports, core, Sortable, vue) {
129
2
  'use strict';
130
3
 
131
4
  function useSortable(el, list, options = {}) {
@@ -173,11 +46,11 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
173
46
  removeNode(e.item);
174
47
  insertNodeAt(e.from, e.item, from);
175
48
  }
176
- const _valueIsRef = vueDemi.isRef(list);
49
+ const _valueIsRef = vue.isRef(list);
177
50
  const array = _valueIsRef ? [...core.toValue(list)] : core.toValue(list);
178
51
  if (to >= 0 && to < array.length) {
179
52
  const element = array.splice(from, 1)[0];
180
- vueDemi.nextTick(() => {
53
+ vue.nextTick(() => {
181
54
  array.splice(to, 0, element);
182
55
  if (_valueIsRef)
183
56
  list.value = array;
@@ -190,4 +63,4 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
190
63
  exports.removeNode = removeNode;
191
64
  exports.useSortable = useSortable;
192
65
 
193
- })(this.VueUse = this.VueUse || {}, VueUse, Sortable, VueDemi);
66
+ })(this.VueUse = this.VueUse || {}, VueUse, Sortable, Vue);
@@ -1 +1 @@
1
- var _VueDemiGlobal=typeof globalThis<"u"?globalThis:typeof global<"u"?global:typeof self<"u"?self:this,VueDemi=function(n,e,v){if(n.install)return n;if(!e)return console.error("[vue-demi] no Vue instance found, please be sure to import `vue` before `vue-demi`."),n;if(e.version.slice(0,4)==="2.7."){let i=function(r,d){var o,c={},l={config:e.config,use:e.use.bind(e),mixin:e.mixin.bind(e),component:e.component.bind(e),provide:function(t,s){return c[t]=s,this},directive:function(t,s){return s?(e.directive(t,s),l):e.directive(t)},mount:function(t,s){return o||(o=new e(Object.assign({propsData:d},r,{provide:Object.assign(c,r.provide)})),o.$mount(t,s),o)},unmount:function(){o&&(o.$destroy(),o=void 0)}};return l};var b=i;for(var f in e)n[f]=e[f];n.isVue2=!0,n.isVue3=!1,n.install=function(){},n.Vue=e,n.Vue2=e,n.version=e.version,n.warn=e.util.warn,n.hasInjectionContext=function(){return!!n.getCurrentInstance()},n.createApp=i}else if(e.version.slice(0,2)==="2.")if(v){for(var f in v)n[f]=v[f];n.isVue2=!0,n.isVue3=!1,n.install=function(){},n.Vue=e,n.Vue2=e,n.version=e.version,n.hasInjectionContext=function(){return!!n.getCurrentInstance()}}else console.error("[vue-demi] no VueCompositionAPI instance found, please be sure to import `@vue/composition-api` before `vue-demi`.");else if(e.version.slice(0,2)==="3."){for(var f in e)n[f]=e[f];n.isVue2=!1,n.isVue3=!0,n.install=function(){},n.Vue=e,n.Vue2=void 0,n.version=e.version,n.set=function(i,r,d){return Array.isArray(i)?(i.length=Math.max(i.length,r),i.splice(r,1,d),d):(i[r]=d,d)},n.del=function(i,r){if(Array.isArray(i)){i.splice(r,1);return}delete i[r]}}else console.error("[vue-demi] Vue version "+e.version+" is unsupported.");return n}(_VueDemiGlobal.VueDemi=_VueDemiGlobal.VueDemi||(typeof VueDemi<"u"?VueDemi:{}),_VueDemiGlobal.Vue||(typeof Vue<"u"?Vue:void 0),_VueDemiGlobal.VueCompositionAPI||(typeof VueCompositionAPI<"u"?VueCompositionAPI:void 0));(function(n,e,v,f){"use strict";function b(o,c,l={}){let t;const{document:s=e.defaultDocument,...a}=l,p={onUpdate:u=>{d(c,u.oldIndex,u.newIndex,u)}},y=()=>{const u=typeof o=="string"?s?.querySelector(o):e.unrefElement(o);!u||t!==void 0||(t=new v(u,{...p,...a}))},h=()=>{t?.destroy(),t=void 0},g=(u,A)=>{if(A!==void 0)t?.option(u,A);else return t?.option(u)};return e.tryOnMounted(y),e.tryOnScopeDispose(h),{stop:h,start:y,option:g}}function i(o,c,l){const t=o.children[l];o.insertBefore(c,t)}function r(o){o.parentNode&&o.parentNode.removeChild(o)}function d(o,c,l,t=null){t!=null&&(r(t.item),i(t.from,t.item,c));const s=f.isRef(o),a=s?[...e.toValue(o)]:e.toValue(o);if(l>=0&&l<a.length){const p=a.splice(c,1)[0];f.nextTick(()=>{a.splice(l,0,p),s&&(o.value=a)})}}n.insertNodeAt=i,n.moveArrayElement=d,n.removeNode=r,n.useSortable=b})(this.VueUse=this.VueUse||{},VueUse,Sortable,VueDemi);
1
+ (function(r,i,N,c){"use strict";function V(t,s,o={}){let e;const{document:l=i.defaultDocument,...u}=o,d={onUpdate:n=>{m(s,n.oldIndex,n.newIndex,n)}},v=()=>{const n=typeof t=="string"?l?.querySelector(t):i.unrefElement(t);!n||e!==void 0||(e=new N(n,{...d,...u}))},p=()=>{e?.destroy(),e=void 0},h=(n,y)=>{if(y!==void 0)e?.option(n,y);else return e?.option(n)};return i.tryOnMounted(v),i.tryOnScopeDispose(p),{stop:p,start:v,option:h}}function f(t,s,o){const e=t.children[o];t.insertBefore(s,e)}function a(t){t.parentNode&&t.parentNode.removeChild(t)}function m(t,s,o,e=null){e!=null&&(a(e.item),f(e.from,e.item,s));const l=c.isRef(t),u=l?[...i.toValue(t)]:i.toValue(t);if(o>=0&&o<u.length){const d=u.splice(s,1)[0];c.nextTick(()=>{u.splice(o,0,d),l&&(t.value=u)})}}r.insertNodeAt=f,r.moveArrayElement=m,r.removeNode=a,r.useSortable=V})(this.VueUse=this.VueUse||{},VueUse,Sortable,Vue);
package/useSortable.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import { tryOnMounted, tryOnScopeDispose, toValue, unrefElement, defaultDocument } from '@vueuse/core';
2
2
  import Sortable from 'sortablejs';
3
- import { isRef, nextTick } from 'vue-demi';
3
+ import { isRef, nextTick } from 'vue';
4
4
 
5
5
  function useSortable(el, list, options = {}) {
6
6
  let sortable;