@vueuse/integrations 10.4.0 → 10.4.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.
package/index.cjs CHANGED
@@ -27,8 +27,14 @@ function useAsyncValidator(value, rules, options = {}) {
27
27
  const errorInfo = vueDemi.shallowRef(null);
28
28
  const isFinished = vueDemi.ref(true);
29
29
  const pass = vueDemi.ref(!immediate || manual);
30
- const errors = vueDemi.computed(() => errorInfo.value?.errors || []);
31
- const errorFields = vueDemi.computed(() => errorInfo.value?.fields || {});
30
+ const errors = vueDemi.computed(() => {
31
+ var _a;
32
+ return ((_a = errorInfo.value) == null ? void 0 : _a.errors) || [];
33
+ });
34
+ const errorFields = vueDemi.computed(() => {
35
+ var _a;
36
+ return ((_a = errorInfo.value) == null ? void 0 : _a.fields) || {};
37
+ });
32
38
  const validator = vueDemi.computed(() => new AsyncValidatorSchema(shared.toValue(rules)));
33
39
  const execute = async () => {
34
40
  isFinished.value = false;
@@ -86,7 +92,7 @@ function useAxios(...args) {
86
92
  immediate: !!argsPlaceholder,
87
93
  shallow: true
88
94
  };
89
- const isAxiosInstance = (val) => !!val?.request;
95
+ const isAxiosInstance = (val) => !!(val == null ? void 0 : val.request);
90
96
  if (args.length > 0 + argsPlaceholder) {
91
97
  if (isAxiosInstance(args[0 + argsPlaceholder]))
92
98
  instance = args[0 + argsPlaceholder];
@@ -142,7 +148,7 @@ function useAxios(...args) {
142
148
  let executeCounter = 0;
143
149
  const execute = (executeUrl = url, config = {}) => {
144
150
  error.value = void 0;
145
- const _url = typeof executeUrl === "string" ? executeUrl : url ?? config.url;
151
+ const _url = typeof executeUrl === "string" ? executeUrl : url != null ? url : config.url;
146
152
  if (_url === void 0) {
147
153
  error.value = new axios.AxiosError(axios.AxiosError.ERR_INVALID_URL);
148
154
  isFinished.value = true;
@@ -162,7 +168,8 @@ function useAxios(...args) {
162
168
  error.value = e;
163
169
  onError(e);
164
170
  }).finally(() => {
165
- options.onFinish?.();
171
+ var _a;
172
+ (_a = options.onFinish) == null ? void 0 : _a.call(options);
166
173
  if (currentExecuteCounter === executeCounter)
167
174
  loading(false);
168
175
  });
@@ -300,15 +307,34 @@ function useDrauu(target, options) {
300
307
  instance.mode = brush.value.mode;
301
308
  }
302
309
  }, { deep: true });
303
- const undo = () => drauuInstance.value?.undo();
304
- const redo = () => drauuInstance.value?.redo();
305
- const clear = () => drauuInstance.value?.clear();
306
- const cancel = () => drauuInstance.value?.cancel();
307
- const load = (svg) => drauuInstance.value?.load(svg);
308
- const dump = () => drauuInstance.value?.dump();
310
+ const undo = () => {
311
+ var _a;
312
+ return (_a = drauuInstance.value) == null ? void 0 : _a.undo();
313
+ };
314
+ const redo = () => {
315
+ var _a;
316
+ return (_a = drauuInstance.value) == null ? void 0 : _a.redo();
317
+ };
318
+ const clear = () => {
319
+ var _a;
320
+ return (_a = drauuInstance.value) == null ? void 0 : _a.clear();
321
+ };
322
+ const cancel = () => {
323
+ var _a;
324
+ return (_a = drauuInstance.value) == null ? void 0 : _a.cancel();
325
+ };
326
+ const load = (svg) => {
327
+ var _a;
328
+ return (_a = drauuInstance.value) == null ? void 0 : _a.load(svg);
329
+ };
330
+ const dump = () => {
331
+ var _a;
332
+ return (_a = drauuInstance.value) == null ? void 0 : _a.dump();
333
+ };
309
334
  const cleanup = () => {
335
+ var _a;
310
336
  disposables.forEach((dispose) => dispose());
311
- drauuInstance.value?.unmount();
337
+ (_a = drauuInstance.value) == null ? void 0 : _a.unmount();
312
338
  };
313
339
  const syncStatus = () => {
314
340
  if (drauuInstance.value) {
@@ -415,14 +441,18 @@ function useFocusTrap(target, options = {}) {
415
441
 
416
442
  function useFuse(search, data, options) {
417
443
  const createFuse = () => {
444
+ var _a, _b;
418
445
  return new Fuse(
419
- shared.toValue(data) ?? [],
420
- shared.toValue(options)?.fuseOptions
446
+ (_a = shared.toValue(data)) != null ? _a : [],
447
+ (_b = shared.toValue(options)) == null ? void 0 : _b.fuseOptions
421
448
  );
422
449
  };
423
450
  const fuse = vueDemi.ref(createFuse());
424
451
  vueDemi.watch(
425
- () => shared.toValue(options)?.fuseOptions,
452
+ () => {
453
+ var _a;
454
+ return (_a = shared.toValue(options)) == null ? void 0 : _a.fuseOptions;
455
+ },
426
456
  () => {
427
457
  fuse.value = createFuse();
428
458
  },
@@ -437,9 +467,9 @@ function useFuse(search, data, options) {
437
467
  );
438
468
  const results = vueDemi.computed(() => {
439
469
  const resolved = shared.toValue(options);
440
- if (resolved?.matchAllWhenSearchEmpty && !shared.toValue(search))
470
+ if ((resolved == null ? void 0 : resolved.matchAllWhenSearchEmpty) && !shared.toValue(search))
441
471
  return shared.toValue(data).map((item, index) => ({ item, refIndex: index }));
442
- const limit = resolved?.resultLimit;
472
+ const limit = resolved == null ? void 0 : resolved.resultLimit;
443
473
  return fuse.value.search(shared.toValue(search), limit ? { limit } : void 0);
444
474
  });
445
475
  return {
@@ -518,7 +548,7 @@ function useJwt(encodedJwt, options = {}) {
518
548
  try {
519
549
  return jwt_decode(encodedJwt2, options2);
520
550
  } catch (err) {
521
- onError?.(err);
551
+ onError == null ? void 0 : onError(err);
522
552
  return fallbackValue;
523
553
  }
524
554
  };
@@ -583,17 +613,17 @@ function useSortable(el, list, options = {}) {
583
613
  }
584
614
  };
585
615
  const start = () => {
586
- const target = typeof el === "string" ? document?.querySelector(el) : core.unrefElement(el);
616
+ const target = typeof el === "string" ? document == null ? void 0 : document.querySelector(el) : core.unrefElement(el);
587
617
  if (!target)
588
618
  return;
589
619
  sortable = new Sortable(target, { ...defaultOptions, ...resetOptions });
590
620
  };
591
- const stop = () => sortable?.destroy();
621
+ const stop = () => sortable == null ? void 0 : sortable.destroy();
592
622
  const option = (name, value) => {
593
623
  if (value !== void 0)
594
- sortable?.option(name, value);
624
+ sortable == null ? void 0 : sortable.option(name, value);
595
625
  else
596
- return sortable?.option(name);
626
+ return sortable == null ? void 0 : sortable.option(name);
597
627
  };
598
628
  core.tryOnMounted(start);
599
629
  core.tryOnScopeDispose(stop);
package/index.iife.js CHANGED
@@ -128,8 +128,14 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
128
128
  const errorInfo = vueDemi.shallowRef(null);
129
129
  const isFinished = vueDemi.ref(true);
130
130
  const pass = vueDemi.ref(!immediate || manual);
131
- const errors = vueDemi.computed(() => errorInfo.value?.errors || []);
132
- const errorFields = vueDemi.computed(() => errorInfo.value?.fields || {});
131
+ const errors = vueDemi.computed(() => {
132
+ var _a;
133
+ return ((_a = errorInfo.value) == null ? void 0 : _a.errors) || [];
134
+ });
135
+ const errorFields = vueDemi.computed(() => {
136
+ var _a;
137
+ return ((_a = errorInfo.value) == null ? void 0 : _a.fields) || {};
138
+ });
133
139
  const validator = vueDemi.computed(() => new AsyncValidatorSchema(shared.toValue(rules)));
134
140
  const execute = async () => {
135
141
  isFinished.value = false;
@@ -187,7 +193,7 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
187
193
  immediate: !!argsPlaceholder,
188
194
  shallow: true
189
195
  };
190
- const isAxiosInstance = (val) => !!val?.request;
196
+ const isAxiosInstance = (val) => !!(val == null ? void 0 : val.request);
191
197
  if (args.length > 0 + argsPlaceholder) {
192
198
  if (isAxiosInstance(args[0 + argsPlaceholder]))
193
199
  instance = args[0 + argsPlaceholder];
@@ -243,7 +249,7 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
243
249
  let executeCounter = 0;
244
250
  const execute = (executeUrl = url, config = {}) => {
245
251
  error.value = void 0;
246
- const _url = typeof executeUrl === "string" ? executeUrl : url ?? config.url;
252
+ const _url = typeof executeUrl === "string" ? executeUrl : url != null ? url : config.url;
247
253
  if (_url === void 0) {
248
254
  error.value = new axios.AxiosError(axios.AxiosError.ERR_INVALID_URL);
249
255
  isFinished.value = true;
@@ -263,7 +269,8 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
263
269
  error.value = e;
264
270
  onError(e);
265
271
  }).finally(() => {
266
- options.onFinish?.();
272
+ var _a;
273
+ (_a = options.onFinish) == null ? void 0 : _a.call(options);
267
274
  if (currentExecuteCounter === executeCounter)
268
275
  loading(false);
269
276
  });
@@ -401,15 +408,34 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
401
408
  instance.mode = brush.value.mode;
402
409
  }
403
410
  }, { deep: true });
404
- const undo = () => drauuInstance.value?.undo();
405
- const redo = () => drauuInstance.value?.redo();
406
- const clear = () => drauuInstance.value?.clear();
407
- const cancel = () => drauuInstance.value?.cancel();
408
- const load = (svg) => drauuInstance.value?.load(svg);
409
- const dump = () => drauuInstance.value?.dump();
411
+ const undo = () => {
412
+ var _a;
413
+ return (_a = drauuInstance.value) == null ? void 0 : _a.undo();
414
+ };
415
+ const redo = () => {
416
+ var _a;
417
+ return (_a = drauuInstance.value) == null ? void 0 : _a.redo();
418
+ };
419
+ const clear = () => {
420
+ var _a;
421
+ return (_a = drauuInstance.value) == null ? void 0 : _a.clear();
422
+ };
423
+ const cancel = () => {
424
+ var _a;
425
+ return (_a = drauuInstance.value) == null ? void 0 : _a.cancel();
426
+ };
427
+ const load = (svg) => {
428
+ var _a;
429
+ return (_a = drauuInstance.value) == null ? void 0 : _a.load(svg);
430
+ };
431
+ const dump = () => {
432
+ var _a;
433
+ return (_a = drauuInstance.value) == null ? void 0 : _a.dump();
434
+ };
410
435
  const cleanup = () => {
436
+ var _a;
411
437
  disposables.forEach((dispose) => dispose());
412
- drauuInstance.value?.unmount();
438
+ (_a = drauuInstance.value) == null ? void 0 : _a.unmount();
413
439
  };
414
440
  const syncStatus = () => {
415
441
  if (drauuInstance.value) {
@@ -516,14 +542,18 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
516
542
 
517
543
  function useFuse(search, data, options) {
518
544
  const createFuse = () => {
545
+ var _a, _b;
519
546
  return new Fuse(
520
- shared.toValue(data) ?? [],
521
- shared.toValue(options)?.fuseOptions
547
+ (_a = shared.toValue(data)) != null ? _a : [],
548
+ (_b = shared.toValue(options)) == null ? void 0 : _b.fuseOptions
522
549
  );
523
550
  };
524
551
  const fuse = vueDemi.ref(createFuse());
525
552
  vueDemi.watch(
526
- () => shared.toValue(options)?.fuseOptions,
553
+ () => {
554
+ var _a;
555
+ return (_a = shared.toValue(options)) == null ? void 0 : _a.fuseOptions;
556
+ },
527
557
  () => {
528
558
  fuse.value = createFuse();
529
559
  },
@@ -538,9 +568,9 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
538
568
  );
539
569
  const results = vueDemi.computed(() => {
540
570
  const resolved = shared.toValue(options);
541
- if (resolved?.matchAllWhenSearchEmpty && !shared.toValue(search))
571
+ if ((resolved == null ? void 0 : resolved.matchAllWhenSearchEmpty) && !shared.toValue(search))
542
572
  return shared.toValue(data).map((item, index) => ({ item, refIndex: index }));
543
- const limit = resolved?.resultLimit;
573
+ const limit = resolved == null ? void 0 : resolved.resultLimit;
544
574
  return fuse.value.search(shared.toValue(search), limit ? { limit } : void 0);
545
575
  });
546
576
  return {
@@ -619,7 +649,7 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
619
649
  try {
620
650
  return jwt_decode(encodedJwt2, options2);
621
651
  } catch (err) {
622
- onError?.(err);
652
+ onError == null ? void 0 : onError(err);
623
653
  return fallbackValue;
624
654
  }
625
655
  };
@@ -684,17 +714,17 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
684
714
  }
685
715
  };
686
716
  const start = () => {
687
- const target = typeof el === "string" ? document?.querySelector(el) : core.unrefElement(el);
717
+ const target = typeof el === "string" ? document == null ? void 0 : document.querySelector(el) : core.unrefElement(el);
688
718
  if (!target)
689
719
  return;
690
720
  sortable = new Sortable(target, { ...defaultOptions, ...resetOptions });
691
721
  };
692
- const stop = () => sortable?.destroy();
722
+ const stop = () => sortable == null ? void 0 : sortable.destroy();
693
723
  const option = (name, value) => {
694
724
  if (value !== void 0)
695
- sortable?.option(name, value);
725
+ sortable == null ? void 0 : sortable.option(name, value);
696
726
  else
697
- return sortable?.option(name);
727
+ return sortable == null ? void 0 : sortable.option(name);
698
728
  };
699
729
  core.tryOnMounted(start);
700
730
  core.tryOnScopeDispose(stop);
package/index.iife.min.js CHANGED
@@ -1 +1 @@
1
- var VueDemi=function(a,o,m){if(a.install)return a;if(!o)return console.error("[vue-demi] no Vue instance found, please be sure to import `vue` before `vue-demi`."),a;if(o.version.slice(0,4)==="2.7."){let v=function(b,k){var p,j={},N={config:o.config,use:o.use.bind(o),mixin:o.mixin.bind(o),component:o.component.bind(o),provide:function(E,L){return j[E]=L,this},directive:function(E,L){return L?(o.directive(E,L),N):o.directive(E)},mount:function(E,L){return p||(p=new o(Object.assign({propsData:k},b,{provide:Object.assign(j,b.provide)})),p.$mount(E,L),p)},unmount:function(){p&&(p.$destroy(),p=void 0)}};return N};var U=v;for(var n in o)a[n]=o[n];a.isVue2=!0,a.isVue3=!1,a.install=function(){},a.Vue=o,a.Vue2=o,a.version=o.version,a.warn=o.util.warn,a.hasInjectionContext=()=>!!a.getCurrentInstance(),a.createApp=v}else if(o.version.slice(0,2)==="2.")if(m){for(var n in m)a[n]=m[n];a.isVue2=!0,a.isVue3=!1,a.install=function(){},a.Vue=o,a.Vue2=o,a.version=o.version,a.hasInjectionContext=()=>!!a.getCurrentInstance()}else console.error("[vue-demi] no VueCompositionAPI instance found, please be sure to import `@vue/composition-api` before `vue-demi`.");else if(o.version.slice(0,2)==="3."){for(var n in o)a[n]=o[n];a.isVue2=!1,a.isVue3=!0,a.install=function(){},a.Vue=o,a.Vue2=void 0,a.version=o.version,a.set=function(v,b,k){return Array.isArray(v)?(v.length=Math.max(v.length,b),v.splice(b,1,k),k):(v[b]=k,k)},a.del=function(v,b){if(Array.isArray(v)){v.splice(b,1);return}delete v[b]}}else console.error("[vue-demi] Vue version "+o.version+" is unsupported.");return a}(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(a,o,m,n,U,v,b,k,p,j,N,E,L,R,V,$){"use strict";const D=m.default||m;function ee(t,r,e={}){const{validateOption:s={},immediate:l=!0,manual:c=!1}=e,i=o.toRef(t),f=n.shallowRef(null),u=n.ref(!0),d=n.ref(!l||c),C=n.computed(()=>f.value?.errors||[]),w=n.computed(()=>f.value?.fields||{}),F=n.computed(()=>new D(o.toValue(r))),g=async()=>{u.value=!1,d.value=!1;try{await F.value.validate(i.value,s),d.value=!0,f.value=null}catch(h){f.value=h}finally{u.value=!0}return{pass:d.value,errorInfo:f.value,errors:C.value,errorFields:w.value}};c||n.watch([i,F],()=>g(),{immediate:l,deep:!0});const I={isFinished:u,pass:d,errors:C,errorInfo:f,errorFields:w,execute:g};function S(){return new Promise((h,P)=>{o.until(u).toBe(!0).then(()=>h(I)).catch(O=>P(O))})}return{...I,then(h,P){return S().then(h,P)}}}function te(...t){const r=typeof t[0]=="string"?t[0]:void 0,e=typeof r=="string"?1:0;let s={},l=U,c={immediate:!!e,shallow:!0};const i=y=>!!y?.request;t.length>0+e&&(i(t[0+e])?l=t[0+e]:s=t[0+e]),t.length>1+e&&i(t[1+e])&&(l=t[1+e]),(t.length===2+e&&!i(t[1+e])||t.length===3+e)&&(c=t[t.length-1]);const{initialData:f,shallow:u,onSuccess:d=o.noop,onError:C=o.noop,immediate:w,resetOnExecute:F=!1}=c,g=n.shallowRef(),I=(u?n.shallowRef:n.ref)(f),S=n.ref(!1),h=n.ref(!1),P=n.ref(!1),O=n.shallowRef(),B=U.CancelToken.source;let H=B();const T=y=>{S.value||!h.value||(H.cancel(y),H=B(),P.value=!0,h.value=!1,S.value=!1)},A=y=>{h.value=y,S.value=!y},W=()=>{F&&(I.value=f)},q=()=>new Promise((y,G)=>{o.until(S).toBe(!0).then(()=>O.value?G(O.value):y(Y))}),J={then:(...y)=>q().then(...y),catch:(...y)=>q().catch(...y)};let Q=0;const X=(y=r,G={})=>{O.value=void 0;const Z=typeof y=="string"?y:r??G.url;if(Z===void 0)return O.value=new U.AxiosError(U.AxiosError.ERR_INVALID_URL),S.value=!0,J;W(),T(),A(!0),Q+=1;const ve=Q;return l(Z,{...s,...typeof y=="object"?y:G,cancelToken:H.token}).then(_=>{g.value=_;const K=_.data;I.value=K,d(K)}).catch(_=>{O.value=_,C(_)}).finally(()=>{c.onFinish?.(),ve===Q&&A(!1)}),J};w&&r&&X();const Y={response:g,data:I,error:O,isFinished:S,isLoading:h,cancel:T,isAborted:P,isCanceled:P,abort:T,execute:X};return{...Y,...J}}var x=Object.freeze({__proto__:null,camelCase:v.camelCase,capitalCase:v.capitalCase,constantCase:v.constantCase,dotCase:v.dotCase,headerCase:v.headerCase,noCase:v.noCase,paramCase:v.paramCase,pascalCase:v.pascalCase,pathCase:v.pathCase,sentenceCase:v.sentenceCase,snakeCase:v.snakeCase});function ne(t,r,e){if(typeof t=="function")return n.computed(()=>x[r](o.toValue(t),e));const s=n.ref(t);return n.computed({get(){return x[r](s.value,e)},set(l){s.value=l}})}function oe(t){const r=new b(t?t.headers.cookie:null);return(e,{doNotParse:s=!1,autoUpdateDependencies:l=!1}={})=>z(e,{doNotParse:s,autoUpdateDependencies:l},r)}function z(t,{doNotParse:r=!1,autoUpdateDependencies:e=!1}={},s=new b){const l=e?[...t||[]]:t;let c=s.getAll({doNotParse:!0});const i=n.ref(0),f=()=>{const u=s.getAll({doNotParse:!0});ae(l||null,u,c)&&i.value++,c=u};return s.addChangeListener(f),o.tryOnScopeDispose(()=>{s.removeChangeListener(f)}),{get:(...u)=>(e&&l&&!l.includes(u[0])&&l.push(u[0]),i.value,s.get(u[0],{doNotParse:r,...u[1]})),getAll:(...u)=>(i.value,s.getAll({doNotParse:r,...u[0]})),set:(...u)=>s.set(...u),remove:(...u)=>s.remove(...u),addChangeListener:(...u)=>s.addChangeListener(...u),removeChangeListener:(...u)=>s.removeChangeListener(...u)}}function ae(t,r,e){if(!t)return!0;for(const s of t)if(r[s]!==e[s])return!0;return!1}function se(t,r){const e=n.ref();let s=[];const l=p.createEventHook(),c=p.createEventHook(),i=p.createEventHook(),f=p.createEventHook(),u=p.createEventHook(),d=n.ref(!1),C=n.ref(!1),w=n.ref(!1),F=n.ref(!1),g=n.ref({color:"black",size:3,arrowEnd:!1,cornerRadius:0,dasharray:void 0,fill:"transparent",mode:"draw"});n.watch(g,()=>{const A=e.value;A&&(A.brush=g.value,A.mode=g.value.mode)},{deep:!0});const I=()=>e.value?.undo(),S=()=>e.value?.redo(),h=()=>e.value?.clear(),P=()=>e.value?.cancel(),O=A=>e.value?.load(A),B=()=>e.value?.dump(),H=()=>{s.forEach(A=>A()),e.value?.unmount()},T=()=>{e.value&&(d.value=e.value.canUndo(),C.value=e.value.canRedo(),w.value=e.value.altPressed,F.value=e.value.shiftPressed)};return n.watch(()=>p.unrefElement(t),A=>{!A||typeof SVGSVGElement>"u"||!(A instanceof SVGSVGElement)||(e.value&&H(),e.value=k.createDrauu({el:A,...r}),T(),s=[e.value.on("canceled",()=>c.trigger()),e.value.on("committed",W=>i.trigger(W)),e.value.on("start",()=>f.trigger()),e.value.on("end",()=>u.trigger()),e.value.on("changed",()=>{T(),l.trigger()})])},{flush:"post"}),o.tryOnScopeDispose(()=>H()),{drauuInstance:e,load:O,dump:B,clear:h,cancel:P,undo:I,redo:S,canUndo:d,canRedo:C,brush:g,onChanged:l.on,onCommitted:i.on,onStart:f.on,onEnd:u.on,onCanceled:c.on}}function re(t,r={}){let e;const{immediate:s,...l}=r,c=n.ref(!1),i=n.ref(!1),f=w=>e&&e.activate(w),u=w=>e&&e.deactivate(w),d=()=>{e&&(e.pause(),i.value=!0)},C=()=>{e&&(e.unpause(),i.value=!1)};return n.watch(()=>p.unrefElement(t),w=>{w&&(e=j.createFocusTrap(w,{...l,onActivate(){c.value=!0,r.onActivate&&r.onActivate()},onDeactivate(){c.value=!1,r.onDeactivate&&r.onDeactivate()}}),s&&f())},{flush:"post"}),p.tryOnScopeDispose(()=>u()),{hasFocus:c,isPaused:i,activate:f,deactivate:u,pause:d,unpause:C}}function le(t,r,e){const s=()=>new N(o.toValue(r)??[],o.toValue(e)?.fuseOptions),l=n.ref(s());n.watch(()=>o.toValue(e)?.fuseOptions,()=>{l.value=s()},{deep:!0}),n.watch(()=>o.toValue(r),i=>{l.value.setCollection(i)},{deep:!0});const c=n.computed(()=>{const i=o.toValue(e);if(i?.matchAllWhenSearchEmpty&&!o.toValue(t))return o.toValue(r).map((u,d)=>({item:u,refIndex:d}));const f=i?.resultLimit;return l.value.search(o.toValue(t),f?{limit:f}:void 0)});return{fuse:l,results:c}}function ue(t,r,e={}){const{flush:s="pre",deep:l=!0,shallow:c=!1,onError:i=h=>{console.error(h)},writeDefaults:f=!0}=e,u=n.ref(!1),d=(c?n.shallowRef:n.ref)(r),C=o.toValue(r);async function w(){try{const h=await E.get(t);h===void 0?C!=null&&f&&await E.set(t,C):d.value=h}catch(h){i(h)}u.value=!0}w();async function F(){try{d.value==null?await E.del(t):Array.isArray(d.value)?await E.update(t,()=>JSON.parse(JSON.stringify(d.value))):typeof d.value=="object"?await E.update(t,()=>({...d.value})):await E.update(t,()=>d.value)}catch(h){i(h)}}const{pause:g,resume:I}=p.watchPausable(d,()=>F(),{flush:s,deep:l});async function S(h){g(),d.value=h,await F(),I()}return{set:S,isFinished:u,data:d}}function ce(t,r={}){const{onError:e,fallbackValue:s=null}=r,l=(f,u)=>{try{return L(f,u)}catch(d){return e?.(d),s}},c=n.computed(()=>l(o.toValue(t),{header:!0})),i=n.computed(()=>l(o.toValue(t)));return{header:c,payload:i}}function ie(t=null,r){const e=n.ref(t),s=n.computed({set:c=>c?R.start():R.done(),get:()=>typeof e.value=="number"&&e.value<1});r&&R.configure(r);const l=R.set;return R.set=c=>(e.value=c,l.call(R,c)),n.watchEffect(()=>{typeof e.value=="number"&&o.isClient&&l.call(R,e.value)}),o.tryOnScopeDispose(R.remove),{isLoading:s,progress:e,start:R.start,done:R.done,remove:()=>{e.value=null,R.remove()}}}function fe(t,r){const e=o.toRef(t),s=n.ref("");return n.watch(e,async l=>{e.value&&o.isClient&&(s.value=await V.toDataURL(l,r))},{immediate:!0}),s}function de(t,r,e={}){let s;const{document:l=p.defaultDocument,...c}=e,i={onUpdate:C=>{M(r,C.oldIndex,C.newIndex)}},f=()=>{const C=typeof t=="string"?l?.querySelector(t):p.unrefElement(t);C&&(s=new $(C,{...i,...c}))},u=()=>s?.destroy(),d=(C,w)=>{if(w!==void 0)s?.option(C,w);else return s?.option(C)};return p.tryOnMounted(f),p.tryOnScopeDispose(u),{stop:u,start:f,option:d}}function M(t,r,e){const s=n.isRef(t),l=s?[...p.toValue(t)]:p.toValue(t);if(e>=0&&e<l.length){const c=l.splice(r,1)[0];n.nextTick(()=>{l.splice(e,0,c),s&&(t.value=l)})}}a.createCookies=oe,a.moveArrayElement=M,a.useAsyncValidator=ee,a.useAxios=te,a.useChangeCase=ne,a.useCookies=z,a.useDrauu=se,a.useFocusTrap=re,a.useFuse=le,a.useIDBKeyval=ue,a.useJwt=ce,a.useNProgress=ie,a.useQRCode=fe,a.useSortable=de})(this.VueUse=this.VueUse||{},VueUse,AsyncValidator,VueDemi,axios,changeCase,UniversalCookie,Drauu,VueUse,focusTrap,Fuse,idbKeyval,jwt_decode,nprogress,QRCode,Sortable);
1
+ var VueDemi=function(r,o,H){if(r.install)return r;if(!o)return console.error("[vue-demi] no Vue instance found, please be sure to import `vue` before `vue-demi`."),r;if(o.version.slice(0,4)==="2.7."){let h=function(b,P){var C,N={},B={config:o.config,use:o.use.bind(o),mixin:o.mixin.bind(o),component:o.component.bind(o),provide:function(E,k){return N[E]=k,this},directive:function(E,k){return k?(o.directive(E,k),B):o.directive(E)},mount:function(E,k){return C||(C=new o(Object.assign({propsData:P},b,{provide:Object.assign(N,b.provide)})),C.$mount(E,k),C)},unmount:function(){C&&(C.$destroy(),C=void 0)}};return B};var j=h;for(var n in o)r[n]=o[n];r.isVue2=!0,r.isVue3=!1,r.install=function(){},r.Vue=o,r.Vue2=o,r.version=o.version,r.warn=o.util.warn,r.hasInjectionContext=()=>!!r.getCurrentInstance(),r.createApp=h}else if(o.version.slice(0,2)==="2.")if(H){for(var n in H)r[n]=H[n];r.isVue2=!0,r.isVue3=!1,r.install=function(){},r.Vue=o,r.Vue2=o,r.version=o.version,r.hasInjectionContext=()=>!!r.getCurrentInstance()}else console.error("[vue-demi] no VueCompositionAPI instance found, please be sure to import `@vue/composition-api` before `vue-demi`.");else if(o.version.slice(0,2)==="3."){for(var n in o)r[n]=o[n];r.isVue2=!1,r.isVue3=!0,r.install=function(){},r.Vue=o,r.Vue2=void 0,r.version=o.version,r.set=function(h,b,P){return Array.isArray(h)?(h.length=Math.max(h.length,b),h.splice(b,1,P),P):(h[b]=P,P)},r.del=function(h,b){if(Array.isArray(h)){h.splice(b,1);return}delete h[b]}}else console.error("[vue-demi] Vue version "+o.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,o,H,n,j,h,b,P,C,N,B,E,k,S,V,$){"use strict";const D=H.default||H;function ee(t,l,e={}){const{validateOption:a={},immediate:s=!0,manual:i=!1}=e,c=o.toRef(t),f=n.shallowRef(null),u=n.ref(!0),p=n.ref(!s||i),w=n.computed(()=>{var v;return((v=f.value)==null?void 0:v.errors)||[]}),y=n.computed(()=>{var v;return((v=f.value)==null?void 0:v.fields)||{}}),O=n.computed(()=>new D(o.toValue(l))),_=async()=>{u.value=!1,p.value=!1;try{await O.value.validate(c.value,a),p.value=!0,f.value=null}catch(v){f.value=v}finally{u.value=!0}return{pass:p.value,errorInfo:f.value,errors:w.value,errorFields:y.value}};i||n.watch([c,O],()=>_(),{immediate:s,deep:!0});const R={isFinished:u,pass:p,errors:w,errorInfo:f,errorFields:y,execute:_};function g(){return new Promise((v,F)=>{o.until(u).toBe(!0).then(()=>v(R)).catch(I=>F(I))})}return{...R,then(v,F){return g().then(v,F)}}}function te(...t){const l=typeof t[0]=="string"?t[0]:void 0,e=typeof l=="string"?1:0;let a={},s=j,i={immediate:!!e,shallow:!0};const c=A=>!!A?.request;t.length>0+e&&(c(t[0+e])?s=t[0+e]:a=t[0+e]),t.length>1+e&&c(t[1+e])&&(s=t[1+e]),(t.length===2+e&&!c(t[1+e])||t.length===3+e)&&(i=t[t.length-1]);const{initialData:f,shallow:u,onSuccess:p=o.noop,onError:w=o.noop,immediate:y,resetOnExecute:O=!1}=i,_=n.shallowRef(),R=(u?n.shallowRef:n.ref)(f),g=n.ref(!1),v=n.ref(!1),F=n.ref(!1),I=n.shallowRef(),G=j.CancelToken.source;let T=G();const U=A=>{g.value||!v.value||(T.cancel(A),T=G(),F.value=!0,v.value=!1,g.value=!1)},d=A=>{v.value=A,g.value=!A},L=()=>{O&&(R.value=f)},q=()=>new Promise((A,W)=>{o.until(g).toBe(!0).then(()=>I.value?W(I.value):A(Y))}),J={then:(...A)=>q().then(...A),catch:(...A)=>q().catch(...A)};let Q=0;const X=(A=l,W={})=>{I.value=void 0;const Z=typeof A=="string"?A:l??W.url;if(Z===void 0)return I.value=new j.AxiosError(j.AxiosError.ERR_INVALID_URL),g.value=!0,J;L(),U(),d(!0),Q+=1;const ve=Q;return s(Z,{...a,...typeof A=="object"?A:W,cancelToken:T.token}).then(m=>{_.value=m;const K=m.data;R.value=K,p(K)}).catch(m=>{I.value=m,w(m)}).finally(()=>{var m;(m=i.onFinish)==null||m.call(i),ve===Q&&d(!1)}),J};y&&l&&X();const Y={response:_,data:R,error:I,isFinished:g,isLoading:v,cancel:U,isAborted:F,isCanceled:F,abort:U,execute:X};return{...Y,...J}}var x=Object.freeze({__proto__:null,camelCase:h.camelCase,capitalCase:h.capitalCase,constantCase:h.constantCase,dotCase:h.dotCase,headerCase:h.headerCase,noCase:h.noCase,paramCase:h.paramCase,pascalCase:h.pascalCase,pathCase:h.pathCase,sentenceCase:h.sentenceCase,snakeCase:h.snakeCase});function ne(t,l,e){if(typeof t=="function")return n.computed(()=>x[l](o.toValue(t),e));const a=n.ref(t);return n.computed({get(){return x[l](a.value,e)},set(s){a.value=s}})}function oe(t){const l=new b(t?t.headers.cookie:null);return(e,{doNotParse:a=!1,autoUpdateDependencies:s=!1}={})=>z(e,{doNotParse:a,autoUpdateDependencies:s},l)}function z(t,{doNotParse:l=!1,autoUpdateDependencies:e=!1}={},a=new b){const s=e?[...t||[]]:t;let i=a.getAll({doNotParse:!0});const c=n.ref(0),f=()=>{const u=a.getAll({doNotParse:!0});ae(s||null,u,i)&&c.value++,i=u};return a.addChangeListener(f),o.tryOnScopeDispose(()=>{a.removeChangeListener(f)}),{get:(...u)=>(e&&s&&!s.includes(u[0])&&s.push(u[0]),c.value,a.get(u[0],{doNotParse:l,...u[1]})),getAll:(...u)=>(c.value,a.getAll({doNotParse:l,...u[0]})),set:(...u)=>a.set(...u),remove:(...u)=>a.remove(...u),addChangeListener:(...u)=>a.addChangeListener(...u),removeChangeListener:(...u)=>a.removeChangeListener(...u)}}function ae(t,l,e){if(!t)return!0;for(const a of t)if(l[a]!==e[a])return!0;return!1}function re(t,l){const e=n.ref();let a=[];const s=C.createEventHook(),i=C.createEventHook(),c=C.createEventHook(),f=C.createEventHook(),u=C.createEventHook(),p=n.ref(!1),w=n.ref(!1),y=n.ref(!1),O=n.ref(!1),_=n.ref({color:"black",size:3,arrowEnd:!1,cornerRadius:0,dasharray:void 0,fill:"transparent",mode:"draw"});n.watch(_,()=>{const d=e.value;d&&(d.brush=_.value,d.mode=_.value.mode)},{deep:!0});const R=()=>{var d;return(d=e.value)==null?void 0:d.undo()},g=()=>{var d;return(d=e.value)==null?void 0:d.redo()},v=()=>{var d;return(d=e.value)==null?void 0:d.clear()},F=()=>{var d;return(d=e.value)==null?void 0:d.cancel()},I=d=>{var L;return(L=e.value)==null?void 0:L.load(d)},G=()=>{var d;return(d=e.value)==null?void 0:d.dump()},T=()=>{var d;a.forEach(L=>L()),(d=e.value)==null||d.unmount()},U=()=>{e.value&&(p.value=e.value.canUndo(),w.value=e.value.canRedo(),y.value=e.value.altPressed,O.value=e.value.shiftPressed)};return n.watch(()=>C.unrefElement(t),d=>{!d||typeof SVGSVGElement>"u"||!(d instanceof SVGSVGElement)||(e.value&&T(),e.value=P.createDrauu({el:d,...l}),U(),a=[e.value.on("canceled",()=>i.trigger()),e.value.on("committed",L=>c.trigger(L)),e.value.on("start",()=>f.trigger()),e.value.on("end",()=>u.trigger()),e.value.on("changed",()=>{U(),s.trigger()})])},{flush:"post"}),o.tryOnScopeDispose(()=>T()),{drauuInstance:e,load:I,dump:G,clear:v,cancel:F,undo:R,redo:g,canUndo:p,canRedo:w,brush:_,onChanged:s.on,onCommitted:c.on,onStart:f.on,onEnd:u.on,onCanceled:i.on}}function le(t,l={}){let e;const{immediate:a,...s}=l,i=n.ref(!1),c=n.ref(!1),f=y=>e&&e.activate(y),u=y=>e&&e.deactivate(y),p=()=>{e&&(e.pause(),c.value=!0)},w=()=>{e&&(e.unpause(),c.value=!1)};return n.watch(()=>C.unrefElement(t),y=>{y&&(e=N.createFocusTrap(y,{...s,onActivate(){i.value=!0,l.onActivate&&l.onActivate()},onDeactivate(){i.value=!1,l.onDeactivate&&l.onDeactivate()}}),a&&f())},{flush:"post"}),C.tryOnScopeDispose(()=>u()),{hasFocus:i,isPaused:c,activate:f,deactivate:u,pause:p,unpause:w}}function se(t,l,e){const a=()=>{var c,f;return new B((c=o.toValue(l))!=null?c:[],(f=o.toValue(e))==null?void 0:f.fuseOptions)},s=n.ref(a());n.watch(()=>{var c;return(c=o.toValue(e))==null?void 0:c.fuseOptions},()=>{s.value=a()},{deep:!0}),n.watch(()=>o.toValue(l),c=>{s.value.setCollection(c)},{deep:!0});const i=n.computed(()=>{const c=o.toValue(e);if(c?.matchAllWhenSearchEmpty&&!o.toValue(t))return o.toValue(l).map((u,p)=>({item:u,refIndex:p}));const f=c?.resultLimit;return s.value.search(o.toValue(t),f?{limit:f}:void 0)});return{fuse:s,results:i}}function ue(t,l,e={}){const{flush:a="pre",deep:s=!0,shallow:i=!1,onError:c=v=>{console.error(v)},writeDefaults:f=!0}=e,u=n.ref(!1),p=(i?n.shallowRef:n.ref)(l),w=o.toValue(l);async function y(){try{const v=await E.get(t);v===void 0?w!=null&&f&&await E.set(t,w):p.value=v}catch(v){c(v)}u.value=!0}y();async function O(){try{p.value==null?await E.del(t):Array.isArray(p.value)?await E.update(t,()=>JSON.parse(JSON.stringify(p.value))):typeof p.value=="object"?await E.update(t,()=>({...p.value})):await E.update(t,()=>p.value)}catch(v){c(v)}}const{pause:_,resume:R}=C.watchPausable(p,()=>O(),{flush:a,deep:s});async function g(v){_(),p.value=v,await O(),R()}return{set:g,isFinished:u,data:p}}function ce(t,l={}){const{onError:e,fallbackValue:a=null}=l,s=(f,u)=>{try{return k(f,u)}catch(p){return e?.(p),a}},i=n.computed(()=>s(o.toValue(t),{header:!0})),c=n.computed(()=>s(o.toValue(t)));return{header:i,payload:c}}function ie(t=null,l){const e=n.ref(t),a=n.computed({set:i=>i?S.start():S.done(),get:()=>typeof e.value=="number"&&e.value<1});l&&S.configure(l);const s=S.set;return S.set=i=>(e.value=i,s.call(S,i)),n.watchEffect(()=>{typeof e.value=="number"&&o.isClient&&s.call(S,e.value)}),o.tryOnScopeDispose(S.remove),{isLoading:a,progress:e,start:S.start,done:S.done,remove:()=>{e.value=null,S.remove()}}}function fe(t,l){const e=o.toRef(t),a=n.ref("");return n.watch(e,async s=>{e.value&&o.isClient&&(a.value=await V.toDataURL(s,l))},{immediate:!0}),a}function de(t,l,e={}){let a;const{document:s=C.defaultDocument,...i}=e,c={onUpdate:w=>{M(l,w.oldIndex,w.newIndex)}},f=()=>{const w=typeof t=="string"?s?.querySelector(t):C.unrefElement(t);w&&(a=new $(w,{...c,...i}))},u=()=>a?.destroy(),p=(w,y)=>{if(y!==void 0)a?.option(w,y);else return a?.option(w)};return C.tryOnMounted(f),C.tryOnScopeDispose(u),{stop:u,start:f,option:p}}function M(t,l,e){const a=n.isRef(t),s=a?[...C.toValue(t)]:C.toValue(t);if(e>=0&&e<s.length){const i=s.splice(l,1)[0];n.nextTick(()=>{s.splice(e,0,i),a&&(t.value=s)})}}r.createCookies=oe,r.moveArrayElement=M,r.useAsyncValidator=ee,r.useAxios=te,r.useChangeCase=ne,r.useCookies=z,r.useDrauu=re,r.useFocusTrap=le,r.useFuse=se,r.useIDBKeyval=ue,r.useJwt=ce,r.useNProgress=ie,r.useQRCode=fe,r.useSortable=de})(this.VueUse=this.VueUse||{},VueUse,AsyncValidator,VueDemi,axios,changeCase,UniversalCookie,Drauu,VueUse,focusTrap,Fuse,idbKeyval,jwt_decode,nprogress,QRCode,Sortable);
package/index.mjs CHANGED
@@ -25,8 +25,14 @@ function useAsyncValidator(value, rules, options = {}) {
25
25
  const errorInfo = shallowRef(null);
26
26
  const isFinished = ref(true);
27
27
  const pass = ref(!immediate || manual);
28
- const errors = computed(() => errorInfo.value?.errors || []);
29
- const errorFields = computed(() => errorInfo.value?.fields || {});
28
+ const errors = computed(() => {
29
+ var _a;
30
+ return ((_a = errorInfo.value) == null ? void 0 : _a.errors) || [];
31
+ });
32
+ const errorFields = computed(() => {
33
+ var _a;
34
+ return ((_a = errorInfo.value) == null ? void 0 : _a.fields) || {};
35
+ });
30
36
  const validator = computed(() => new AsyncValidatorSchema(toValue(rules)));
31
37
  const execute = async () => {
32
38
  isFinished.value = false;
@@ -84,7 +90,7 @@ function useAxios(...args) {
84
90
  immediate: !!argsPlaceholder,
85
91
  shallow: true
86
92
  };
87
- const isAxiosInstance = (val) => !!val?.request;
93
+ const isAxiosInstance = (val) => !!(val == null ? void 0 : val.request);
88
94
  if (args.length > 0 + argsPlaceholder) {
89
95
  if (isAxiosInstance(args[0 + argsPlaceholder]))
90
96
  instance = args[0 + argsPlaceholder];
@@ -140,7 +146,7 @@ function useAxios(...args) {
140
146
  let executeCounter = 0;
141
147
  const execute = (executeUrl = url, config = {}) => {
142
148
  error.value = void 0;
143
- const _url = typeof executeUrl === "string" ? executeUrl : url ?? config.url;
149
+ const _url = typeof executeUrl === "string" ? executeUrl : url != null ? url : config.url;
144
150
  if (_url === void 0) {
145
151
  error.value = new AxiosError(AxiosError.ERR_INVALID_URL);
146
152
  isFinished.value = true;
@@ -160,7 +166,8 @@ function useAxios(...args) {
160
166
  error.value = e;
161
167
  onError(e);
162
168
  }).finally(() => {
163
- options.onFinish?.();
169
+ var _a;
170
+ (_a = options.onFinish) == null ? void 0 : _a.call(options);
164
171
  if (currentExecuteCounter === executeCounter)
165
172
  loading(false);
166
173
  });
@@ -298,15 +305,34 @@ function useDrauu(target, options) {
298
305
  instance.mode = brush.value.mode;
299
306
  }
300
307
  }, { deep: true });
301
- const undo = () => drauuInstance.value?.undo();
302
- const redo = () => drauuInstance.value?.redo();
303
- const clear = () => drauuInstance.value?.clear();
304
- const cancel = () => drauuInstance.value?.cancel();
305
- const load = (svg) => drauuInstance.value?.load(svg);
306
- const dump = () => drauuInstance.value?.dump();
308
+ const undo = () => {
309
+ var _a;
310
+ return (_a = drauuInstance.value) == null ? void 0 : _a.undo();
311
+ };
312
+ const redo = () => {
313
+ var _a;
314
+ return (_a = drauuInstance.value) == null ? void 0 : _a.redo();
315
+ };
316
+ const clear = () => {
317
+ var _a;
318
+ return (_a = drauuInstance.value) == null ? void 0 : _a.clear();
319
+ };
320
+ const cancel = () => {
321
+ var _a;
322
+ return (_a = drauuInstance.value) == null ? void 0 : _a.cancel();
323
+ };
324
+ const load = (svg) => {
325
+ var _a;
326
+ return (_a = drauuInstance.value) == null ? void 0 : _a.load(svg);
327
+ };
328
+ const dump = () => {
329
+ var _a;
330
+ return (_a = drauuInstance.value) == null ? void 0 : _a.dump();
331
+ };
307
332
  const cleanup = () => {
333
+ var _a;
308
334
  disposables.forEach((dispose) => dispose());
309
- drauuInstance.value?.unmount();
335
+ (_a = drauuInstance.value) == null ? void 0 : _a.unmount();
310
336
  };
311
337
  const syncStatus = () => {
312
338
  if (drauuInstance.value) {
@@ -413,14 +439,18 @@ function useFocusTrap(target, options = {}) {
413
439
 
414
440
  function useFuse(search, data, options) {
415
441
  const createFuse = () => {
442
+ var _a, _b;
416
443
  return new Fuse(
417
- toValue(data) ?? [],
418
- toValue(options)?.fuseOptions
444
+ (_a = toValue(data)) != null ? _a : [],
445
+ (_b = toValue(options)) == null ? void 0 : _b.fuseOptions
419
446
  );
420
447
  };
421
448
  const fuse = ref(createFuse());
422
449
  watch(
423
- () => toValue(options)?.fuseOptions,
450
+ () => {
451
+ var _a;
452
+ return (_a = toValue(options)) == null ? void 0 : _a.fuseOptions;
453
+ },
424
454
  () => {
425
455
  fuse.value = createFuse();
426
456
  },
@@ -435,9 +465,9 @@ function useFuse(search, data, options) {
435
465
  );
436
466
  const results = computed(() => {
437
467
  const resolved = toValue(options);
438
- if (resolved?.matchAllWhenSearchEmpty && !toValue(search))
468
+ if ((resolved == null ? void 0 : resolved.matchAllWhenSearchEmpty) && !toValue(search))
439
469
  return toValue(data).map((item, index) => ({ item, refIndex: index }));
440
- const limit = resolved?.resultLimit;
470
+ const limit = resolved == null ? void 0 : resolved.resultLimit;
441
471
  return fuse.value.search(toValue(search), limit ? { limit } : void 0);
442
472
  });
443
473
  return {
@@ -516,7 +546,7 @@ function useJwt(encodedJwt, options = {}) {
516
546
  try {
517
547
  return jwt_decode(encodedJwt2, options2);
518
548
  } catch (err) {
519
- onError?.(err);
549
+ onError == null ? void 0 : onError(err);
520
550
  return fallbackValue;
521
551
  }
522
552
  };
@@ -581,17 +611,17 @@ function useSortable(el, list, options = {}) {
581
611
  }
582
612
  };
583
613
  const start = () => {
584
- const target = typeof el === "string" ? document?.querySelector(el) : unrefElement(el);
614
+ const target = typeof el === "string" ? document == null ? void 0 : document.querySelector(el) : unrefElement(el);
585
615
  if (!target)
586
616
  return;
587
617
  sortable = new Sortable(target, { ...defaultOptions, ...resetOptions });
588
618
  };
589
- const stop = () => sortable?.destroy();
619
+ const stop = () => sortable == null ? void 0 : sortable.destroy();
590
620
  const option = (name, value) => {
591
621
  if (value !== void 0)
592
- sortable?.option(name, value);
622
+ sortable == null ? void 0 : sortable.option(name, value);
593
623
  else
594
- return sortable?.option(name);
624
+ return sortable == null ? void 0 : sortable.option(name);
595
625
  };
596
626
  tryOnMounted(start);
597
627
  tryOnScopeDispose$1(stop);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vueuse/integrations",
3
- "version": "10.4.0",
3
+ "version": "10.4.1",
4
4
  "description": "Integration wrappers for utility libraries",
5
5
  "author": "Anthony Fu <https://github.com/antfu>",
6
6
  "license": "MIT",
@@ -27,64 +27,64 @@
27
27
  },
28
28
  "./*": "./*",
29
29
  "./useAsyncValidator": {
30
- "require": "./useAsyncValidator.cjs",
31
- "import": "./useAsyncValidator.mjs"
30
+ "import": "./useAsyncValidator.mjs",
31
+ "require": "./useAsyncValidator.cjs"
32
32
  },
33
33
  "./useAxios": {
34
- "require": "./useAxios.cjs",
35
- "import": "./useAxios.mjs"
34
+ "import": "./useAxios.mjs",
35
+ "require": "./useAxios.cjs"
36
36
  },
37
37
  "./useCookies": {
38
- "require": "./useCookies.cjs",
39
- "import": "./useCookies.mjs"
38
+ "import": "./useCookies.mjs",
39
+ "require": "./useCookies.cjs"
40
40
  },
41
41
  "./useDrauu": {
42
- "require": "./useDrauu.cjs",
43
- "import": "./useDrauu.mjs"
42
+ "import": "./useDrauu.mjs",
43
+ "require": "./useDrauu.cjs"
44
44
  },
45
45
  "./useFocusTrap": {
46
- "require": "./useFocusTrap.cjs",
47
- "import": "./useFocusTrap.mjs"
46
+ "import": "./useFocusTrap.mjs",
47
+ "require": "./useFocusTrap.cjs"
48
48
  },
49
49
  "./useFocusTrap/component": {
50
- "require": "./useFocusTrap/component.cjs",
51
- "import": "./useFocusTrap/component.mjs"
50
+ "import": "./useFocusTrap/component.mjs",
51
+ "require": "./useFocusTrap/component.cjs"
52
52
  },
53
53
  "./useFuse": {
54
- "require": "./useFuse.cjs",
55
- "import": "./useFuse.mjs"
54
+ "import": "./useFuse.mjs",
55
+ "require": "./useFuse.cjs"
56
56
  },
57
57
  "./useJwt": {
58
- "require": "./useJwt.cjs",
59
- "import": "./useJwt.mjs"
58
+ "import": "./useJwt.mjs",
59
+ "require": "./useJwt.cjs"
60
60
  },
61
61
  "./useNProgress": {
62
- "require": "./useNProgress.cjs",
63
- "import": "./useNProgress.mjs"
62
+ "import": "./useNProgress.mjs",
63
+ "require": "./useNProgress.cjs"
64
64
  },
65
65
  "./useQRCode": {
66
- "require": "./useQRCode.cjs",
67
- "import": "./useQRCode.mjs"
66
+ "import": "./useQRCode.mjs",
67
+ "require": "./useQRCode.cjs"
68
68
  },
69
69
  "./useChangeCase": {
70
- "require": "./useChangeCase.cjs",
71
- "import": "./useChangeCase.mjs"
70
+ "import": "./useChangeCase.mjs",
71
+ "require": "./useChangeCase.cjs"
72
72
  },
73
73
  "./useAsyncValidator/component": {
74
- "require": "./useAsyncValidator/component.cjs",
75
- "import": "./useAsyncValidator/component.mjs"
74
+ "import": "./useAsyncValidator/component.mjs",
75
+ "require": "./useAsyncValidator/component.cjs"
76
76
  },
77
77
  "./useIDBKeyval": {
78
- "require": "./useIDBKeyval.cjs",
79
- "import": "./useIDBKeyval.mjs"
78
+ "import": "./useIDBKeyval.mjs",
79
+ "require": "./useIDBKeyval.cjs"
80
80
  },
81
81
  "./useSortable": {
82
- "require": "./useSortable.cjs",
83
- "import": "./useSortable.mjs"
82
+ "import": "./useSortable.mjs",
83
+ "require": "./useSortable.cjs"
84
84
  },
85
85
  "./useSortable/component": {
86
- "require": "./useSortable/component.cjs",
87
- "import": "./useSortable/component.mjs"
86
+ "import": "./useSortable/component.mjs",
87
+ "require": "./useSortable/component.cjs"
88
88
  }
89
89
  },
90
90
  "main": "./index.cjs",
@@ -145,8 +145,8 @@
145
145
  }
146
146
  },
147
147
  "dependencies": {
148
- "@vueuse/core": "10.4.0",
149
- "@vueuse/shared": "10.4.0",
148
+ "@vueuse/core": "10.4.1",
149
+ "@vueuse/shared": "10.4.1",
150
150
  "vue-demi": ">=0.14.5"
151
151
  },
152
152
  "devDependencies": {
@@ -15,8 +15,14 @@ function useAsyncValidator(value, rules, options = {}) {
15
15
  const errorInfo = vueDemi.shallowRef(null);
16
16
  const isFinished = vueDemi.ref(true);
17
17
  const pass = vueDemi.ref(!immediate || manual);
18
- const errors = vueDemi.computed(() => errorInfo.value?.errors || []);
19
- const errorFields = vueDemi.computed(() => errorInfo.value?.fields || {});
18
+ const errors = vueDemi.computed(() => {
19
+ var _a;
20
+ return ((_a = errorInfo.value) == null ? void 0 : _a.errors) || [];
21
+ });
22
+ const errorFields = vueDemi.computed(() => {
23
+ var _a;
24
+ return ((_a = errorInfo.value) == null ? void 0 : _a.fields) || {};
25
+ });
20
26
  const validator = vueDemi.computed(() => new AsyncValidatorSchema(shared.toValue(rules)));
21
27
  const execute = async () => {
22
28
  isFinished.value = false;
@@ -128,8 +128,14 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
128
128
  const errorInfo = vueDemi.shallowRef(null);
129
129
  const isFinished = vueDemi.ref(true);
130
130
  const pass = vueDemi.ref(!immediate || manual);
131
- const errors = vueDemi.computed(() => errorInfo.value?.errors || []);
132
- const errorFields = vueDemi.computed(() => errorInfo.value?.fields || {});
131
+ const errors = vueDemi.computed(() => {
132
+ var _a;
133
+ return ((_a = errorInfo.value) == null ? void 0 : _a.errors) || [];
134
+ });
135
+ const errorFields = vueDemi.computed(() => {
136
+ var _a;
137
+ return ((_a = errorInfo.value) == null ? void 0 : _a.fields) || {};
138
+ });
133
139
  const validator = vueDemi.computed(() => new AsyncValidatorSchema(shared.toValue(rules)));
134
140
  const execute = async () => {
135
141
  isFinished.value = false;
@@ -1 +1 @@
1
- var VueDemi=function(n,r,c){if(n.install)return n;if(!r)return console.error("[vue-demi] no Vue instance found, please be sure to import `vue` before `vue-demi`."),n;if(r.version.slice(0,4)==="2.7."){let e=function(s,l){var o,v={},u={config:r.config,use:r.use.bind(r),mixin:r.mixin.bind(r),component:r.component.bind(r),provide:function(i,a){return v[i]=a,this},directive:function(i,a){return a?(r.directive(i,a),u):r.directive(i)},mount:function(i,a){return o||(o=new r(Object.assign({propsData:l},s,{provide:Object.assign(v,s.provide)})),o.$mount(i,a),o)},unmount:function(){o&&(o.$destroy(),o=void 0)}};return u};var A=e;for(var t in r)n[t]=r[t];n.isVue2=!0,n.isVue3=!1,n.install=function(){},n.Vue=r,n.Vue2=r,n.version=r.version,n.warn=r.util.warn,n.hasInjectionContext=()=>!!n.getCurrentInstance(),n.createApp=e}else if(r.version.slice(0,2)==="2.")if(c){for(var t in c)n[t]=c[t];n.isVue2=!0,n.isVue3=!1,n.install=function(){},n.Vue=r,n.Vue2=r,n.version=r.version,n.hasInjectionContext=()=>!!n.getCurrentInstance()}else console.error("[vue-demi] no VueCompositionAPI instance found, please be sure to import `@vue/composition-api` before `vue-demi`.");else if(r.version.slice(0,2)==="3."){for(var t in r)n[t]=r[t];n.isVue2=!1,n.isVue3=!0,n.install=function(){},n.Vue=r,n.Vue2=void 0,n.version=r.version,n.set=function(e,s,l){return Array.isArray(e)?(e.length=Math.max(e.length,s),e.splice(s,1,l),l):(e[s]=l,l)},n.del=function(e,s){if(Array.isArray(e)){e.splice(s,1);return}delete e[s]}}else console.error("[vue-demi] Vue version "+r.version+" is unsupported.");return n}(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(n,r,c,t){"use strict";const A=c.default||c;function e(s,l,o={}){const{validateOption:v={},immediate:u=!0,manual:i=!1}=o,a=r.toRef(s),f=t.shallowRef(null),p=t.ref(!0),h=t.ref(!u||i),b=t.computed(()=>f.value?.errors||[]),w=t.computed(()=>f.value?.fields||{}),I=t.computed(()=>new A(r.toValue(l))),x=async()=>{p.value=!1,h.value=!1;try{await I.value.validate(a.value,v),h.value=!0,f.value=null}catch(d){f.value=d}finally{p.value=!0}return{pass:h.value,errorInfo:f.value,errors:b.value,errorFields:w.value}};i||t.watch([a,I],()=>x(),{immediate:u,deep:!0});const C={isFinished:p,pass:h,errors:b,errorInfo:f,errorFields:w,execute:x};function j(){return new Promise((d,y)=>{r.until(p).toBe(!0).then(()=>d(C)).catch(F=>y(F))})}return{...C,then(d,y){return j().then(d,y)}}}n.useAsyncValidator=e})(this.VueUse=this.VueUse||{},VueUse,AsyncValidator,VueDemi);
1
+ var VueDemi=function(n,r,f){if(n.install)return n;if(!r)return console.error("[vue-demi] no Vue instance found, please be sure to import `vue` before `vue-demi`."),n;if(r.version.slice(0,4)==="2.7."){let e=function(o,c){var i,v={},d={config:r.config,use:r.use.bind(r),mixin:r.mixin.bind(r),component:r.component.bind(r),provide:function(a,l){return v[a]=l,this},directive:function(a,l){return l?(r.directive(a,l),d):r.directive(a)},mount:function(a,l){return i||(i=new r(Object.assign({propsData:c},o,{provide:Object.assign(v,o.provide)})),i.$mount(a,l),i)},unmount:function(){i&&(i.$destroy(),i=void 0)}};return d};var A=e;for(var t in r)n[t]=r[t];n.isVue2=!0,n.isVue3=!1,n.install=function(){},n.Vue=r,n.Vue2=r,n.version=r.version,n.warn=r.util.warn,n.hasInjectionContext=()=>!!n.getCurrentInstance(),n.createApp=e}else if(r.version.slice(0,2)==="2.")if(f){for(var t in f)n[t]=f[t];n.isVue2=!0,n.isVue3=!1,n.install=function(){},n.Vue=r,n.Vue2=r,n.version=r.version,n.hasInjectionContext=()=>!!n.getCurrentInstance()}else console.error("[vue-demi] no VueCompositionAPI instance found, please be sure to import `@vue/composition-api` before `vue-demi`.");else if(r.version.slice(0,2)==="3."){for(var t in r)n[t]=r[t];n.isVue2=!1,n.isVue3=!0,n.install=function(){},n.Vue=r,n.Vue2=void 0,n.version=r.version,n.set=function(e,o,c){return Array.isArray(e)?(e.length=Math.max(e.length,o),e.splice(o,1,c),c):(e[o]=c,c)},n.del=function(e,o){if(Array.isArray(e)){e.splice(o,1);return}delete e[o]}}else console.error("[vue-demi] Vue version "+r.version+" is unsupported.");return n}(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(n,r,f,t){"use strict";const A=f.default||f;function e(o,c,i={}){const{validateOption:v={},immediate:d=!0,manual:a=!1}=i,l=r.toRef(o),u=t.shallowRef(null),p=t.ref(!0),h=t.ref(!d||a),b=t.computed(()=>{var s;return((s=u.value)==null?void 0:s.errors)||[]}),w=t.computed(()=>{var s;return((s=u.value)==null?void 0:s.fields)||{}}),I=t.computed(()=>new A(r.toValue(c))),x=async()=>{p.value=!1,h.value=!1;try{await I.value.validate(l.value,v),h.value=!0,u.value=null}catch(s){u.value=s}finally{p.value=!0}return{pass:h.value,errorInfo:u.value,errors:b.value,errorFields:w.value}};a||t.watch([l,I],()=>x(),{immediate:d,deep:!0});const C={isFinished:p,pass:h,errors:b,errorInfo:u,errorFields:w,execute:x};function j(){return new Promise((s,y)=>{r.until(p).toBe(!0).then(()=>s(C)).catch(F=>y(F))})}return{...C,then(s,y){return j().then(s,y)}}}n.useAsyncValidator=e})(this.VueUse=this.VueUse||{},VueUse,AsyncValidator,VueDemi);
@@ -13,8 +13,14 @@ function useAsyncValidator(value, rules, options = {}) {
13
13
  const errorInfo = shallowRef(null);
14
14
  const isFinished = ref(true);
15
15
  const pass = ref(!immediate || manual);
16
- const errors = computed(() => errorInfo.value?.errors || []);
17
- const errorFields = computed(() => errorInfo.value?.fields || {});
16
+ const errors = computed(() => {
17
+ var _a;
18
+ return ((_a = errorInfo.value) == null ? void 0 : _a.errors) || [];
19
+ });
20
+ const errorFields = computed(() => {
21
+ var _a;
22
+ return ((_a = errorInfo.value) == null ? void 0 : _a.fields) || {};
23
+ });
18
24
  const validator = computed(() => new AsyncValidatorSchema(toValue(rules)));
19
25
  const execute = async () => {
20
26
  isFinished.value = false;
package/useAxios.cjs CHANGED
@@ -13,7 +13,7 @@ function useAxios(...args) {
13
13
  immediate: !!argsPlaceholder,
14
14
  shallow: true
15
15
  };
16
- const isAxiosInstance = (val) => !!val?.request;
16
+ const isAxiosInstance = (val) => !!(val == null ? void 0 : val.request);
17
17
  if (args.length > 0 + argsPlaceholder) {
18
18
  if (isAxiosInstance(args[0 + argsPlaceholder]))
19
19
  instance = args[0 + argsPlaceholder];
@@ -69,7 +69,7 @@ function useAxios(...args) {
69
69
  let executeCounter = 0;
70
70
  const execute = (executeUrl = url, config = {}) => {
71
71
  error.value = void 0;
72
- const _url = typeof executeUrl === "string" ? executeUrl : url ?? config.url;
72
+ const _url = typeof executeUrl === "string" ? executeUrl : url != null ? url : config.url;
73
73
  if (_url === void 0) {
74
74
  error.value = new axios.AxiosError(axios.AxiosError.ERR_INVALID_URL);
75
75
  isFinished.value = true;
@@ -89,7 +89,8 @@ function useAxios(...args) {
89
89
  error.value = e;
90
90
  onError(e);
91
91
  }).finally(() => {
92
- options.onFinish?.();
92
+ var _a;
93
+ (_a = options.onFinish) == null ? void 0 : _a.call(options);
93
94
  if (currentExecuteCounter === executeCounter)
94
95
  loading(false);
95
96
  });
package/useAxios.iife.js CHANGED
@@ -126,7 +126,7 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
126
126
  immediate: !!argsPlaceholder,
127
127
  shallow: true
128
128
  };
129
- const isAxiosInstance = (val) => !!val?.request;
129
+ const isAxiosInstance = (val) => !!(val == null ? void 0 : val.request);
130
130
  if (args.length > 0 + argsPlaceholder) {
131
131
  if (isAxiosInstance(args[0 + argsPlaceholder]))
132
132
  instance = args[0 + argsPlaceholder];
@@ -182,7 +182,7 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
182
182
  let executeCounter = 0;
183
183
  const execute = (executeUrl = url, config = {}) => {
184
184
  error.value = void 0;
185
- const _url = typeof executeUrl === "string" ? executeUrl : url ?? config.url;
185
+ const _url = typeof executeUrl === "string" ? executeUrl : url != null ? url : config.url;
186
186
  if (_url === void 0) {
187
187
  error.value = new axios.AxiosError(axios.AxiosError.ERR_INVALID_URL);
188
188
  isFinished.value = true;
@@ -202,7 +202,8 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
202
202
  error.value = e;
203
203
  onError(e);
204
204
  }).finally(() => {
205
- options.onFinish?.();
205
+ var _a;
206
+ (_a = options.onFinish) == null ? void 0 : _a.call(options);
206
207
  if (currentExecuteCounter === executeCounter)
207
208
  loading(false);
208
209
  });
@@ -1 +1 @@
1
- var VueDemi=function(e,n,a){if(e.install)return e;if(!n)return console.error("[vue-demi] no Vue instance found, please be sure to import `vue` before `vue-demi`."),e;if(n.version.slice(0,4)==="2.7."){let t=function(i,o){var l,u={},d={config:n.config,use:n.use.bind(n),mixin:n.mixin.bind(n),component:n.component.bind(n),provide:function(c,f){return u[c]=f,this},directive:function(c,f){return f?(n.directive(c,f),d):n.directive(c)},mount:function(c,f){return l||(l=new n(Object.assign({propsData:o},i,{provide:Object.assign(u,i.provide)})),l.$mount(c,f),l)},unmount:function(){l&&(l.$destroy(),l=void 0)}};return d};var R=t;for(var r in n)e[r]=n[r];e.isVue2=!0,e.isVue3=!1,e.install=function(){},e.Vue=n,e.Vue2=n,e.version=n.version,e.warn=n.util.warn,e.hasInjectionContext=()=>!!e.getCurrentInstance(),e.createApp=t}else if(n.version.slice(0,2)==="2.")if(a){for(var r in a)e[r]=a[r];e.isVue2=!0,e.isVue3=!1,e.install=function(){},e.Vue=n,e.Vue2=n,e.version=n.version,e.hasInjectionContext=()=>!!e.getCurrentInstance()}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 r in n)e[r]=n[r];e.isVue2=!1,e.isVue3=!0,e.install=function(){},e.Vue=n,e.Vue2=void 0,e.version=n.version,e.set=function(t,i,o){return Array.isArray(t)?(t.length=Math.max(t.length,i),t.splice(i,1,o),o):(t[i]=o,o)},e.del=function(t,i){if(Array.isArray(t)){t.splice(i,1);return}delete t[i]}}else console.error("[vue-demi] Vue version "+n.version+" is unsupported.");return e}(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(e,n,a,r){"use strict";function R(...t){const i=typeof t[0]=="string"?t[0]:void 0,o=typeof i=="string"?1:0;let l={},u=r,d={immediate:!!o,shallow:!0};const c=s=>!!s?.request;t.length>0+o&&(c(t[0+o])?u=t[0+o]:l=t[0+o]),t.length>1+o&&c(t[1+o])&&(u=t[1+o]),(t.length===2+o&&!c(t[1+o])||t.length===3+o)&&(d=t[t.length-1]);const{initialData:f,shallow:S,onSuccess:U=a.noop,onError:$=a.noop,immediate:q,resetOnExecute:B=!1}=d,j=n.shallowRef(),w=(S?n.shallowRef:n.ref)(f),v=n.ref(!1),A=n.ref(!1),y=n.ref(!1),p=n.shallowRef(),P=r.CancelToken.source;let C=P();const x=s=>{v.value||!A.value||(C.cancel(s),C=P(),y.value=!0,A.value=!1,v.value=!1)},T=s=>{A.value=s,v.value=!s},M=()=>{B&&(w.value=f)},k=()=>new Promise((s,b)=>{a.until(v).toBe(!0).then(()=>p.value?b(p.value):s(L))}),I={then:(...s)=>k().then(...s),catch:(...s)=>k().catch(...s)};let E=0;const F=(s=i,b={})=>{p.value=void 0;const O=typeof s=="string"?s:i??b.url;if(O===void 0)return p.value=new r.AxiosError(r.AxiosError.ERR_INVALID_URL),v.value=!0,I;M(),x(),T(!0),E+=1;const N=E;return u(O,{...l,...typeof s=="object"?s:b,cancelToken:C.token}).then(h=>{j.value=h;const _=h.data;w.value=_,U(_)}).catch(h=>{p.value=h,$(h)}).finally(()=>{d.onFinish?.(),N===E&&T(!1)}),I};q&&i&&F();const L={response:j,data:w,error:p,isFinished:v,isLoading:A,cancel:x,isAborted:y,isCanceled:y,abort:x,execute:F};return{...L,...I}}e.useAxios=R})(this.VueUse=this.VueUse||{},VueDemi,VueUse,axios);
1
+ var VueDemi=function(e,n,u){if(e.install)return e;if(!n)return console.error("[vue-demi] no Vue instance found, please be sure to import `vue` before `vue-demi`."),e;if(n.version.slice(0,4)==="2.7."){let t=function(i,o){var l,v={},d={config:n.config,use:n.use.bind(n),mixin:n.mixin.bind(n),component:n.component.bind(n),provide:function(c,f){return v[c]=f,this},directive:function(c,f){return f?(n.directive(c,f),d):n.directive(c)},mount:function(c,f){return l||(l=new n(Object.assign({propsData:o},i,{provide:Object.assign(v,i.provide)})),l.$mount(c,f),l)},unmount:function(){l&&(l.$destroy(),l=void 0)}};return d};var R=t;for(var r in n)e[r]=n[r];e.isVue2=!0,e.isVue3=!1,e.install=function(){},e.Vue=n,e.Vue2=n,e.version=n.version,e.warn=n.util.warn,e.hasInjectionContext=()=>!!e.getCurrentInstance(),e.createApp=t}else if(n.version.slice(0,2)==="2.")if(u){for(var r in u)e[r]=u[r];e.isVue2=!0,e.isVue3=!1,e.install=function(){},e.Vue=n,e.Vue2=n,e.version=n.version,e.hasInjectionContext=()=>!!e.getCurrentInstance()}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 r in n)e[r]=n[r];e.isVue2=!1,e.isVue3=!0,e.install=function(){},e.Vue=n,e.Vue2=void 0,e.version=n.version,e.set=function(t,i,o){return Array.isArray(t)?(t.length=Math.max(t.length,i),t.splice(i,1,o),o):(t[i]=o,o)},e.del=function(t,i){if(Array.isArray(t)){t.splice(i,1);return}delete t[i]}}else console.error("[vue-demi] Vue version "+n.version+" is unsupported.");return e}(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(e,n,u,r){"use strict";function R(...t){const i=typeof t[0]=="string"?t[0]:void 0,o=typeof i=="string"?1:0;let l={},v=r,d={immediate:!!o,shallow:!0};const c=s=>!!s?.request;t.length>0+o&&(c(t[0+o])?v=t[0+o]:l=t[0+o]),t.length>1+o&&c(t[1+o])&&(v=t[1+o]),(t.length===2+o&&!c(t[1+o])||t.length===3+o)&&(d=t[t.length-1]);const{initialData:f,shallow:S,onSuccess:U=u.noop,onError:$=u.noop,immediate:q,resetOnExecute:B=!1}=d,j=n.shallowRef(),w=(S?n.shallowRef:n.ref)(f),p=n.ref(!1),A=n.ref(!1),y=n.ref(!1),h=n.shallowRef(),P=r.CancelToken.source;let C=P();const x=s=>{p.value||!A.value||(C.cancel(s),C=P(),y.value=!0,A.value=!1,p.value=!1)},T=s=>{A.value=s,p.value=!s},M=()=>{B&&(w.value=f)},_=()=>new Promise((s,b)=>{u.until(p).toBe(!0).then(()=>h.value?b(h.value):s(F))}),I={then:(...s)=>_().then(...s),catch:(...s)=>_().catch(...s)};let E=0;const k=(s=i,b={})=>{h.value=void 0;const L=typeof s=="string"?s:i??b.url;if(L===void 0)return h.value=new r.AxiosError(r.AxiosError.ERR_INVALID_URL),p.value=!0,I;M(),x(),T(!0),E+=1;const N=E;return v(L,{...l,...typeof s=="object"?s:b,cancelToken:C.token}).then(a=>{j.value=a;const O=a.data;w.value=O,U(O)}).catch(a=>{h.value=a,$(a)}).finally(()=>{var a;(a=d.onFinish)==null||a.call(d),N===E&&T(!1)}),I};q&&i&&k();const F={response:j,data:w,error:h,isFinished:p,isLoading:A,cancel:x,isAborted:y,isCanceled:y,abort:x,execute:k};return{...F,...I}}e.useAxios=R})(this.VueUse=this.VueUse||{},VueDemi,VueUse,axios);
package/useAxios.mjs CHANGED
@@ -11,7 +11,7 @@ function useAxios(...args) {
11
11
  immediate: !!argsPlaceholder,
12
12
  shallow: true
13
13
  };
14
- const isAxiosInstance = (val) => !!val?.request;
14
+ const isAxiosInstance = (val) => !!(val == null ? void 0 : val.request);
15
15
  if (args.length > 0 + argsPlaceholder) {
16
16
  if (isAxiosInstance(args[0 + argsPlaceholder]))
17
17
  instance = args[0 + argsPlaceholder];
@@ -67,7 +67,7 @@ function useAxios(...args) {
67
67
  let executeCounter = 0;
68
68
  const execute = (executeUrl = url, config = {}) => {
69
69
  error.value = void 0;
70
- const _url = typeof executeUrl === "string" ? executeUrl : url ?? config.url;
70
+ const _url = typeof executeUrl === "string" ? executeUrl : url != null ? url : config.url;
71
71
  if (_url === void 0) {
72
72
  error.value = new AxiosError(AxiosError.ERR_INVALID_URL);
73
73
  isFinished.value = true;
@@ -87,7 +87,8 @@ function useAxios(...args) {
87
87
  error.value = e;
88
88
  onError(e);
89
89
  }).finally(() => {
90
- options.onFinish?.();
90
+ var _a;
91
+ (_a = options.onFinish) == null ? void 0 : _a.call(options);
91
92
  if (currentExecuteCounter === executeCounter)
92
93
  loading(false);
93
94
  });
package/useDrauu.cjs CHANGED
@@ -33,15 +33,34 @@ function useDrauu(target, options) {
33
33
  instance.mode = brush.value.mode;
34
34
  }
35
35
  }, { deep: true });
36
- const undo = () => drauuInstance.value?.undo();
37
- const redo = () => drauuInstance.value?.redo();
38
- const clear = () => drauuInstance.value?.clear();
39
- const cancel = () => drauuInstance.value?.cancel();
40
- const load = (svg) => drauuInstance.value?.load(svg);
41
- const dump = () => drauuInstance.value?.dump();
36
+ const undo = () => {
37
+ var _a;
38
+ return (_a = drauuInstance.value) == null ? void 0 : _a.undo();
39
+ };
40
+ const redo = () => {
41
+ var _a;
42
+ return (_a = drauuInstance.value) == null ? void 0 : _a.redo();
43
+ };
44
+ const clear = () => {
45
+ var _a;
46
+ return (_a = drauuInstance.value) == null ? void 0 : _a.clear();
47
+ };
48
+ const cancel = () => {
49
+ var _a;
50
+ return (_a = drauuInstance.value) == null ? void 0 : _a.cancel();
51
+ };
52
+ const load = (svg) => {
53
+ var _a;
54
+ return (_a = drauuInstance.value) == null ? void 0 : _a.load(svg);
55
+ };
56
+ const dump = () => {
57
+ var _a;
58
+ return (_a = drauuInstance.value) == null ? void 0 : _a.dump();
59
+ };
42
60
  const cleanup = () => {
61
+ var _a;
43
62
  disposables.forEach((dispose) => dispose());
44
- drauuInstance.value?.unmount();
63
+ (_a = drauuInstance.value) == null ? void 0 : _a.unmount();
45
64
  };
46
65
  const syncStatus = () => {
47
66
  if (drauuInstance.value) {
package/useDrauu.iife.js CHANGED
@@ -145,15 +145,34 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
145
145
  instance.mode = brush.value.mode;
146
146
  }
147
147
  }, { deep: true });
148
- const undo = () => drauuInstance.value?.undo();
149
- const redo = () => drauuInstance.value?.redo();
150
- const clear = () => drauuInstance.value?.clear();
151
- const cancel = () => drauuInstance.value?.cancel();
152
- const load = (svg) => drauuInstance.value?.load(svg);
153
- const dump = () => drauuInstance.value?.dump();
148
+ const undo = () => {
149
+ var _a;
150
+ return (_a = drauuInstance.value) == null ? void 0 : _a.undo();
151
+ };
152
+ const redo = () => {
153
+ var _a;
154
+ return (_a = drauuInstance.value) == null ? void 0 : _a.redo();
155
+ };
156
+ const clear = () => {
157
+ var _a;
158
+ return (_a = drauuInstance.value) == null ? void 0 : _a.clear();
159
+ };
160
+ const cancel = () => {
161
+ var _a;
162
+ return (_a = drauuInstance.value) == null ? void 0 : _a.cancel();
163
+ };
164
+ const load = (svg) => {
165
+ var _a;
166
+ return (_a = drauuInstance.value) == null ? void 0 : _a.load(svg);
167
+ };
168
+ const dump = () => {
169
+ var _a;
170
+ return (_a = drauuInstance.value) == null ? void 0 : _a.dump();
171
+ };
154
172
  const cleanup = () => {
173
+ var _a;
155
174
  disposables.forEach((dispose) => dispose());
156
- drauuInstance.value?.unmount();
175
+ (_a = drauuInstance.value) == null ? void 0 : _a.unmount();
157
176
  };
158
177
  const syncStatus = () => {
159
178
  if (drauuInstance.value) {
@@ -1 +1 @@
1
- var VueDemi=function(e,n,d){if(e.install)return e;if(!n)return console.error("[vue-demi] no Vue instance found, please be sure to import `vue` before `vue-demi`."),e;if(n.version.slice(0,4)==="2.7."){let r=function(s,l){var o,u={},f={config:n.config,use:n.use.bind(n),mixin:n.mixin.bind(n),component:n.component.bind(n),provide:function(i,c){return u[i]=c,this},directive:function(i,c){return c?(n.directive(i,c),f):n.directive(i)},mount:function(i,c){return o||(o=new n(Object.assign({propsData:l},s,{provide:Object.assign(u,s.provide)})),o.$mount(i,c),o)},unmount:function(){o&&(o.$destroy(),o=void 0)}};return f};var p=r;for(var t in n)e[t]=n[t];e.isVue2=!0,e.isVue3=!1,e.install=function(){},e.Vue=n,e.Vue2=n,e.version=n.version,e.warn=n.util.warn,e.hasInjectionContext=()=>!!e.getCurrentInstance(),e.createApp=r}else if(n.version.slice(0,2)==="2.")if(d){for(var t in d)e[t]=d[t];e.isVue2=!0,e.isVue3=!1,e.install=function(){},e.Vue=n,e.Vue2=n,e.version=n.version,e.hasInjectionContext=()=>!!e.getCurrentInstance()}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 t in n)e[t]=n[t];e.isVue2=!1,e.isVue3=!0,e.install=function(){},e.Vue=n,e.Vue2=void 0,e.version=n.version,e.set=function(r,s,l){return Array.isArray(r)?(r.length=Math.max(r.length,s),r.splice(s,1,l),l):(r[s]=l,l)},e.del=function(r,s){if(Array.isArray(r)){r.splice(s,1);return}delete r[s]}}else console.error("[vue-demi] Vue version "+n.version+" is unsupported.");return e}(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(e,n,d,t,p){"use strict";function r(s,l){const o=n.ref();let u=[];const f=t.createEventHook(),i=t.createEventHook(),c=t.createEventHook(),h=t.createEventHook(),g=t.createEventHook(),b=n.ref(!1),E=n.ref(!1),H=n.ref(!1),k=n.ref(!1),v=n.ref({color:"black",size:3,arrowEnd:!1,cornerRadius:0,dasharray:void 0,fill:"transparent",mode:"draw"});n.watch(v,()=>{const a=o.value;a&&(a.brush=v.value,a.mode=v.value.mode)},{deep:!0});const S=()=>o.value?.undo(),w=()=>o.value?.redo(),A=()=>o.value?.clear(),I=()=>o.value?.cancel(),P=a=>o.value?.load(a),U=()=>o.value?.dump(),C=()=>{u.forEach(a=>a()),o.value?.unmount()},y=()=>{o.value&&(b.value=o.value.canUndo(),E.value=o.value.canRedo(),H.value=o.value.altPressed,k.value=o.value.shiftPressed)};return n.watch(()=>t.unrefElement(s),a=>{!a||typeof SVGSVGElement>"u"||!(a instanceof SVGSVGElement)||(o.value&&C(),o.value=d.createDrauu({el:a,...l}),y(),u=[o.value.on("canceled",()=>i.trigger()),o.value.on("committed",x=>c.trigger(x)),o.value.on("start",()=>h.trigger()),o.value.on("end",()=>g.trigger()),o.value.on("changed",()=>{y(),f.trigger()})])},{flush:"post"}),p.tryOnScopeDispose(()=>C()),{drauuInstance:o,load:P,dump:U,clear:A,cancel:I,undo:S,redo:w,canUndo:b,canRedo:E,brush:v,onChanged:f.on,onCommitted:c.on,onStart:h.on,onEnd:g.on,onCanceled:i.on}}e.useDrauu=r})(this.VueUse=this.VueUse||{},VueDemi,Drauu,VueUse,VueUse);
1
+ var VueDemi=function(e,n,d){if(e.install)return e;if(!n)return console.error("[vue-demi] no Vue instance found, please be sure to import `vue` before `vue-demi`."),e;if(n.version.slice(0,4)==="2.7."){let s=function(a,c){var o,f={},v={config:n.config,use:n.use.bind(n),mixin:n.mixin.bind(n),component:n.component.bind(n),provide:function(i,l){return f[i]=l,this},directive:function(i,l){return l?(n.directive(i,l),v):n.directive(i)},mount:function(i,l){return o||(o=new n(Object.assign({propsData:c},a,{provide:Object.assign(f,a.provide)})),o.$mount(i,l),o)},unmount:function(){o&&(o.$destroy(),o=void 0)}};return v};var h=s;for(var t in n)e[t]=n[t];e.isVue2=!0,e.isVue3=!1,e.install=function(){},e.Vue=n,e.Vue2=n,e.version=n.version,e.warn=n.util.warn,e.hasInjectionContext=()=>!!e.getCurrentInstance(),e.createApp=s}else if(n.version.slice(0,2)==="2.")if(d){for(var t in d)e[t]=d[t];e.isVue2=!0,e.isVue3=!1,e.install=function(){},e.Vue=n,e.Vue2=n,e.version=n.version,e.hasInjectionContext=()=>!!e.getCurrentInstance()}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 t in n)e[t]=n[t];e.isVue2=!1,e.isVue3=!0,e.install=function(){},e.Vue=n,e.Vue2=void 0,e.version=n.version,e.set=function(s,a,c){return Array.isArray(s)?(s.length=Math.max(s.length,a),s.splice(a,1,c),c):(s[a]=c,c)},e.del=function(s,a){if(Array.isArray(s)){s.splice(a,1);return}delete s[a]}}else console.error("[vue-demi] Vue version "+n.version+" is unsupported.");return e}(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(e,n,d,t,h){"use strict";function s(a,c){const o=n.ref();let f=[];const v=t.createEventHook(),i=t.createEventHook(),l=t.createEventHook(),g=t.createEventHook(),b=t.createEventHook(),E=n.ref(!1),C=n.ref(!1),k=n.ref(!1),S=n.ref(!1),p=n.ref({color:"black",size:3,arrowEnd:!1,cornerRadius:0,dasharray:void 0,fill:"transparent",mode:"draw"});n.watch(p,()=>{const r=o.value;r&&(r.brush=p.value,r.mode=p.value.mode)},{deep:!0});const w=()=>{var r;return(r=o.value)==null?void 0:r.undo()},A=()=>{var r;return(r=o.value)==null?void 0:r.redo()},I=()=>{var r;return(r=o.value)==null?void 0:r.clear()},_=()=>{var r;return(r=o.value)==null?void 0:r.cancel()},P=r=>{var u;return(u=o.value)==null?void 0:u.load(r)},U=()=>{var r;return(r=o.value)==null?void 0:r.dump()},y=()=>{var r;f.forEach(u=>u()),(r=o.value)==null||r.unmount()},H=()=>{o.value&&(E.value=o.value.canUndo(),C.value=o.value.canRedo(),k.value=o.value.altPressed,S.value=o.value.shiftPressed)};return n.watch(()=>t.unrefElement(a),r=>{!r||typeof SVGSVGElement>"u"||!(r instanceof SVGSVGElement)||(o.value&&y(),o.value=d.createDrauu({el:r,...c}),H(),f=[o.value.on("canceled",()=>i.trigger()),o.value.on("committed",u=>l.trigger(u)),o.value.on("start",()=>g.trigger()),o.value.on("end",()=>b.trigger()),o.value.on("changed",()=>{H(),v.trigger()})])},{flush:"post"}),h.tryOnScopeDispose(()=>y()),{drauuInstance:o,load:P,dump:U,clear:I,cancel:_,undo:w,redo:A,canUndo:E,canRedo:C,brush:p,onChanged:v.on,onCommitted:l.on,onStart:g.on,onEnd:b.on,onCanceled:i.on}}e.useDrauu=s})(this.VueUse=this.VueUse||{},VueDemi,Drauu,VueUse,VueUse);
package/useDrauu.mjs CHANGED
@@ -31,15 +31,34 @@ function useDrauu(target, options) {
31
31
  instance.mode = brush.value.mode;
32
32
  }
33
33
  }, { deep: true });
34
- const undo = () => drauuInstance.value?.undo();
35
- const redo = () => drauuInstance.value?.redo();
36
- const clear = () => drauuInstance.value?.clear();
37
- const cancel = () => drauuInstance.value?.cancel();
38
- const load = (svg) => drauuInstance.value?.load(svg);
39
- const dump = () => drauuInstance.value?.dump();
34
+ const undo = () => {
35
+ var _a;
36
+ return (_a = drauuInstance.value) == null ? void 0 : _a.undo();
37
+ };
38
+ const redo = () => {
39
+ var _a;
40
+ return (_a = drauuInstance.value) == null ? void 0 : _a.redo();
41
+ };
42
+ const clear = () => {
43
+ var _a;
44
+ return (_a = drauuInstance.value) == null ? void 0 : _a.clear();
45
+ };
46
+ const cancel = () => {
47
+ var _a;
48
+ return (_a = drauuInstance.value) == null ? void 0 : _a.cancel();
49
+ };
50
+ const load = (svg) => {
51
+ var _a;
52
+ return (_a = drauuInstance.value) == null ? void 0 : _a.load(svg);
53
+ };
54
+ const dump = () => {
55
+ var _a;
56
+ return (_a = drauuInstance.value) == null ? void 0 : _a.dump();
57
+ };
40
58
  const cleanup = () => {
59
+ var _a;
41
60
  disposables.forEach((dispose) => dispose());
42
- drauuInstance.value?.unmount();
61
+ (_a = drauuInstance.value) == null ? void 0 : _a.unmount();
43
62
  };
44
63
  const syncStatus = () => {
45
64
  if (drauuInstance.value) {
package/useFuse.cjs CHANGED
@@ -6,14 +6,18 @@ var shared = require('@vueuse/shared');
6
6
 
7
7
  function useFuse(search, data, options) {
8
8
  const createFuse = () => {
9
+ var _a, _b;
9
10
  return new Fuse(
10
- shared.toValue(data) ?? [],
11
- shared.toValue(options)?.fuseOptions
11
+ (_a = shared.toValue(data)) != null ? _a : [],
12
+ (_b = shared.toValue(options)) == null ? void 0 : _b.fuseOptions
12
13
  );
13
14
  };
14
15
  const fuse = vueDemi.ref(createFuse());
15
16
  vueDemi.watch(
16
- () => shared.toValue(options)?.fuseOptions,
17
+ () => {
18
+ var _a;
19
+ return (_a = shared.toValue(options)) == null ? void 0 : _a.fuseOptions;
20
+ },
17
21
  () => {
18
22
  fuse.value = createFuse();
19
23
  },
@@ -28,9 +32,9 @@ function useFuse(search, data, options) {
28
32
  );
29
33
  const results = vueDemi.computed(() => {
30
34
  const resolved = shared.toValue(options);
31
- if (resolved?.matchAllWhenSearchEmpty && !shared.toValue(search))
35
+ if ((resolved == null ? void 0 : resolved.matchAllWhenSearchEmpty) && !shared.toValue(search))
32
36
  return shared.toValue(data).map((item, index) => ({ item, refIndex: index }));
33
- const limit = resolved?.resultLimit;
37
+ const limit = resolved == null ? void 0 : resolved.resultLimit;
34
38
  return fuse.value.search(shared.toValue(search), limit ? { limit } : void 0);
35
39
  });
36
40
  return {
package/useFuse.iife.js CHANGED
@@ -119,14 +119,18 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
119
119
 
120
120
  function useFuse(search, data, options) {
121
121
  const createFuse = () => {
122
+ var _a, _b;
122
123
  return new Fuse(
123
- shared.toValue(data) ?? [],
124
- shared.toValue(options)?.fuseOptions
124
+ (_a = shared.toValue(data)) != null ? _a : [],
125
+ (_b = shared.toValue(options)) == null ? void 0 : _b.fuseOptions
125
126
  );
126
127
  };
127
128
  const fuse = vueDemi.ref(createFuse());
128
129
  vueDemi.watch(
129
- () => shared.toValue(options)?.fuseOptions,
130
+ () => {
131
+ var _a;
132
+ return (_a = shared.toValue(options)) == null ? void 0 : _a.fuseOptions;
133
+ },
130
134
  () => {
131
135
  fuse.value = createFuse();
132
136
  },
@@ -141,9 +145,9 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
141
145
  );
142
146
  const results = vueDemi.computed(() => {
143
147
  const resolved = shared.toValue(options);
144
- if (resolved?.matchAllWhenSearchEmpty && !shared.toValue(search))
148
+ if ((resolved == null ? void 0 : resolved.matchAllWhenSearchEmpty) && !shared.toValue(search))
145
149
  return shared.toValue(data).map((item, index) => ({ item, refIndex: index }));
146
- const limit = resolved?.resultLimit;
150
+ const limit = resolved == null ? void 0 : resolved.resultLimit;
147
151
  return fuse.value.search(shared.toValue(search), limit ? { limit } : void 0);
148
152
  });
149
153
  return {
@@ -1 +1 @@
1
- var VueDemi=function(n,t,u){if(n.install)return n;if(!t)return console.error("[vue-demi] no Vue instance found, please be sure to import `vue` before `vue-demi`."),n;if(t.version.slice(0,4)==="2.7."){let r=function(o,f){var s,l={},a={config:t.config,use:t.use.bind(t),mixin:t.mixin.bind(t),component:t.component.bind(t),provide:function(i,c){return l[i]=c,this},directive:function(i,c){return c?(t.directive(i,c),a):t.directive(i)},mount:function(i,c){return s||(s=new t(Object.assign({propsData:f},o,{provide:Object.assign(l,o.provide)})),s.$mount(i,c),s)},unmount:function(){s&&(s.$destroy(),s=void 0)}};return a};var v=r;for(var e in t)n[e]=t[e];n.isVue2=!0,n.isVue3=!1,n.install=function(){},n.Vue=t,n.Vue2=t,n.version=t.version,n.warn=t.util.warn,n.hasInjectionContext=()=>!!n.getCurrentInstance(),n.createApp=r}else if(t.version.slice(0,2)==="2.")if(u){for(var e in u)n[e]=u[e];n.isVue2=!0,n.isVue3=!1,n.install=function(){},n.Vue=t,n.Vue2=t,n.version=t.version,n.hasInjectionContext=()=>!!n.getCurrentInstance()}else console.error("[vue-demi] no VueCompositionAPI instance found, please be sure to import `@vue/composition-api` before `vue-demi`.");else if(t.version.slice(0,2)==="3."){for(var e in t)n[e]=t[e];n.isVue2=!1,n.isVue3=!0,n.install=function(){},n.Vue=t,n.Vue2=void 0,n.version=t.version,n.set=function(r,o,f){return Array.isArray(r)?(r.length=Math.max(r.length,o),r.splice(o,1,f),f):(r[o]=f,f)},n.del=function(r,o){if(Array.isArray(r)){r.splice(o,1);return}delete r[o]}}else console.error("[vue-demi] Vue version "+t.version+" is unsupported.");return n}(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(n,t,u,e){"use strict";function v(r,o,f){const s=()=>new t(e.toValue(o)??[],e.toValue(f)?.fuseOptions),l=u.ref(s());u.watch(()=>e.toValue(f)?.fuseOptions,()=>{l.value=s()},{deep:!0}),u.watch(()=>e.toValue(o),i=>{l.value.setCollection(i)},{deep:!0});const a=u.computed(()=>{const i=e.toValue(f);if(i?.matchAllWhenSearchEmpty&&!e.toValue(r))return e.toValue(o).map((d,p)=>({item:d,refIndex:p}));const c=i?.resultLimit;return l.value.search(e.toValue(r),c?{limit:c}:void 0)});return{fuse:l,results:a}}n.useFuse=v})(this.VueUse=this.VueUse||{},Fuse,VueDemi,VueUse);
1
+ var VueDemi=function(n,t,f){if(n.install)return n;if(!t)return console.error("[vue-demi] no Vue instance found, please be sure to import `vue` before `vue-demi`."),n;if(t.version.slice(0,4)==="2.7."){let o=function(i,u){var l,c={},v={config:t.config,use:t.use.bind(t),mixin:t.mixin.bind(t),component:t.component.bind(t),provide:function(e,s){return c[e]=s,this},directive:function(e,s){return s?(t.directive(e,s),v):t.directive(e)},mount:function(e,s){return l||(l=new t(Object.assign({propsData:u},i,{provide:Object.assign(c,i.provide)})),l.$mount(e,s),l)},unmount:function(){l&&(l.$destroy(),l=void 0)}};return v};var a=o;for(var r in t)n[r]=t[r];n.isVue2=!0,n.isVue3=!1,n.install=function(){},n.Vue=t,n.Vue2=t,n.version=t.version,n.warn=t.util.warn,n.hasInjectionContext=()=>!!n.getCurrentInstance(),n.createApp=o}else if(t.version.slice(0,2)==="2.")if(f){for(var r in f)n[r]=f[r];n.isVue2=!0,n.isVue3=!1,n.install=function(){},n.Vue=t,n.Vue2=t,n.version=t.version,n.hasInjectionContext=()=>!!n.getCurrentInstance()}else console.error("[vue-demi] no VueCompositionAPI instance found, please be sure to import `@vue/composition-api` before `vue-demi`.");else if(t.version.slice(0,2)==="3."){for(var r in t)n[r]=t[r];n.isVue2=!1,n.isVue3=!0,n.install=function(){},n.Vue=t,n.Vue2=void 0,n.version=t.version,n.set=function(o,i,u){return Array.isArray(o)?(o.length=Math.max(o.length,i),o.splice(i,1,u),u):(o[i]=u,u)},n.del=function(o,i){if(Array.isArray(o)){o.splice(i,1);return}delete o[i]}}else console.error("[vue-demi] Vue version "+t.version+" is unsupported.");return n}(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(n,t,f,r){"use strict";function a(o,i,u){const l=()=>{var e,s;return new t((e=r.toValue(i))!=null?e:[],(s=r.toValue(u))==null?void 0:s.fuseOptions)},c=f.ref(l());f.watch(()=>{var e;return(e=r.toValue(u))==null?void 0:e.fuseOptions},()=>{c.value=l()},{deep:!0}),f.watch(()=>r.toValue(i),e=>{c.value.setCollection(e)},{deep:!0});const v=f.computed(()=>{const e=r.toValue(u);if(e?.matchAllWhenSearchEmpty&&!r.toValue(o))return r.toValue(i).map((d,p)=>({item:d,refIndex:p}));const s=e?.resultLimit;return c.value.search(r.toValue(o),s?{limit:s}:void 0)});return{fuse:c,results:v}}n.useFuse=a})(this.VueUse=this.VueUse||{},Fuse,VueDemi,VueUse);
package/useFuse.mjs CHANGED
@@ -4,14 +4,18 @@ import { toValue } from '@vueuse/shared';
4
4
 
5
5
  function useFuse(search, data, options) {
6
6
  const createFuse = () => {
7
+ var _a, _b;
7
8
  return new Fuse(
8
- toValue(data) ?? [],
9
- toValue(options)?.fuseOptions
9
+ (_a = toValue(data)) != null ? _a : [],
10
+ (_b = toValue(options)) == null ? void 0 : _b.fuseOptions
10
11
  );
11
12
  };
12
13
  const fuse = ref(createFuse());
13
14
  watch(
14
- () => toValue(options)?.fuseOptions,
15
+ () => {
16
+ var _a;
17
+ return (_a = toValue(options)) == null ? void 0 : _a.fuseOptions;
18
+ },
15
19
  () => {
16
20
  fuse.value = createFuse();
17
21
  },
@@ -26,9 +30,9 @@ function useFuse(search, data, options) {
26
30
  );
27
31
  const results = computed(() => {
28
32
  const resolved = toValue(options);
29
- if (resolved?.matchAllWhenSearchEmpty && !toValue(search))
33
+ if ((resolved == null ? void 0 : resolved.matchAllWhenSearchEmpty) && !toValue(search))
30
34
  return toValue(data).map((item, index) => ({ item, refIndex: index }));
31
- const limit = resolved?.resultLimit;
35
+ const limit = resolved == null ? void 0 : resolved.resultLimit;
32
36
  return fuse.value.search(toValue(search), limit ? { limit } : void 0);
33
37
  });
34
38
  return {
package/useJwt.cjs CHANGED
@@ -13,7 +13,7 @@ function useJwt(encodedJwt, options = {}) {
13
13
  try {
14
14
  return jwt_decode(encodedJwt2, options2);
15
15
  } catch (err) {
16
- onError?.(err);
16
+ onError == null ? void 0 : onError(err);
17
17
  return fallbackValue;
18
18
  }
19
19
  };
package/useJwt.iife.js CHANGED
@@ -126,7 +126,7 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
126
126
  try {
127
127
  return jwt_decode(encodedJwt2, options2);
128
128
  } catch (err) {
129
- onError?.(err);
129
+ onError == null ? void 0 : onError(err);
130
130
  return fallbackValue;
131
131
  }
132
132
  };
@@ -1 +1 @@
1
- var VueDemi=function(n,r,d){if(n.install)return n;if(!r)return console.error("[vue-demi] no Vue instance found, please be sure to import `vue` before `vue-demi`."),n;if(r.version.slice(0,4)==="2.7."){let t=function(o,e){var s,l={},a={config:r.config,use:r.use.bind(r),mixin:r.mixin.bind(r),component:r.component.bind(r),provide:function(c,f){return l[c]=f,this},directive:function(c,f){return f?(r.directive(c,f),a):r.directive(c)},mount:function(c,f){return s||(s=new r(Object.assign({propsData:e},o,{provide:Object.assign(l,o.provide)})),s.$mount(c,f),s)},unmount:function(){s&&(s.$destroy(),s=void 0)}};return a};var u=t;for(var i in r)n[i]=r[i];n.isVue2=!0,n.isVue3=!1,n.install=function(){},n.Vue=r,n.Vue2=r,n.version=r.version,n.warn=r.util.warn,n.hasInjectionContext=()=>!!n.getCurrentInstance(),n.createApp=t}else if(r.version.slice(0,2)==="2.")if(d){for(var i in d)n[i]=d[i];n.isVue2=!0,n.isVue3=!1,n.install=function(){},n.Vue=r,n.Vue2=r,n.version=r.version,n.hasInjectionContext=()=>!!n.getCurrentInstance()}else console.error("[vue-demi] no VueCompositionAPI instance found, please be sure to import `@vue/composition-api` before `vue-demi`.");else if(r.version.slice(0,2)==="3."){for(var i in r)n[i]=r[i];n.isVue2=!1,n.isVue3=!0,n.install=function(){},n.Vue=r,n.Vue2=void 0,n.version=r.version,n.set=function(t,o,e){return Array.isArray(t)?(t.length=Math.max(t.length,o),t.splice(o,1,e),e):(t[o]=e,e)},n.del=function(t,o){if(Array.isArray(t)){t.splice(o,1);return}delete t[o]}}else console.error("[vue-demi] Vue version "+r.version+" is unsupported.");return n}(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(n,r,d,i){"use strict";function u(t,o={}){const{onError:e,fallbackValue:s=null}=o,l=(f,p)=>{try{return i(f,p)}catch(v){return e?.(v),s}},a=r.computed(()=>l(d.toValue(t),{header:!0})),c=r.computed(()=>l(d.toValue(t)));return{header:a,payload:c}}n.useJwt=u})(this.VueUse=this.VueUse||{},VueDemi,VueUse,jwt_decode);
1
+ var VueDemi=function(n,r,d){if(n.install)return n;if(!r)return console.error("[vue-demi] no Vue instance found, please be sure to import `vue` before `vue-demi`."),n;if(r.version.slice(0,4)==="2.7."){let t=function(o,e){var s,l={},a={config:r.config,use:r.use.bind(r),mixin:r.mixin.bind(r),component:r.component.bind(r),provide:function(c,f){return l[c]=f,this},directive:function(c,f){return f?(r.directive(c,f),a):r.directive(c)},mount:function(c,f){return s||(s=new r(Object.assign({propsData:e},o,{provide:Object.assign(l,o.provide)})),s.$mount(c,f),s)},unmount:function(){s&&(s.$destroy(),s=void 0)}};return a};var u=t;for(var i in r)n[i]=r[i];n.isVue2=!0,n.isVue3=!1,n.install=function(){},n.Vue=r,n.Vue2=r,n.version=r.version,n.warn=r.util.warn,n.hasInjectionContext=()=>!!n.getCurrentInstance(),n.createApp=t}else if(r.version.slice(0,2)==="2.")if(d){for(var i in d)n[i]=d[i];n.isVue2=!0,n.isVue3=!1,n.install=function(){},n.Vue=r,n.Vue2=r,n.version=r.version,n.hasInjectionContext=()=>!!n.getCurrentInstance()}else console.error("[vue-demi] no VueCompositionAPI instance found, please be sure to import `@vue/composition-api` before `vue-demi`.");else if(r.version.slice(0,2)==="3."){for(var i in r)n[i]=r[i];n.isVue2=!1,n.isVue3=!0,n.install=function(){},n.Vue=r,n.Vue2=void 0,n.version=r.version,n.set=function(t,o,e){return Array.isArray(t)?(t.length=Math.max(t.length,o),t.splice(o,1,e),e):(t[o]=e,e)},n.del=function(t,o){if(Array.isArray(t)){t.splice(o,1);return}delete t[o]}}else console.error("[vue-demi] Vue version "+r.version+" is unsupported.");return n}(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(n,r,d,i){"use strict";function u(t,o={}){const{onError:e,fallbackValue:s=null}=o,l=(f,v)=>{try{return i(f,v)}catch(p){return e?.(p),s}},a=r.computed(()=>l(d.toValue(t),{header:!0})),c=r.computed(()=>l(d.toValue(t)));return{header:a,payload:c}}n.useJwt=u})(this.VueUse=this.VueUse||{},VueDemi,VueUse,jwt_decode);
package/useJwt.mjs CHANGED
@@ -11,7 +11,7 @@ function useJwt(encodedJwt, options = {}) {
11
11
  try {
12
12
  return jwt_decode(encodedJwt2, options2);
13
13
  } catch (err) {
14
- onError?.(err);
14
+ onError == null ? void 0 : onError(err);
15
15
  return fallbackValue;
16
16
  }
17
17
  };
package/useSortable.cjs CHANGED
@@ -13,17 +13,17 @@ function useSortable(el, list, options = {}) {
13
13
  }
14
14
  };
15
15
  const start = () => {
16
- const target = typeof el === "string" ? document?.querySelector(el) : core.unrefElement(el);
16
+ const target = typeof el === "string" ? document == null ? void 0 : document.querySelector(el) : core.unrefElement(el);
17
17
  if (!target)
18
18
  return;
19
19
  sortable = new Sortable(target, { ...defaultOptions, ...resetOptions });
20
20
  };
21
- const stop = () => sortable?.destroy();
21
+ const stop = () => sortable == null ? void 0 : sortable.destroy();
22
22
  const option = (name, value) => {
23
23
  if (value !== void 0)
24
- sortable?.option(name, value);
24
+ sortable == null ? void 0 : sortable.option(name, value);
25
25
  else
26
- return sortable?.option(name);
26
+ return sortable == null ? void 0 : sortable.option(name);
27
27
  };
28
28
  core.tryOnMounted(start);
29
29
  core.tryOnScopeDispose(stop);
@@ -126,17 +126,17 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
126
126
  }
127
127
  };
128
128
  const start = () => {
129
- const target = typeof el === "string" ? document?.querySelector(el) : core.unrefElement(el);
129
+ const target = typeof el === "string" ? document == null ? void 0 : document.querySelector(el) : core.unrefElement(el);
130
130
  if (!target)
131
131
  return;
132
132
  sortable = new Sortable(target, { ...defaultOptions, ...resetOptions });
133
133
  };
134
- const stop = () => sortable?.destroy();
134
+ const stop = () => sortable == null ? void 0 : sortable.destroy();
135
135
  const option = (name, value) => {
136
136
  if (value !== void 0)
137
- sortable?.option(name, value);
137
+ sortable == null ? void 0 : sortable.option(name, value);
138
138
  else
139
- return sortable?.option(name);
139
+ return sortable == null ? void 0 : sortable.option(name);
140
140
  };
141
141
  core.tryOnMounted(start);
142
142
  core.tryOnScopeDispose(stop);
@@ -1 +1 @@
1
- var VueDemi=function(n,t,u){if(n.install)return n;if(!t)return console.error("[vue-demi] no Vue instance found, please be sure to import `vue` before `vue-demi`."),n;if(t.version.slice(0,4)==="2.7."){let o=function(e,i){var r,f={},d={config:t.config,use:t.use.bind(t),mixin:t.mixin.bind(t),component:t.component.bind(t),provide:function(c,l){return f[c]=l,this},directive:function(c,l){return l?(t.directive(c,l),d):t.directive(c)},mount:function(c,l){return r||(r=new t(Object.assign({propsData:i},e,{provide:Object.assign(f,e.provide)})),r.$mount(c,l),r)},unmount:function(){r&&(r.$destroy(),r=void 0)}};return d};var p=o;for(var s in t)n[s]=t[s];n.isVue2=!0,n.isVue3=!1,n.install=function(){},n.Vue=t,n.Vue2=t,n.version=t.version,n.warn=t.util.warn,n.hasInjectionContext=()=>!!n.getCurrentInstance(),n.createApp=o}else if(t.version.slice(0,2)==="2.")if(u){for(var s in u)n[s]=u[s];n.isVue2=!0,n.isVue3=!1,n.install=function(){},n.Vue=t,n.Vue2=t,n.version=t.version,n.hasInjectionContext=()=>!!n.getCurrentInstance()}else console.error("[vue-demi] no VueCompositionAPI instance found, please be sure to import `@vue/composition-api` before `vue-demi`.");else if(t.version.slice(0,2)==="3."){for(var s in t)n[s]=t[s];n.isVue2=!1,n.isVue3=!0,n.install=function(){},n.Vue=t,n.Vue2=void 0,n.version=t.version,n.set=function(o,e,i){return Array.isArray(o)?(o.length=Math.max(o.length,e),o.splice(e,1,i),i):(o[e]=i,i)},n.del=function(o,e){if(Array.isArray(o)){o.splice(e,1);return}delete o[e]}}else console.error("[vue-demi] Vue version "+t.version+" is unsupported.");return n}(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(n,t,u,s){"use strict";function p(e,i,r={}){let f;const{document:d=t.defaultDocument,...c}=r,l={onUpdate:a=>{o(i,a.oldIndex,a.newIndex)}},v=()=>{const a=typeof e=="string"?d?.querySelector(e):t.unrefElement(e);a&&(f=new u(a,{...l,...c}))},y=()=>f?.destroy(),h=(a,b)=>{if(b!==void 0)f?.option(a,b);else return f?.option(a)};return t.tryOnMounted(v),t.tryOnScopeDispose(y),{stop:y,start:v,option:h}}function o(e,i,r){const f=s.isRef(e),d=f?[...t.toValue(e)]:t.toValue(e);if(r>=0&&r<d.length){const c=d.splice(i,1)[0];s.nextTick(()=>{d.splice(r,0,c),f&&(e.value=d)})}}n.moveArrayElement=o,n.useSortable=p})(this.VueUse=this.VueUse||{},VueUse,Sortable,VueDemi);
1
+ var VueDemi=function(n,t,a){if(n.install)return n;if(!t)return console.error("[vue-demi] no Vue instance found, please be sure to import `vue` before `vue-demi`."),n;if(t.version.slice(0,4)==="2.7."){let e=function(o,f){var r,i={},l={config:t.config,use:t.use.bind(t),mixin:t.mixin.bind(t),component:t.component.bind(t),provide:function(c,d){return i[c]=d,this},directive:function(c,d){return d?(t.directive(c,d),l):t.directive(c)},mount:function(c,d){return r||(r=new t(Object.assign({propsData:f},o,{provide:Object.assign(i,o.provide)})),r.$mount(c,d),r)},unmount:function(){r&&(r.$destroy(),r=void 0)}};return l};var p=e;for(var s in t)n[s]=t[s];n.isVue2=!0,n.isVue3=!1,n.install=function(){},n.Vue=t,n.Vue2=t,n.version=t.version,n.warn=t.util.warn,n.hasInjectionContext=()=>!!n.getCurrentInstance(),n.createApp=e}else if(t.version.slice(0,2)==="2.")if(a){for(var s in a)n[s]=a[s];n.isVue2=!0,n.isVue3=!1,n.install=function(){},n.Vue=t,n.Vue2=t,n.version=t.version,n.hasInjectionContext=()=>!!n.getCurrentInstance()}else console.error("[vue-demi] no VueCompositionAPI instance found, please be sure to import `@vue/composition-api` before `vue-demi`.");else if(t.version.slice(0,2)==="3."){for(var s in t)n[s]=t[s];n.isVue2=!1,n.isVue3=!0,n.install=function(){},n.Vue=t,n.Vue2=void 0,n.version=t.version,n.set=function(e,o,f){return Array.isArray(e)?(e.length=Math.max(e.length,o),e.splice(o,1,f),f):(e[o]=f,f)},n.del=function(e,o){if(Array.isArray(e)){e.splice(o,1);return}delete e[o]}}else console.error("[vue-demi] Vue version "+t.version+" is unsupported.");return n}(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(n,t,a,s){"use strict";function p(o,f,r={}){let i;const{document:l=t.defaultDocument,...c}=r,d={onUpdate:u=>{e(f,u.oldIndex,u.newIndex)}},v=()=>{const u=typeof o=="string"?l?.querySelector(o):t.unrefElement(o);u&&(i=new a(u,{...d,...c}))},y=()=>i?.destroy(),h=(u,b)=>{if(b!==void 0)i?.option(u,b);else return i?.option(u)};return t.tryOnMounted(v),t.tryOnScopeDispose(y),{stop:y,start:v,option:h}}function e(o,f,r){const i=s.isRef(o),l=i?[...t.toValue(o)]:t.toValue(o);if(r>=0&&r<l.length){const c=l.splice(f,1)[0];s.nextTick(()=>{l.splice(r,0,c),i&&(o.value=l)})}}n.moveArrayElement=e,n.useSortable=p})(this.VueUse=this.VueUse||{},VueUse,Sortable,VueDemi);
package/useSortable.mjs CHANGED
@@ -11,17 +11,17 @@ function useSortable(el, list, options = {}) {
11
11
  }
12
12
  };
13
13
  const start = () => {
14
- const target = typeof el === "string" ? document?.querySelector(el) : unrefElement(el);
14
+ const target = typeof el === "string" ? document == null ? void 0 : document.querySelector(el) : unrefElement(el);
15
15
  if (!target)
16
16
  return;
17
17
  sortable = new Sortable(target, { ...defaultOptions, ...resetOptions });
18
18
  };
19
- const stop = () => sortable?.destroy();
19
+ const stop = () => sortable == null ? void 0 : sortable.destroy();
20
20
  const option = (name, value) => {
21
21
  if (value !== void 0)
22
- sortable?.option(name, value);
22
+ sortable == null ? void 0 : sortable.option(name, value);
23
23
  else
24
- return sortable?.option(name);
24
+ return sortable == null ? void 0 : sortable.option(name);
25
25
  };
26
26
  tryOnMounted(start);
27
27
  tryOnScopeDispose(stop);