@vueuse/integrations 12.5.0 → 12.6.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
@@ -48,11 +48,11 @@ function useAsyncValidator(value, rules, options = {}) {
48
48
  const pass = vue.ref(!immediate || manual);
49
49
  const errors = vue.computed(() => {
50
50
  var _a;
51
- return ((_a = errorInfo.value) == null ? undefined : _a.errors) || [];
51
+ return ((_a = errorInfo.value) == null ? void 0 : _a.errors) || [];
52
52
  });
53
53
  const errorFields = vue.computed(() => {
54
54
  var _a;
55
- return ((_a = errorInfo.value) == null ? undefined : _a.fields) || {};
55
+ return ((_a = errorInfo.value) == null ? void 0 : _a.fields) || {};
56
56
  });
57
57
  const validator = vue.computed(() => new AsyncValidatorSchema(vue.toValue(rules)));
58
58
  const execute = async () => {
@@ -103,7 +103,7 @@ function useAsyncValidator(value, rules, options = {}) {
103
103
  }
104
104
 
105
105
  function useAxios(...args) {
106
- const url = typeof args[0] === "string" ? args[0] : undefined;
106
+ const url = typeof args[0] === "string" ? args[0] : void 0;
107
107
  const argsPlaceholder = typeof url === "string" ? 1 : 0;
108
108
  const defaultOptions = {
109
109
  immediate: !!argsPlaceholder,
@@ -113,7 +113,7 @@ function useAxios(...args) {
113
113
  let defaultConfig = {};
114
114
  let instance = axios;
115
115
  let options = defaultOptions;
116
- const isAxiosInstance = (val) => !!(val == null ? undefined : val.request);
116
+ const isAxiosInstance = (val) => !!(val == null ? void 0 : val.request);
117
117
  if (args.length > 0 + argsPlaceholder) {
118
118
  if (isAxiosInstance(args[0 + argsPlaceholder]))
119
119
  instance = args[0 + argsPlaceholder];
@@ -168,9 +168,9 @@ function useAxios(...args) {
168
168
  };
169
169
  let executeCounter = 0;
170
170
  const execute = (executeUrl = url, config = {}) => {
171
- error.value = undefined;
171
+ error.value = void 0;
172
172
  const _url = typeof executeUrl === "string" ? executeUrl : url != null ? url : config.url;
173
- if (_url === undefined) {
173
+ if (_url === void 0) {
174
174
  error.value = new axios.AxiosError(axios.AxiosError.ERR_INVALID_URL);
175
175
  isFinished.value = true;
176
176
  return promise;
@@ -194,7 +194,7 @@ function useAxios(...args) {
194
194
  onError(e);
195
195
  }).finally(() => {
196
196
  var _a;
197
- (_a = options.onFinish) == null ? undefined : _a.call(options);
197
+ (_a = options.onFinish) == null ? void 0 : _a.call(options);
198
198
  if (currentExecuteCounter === executeCounter)
199
199
  loading(false);
200
200
  });
@@ -317,10 +317,10 @@ function useDrauu(target, options) {
317
317
  size: 3,
318
318
  arrowEnd: false,
319
319
  cornerRadius: 0,
320
- dasharray: undefined,
320
+ dasharray: void 0,
321
321
  fill: "transparent",
322
322
  mode: "draw",
323
- ...options == null ? undefined : options.brush
323
+ ...options == null ? void 0 : options.brush
324
324
  });
325
325
  vue.watch(brush, () => {
326
326
  const instance = drauuInstance.value;
@@ -331,32 +331,32 @@ function useDrauu(target, options) {
331
331
  }, { deep: true });
332
332
  const undo = () => {
333
333
  var _a;
334
- return (_a = drauuInstance.value) == null ? undefined : _a.undo();
334
+ return (_a = drauuInstance.value) == null ? void 0 : _a.undo();
335
335
  };
336
336
  const redo = () => {
337
337
  var _a;
338
- return (_a = drauuInstance.value) == null ? undefined : _a.redo();
338
+ return (_a = drauuInstance.value) == null ? void 0 : _a.redo();
339
339
  };
340
340
  const clear = () => {
341
341
  var _a;
342
- return (_a = drauuInstance.value) == null ? undefined : _a.clear();
342
+ return (_a = drauuInstance.value) == null ? void 0 : _a.clear();
343
343
  };
344
344
  const cancel = () => {
345
345
  var _a;
346
- return (_a = drauuInstance.value) == null ? undefined : _a.cancel();
346
+ return (_a = drauuInstance.value) == null ? void 0 : _a.cancel();
347
347
  };
348
348
  const load = (svg) => {
349
349
  var _a;
350
- return (_a = drauuInstance.value) == null ? undefined : _a.load(svg);
350
+ return (_a = drauuInstance.value) == null ? void 0 : _a.load(svg);
351
351
  };
352
352
  const dump = () => {
353
353
  var _a;
354
- return (_a = drauuInstance.value) == null ? undefined : _a.dump();
354
+ return (_a = drauuInstance.value) == null ? void 0 : _a.dump();
355
355
  };
356
356
  const cleanup = () => {
357
357
  var _a;
358
358
  disposables.forEach((dispose) => dispose());
359
- (_a = drauuInstance.value) == null ? undefined : _a.unmount();
359
+ (_a = drauuInstance.value) == null ? void 0 : _a.unmount();
360
360
  };
361
361
  const syncStatus = () => {
362
362
  if (drauuInstance.value) {
@@ -473,14 +473,14 @@ function useFuse(search, data, options) {
473
473
  var _a, _b;
474
474
  return new Fuse(
475
475
  (_a = vue.toValue(data)) != null ? _a : [],
476
- (_b = vue.toValue(options)) == null ? undefined : _b.fuseOptions
476
+ (_b = vue.toValue(options)) == null ? void 0 : _b.fuseOptions
477
477
  );
478
478
  };
479
479
  const fuse = vue.ref(createFuse());
480
480
  vue.watch(
481
481
  () => {
482
482
  var _a;
483
- return (_a = vue.toValue(options)) == null ? undefined : _a.fuseOptions;
483
+ return (_a = vue.toValue(options)) == null ? void 0 : _a.fuseOptions;
484
484
  },
485
485
  () => {
486
486
  fuse.value = createFuse();
@@ -496,10 +496,10 @@ function useFuse(search, data, options) {
496
496
  );
497
497
  const results = vue.computed(() => {
498
498
  const resolved = vue.toValue(options);
499
- if ((resolved == null ? undefined : resolved.matchAllWhenSearchEmpty) && !vue.toValue(search))
499
+ if ((resolved == null ? void 0 : resolved.matchAllWhenSearchEmpty) && !vue.toValue(search))
500
500
  return vue.toValue(data).map((item, index) => ({ item, refIndex: index }));
501
- const limit = resolved == null ? undefined : resolved.resultLimit;
502
- return fuse.value.search(vue.toValue(search), limit ? { limit } : undefined);
501
+ const limit = resolved == null ? void 0 : resolved.resultLimit;
502
+ return fuse.value.search(vue.toValue(search), limit ? { limit } : void 0);
503
503
  });
504
504
  return {
505
505
  fuse,
@@ -572,7 +572,7 @@ function useJwt(encodedJwt, options = {}) {
572
572
  try {
573
573
  return jwtDecode.jwtDecode(encodedJwt2, options2);
574
574
  } catch (err) {
575
- onError == null ? undefined : onError(err);
575
+ onError == null ? void 0 : onError(err);
576
576
  return fallbackValue;
577
577
  }
578
578
  };
@@ -637,20 +637,20 @@ function useSortable(el, list, options = {}) {
637
637
  }
638
638
  };
639
639
  const start = () => {
640
- const target = typeof el === "string" ? document == null ? undefined : document.querySelector(el) : core.unrefElement(el);
641
- if (!target || sortable !== undefined)
640
+ const target = typeof el === "string" ? document == null ? void 0 : document.querySelector(el) : core.unrefElement(el);
641
+ if (!target || sortable !== void 0)
642
642
  return;
643
643
  sortable = new Sortable(target, { ...defaultOptions, ...resetOptions });
644
644
  };
645
645
  const stop = () => {
646
- sortable == null ? undefined : sortable.destroy();
647
- sortable = undefined;
646
+ sortable == null ? void 0 : sortable.destroy();
647
+ sortable = void 0;
648
648
  };
649
649
  const option = (name, value) => {
650
- if (value !== undefined)
651
- sortable == null ? undefined : sortable.option(name, value);
650
+ if (value !== void 0)
651
+ sortable == null ? void 0 : sortable.option(name, value);
652
652
  else
653
- return sortable == null ? undefined : sortable.option(name);
653
+ return sortable == null ? void 0 : sortable.option(name);
654
654
  };
655
655
  core.tryOnMounted(start);
656
656
  core.tryOnScopeDispose(stop);
package/index.iife.js CHANGED
@@ -33,11 +33,11 @@
33
33
  const pass = vue.ref(!immediate || manual);
34
34
  const errors = vue.computed(() => {
35
35
  var _a;
36
- return ((_a = errorInfo.value) == null ? undefined : _a.errors) || [];
36
+ return ((_a = errorInfo.value) == null ? void 0 : _a.errors) || [];
37
37
  });
38
38
  const errorFields = vue.computed(() => {
39
39
  var _a;
40
- return ((_a = errorInfo.value) == null ? undefined : _a.fields) || {};
40
+ return ((_a = errorInfo.value) == null ? void 0 : _a.fields) || {};
41
41
  });
42
42
  const validator = vue.computed(() => new AsyncValidatorSchema(vue.toValue(rules)));
43
43
  const execute = async () => {
@@ -88,7 +88,7 @@
88
88
  }
89
89
 
90
90
  function useAxios(...args) {
91
- const url = typeof args[0] === "string" ? args[0] : undefined;
91
+ const url = typeof args[0] === "string" ? args[0] : void 0;
92
92
  const argsPlaceholder = typeof url === "string" ? 1 : 0;
93
93
  const defaultOptions = {
94
94
  immediate: !!argsPlaceholder,
@@ -98,7 +98,7 @@
98
98
  let defaultConfig = {};
99
99
  let instance = axios;
100
100
  let options = defaultOptions;
101
- const isAxiosInstance = (val) => !!(val == null ? undefined : val.request);
101
+ const isAxiosInstance = (val) => !!(val == null ? void 0 : val.request);
102
102
  if (args.length > 0 + argsPlaceholder) {
103
103
  if (isAxiosInstance(args[0 + argsPlaceholder]))
104
104
  instance = args[0 + argsPlaceholder];
@@ -153,9 +153,9 @@
153
153
  };
154
154
  let executeCounter = 0;
155
155
  const execute = (executeUrl = url, config = {}) => {
156
- error.value = undefined;
156
+ error.value = void 0;
157
157
  const _url = typeof executeUrl === "string" ? executeUrl : url != null ? url : config.url;
158
- if (_url === undefined) {
158
+ if (_url === void 0) {
159
159
  error.value = new axios.AxiosError(axios.AxiosError.ERR_INVALID_URL);
160
160
  isFinished.value = true;
161
161
  return promise;
@@ -179,7 +179,7 @@
179
179
  onError(e);
180
180
  }).finally(() => {
181
181
  var _a;
182
- (_a = options.onFinish) == null ? undefined : _a.call(options);
182
+ (_a = options.onFinish) == null ? void 0 : _a.call(options);
183
183
  if (currentExecuteCounter === executeCounter)
184
184
  loading(false);
185
185
  });
@@ -302,10 +302,10 @@
302
302
  size: 3,
303
303
  arrowEnd: false,
304
304
  cornerRadius: 0,
305
- dasharray: undefined,
305
+ dasharray: void 0,
306
306
  fill: "transparent",
307
307
  mode: "draw",
308
- ...options == null ? undefined : options.brush
308
+ ...options == null ? void 0 : options.brush
309
309
  });
310
310
  vue.watch(brush, () => {
311
311
  const instance = drauuInstance.value;
@@ -316,32 +316,32 @@
316
316
  }, { deep: true });
317
317
  const undo = () => {
318
318
  var _a;
319
- return (_a = drauuInstance.value) == null ? undefined : _a.undo();
319
+ return (_a = drauuInstance.value) == null ? void 0 : _a.undo();
320
320
  };
321
321
  const redo = () => {
322
322
  var _a;
323
- return (_a = drauuInstance.value) == null ? undefined : _a.redo();
323
+ return (_a = drauuInstance.value) == null ? void 0 : _a.redo();
324
324
  };
325
325
  const clear = () => {
326
326
  var _a;
327
- return (_a = drauuInstance.value) == null ? undefined : _a.clear();
327
+ return (_a = drauuInstance.value) == null ? void 0 : _a.clear();
328
328
  };
329
329
  const cancel = () => {
330
330
  var _a;
331
- return (_a = drauuInstance.value) == null ? undefined : _a.cancel();
331
+ return (_a = drauuInstance.value) == null ? void 0 : _a.cancel();
332
332
  };
333
333
  const load = (svg) => {
334
334
  var _a;
335
- return (_a = drauuInstance.value) == null ? undefined : _a.load(svg);
335
+ return (_a = drauuInstance.value) == null ? void 0 : _a.load(svg);
336
336
  };
337
337
  const dump = () => {
338
338
  var _a;
339
- return (_a = drauuInstance.value) == null ? undefined : _a.dump();
339
+ return (_a = drauuInstance.value) == null ? void 0 : _a.dump();
340
340
  };
341
341
  const cleanup = () => {
342
342
  var _a;
343
343
  disposables.forEach((dispose) => dispose());
344
- (_a = drauuInstance.value) == null ? undefined : _a.unmount();
344
+ (_a = drauuInstance.value) == null ? void 0 : _a.unmount();
345
345
  };
346
346
  const syncStatus = () => {
347
347
  if (drauuInstance.value) {
@@ -458,14 +458,14 @@
458
458
  var _a, _b;
459
459
  return new Fuse(
460
460
  (_a = vue.toValue(data)) != null ? _a : [],
461
- (_b = vue.toValue(options)) == null ? undefined : _b.fuseOptions
461
+ (_b = vue.toValue(options)) == null ? void 0 : _b.fuseOptions
462
462
  );
463
463
  };
464
464
  const fuse = vue.ref(createFuse());
465
465
  vue.watch(
466
466
  () => {
467
467
  var _a;
468
- return (_a = vue.toValue(options)) == null ? undefined : _a.fuseOptions;
468
+ return (_a = vue.toValue(options)) == null ? void 0 : _a.fuseOptions;
469
469
  },
470
470
  () => {
471
471
  fuse.value = createFuse();
@@ -481,10 +481,10 @@
481
481
  );
482
482
  const results = vue.computed(() => {
483
483
  const resolved = vue.toValue(options);
484
- if ((resolved == null ? undefined : resolved.matchAllWhenSearchEmpty) && !vue.toValue(search))
484
+ if ((resolved == null ? void 0 : resolved.matchAllWhenSearchEmpty) && !vue.toValue(search))
485
485
  return vue.toValue(data).map((item, index) => ({ item, refIndex: index }));
486
- const limit = resolved == null ? undefined : resolved.resultLimit;
487
- return fuse.value.search(vue.toValue(search), limit ? { limit } : undefined);
486
+ const limit = resolved == null ? void 0 : resolved.resultLimit;
487
+ return fuse.value.search(vue.toValue(search), limit ? { limit } : void 0);
488
488
  });
489
489
  return {
490
490
  fuse,
@@ -557,7 +557,7 @@
557
557
  try {
558
558
  return jwtDecode.jwtDecode(encodedJwt2, options2);
559
559
  } catch (err) {
560
- onError == null ? undefined : onError(err);
560
+ onError == null ? void 0 : onError(err);
561
561
  return fallbackValue;
562
562
  }
563
563
  };
@@ -622,20 +622,20 @@
622
622
  }
623
623
  };
624
624
  const start = () => {
625
- const target = typeof el === "string" ? document == null ? undefined : document.querySelector(el) : core.unrefElement(el);
626
- if (!target || sortable !== undefined)
625
+ const target = typeof el === "string" ? document == null ? void 0 : document.querySelector(el) : core.unrefElement(el);
626
+ if (!target || sortable !== void 0)
627
627
  return;
628
628
  sortable = new Sortable(target, { ...defaultOptions, ...resetOptions });
629
629
  };
630
630
  const stop = () => {
631
- sortable == null ? undefined : sortable.destroy();
632
- sortable = undefined;
631
+ sortable == null ? void 0 : sortable.destroy();
632
+ sortable = void 0;
633
633
  };
634
634
  const option = (name, value) => {
635
- if (value !== undefined)
636
- sortable == null ? undefined : sortable.option(name, value);
635
+ if (value !== void 0)
636
+ sortable == null ? void 0 : sortable.option(name, value);
637
637
  else
638
- return sortable == null ? undefined : sortable.option(name);
638
+ return sortable == null ? void 0 : sortable.option(name);
639
639
  };
640
640
  core.tryOnMounted(start);
641
641
  core.tryOnScopeDispose(stop);
package/index.iife.min.js CHANGED
@@ -1 +1 @@
1
- (function(p,C,U,n,L,$,k,w,K,X,Y,P,Z,b,x,ee){"use strict";function te(t){var l=Object.create(null);return t&&Object.keys(t).forEach(function(e){if(e!=="default"){var a=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(l,e,a.get?a:{enumerable:!0,get:function(){return t[e]}})}}),l.default=t,Object.freeze(l)}var ne=te($);const ae=U.default||U;function le(t,l,e={}){const{validateOption:a={},immediate:u=!0,manual:r=!1}=e,o=C.toRef(t),c=n.shallowRef(null),s=n.ref(!0),d=n.ref(!u||r),h=n.computed(()=>{var i;return((i=c.value)==null?void 0:i.errors)||[]}),g=n.computed(()=>{var i;return((i=c.value)==null?void 0:i.fields)||{}}),m=n.computed(()=>new ae(n.toValue(l))),y=async()=>{s.value=!1,d.value=!1;try{await m.value.validate(o.value,a),d.value=!0,c.value=null}catch(i){c.value=i}finally{s.value=!0}return{pass:d.value,errorInfo:c.value,errors:h.value,errorFields:g.value}};r||n.watch([o,m],()=>y(),{immediate:u,deep:!0});const V={isFinished:s,pass:d,errors:h,errorInfo:c,errorFields:g,execute:y};function A(){return new Promise((i,E)=>{C.until(s).toBe(!0).then(()=>i(V)).catch(D=>E(D))})}return{...V,then(i,E){return A().then(i,E)}}}function oe(...t){const l=typeof t[0]=="string"?t[0]:void 0,e=typeof l=="string"?1:0,a={immediate:!!e,shallow:!0,abortPrevious:!0};let u={},r=L,o=a;const c=v=>!!v?.request;t.length>0+e&&(c(t[0+e])?r=t[0+e]:u=t[0+e]),t.length>1+e&&c(t[1+e])&&(r=t[1+e]),(t.length===2+e&&!c(t[1+e])||t.length===3+e)&&(o=t[t.length-1]||a);const{shallow:s,onSuccess:d=C.noop,onError:h=C.noop,immediate:g,resetOnExecute:m=!1}=o,y=o.initialData,V=n.shallowRef(),A=(s?n.shallowRef:n.ref)(y),i=n.ref(!1),E=n.ref(!1),D=n.ref(!1),R=n.shallowRef();let S=new AbortController;const F=v=>{i.value||!E.value||(S.abort(v),S=new AbortController,D.value=!0,E.value=!1,i.value=!1)},f=v=>{E.value=v,i.value=!v},_=()=>{m&&(A.value=y)},Q=()=>new Promise((v,I)=>{C.until(i).toBe(!0).then(()=>R.value?I(R.value):v(q))}),H={then:(...v)=>Q().then(...v),catch:(...v)=>Q().catch(...v)};let j=0;const z=(v=l,I={})=>{R.value=void 0;const J=typeof v=="string"?v:l??I.url;if(J===void 0)return R.value=new L.AxiosError(L.AxiosError.ERR_INVALID_URL),i.value=!0,H;_(),o.abortPrevious!==!1&&F(),f(!0),j+=1;const we=j;return D.value=!1,r(J,{...u,...typeof v=="object"?v:I,signal:S.signal}).then(O=>{if(D.value)return;V.value=O;const M=O.data;A.value=M,d(M)}).catch(O=>{R.value=O,h(O)}).finally(()=>{var O;(O=o.onFinish)==null||O.call(o),we===j&&f(!1)}),H};g&&l&&z();const q={response:V,data:A,error:R,isFinished:i,isLoading:E,cancel:F,isAborted:D,isCanceled:D,abort:F,execute:z};return{...q,...H}}const N=Object.entries(ne).filter(([t,l])=>typeof l=="function"&&t.endsWith("Case")).reduce((t,[l,e])=>(t[l]=e,t),{});function ue(t,l,e){const a=n.computed(()=>{const r=n.toValue(l);if(!N[r])throw new Error(`Invalid change case type "${r}"`);return r});if(typeof t=="function")return n.computed(()=>N[a.value](n.toValue(t),n.toValue(e)));const u=n.ref(t);return n.computed({get(){return N[a.value](u.value,n.toValue(e))},set(r){u.value=r}})}function re(t){const l=new k(t?t.headers.cookie:null);return(e,{doNotParse:a=!1,autoUpdateDependencies:u=!1}={})=>T(e,{doNotParse:a,autoUpdateDependencies:u},l)}function T(t,{doNotParse:l=!1,autoUpdateDependencies:e=!1}={},a=new k){const u=e?[...t||[]]:t;let r=a.getAll({doNotParse:!0});const o=n.ref(0),c=()=>{const s=a.getAll({doNotParse:!0});se(u||null,s,r)&&o.value++,r=s};return a.addChangeListener(c),C.tryOnScopeDispose(()=>{a.removeChangeListener(c)}),{get:(...s)=>(e&&u&&!u.includes(s[0])&&u.push(s[0]),o.value,a.get(s[0],{doNotParse:l,...s[1]})),getAll:(...s)=>(o.value,a.getAll({doNotParse:l,...s[0]})),set:(...s)=>a.set(...s),remove:(...s)=>a.remove(...s),addChangeListener:(...s)=>a.addChangeListener(...s),removeChangeListener:(...s)=>a.removeChangeListener(...s)}}function se(t,l,e){if(!t)return!0;for(const a of t)if(l[a]!==e[a])return!0;return!1}function ce(t,l){const e=n.ref();let a=[];const u=w.createEventHook(),r=w.createEventHook(),o=w.createEventHook(),c=w.createEventHook(),s=w.createEventHook(),d=n.ref(!1),h=n.ref(!1),g=n.ref(!1),m=n.ref(!1),y=n.ref({color:"black",size:3,arrowEnd:!1,cornerRadius:0,dasharray:void 0,fill:"transparent",mode:"draw",...l?.brush});n.watch(y,()=>{const f=e.value;f&&(f.brush=y.value,f.mode=y.value.mode)},{deep:!0});const V=()=>{var f;return(f=e.value)==null?void 0:f.undo()},A=()=>{var f;return(f=e.value)==null?void 0:f.redo()},i=()=>{var f;return(f=e.value)==null?void 0:f.clear()},E=()=>{var f;return(f=e.value)==null?void 0:f.cancel()},D=f=>{var _;return(_=e.value)==null?void 0:_.load(f)},R=()=>{var f;return(f=e.value)==null?void 0:f.dump()},S=()=>{var f;a.forEach(_=>_()),(f=e.value)==null||f.unmount()},F=()=>{e.value&&(d.value=e.value.canUndo(),h.value=e.value.canRedo(),g.value=e.value.altPressed,m.value=e.value.shiftPressed)};return n.watch(()=>w.unrefElement(t),f=>{!f||typeof SVGSVGElement>"u"||!(f instanceof SVGSVGElement)||(e.value&&S(),e.value=K.createDrauu({el:f,...l}),F(),a=[e.value.on("canceled",()=>r.trigger()),e.value.on("committed",_=>o.trigger(_)),e.value.on("start",()=>c.trigger()),e.value.on("end",()=>s.trigger()),e.value.on("changed",()=>{F(),u.trigger()})])},{flush:"post"}),C.tryOnScopeDispose(()=>S()),{drauuInstance:e,load:D,dump:R,clear:i,cancel:E,undo:V,redo:A,canUndo:d,canRedo:h,brush:y,onChanged:u.on,onCommitted:o.on,onStart:c.on,onEnd:s.on,onCanceled:r.on}}function ie(t,l={}){let e;const{immediate:a,...u}=l,r=n.ref(!1),o=n.ref(!1),c=m=>e&&e.activate(m),s=m=>e&&e.deactivate(m),d=()=>{e&&(e.pause(),o.value=!0)},h=()=>{e&&(e.unpause(),o.value=!1)},g=n.computed(()=>{const m=n.toValue(t);return w.toArray(m).map(y=>{const V=n.toValue(y);return typeof V=="string"?V:w.unrefElement(V)}).filter(C.notNullish)});return n.watch(g,m=>{m.length&&(e=X.createFocusTrap(m,{...u,onActivate(){r.value=!0,l.onActivate&&l.onActivate()},onDeactivate(){r.value=!1,l.onDeactivate&&l.onDeactivate()}}),a&&c())},{flush:"post"}),w.tryOnScopeDispose(()=>s()),{hasFocus:r,isPaused:o,activate:c,deactivate:s,pause:d,unpause:h}}function fe(t,l,e){const a=()=>{var o,c;return new Y((o=n.toValue(l))!=null?o:[],(c=n.toValue(e))==null?void 0:c.fuseOptions)},u=n.ref(a());n.watch(()=>{var o;return(o=n.toValue(e))==null?void 0:o.fuseOptions},()=>{u.value=a()},{deep:!0}),n.watch(()=>n.toValue(l),o=>{u.value.setCollection(o)},{deep:!0});const r=n.computed(()=>{const o=n.toValue(e);if(o?.matchAllWhenSearchEmpty&&!n.toValue(t))return n.toValue(l).map((s,d)=>({item:s,refIndex:d}));const c=o?.resultLimit;return u.value.search(n.toValue(t),c?{limit:c}:void 0)});return{fuse:u,results:r}}function de(t,l,e={}){const{flush:a="pre",deep:u=!0,shallow:r=!1,onError:o=i=>{console.error(i)},writeDefaults:c=!0}=e,s=n.ref(!1),d=(r?n.shallowRef:n.ref)(l),h=n.toValue(l);async function g(){try{const i=await P.get(t);i===void 0?h!=null&&c&&await P.set(t,h):d.value=i}catch(i){o(i)}s.value=!0}g();async function m(){try{d.value==null?await P.del(t):await P.update(t,()=>n.toRaw(d.value))}catch(i){o(i)}}const{pause:y,resume:V}=w.watchPausable(d,()=>m(),{flush:a,deep:u});async function A(i){y(),d.value=i,await m(),V()}return{set:A,isFinished:s,data:d}}function he(t,l={}){const{onError:e,fallbackValue:a=null}=l,u=(c,s)=>{try{return Z.jwtDecode(c,s)}catch(d){return e?.(d),a}},r=n.computed(()=>u(n.toValue(t),{header:!0})),o=n.computed(()=>u(n.toValue(t)));return{header:r,payload:o}}function me(t=null,l){const e=C.toRef(t),a=n.computed({set:r=>r?b.start():b.done(),get:()=>typeof e.value=="number"&&e.value<1});l&&b.configure(l);const u=b.set;return b.set=r=>(e.value=r,u.call(b,r)),n.watchEffect(()=>{typeof e.value=="number"&&C.isClient&&u.call(b,e.value)}),C.tryOnScopeDispose(b.remove),{isLoading:a,progress:e,start:b.start,done:b.done,remove:()=>{e.value=null,b.remove()}}}function ve(t,l){const e=C.toRef(t),a=n.ref("");return n.watch(e,async u=>{e.value&&C.isClient&&(a.value=await x.toDataURL(u,l))},{immediate:!0}),a}function pe(t,l,e={}){let a;const{document:u=w.defaultDocument,...r}=e,o={onUpdate:h=>{G(l,h.oldIndex,h.newIndex,h)}},c=()=>{const h=typeof t=="string"?u?.querySelector(t):w.unrefElement(t);!h||a!==void 0||(a=new ee(h,{...o,...r}))},s=()=>{a?.destroy(),a=void 0},d=(h,g)=>{if(g!==void 0)a?.option(h,g);else return a?.option(h)};return w.tryOnMounted(c),w.tryOnScopeDispose(s),{stop:s,start:c,option:d}}function B(t,l,e){const a=t.children[e];t.insertBefore(l,a)}function W(t){t.parentNode&&t.parentNode.removeChild(t)}function G(t,l,e,a=null){a!=null&&(W(a.item),B(a.from,a.item,l));const u=n.isRef(t),r=u?[...n.toValue(t)]:n.toValue(t);if(e>=0&&e<r.length){const o=r.splice(l,1)[0];n.nextTick(()=>{r.splice(e,0,o),u&&(t.value=r)})}}p.createCookies=re,p.insertNodeAt=B,p.moveArrayElement=G,p.removeNode=W,p.useAsyncValidator=le,p.useAxios=oe,p.useChangeCase=ue,p.useCookies=T,p.useDrauu=ce,p.useFocusTrap=ie,p.useFuse=fe,p.useIDBKeyval=de,p.useJwt=he,p.useNProgress=me,p.useQRCode=ve,p.useSortable=pe})(this.VueUse=this.VueUse||{},VueUse,AsyncValidator,Vue,axios,changeCase,UniversalCookie,VueUse,Drauu,focusTrap,Fuse,idbKeyval,jwt_decode,nprogress,QRCode,Sortable);
1
+ (function(p,C,U,n,L,$,k,w,K,X,Y,P,Z,b,x,ee){"use strict";function te(t){var o=Object.create(null);return t&&Object.keys(t).forEach(function(e){if(e!=="default"){var a=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(o,e,a.get?a:{enumerable:!0,get:function(){return t[e]}})}}),o.default=t,Object.freeze(o)}var ne=te($);const ae=U.default||U;function oe(t,o,e={}){const{validateOption:a={},immediate:r=!0,manual:u=!1}=e,l=C.toRef(t),c=n.shallowRef(null),s=n.ref(!0),d=n.ref(!r||u),v=n.computed(()=>{var i;return((i=c.value)==null?void 0:i.errors)||[]}),g=n.computed(()=>{var i;return((i=c.value)==null?void 0:i.fields)||{}}),h=n.computed(()=>new ae(n.toValue(o))),y=async()=>{s.value=!1,d.value=!1;try{await h.value.validate(l.value,a),d.value=!0,c.value=null}catch(i){c.value=i}finally{s.value=!0}return{pass:d.value,errorInfo:c.value,errors:v.value,errorFields:g.value}};u||n.watch([l,h],()=>y(),{immediate:r,deep:!0});const V={isFinished:s,pass:d,errors:v,errorInfo:c,errorFields:g,execute:y};function A(){return new Promise((i,E)=>{C.until(s).toBe(!0).then(()=>i(V)).catch(D=>E(D))})}return{...V,then(i,E){return A().then(i,E)}}}function le(...t){const o=typeof t[0]=="string"?t[0]:void 0,e=typeof o=="string"?1:0,a={immediate:!!e,shallow:!0,abortPrevious:!0};let r={},u=L,l=a;const c=m=>!!m?.request;t.length>0+e&&(c(t[0+e])?u=t[0+e]:r=t[0+e]),t.length>1+e&&c(t[1+e])&&(u=t[1+e]),(t.length===2+e&&!c(t[1+e])||t.length===3+e)&&(l=t[t.length-1]||a);const{shallow:s,onSuccess:d=C.noop,onError:v=C.noop,immediate:g,resetOnExecute:h=!1}=l,y=l.initialData,V=n.shallowRef(),A=(s?n.shallowRef:n.ref)(y),i=n.ref(!1),E=n.ref(!1),D=n.ref(!1),R=n.shallowRef();let S=new AbortController;const F=m=>{i.value||!E.value||(S.abort(m),S=new AbortController,D.value=!0,E.value=!1,i.value=!1)},f=m=>{E.value=m,i.value=!m},_=()=>{h&&(A.value=y)},Q=()=>new Promise((m,I)=>{C.until(i).toBe(!0).then(()=>R.value?I(R.value):m(q))}),H={then:(...m)=>Q().then(...m),catch:(...m)=>Q().catch(...m)};let j=0;const z=(m=o,I={})=>{R.value=void 0;const J=typeof m=="string"?m:o??I.url;if(J===void 0)return R.value=new L.AxiosError(L.AxiosError.ERR_INVALID_URL),i.value=!0,H;_(),l.abortPrevious!==!1&&F(),f(!0),j+=1;const we=j;return D.value=!1,u(J,{...r,...typeof m=="object"?m:I,signal:S.signal}).then(O=>{if(D.value)return;V.value=O;const M=O.data;A.value=M,d(M)}).catch(O=>{R.value=O,v(O)}).finally(()=>{var O;(O=l.onFinish)==null||O.call(l),we===j&&f(!1)}),H};g&&o&&z();const q={response:V,data:A,error:R,isFinished:i,isLoading:E,cancel:F,isAborted:D,isCanceled:D,abort:F,execute:z};return{...q,...H}}const N=Object.entries(ne).filter(([t,o])=>typeof o=="function"&&t.endsWith("Case")).reduce((t,[o,e])=>(t[o]=e,t),{});function re(t,o,e){const a=n.computed(()=>{const u=n.toValue(o);if(!N[u])throw new Error(`Invalid change case type "${u}"`);return u});if(typeof t=="function")return n.computed(()=>N[a.value](n.toValue(t),n.toValue(e)));const r=n.ref(t);return n.computed({get(){return N[a.value](r.value,n.toValue(e))},set(u){r.value=u}})}function ue(t){const o=new k(t?t.headers.cookie:null);return(e,{doNotParse:a=!1,autoUpdateDependencies:r=!1}={})=>T(e,{doNotParse:a,autoUpdateDependencies:r},o)}function T(t,{doNotParse:o=!1,autoUpdateDependencies:e=!1}={},a=new k){const r=e?[...t||[]]:t;let u=a.getAll({doNotParse:!0});const l=n.ref(0),c=()=>{const s=a.getAll({doNotParse:!0});se(r||null,s,u)&&l.value++,u=s};return a.addChangeListener(c),C.tryOnScopeDispose(()=>{a.removeChangeListener(c)}),{get:(...s)=>(e&&r&&!r.includes(s[0])&&r.push(s[0]),l.value,a.get(s[0],{doNotParse:o,...s[1]})),getAll:(...s)=>(l.value,a.getAll({doNotParse:o,...s[0]})),set:(...s)=>a.set(...s),remove:(...s)=>a.remove(...s),addChangeListener:(...s)=>a.addChangeListener(...s),removeChangeListener:(...s)=>a.removeChangeListener(...s)}}function se(t,o,e){if(!t)return!0;for(const a of t)if(o[a]!==e[a])return!0;return!1}function ce(t,o){const e=n.ref();let a=[];const r=w.createEventHook(),u=w.createEventHook(),l=w.createEventHook(),c=w.createEventHook(),s=w.createEventHook(),d=n.ref(!1),v=n.ref(!1),g=n.ref(!1),h=n.ref(!1),y=n.ref({color:"black",size:3,arrowEnd:!1,cornerRadius:0,dasharray:void 0,fill:"transparent",mode:"draw",...o?.brush});n.watch(y,()=>{const f=e.value;f&&(f.brush=y.value,f.mode=y.value.mode)},{deep:!0});const V=()=>{var f;return(f=e.value)==null?void 0:f.undo()},A=()=>{var f;return(f=e.value)==null?void 0:f.redo()},i=()=>{var f;return(f=e.value)==null?void 0:f.clear()},E=()=>{var f;return(f=e.value)==null?void 0:f.cancel()},D=f=>{var _;return(_=e.value)==null?void 0:_.load(f)},R=()=>{var f;return(f=e.value)==null?void 0:f.dump()},S=()=>{var f;a.forEach(_=>_()),(f=e.value)==null||f.unmount()},F=()=>{e.value&&(d.value=e.value.canUndo(),v.value=e.value.canRedo(),g.value=e.value.altPressed,h.value=e.value.shiftPressed)};return n.watch(()=>w.unrefElement(t),f=>{!f||typeof SVGSVGElement>"u"||!(f instanceof SVGSVGElement)||(e.value&&S(),e.value=K.createDrauu({el:f,...o}),F(),a=[e.value.on("canceled",()=>u.trigger()),e.value.on("committed",_=>l.trigger(_)),e.value.on("start",()=>c.trigger()),e.value.on("end",()=>s.trigger()),e.value.on("changed",()=>{F(),r.trigger()})])},{flush:"post"}),C.tryOnScopeDispose(()=>S()),{drauuInstance:e,load:D,dump:R,clear:i,cancel:E,undo:V,redo:A,canUndo:d,canRedo:v,brush:y,onChanged:r.on,onCommitted:l.on,onStart:c.on,onEnd:s.on,onCanceled:u.on}}function ie(t,o={}){let e;const{immediate:a,...r}=o,u=n.ref(!1),l=n.ref(!1),c=h=>e&&e.activate(h),s=h=>e&&e.deactivate(h),d=()=>{e&&(e.pause(),l.value=!0)},v=()=>{e&&(e.unpause(),l.value=!1)},g=n.computed(()=>{const h=n.toValue(t);return w.toArray(h).map(y=>{const V=n.toValue(y);return typeof V=="string"?V:w.unrefElement(V)}).filter(C.notNullish)});return n.watch(g,h=>{h.length&&(e=X.createFocusTrap(h,{...r,onActivate(){u.value=!0,o.onActivate&&o.onActivate()},onDeactivate(){u.value=!1,o.onDeactivate&&o.onDeactivate()}}),a&&c())},{flush:"post"}),w.tryOnScopeDispose(()=>s()),{hasFocus:u,isPaused:l,activate:c,deactivate:s,pause:d,unpause:v}}function fe(t,o,e){const a=()=>{var l,c;return new Y((l=n.toValue(o))!=null?l:[],(c=n.toValue(e))==null?void 0:c.fuseOptions)},r=n.ref(a());n.watch(()=>{var l;return(l=n.toValue(e))==null?void 0:l.fuseOptions},()=>{r.value=a()},{deep:!0}),n.watch(()=>n.toValue(o),l=>{r.value.setCollection(l)},{deep:!0});const u=n.computed(()=>{const l=n.toValue(e);if(l?.matchAllWhenSearchEmpty&&!n.toValue(t))return n.toValue(o).map((s,d)=>({item:s,refIndex:d}));const c=l?.resultLimit;return r.value.search(n.toValue(t),c?{limit:c}:void 0)});return{fuse:r,results:u}}function de(t,o,e={}){const{flush:a="pre",deep:r=!0,shallow:u=!1,onError:l=i=>{console.error(i)},writeDefaults:c=!0}=e,s=n.ref(!1),d=(u?n.shallowRef:n.ref)(o),v=n.toValue(o);async function g(){try{const i=await P.get(t);i===void 0?v!=null&&c&&await P.set(t,v):d.value=i}catch(i){l(i)}s.value=!0}g();async function h(){try{d.value==null?await P.del(t):await P.update(t,()=>n.toRaw(d.value))}catch(i){l(i)}}const{pause:y,resume:V}=w.watchPausable(d,()=>h(),{flush:a,deep:r});async function A(i){y(),d.value=i,await h(),V()}return{set:A,isFinished:s,data:d}}function ve(t,o={}){const{onError:e,fallbackValue:a=null}=o,r=(c,s)=>{try{return Z.jwtDecode(c,s)}catch(d){return e?.(d),a}},u=n.computed(()=>r(n.toValue(t),{header:!0})),l=n.computed(()=>r(n.toValue(t)));return{header:u,payload:l}}function he(t=null,o){const e=C.toRef(t),a=n.computed({set:u=>u?b.start():b.done(),get:()=>typeof e.value=="number"&&e.value<1});o&&b.configure(o);const r=b.set;return b.set=u=>(e.value=u,r.call(b,u)),n.watchEffect(()=>{typeof e.value=="number"&&C.isClient&&r.call(b,e.value)}),C.tryOnScopeDispose(b.remove),{isLoading:a,progress:e,start:b.start,done:b.done,remove:()=>{e.value=null,b.remove()}}}function me(t,o){const e=C.toRef(t),a=n.ref("");return n.watch(e,async r=>{e.value&&C.isClient&&(a.value=await x.toDataURL(r,o))},{immediate:!0}),a}function pe(t,o,e={}){let a;const{document:r=w.defaultDocument,...u}=e,l={onUpdate:v=>{G(o,v.oldIndex,v.newIndex,v)}},c=()=>{const v=typeof t=="string"?r?.querySelector(t):w.unrefElement(t);!v||a!==void 0||(a=new ee(v,{...l,...u}))},s=()=>{a?.destroy(),a=void 0},d=(v,g)=>{if(g!==void 0)a?.option(v,g);else return a?.option(v)};return w.tryOnMounted(c),w.tryOnScopeDispose(s),{stop:s,start:c,option:d}}function B(t,o,e){const a=t.children[e];t.insertBefore(o,a)}function W(t){t.parentNode&&t.parentNode.removeChild(t)}function G(t,o,e,a=null){a!=null&&(W(a.item),B(a.from,a.item,o));const r=n.isRef(t),u=r?[...n.toValue(t)]:n.toValue(t);if(e>=0&&e<u.length){const l=u.splice(o,1)[0];n.nextTick(()=>{u.splice(e,0,l),r&&(t.value=u)})}}p.createCookies=ue,p.insertNodeAt=B,p.moveArrayElement=G,p.removeNode=W,p.useAsyncValidator=oe,p.useAxios=le,p.useChangeCase=re,p.useCookies=T,p.useDrauu=ce,p.useFocusTrap=ie,p.useFuse=fe,p.useIDBKeyval=de,p.useJwt=ve,p.useNProgress=he,p.useQRCode=me,p.useSortable=pe})(this.VueUse=this.VueUse||{},VueUse,AsyncValidator,Vue,axios,changeCase,UniversalCookie,VueUse,Drauu,focusTrap,Fuse,idbKeyval,jwt_decode,nprogress,QRCode,Sortable);
package/index.mjs CHANGED
@@ -4,7 +4,7 @@ import { shallowRef, ref, computed, toValue, watch, toRaw, watchEffect, isRef, n
4
4
  import axios, { AxiosError } from 'axios';
5
5
  import * as changeCase from 'change-case';
6
6
  import Cookie from 'universal-cookie';
7
- import { createEventHook, unrefElement, toArray, tryOnScopeDispose as tryOnScopeDispose$1, watchPausable, tryOnMounted, defaultDocument } from '@vueuse/core';
7
+ import { createEventHook, unrefElement, toArray, tryOnScopeDispose as tryOnScopeDispose$1, watchPausable, defaultDocument, tryOnMounted } from '@vueuse/core';
8
8
  import { createDrauu } from 'drauu';
9
9
  import { createFocusTrap } from 'focus-trap';
10
10
  import Fuse from 'fuse.js';
@@ -27,11 +27,11 @@ function useAsyncValidator(value, rules, options = {}) {
27
27
  const pass = ref(!immediate || manual);
28
28
  const errors = computed(() => {
29
29
  var _a;
30
- return ((_a = errorInfo.value) == null ? undefined : _a.errors) || [];
30
+ return ((_a = errorInfo.value) == null ? void 0 : _a.errors) || [];
31
31
  });
32
32
  const errorFields = computed(() => {
33
33
  var _a;
34
- return ((_a = errorInfo.value) == null ? undefined : _a.fields) || {};
34
+ return ((_a = errorInfo.value) == null ? void 0 : _a.fields) || {};
35
35
  });
36
36
  const validator = computed(() => new AsyncValidatorSchema(toValue(rules)));
37
37
  const execute = async () => {
@@ -82,7 +82,7 @@ function useAsyncValidator(value, rules, options = {}) {
82
82
  }
83
83
 
84
84
  function useAxios(...args) {
85
- const url = typeof args[0] === "string" ? args[0] : undefined;
85
+ const url = typeof args[0] === "string" ? args[0] : void 0;
86
86
  const argsPlaceholder = typeof url === "string" ? 1 : 0;
87
87
  const defaultOptions = {
88
88
  immediate: !!argsPlaceholder,
@@ -92,7 +92,7 @@ function useAxios(...args) {
92
92
  let defaultConfig = {};
93
93
  let instance = axios;
94
94
  let options = defaultOptions;
95
- const isAxiosInstance = (val) => !!(val == null ? undefined : val.request);
95
+ const isAxiosInstance = (val) => !!(val == null ? void 0 : val.request);
96
96
  if (args.length > 0 + argsPlaceholder) {
97
97
  if (isAxiosInstance(args[0 + argsPlaceholder]))
98
98
  instance = args[0 + argsPlaceholder];
@@ -147,9 +147,9 @@ function useAxios(...args) {
147
147
  };
148
148
  let executeCounter = 0;
149
149
  const execute = (executeUrl = url, config = {}) => {
150
- error.value = undefined;
150
+ error.value = void 0;
151
151
  const _url = typeof executeUrl === "string" ? executeUrl : url != null ? url : config.url;
152
- if (_url === undefined) {
152
+ if (_url === void 0) {
153
153
  error.value = new AxiosError(AxiosError.ERR_INVALID_URL);
154
154
  isFinished.value = true;
155
155
  return promise;
@@ -173,7 +173,7 @@ function useAxios(...args) {
173
173
  onError(e);
174
174
  }).finally(() => {
175
175
  var _a;
176
- (_a = options.onFinish) == null ? undefined : _a.call(options);
176
+ (_a = options.onFinish) == null ? void 0 : _a.call(options);
177
177
  if (currentExecuteCounter === executeCounter)
178
178
  loading(false);
179
179
  });
@@ -296,10 +296,10 @@ function useDrauu(target, options) {
296
296
  size: 3,
297
297
  arrowEnd: false,
298
298
  cornerRadius: 0,
299
- dasharray: undefined,
299
+ dasharray: void 0,
300
300
  fill: "transparent",
301
301
  mode: "draw",
302
- ...options == null ? undefined : options.brush
302
+ ...options == null ? void 0 : options.brush
303
303
  });
304
304
  watch(brush, () => {
305
305
  const instance = drauuInstance.value;
@@ -310,32 +310,32 @@ function useDrauu(target, options) {
310
310
  }, { deep: true });
311
311
  const undo = () => {
312
312
  var _a;
313
- return (_a = drauuInstance.value) == null ? undefined : _a.undo();
313
+ return (_a = drauuInstance.value) == null ? void 0 : _a.undo();
314
314
  };
315
315
  const redo = () => {
316
316
  var _a;
317
- return (_a = drauuInstance.value) == null ? undefined : _a.redo();
317
+ return (_a = drauuInstance.value) == null ? void 0 : _a.redo();
318
318
  };
319
319
  const clear = () => {
320
320
  var _a;
321
- return (_a = drauuInstance.value) == null ? undefined : _a.clear();
321
+ return (_a = drauuInstance.value) == null ? void 0 : _a.clear();
322
322
  };
323
323
  const cancel = () => {
324
324
  var _a;
325
- return (_a = drauuInstance.value) == null ? undefined : _a.cancel();
325
+ return (_a = drauuInstance.value) == null ? void 0 : _a.cancel();
326
326
  };
327
327
  const load = (svg) => {
328
328
  var _a;
329
- return (_a = drauuInstance.value) == null ? undefined : _a.load(svg);
329
+ return (_a = drauuInstance.value) == null ? void 0 : _a.load(svg);
330
330
  };
331
331
  const dump = () => {
332
332
  var _a;
333
- return (_a = drauuInstance.value) == null ? undefined : _a.dump();
333
+ return (_a = drauuInstance.value) == null ? void 0 : _a.dump();
334
334
  };
335
335
  const cleanup = () => {
336
336
  var _a;
337
337
  disposables.forEach((dispose) => dispose());
338
- (_a = drauuInstance.value) == null ? undefined : _a.unmount();
338
+ (_a = drauuInstance.value) == null ? void 0 : _a.unmount();
339
339
  };
340
340
  const syncStatus = () => {
341
341
  if (drauuInstance.value) {
@@ -452,14 +452,14 @@ function useFuse(search, data, options) {
452
452
  var _a, _b;
453
453
  return new Fuse(
454
454
  (_a = toValue(data)) != null ? _a : [],
455
- (_b = toValue(options)) == null ? undefined : _b.fuseOptions
455
+ (_b = toValue(options)) == null ? void 0 : _b.fuseOptions
456
456
  );
457
457
  };
458
458
  const fuse = ref(createFuse());
459
459
  watch(
460
460
  () => {
461
461
  var _a;
462
- return (_a = toValue(options)) == null ? undefined : _a.fuseOptions;
462
+ return (_a = toValue(options)) == null ? void 0 : _a.fuseOptions;
463
463
  },
464
464
  () => {
465
465
  fuse.value = createFuse();
@@ -475,10 +475,10 @@ function useFuse(search, data, options) {
475
475
  );
476
476
  const results = computed(() => {
477
477
  const resolved = toValue(options);
478
- if ((resolved == null ? undefined : resolved.matchAllWhenSearchEmpty) && !toValue(search))
478
+ if ((resolved == null ? void 0 : resolved.matchAllWhenSearchEmpty) && !toValue(search))
479
479
  return toValue(data).map((item, index) => ({ item, refIndex: index }));
480
- const limit = resolved == null ? undefined : resolved.resultLimit;
481
- return fuse.value.search(toValue(search), limit ? { limit } : undefined);
480
+ const limit = resolved == null ? void 0 : resolved.resultLimit;
481
+ return fuse.value.search(toValue(search), limit ? { limit } : void 0);
482
482
  });
483
483
  return {
484
484
  fuse,
@@ -551,7 +551,7 @@ function useJwt(encodedJwt, options = {}) {
551
551
  try {
552
552
  return jwtDecode(encodedJwt2, options2);
553
553
  } catch (err) {
554
- onError == null ? undefined : onError(err);
554
+ onError == null ? void 0 : onError(err);
555
555
  return fallbackValue;
556
556
  }
557
557
  };
@@ -616,20 +616,20 @@ function useSortable(el, list, options = {}) {
616
616
  }
617
617
  };
618
618
  const start = () => {
619
- const target = typeof el === "string" ? document == null ? undefined : document.querySelector(el) : unrefElement(el);
620
- if (!target || sortable !== undefined)
619
+ const target = typeof el === "string" ? document == null ? void 0 : document.querySelector(el) : unrefElement(el);
620
+ if (!target || sortable !== void 0)
621
621
  return;
622
622
  sortable = new Sortable(target, { ...defaultOptions, ...resetOptions });
623
623
  };
624
624
  const stop = () => {
625
- sortable == null ? undefined : sortable.destroy();
626
- sortable = undefined;
625
+ sortable == null ? void 0 : sortable.destroy();
626
+ sortable = void 0;
627
627
  };
628
628
  const option = (name, value) => {
629
- if (value !== undefined)
630
- sortable == null ? undefined : sortable.option(name, value);
629
+ if (value !== void 0)
630
+ sortable == null ? void 0 : sortable.option(name, value);
631
631
  else
632
- return sortable == null ? undefined : sortable.option(name);
632
+ return sortable == null ? void 0 : sortable.option(name);
633
633
  };
634
634
  tryOnMounted(start);
635
635
  tryOnScopeDispose$1(stop);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vueuse/integrations",
3
3
  "type": "module",
4
- "version": "12.5.0",
4
+ "version": "12.6.1",
5
5
  "description": "Integration wrappers for utility libraries",
6
6
  "author": "Anthony Fu <https://github.com/antfu>",
7
7
  "license": "MIT",
@@ -155,8 +155,8 @@
155
155
  },
156
156
  "dependencies": {
157
157
  "vue": "^3.5.13",
158
- "@vueuse/core": "12.5.0",
159
- "@vueuse/shared": "12.5.0"
158
+ "@vueuse/core": "12.6.1",
159
+ "@vueuse/shared": "12.6.1"
160
160
  },
161
161
  "devDependencies": {
162
162
  "@types/nprogress": "^0.2.3",
@@ -166,8 +166,8 @@
166
166
  "axios": "^1.7.9",
167
167
  "change-case": "^5.4.4",
168
168
  "drauu": "^0.4.2",
169
- "focus-trap": "^7.6.2",
170
- "fuse.js": "^7.0.0",
169
+ "focus-trap": "^7.6.4",
170
+ "fuse.js": "^7.1.0",
171
171
  "idb-keyval": "^6.2.1",
172
172
  "jwt-decode": "^4.0.0",
173
173
  "nprogress": "^0.2.0",
@@ -17,11 +17,11 @@ function useAsyncValidator(value, rules, options = {}) {
17
17
  const pass = vue.ref(!immediate || manual);
18
18
  const errors = vue.computed(() => {
19
19
  var _a;
20
- return ((_a = errorInfo.value) == null ? undefined : _a.errors) || [];
20
+ return ((_a = errorInfo.value) == null ? void 0 : _a.errors) || [];
21
21
  });
22
22
  const errorFields = vue.computed(() => {
23
23
  var _a;
24
- return ((_a = errorInfo.value) == null ? undefined : _a.fields) || {};
24
+ return ((_a = errorInfo.value) == null ? void 0 : _a.fields) || {};
25
25
  });
26
26
  const validator = vue.computed(() => new AsyncValidatorSchema(vue.toValue(rules)));
27
27
  const execute = async () => {
@@ -14,11 +14,11 @@
14
14
  const pass = vue.ref(!immediate || manual);
15
15
  const errors = vue.computed(() => {
16
16
  var _a;
17
- return ((_a = errorInfo.value) == null ? undefined : _a.errors) || [];
17
+ return ((_a = errorInfo.value) == null ? void 0 : _a.errors) || [];
18
18
  });
19
19
  const errorFields = vue.computed(() => {
20
20
  var _a;
21
- return ((_a = errorInfo.value) == null ? undefined : _a.fields) || {};
21
+ return ((_a = errorInfo.value) == null ? void 0 : _a.fields) || {};
22
22
  });
23
23
  const validator = vue.computed(() => new AsyncValidatorSchema(vue.toValue(rules)));
24
24
  const execute = async () => {
@@ -1 +1 @@
1
- (function(m,u,s,t){"use strict";const p=s.default||s;function y(w,A,F={}){const{validateOption:U={},immediate:o=!0,manual:i=!1}=F,c=u.toRef(w),r=t.shallowRef(null),a=t.ref(!0),n=t.ref(!o||i),d=t.computed(()=>{var e;return((e=r.value)==null?void 0:e.errors)||[]}),f=t.computed(()=>{var e;return((e=r.value)==null?void 0:e.fields)||{}}),v=t.computed(()=>new p(t.toValue(A))),h=async()=>{a.value=!1,n.value=!1;try{await v.value.validate(c.value,U),n.value=!0,r.value=null}catch(e){r.value=e}finally{a.value=!0}return{pass:n.value,errorInfo:r.value,errors:d.value,errorFields:f.value}};i||t.watch([c,v],()=>h(),{immediate:o,deep:!0});const V={isFinished:a,pass:n,errors:d,errorInfo:r,errorFields:f,execute:h};function R(){return new Promise((e,l)=>{u.until(a).toBe(!0).then(()=>e(V)).catch(I=>l(I))})}return{...V,then(e,l){return R().then(e,l)}}}m.useAsyncValidator=y})(this.VueUse=this.VueUse||{},VueUse,AsyncValidator,Vue);
1
+ (function(m,s,u,t){"use strict";const p=u.default||u;function y(w,A,F={}){const{validateOption:U={},immediate:o=!0,manual:i=!1}=F,c=s.toRef(w),r=t.shallowRef(null),a=t.ref(!0),l=t.ref(!o||i),d=t.computed(()=>{var e;return((e=r.value)==null?void 0:e.errors)||[]}),f=t.computed(()=>{var e;return((e=r.value)==null?void 0:e.fields)||{}}),v=t.computed(()=>new p(t.toValue(A))),h=async()=>{a.value=!1,l.value=!1;try{await v.value.validate(c.value,U),l.value=!0,r.value=null}catch(e){r.value=e}finally{a.value=!0}return{pass:l.value,errorInfo:r.value,errors:d.value,errorFields:f.value}};i||t.watch([c,v],()=>h(),{immediate:o,deep:!0});const V={isFinished:a,pass:l,errors:d,errorInfo:r,errorFields:f,execute:h};function R(){return new Promise((e,n)=>{s.until(a).toBe(!0).then(()=>e(V)).catch(I=>n(I))})}return{...V,then(e,n){return R().then(e,n)}}}m.useAsyncValidator=y})(this.VueUse=this.VueUse||{},VueUse,AsyncValidator,Vue);
@@ -15,11 +15,11 @@ function useAsyncValidator(value, rules, options = {}) {
15
15
  const pass = ref(!immediate || manual);
16
16
  const errors = computed(() => {
17
17
  var _a;
18
- return ((_a = errorInfo.value) == null ? undefined : _a.errors) || [];
18
+ return ((_a = errorInfo.value) == null ? void 0 : _a.errors) || [];
19
19
  });
20
20
  const errorFields = computed(() => {
21
21
  var _a;
22
- return ((_a = errorInfo.value) == null ? undefined : _a.fields) || {};
22
+ return ((_a = errorInfo.value) == null ? void 0 : _a.fields) || {};
23
23
  });
24
24
  const validator = computed(() => new AsyncValidatorSchema(toValue(rules)));
25
25
  const execute = async () => {
package/useAxios.cjs CHANGED
@@ -5,7 +5,7 @@ var axios = require('axios');
5
5
  var vue = require('vue');
6
6
 
7
7
  function useAxios(...args) {
8
- const url = typeof args[0] === "string" ? args[0] : undefined;
8
+ const url = typeof args[0] === "string" ? args[0] : void 0;
9
9
  const argsPlaceholder = typeof url === "string" ? 1 : 0;
10
10
  const defaultOptions = {
11
11
  immediate: !!argsPlaceholder,
@@ -15,7 +15,7 @@ function useAxios(...args) {
15
15
  let defaultConfig = {};
16
16
  let instance = axios;
17
17
  let options = defaultOptions;
18
- const isAxiosInstance = (val) => !!(val == null ? undefined : val.request);
18
+ const isAxiosInstance = (val) => !!(val == null ? void 0 : val.request);
19
19
  if (args.length > 0 + argsPlaceholder) {
20
20
  if (isAxiosInstance(args[0 + argsPlaceholder]))
21
21
  instance = args[0 + argsPlaceholder];
@@ -70,9 +70,9 @@ function useAxios(...args) {
70
70
  };
71
71
  let executeCounter = 0;
72
72
  const execute = (executeUrl = url, config = {}) => {
73
- error.value = undefined;
73
+ error.value = void 0;
74
74
  const _url = typeof executeUrl === "string" ? executeUrl : url != null ? url : config.url;
75
- if (_url === undefined) {
75
+ if (_url === void 0) {
76
76
  error.value = new axios.AxiosError(axios.AxiosError.ERR_INVALID_URL);
77
77
  isFinished.value = true;
78
78
  return promise;
@@ -96,7 +96,7 @@ function useAxios(...args) {
96
96
  onError(e);
97
97
  }).finally(() => {
98
98
  var _a;
99
- (_a = options.onFinish) == null ? undefined : _a.call(options);
99
+ (_a = options.onFinish) == null ? void 0 : _a.call(options);
100
100
  if (currentExecuteCounter === executeCounter)
101
101
  loading(false);
102
102
  });
package/useAxios.iife.js CHANGED
@@ -2,7 +2,7 @@
2
2
  'use strict';
3
3
 
4
4
  function useAxios(...args) {
5
- const url = typeof args[0] === "string" ? args[0] : undefined;
5
+ const url = typeof args[0] === "string" ? args[0] : void 0;
6
6
  const argsPlaceholder = typeof url === "string" ? 1 : 0;
7
7
  const defaultOptions = {
8
8
  immediate: !!argsPlaceholder,
@@ -12,7 +12,7 @@
12
12
  let defaultConfig = {};
13
13
  let instance = axios;
14
14
  let options = defaultOptions;
15
- const isAxiosInstance = (val) => !!(val == null ? undefined : val.request);
15
+ const isAxiosInstance = (val) => !!(val == null ? void 0 : val.request);
16
16
  if (args.length > 0 + argsPlaceholder) {
17
17
  if (isAxiosInstance(args[0 + argsPlaceholder]))
18
18
  instance = args[0 + argsPlaceholder];
@@ -67,9 +67,9 @@
67
67
  };
68
68
  let executeCounter = 0;
69
69
  const execute = (executeUrl = url, config = {}) => {
70
- error.value = undefined;
70
+ error.value = void 0;
71
71
  const _url = typeof executeUrl === "string" ? executeUrl : url != null ? url : config.url;
72
- if (_url === undefined) {
72
+ if (_url === void 0) {
73
73
  error.value = new axios.AxiosError(axios.AxiosError.ERR_INVALID_URL);
74
74
  isFinished.value = true;
75
75
  return promise;
@@ -93,7 +93,7 @@
93
93
  onError(e);
94
94
  }).finally(() => {
95
95
  var _a;
96
- (_a = options.onFinish) == null ? undefined : _a.call(options);
96
+ (_a = options.onFinish) == null ? void 0 : _a.call(options);
97
97
  if (currentExecuteCounter === executeCounter)
98
98
  loading(false);
99
99
  });
@@ -1 +1 @@
1
- (function(L,h,d,o){"use strict";function O(...t){const a=typeof t[0]=="string"?t[0]:void 0,n=typeof a=="string"?1:0,E={immediate:!!n,shallow:!0,abortPrevious:!0};let R={},v=d,s=E;const p=e=>!!e?.request;t.length>0+n&&(p(t[0+n])?v=t[0+n]:R=t[0+n]),t.length>1+n&&p(t[1+n])&&(v=t[1+n]),(t.length===2+n&&!p(t[1+n])||t.length===3+n)&&(s=t[t.length-1]||E);const{shallow:U,onSuccess:j=h.noop,onError:q=h.noop,immediate:B,resetOnExecute:N=!1}=s,x=s.initialData,y=o.shallowRef(),w=(U?o.shallowRef:o.ref)(x),i=o.ref(!1),c=o.ref(!1),r=o.ref(!1),u=o.shallowRef();let b=new AbortController;const A=e=>{i.value||!c.value||(b.abort(e),b=new AbortController,r.value=!0,c.value=!1,i.value=!1)},V=e=>{c.value=e,i.value=!e},S=()=>{N&&(w.value=x)},D=()=>new Promise((e,f)=>{h.until(i).toBe(!0).then(()=>u.value?f(u.value):e(_))}),C={then:(...e)=>D().then(...e),catch:(...e)=>D().catch(...e)};let m=0;const P=(e=a,f={})=>{u.value=void 0;const F=typeof e=="string"?e:a??f.url;if(F===void 0)return u.value=new d.AxiosError(d.AxiosError.ERR_INVALID_URL),i.value=!0,C;S(),s.abortPrevious!==!1&&A(),V(!0),m+=1;const k=m;return r.value=!1,v(F,{...R,...typeof e=="object"?e:f,signal:b.signal}).then(l=>{if(r.value)return;y.value=l;const I=l.data;w.value=I,j(I)}).catch(l=>{u.value=l,q(l)}).finally(()=>{var l;(l=s.onFinish)==null||l.call(s),k===m&&V(!1)}),C};B&&a&&P();const _={response:y,data:w,error:u,isFinished:i,isLoading:c,cancel:A,isAborted:r,isCanceled:r,abort:A,execute:P};return{..._,...C}}L.useAxios=O})(this.VueUse=this.VueUse||{},VueUse,axios,Vue);
1
+ (function(L,h,v,l){"use strict";function O(...t){const r=typeof t[0]=="string"?t[0]:void 0,n=typeof r=="string"?1:0,E={immediate:!!n,shallow:!0,abortPrevious:!0};let R={},d=v,s=E;const p=e=>!!e?.request;t.length>0+n&&(p(t[0+n])?d=t[0+n]:R=t[0+n]),t.length>1+n&&p(t[1+n])&&(d=t[1+n]),(t.length===2+n&&!p(t[1+n])||t.length===3+n)&&(s=t[t.length-1]||E);const{shallow:U,onSuccess:j=h.noop,onError:q=h.noop,immediate:B,resetOnExecute:N=!1}=s,x=s.initialData,y=l.shallowRef(),w=(U?l.shallowRef:l.ref)(x),i=l.ref(!1),c=l.ref(!1),u=l.ref(!1),a=l.shallowRef();let b=new AbortController;const A=e=>{i.value||!c.value||(b.abort(e),b=new AbortController,u.value=!0,c.value=!1,i.value=!1)},V=e=>{c.value=e,i.value=!e},S=()=>{N&&(w.value=x)},D=()=>new Promise((e,f)=>{h.until(i).toBe(!0).then(()=>a.value?f(a.value):e(_))}),C={then:(...e)=>D().then(...e),catch:(...e)=>D().catch(...e)};let m=0;const P=(e=r,f={})=>{a.value=void 0;const F=typeof e=="string"?e:r??f.url;if(F===void 0)return a.value=new v.AxiosError(v.AxiosError.ERR_INVALID_URL),i.value=!0,C;S(),s.abortPrevious!==!1&&A(),V(!0),m+=1;const k=m;return u.value=!1,d(F,{...R,...typeof e=="object"?e:f,signal:b.signal}).then(o=>{if(u.value)return;y.value=o;const I=o.data;w.value=I,j(I)}).catch(o=>{a.value=o,q(o)}).finally(()=>{var o;(o=s.onFinish)==null||o.call(s),k===m&&V(!1)}),C};B&&r&&P();const _={response:y,data:w,error:a,isFinished:i,isLoading:c,cancel:A,isAborted:u,isCanceled:u,abort:A,execute:P};return{..._,...C}}L.useAxios=O})(this.VueUse=this.VueUse||{},VueUse,axios,Vue);
package/useAxios.mjs CHANGED
@@ -3,7 +3,7 @@ import axios, { AxiosError } from 'axios';
3
3
  import { shallowRef, ref } from 'vue';
4
4
 
5
5
  function useAxios(...args) {
6
- const url = typeof args[0] === "string" ? args[0] : undefined;
6
+ const url = typeof args[0] === "string" ? args[0] : void 0;
7
7
  const argsPlaceholder = typeof url === "string" ? 1 : 0;
8
8
  const defaultOptions = {
9
9
  immediate: !!argsPlaceholder,
@@ -13,7 +13,7 @@ function useAxios(...args) {
13
13
  let defaultConfig = {};
14
14
  let instance = axios;
15
15
  let options = defaultOptions;
16
- const isAxiosInstance = (val) => !!(val == null ? undefined : 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];
@@ -68,9 +68,9 @@ function useAxios(...args) {
68
68
  };
69
69
  let executeCounter = 0;
70
70
  const execute = (executeUrl = url, config = {}) => {
71
- error.value = undefined;
71
+ error.value = void 0;
72
72
  const _url = typeof executeUrl === "string" ? executeUrl : url != null ? url : config.url;
73
- if (_url === undefined) {
73
+ if (_url === void 0) {
74
74
  error.value = new AxiosError(AxiosError.ERR_INVALID_URL);
75
75
  isFinished.value = true;
76
76
  return promise;
@@ -94,7 +94,7 @@ function useAxios(...args) {
94
94
  onError(e);
95
95
  }).finally(() => {
96
96
  var _a;
97
- (_a = options.onFinish) == null ? undefined : _a.call(options);
97
+ (_a = options.onFinish) == null ? void 0 : _a.call(options);
98
98
  if (currentExecuteCounter === executeCounter)
99
99
  loading(false);
100
100
  });
package/useDrauu.cjs CHANGED
@@ -22,10 +22,10 @@ function useDrauu(target, options) {
22
22
  size: 3,
23
23
  arrowEnd: false,
24
24
  cornerRadius: 0,
25
- dasharray: undefined,
25
+ dasharray: void 0,
26
26
  fill: "transparent",
27
27
  mode: "draw",
28
- ...options == null ? undefined : options.brush
28
+ ...options == null ? void 0 : options.brush
29
29
  });
30
30
  vue.watch(brush, () => {
31
31
  const instance = drauuInstance.value;
@@ -36,32 +36,32 @@ function useDrauu(target, options) {
36
36
  }, { deep: true });
37
37
  const undo = () => {
38
38
  var _a;
39
- return (_a = drauuInstance.value) == null ? undefined : _a.undo();
39
+ return (_a = drauuInstance.value) == null ? void 0 : _a.undo();
40
40
  };
41
41
  const redo = () => {
42
42
  var _a;
43
- return (_a = drauuInstance.value) == null ? undefined : _a.redo();
43
+ return (_a = drauuInstance.value) == null ? void 0 : _a.redo();
44
44
  };
45
45
  const clear = () => {
46
46
  var _a;
47
- return (_a = drauuInstance.value) == null ? undefined : _a.clear();
47
+ return (_a = drauuInstance.value) == null ? void 0 : _a.clear();
48
48
  };
49
49
  const cancel = () => {
50
50
  var _a;
51
- return (_a = drauuInstance.value) == null ? undefined : _a.cancel();
51
+ return (_a = drauuInstance.value) == null ? void 0 : _a.cancel();
52
52
  };
53
53
  const load = (svg) => {
54
54
  var _a;
55
- return (_a = drauuInstance.value) == null ? undefined : _a.load(svg);
55
+ return (_a = drauuInstance.value) == null ? void 0 : _a.load(svg);
56
56
  };
57
57
  const dump = () => {
58
58
  var _a;
59
- return (_a = drauuInstance.value) == null ? undefined : _a.dump();
59
+ return (_a = drauuInstance.value) == null ? void 0 : _a.dump();
60
60
  };
61
61
  const cleanup = () => {
62
62
  var _a;
63
63
  disposables.forEach((dispose) => dispose());
64
- (_a = drauuInstance.value) == null ? undefined : _a.unmount();
64
+ (_a = drauuInstance.value) == null ? void 0 : _a.unmount();
65
65
  };
66
66
  const syncStatus = () => {
67
67
  if (drauuInstance.value) {
package/useDrauu.iife.js CHANGED
@@ -18,10 +18,10 @@
18
18
  size: 3,
19
19
  arrowEnd: false,
20
20
  cornerRadius: 0,
21
- dasharray: undefined,
21
+ dasharray: void 0,
22
22
  fill: "transparent",
23
23
  mode: "draw",
24
- ...options == null ? undefined : options.brush
24
+ ...options == null ? void 0 : options.brush
25
25
  });
26
26
  vue.watch(brush, () => {
27
27
  const instance = drauuInstance.value;
@@ -32,32 +32,32 @@
32
32
  }, { deep: true });
33
33
  const undo = () => {
34
34
  var _a;
35
- return (_a = drauuInstance.value) == null ? undefined : _a.undo();
35
+ return (_a = drauuInstance.value) == null ? void 0 : _a.undo();
36
36
  };
37
37
  const redo = () => {
38
38
  var _a;
39
- return (_a = drauuInstance.value) == null ? undefined : _a.redo();
39
+ return (_a = drauuInstance.value) == null ? void 0 : _a.redo();
40
40
  };
41
41
  const clear = () => {
42
42
  var _a;
43
- return (_a = drauuInstance.value) == null ? undefined : _a.clear();
43
+ return (_a = drauuInstance.value) == null ? void 0 : _a.clear();
44
44
  };
45
45
  const cancel = () => {
46
46
  var _a;
47
- return (_a = drauuInstance.value) == null ? undefined : _a.cancel();
47
+ return (_a = drauuInstance.value) == null ? void 0 : _a.cancel();
48
48
  };
49
49
  const load = (svg) => {
50
50
  var _a;
51
- return (_a = drauuInstance.value) == null ? undefined : _a.load(svg);
51
+ return (_a = drauuInstance.value) == null ? void 0 : _a.load(svg);
52
52
  };
53
53
  const dump = () => {
54
54
  var _a;
55
- return (_a = drauuInstance.value) == null ? undefined : _a.dump();
55
+ return (_a = drauuInstance.value) == null ? void 0 : _a.dump();
56
56
  };
57
57
  const cleanup = () => {
58
58
  var _a;
59
59
  disposables.forEach((dispose) => dispose());
60
- (_a = drauuInstance.value) == null ? undefined : _a.unmount();
60
+ (_a = drauuInstance.value) == null ? void 0 : _a.unmount();
61
61
  };
62
62
  const syncStatus = () => {
63
63
  if (drauuInstance.value) {
@@ -1 +1 @@
1
- (function(E,t,k,H,a){"use strict";function V(p,r){const n=a.ref();let l=[];const s=t.createEventHook(),d=t.createEventHook(),c=t.createEventHook(),f=t.createEventHook(),i=t.createEventHook(),v=a.ref(!1),h=a.ref(!1),S=a.ref(!1),_=a.ref(!1),u=a.ref({color:"black",size:3,arrowEnd:!1,cornerRadius:0,dasharray:void 0,fill:"transparent",mode:"draw",...r?.brush});a.watch(u,()=>{const e=n.value;e&&(e.brush=u.value,e.mode=u.value.mode)},{deep:!0});const C=()=>{var e;return(e=n.value)==null?void 0:e.undo()},U=()=>{var e;return(e=n.value)==null?void 0:e.redo()},b=()=>{var e;return(e=n.value)==null?void 0:e.clear()},D=()=>{var e;return(e=n.value)==null?void 0:e.cancel()},w=e=>{var o;return(o=n.value)==null?void 0:o.load(e)},y=()=>{var e;return(e=n.value)==null?void 0:e.dump()},m=()=>{var e;l.forEach(o=>o()),(e=n.value)==null||e.unmount()},g=()=>{n.value&&(v.value=n.value.canUndo(),h.value=n.value.canRedo(),S.value=n.value.altPressed,_.value=n.value.shiftPressed)};return a.watch(()=>t.unrefElement(p),e=>{!e||typeof SVGSVGElement>"u"||!(e instanceof SVGSVGElement)||(n.value&&m(),n.value=H.createDrauu({el:e,...r}),g(),l=[n.value.on("canceled",()=>d.trigger()),n.value.on("committed",o=>c.trigger(o)),n.value.on("start",()=>f.trigger()),n.value.on("end",()=>i.trigger()),n.value.on("changed",()=>{g(),s.trigger()})])},{flush:"post"}),k.tryOnScopeDispose(()=>m()),{drauuInstance:n,load:w,dump:y,clear:b,cancel:D,undo:C,redo:U,canUndo:v,canRedo:h,brush:u,onChanged:s.on,onCommitted:c.on,onStart:f.on,onEnd:i.on,onCanceled:d.on}}E.useDrauu=V})(this.VueUse=this.VueUse||{},VueUse,VueUse,Drauu,Vue);
1
+ (function(E,o,k,H,a){"use strict";function V(p,u){const n=a.ref();let l=[];const s=o.createEventHook(),c=o.createEventHook(),d=o.createEventHook(),v=o.createEventHook(),i=o.createEventHook(),f=a.ref(!1),h=a.ref(!1),S=a.ref(!1),_=a.ref(!1),r=a.ref({color:"black",size:3,arrowEnd:!1,cornerRadius:0,dasharray:void 0,fill:"transparent",mode:"draw",...u?.brush});a.watch(r,()=>{const e=n.value;e&&(e.brush=r.value,e.mode=r.value.mode)},{deep:!0});const C=()=>{var e;return(e=n.value)==null?void 0:e.undo()},U=()=>{var e;return(e=n.value)==null?void 0:e.redo()},b=()=>{var e;return(e=n.value)==null?void 0:e.clear()},D=()=>{var e;return(e=n.value)==null?void 0:e.cancel()},w=e=>{var t;return(t=n.value)==null?void 0:t.load(e)},y=()=>{var e;return(e=n.value)==null?void 0:e.dump()},m=()=>{var e;l.forEach(t=>t()),(e=n.value)==null||e.unmount()},g=()=>{n.value&&(f.value=n.value.canUndo(),h.value=n.value.canRedo(),S.value=n.value.altPressed,_.value=n.value.shiftPressed)};return a.watch(()=>o.unrefElement(p),e=>{!e||typeof SVGSVGElement>"u"||!(e instanceof SVGSVGElement)||(n.value&&m(),n.value=H.createDrauu({el:e,...u}),g(),l=[n.value.on("canceled",()=>c.trigger()),n.value.on("committed",t=>d.trigger(t)),n.value.on("start",()=>v.trigger()),n.value.on("end",()=>i.trigger()),n.value.on("changed",()=>{g(),s.trigger()})])},{flush:"post"}),k.tryOnScopeDispose(()=>m()),{drauuInstance:n,load:w,dump:y,clear:b,cancel:D,undo:C,redo:U,canUndo:f,canRedo:h,brush:r,onChanged:s.on,onCommitted:d.on,onStart:v.on,onEnd:i.on,onCanceled:c.on}}E.useDrauu=V})(this.VueUse=this.VueUse||{},VueUse,VueUse,Drauu,Vue);
package/useDrauu.mjs CHANGED
@@ -20,10 +20,10 @@ function useDrauu(target, options) {
20
20
  size: 3,
21
21
  arrowEnd: false,
22
22
  cornerRadius: 0,
23
- dasharray: undefined,
23
+ dasharray: void 0,
24
24
  fill: "transparent",
25
25
  mode: "draw",
26
- ...options == null ? undefined : options.brush
26
+ ...options == null ? void 0 : options.brush
27
27
  });
28
28
  watch(brush, () => {
29
29
  const instance = drauuInstance.value;
@@ -34,32 +34,32 @@ function useDrauu(target, options) {
34
34
  }, { deep: true });
35
35
  const undo = () => {
36
36
  var _a;
37
- return (_a = drauuInstance.value) == null ? undefined : _a.undo();
37
+ return (_a = drauuInstance.value) == null ? void 0 : _a.undo();
38
38
  };
39
39
  const redo = () => {
40
40
  var _a;
41
- return (_a = drauuInstance.value) == null ? undefined : _a.redo();
41
+ return (_a = drauuInstance.value) == null ? void 0 : _a.redo();
42
42
  };
43
43
  const clear = () => {
44
44
  var _a;
45
- return (_a = drauuInstance.value) == null ? undefined : _a.clear();
45
+ return (_a = drauuInstance.value) == null ? void 0 : _a.clear();
46
46
  };
47
47
  const cancel = () => {
48
48
  var _a;
49
- return (_a = drauuInstance.value) == null ? undefined : _a.cancel();
49
+ return (_a = drauuInstance.value) == null ? void 0 : _a.cancel();
50
50
  };
51
51
  const load = (svg) => {
52
52
  var _a;
53
- return (_a = drauuInstance.value) == null ? undefined : _a.load(svg);
53
+ return (_a = drauuInstance.value) == null ? void 0 : _a.load(svg);
54
54
  };
55
55
  const dump = () => {
56
56
  var _a;
57
- return (_a = drauuInstance.value) == null ? undefined : _a.dump();
57
+ return (_a = drauuInstance.value) == null ? void 0 : _a.dump();
58
58
  };
59
59
  const cleanup = () => {
60
60
  var _a;
61
61
  disposables.forEach((dispose) => dispose());
62
- (_a = drauuInstance.value) == null ? undefined : _a.unmount();
62
+ (_a = drauuInstance.value) == null ? void 0 : _a.unmount();
63
63
  };
64
64
  const syncStatus = () => {
65
65
  if (drauuInstance.value) {
package/useFuse.cjs CHANGED
@@ -8,14 +8,14 @@ function useFuse(search, data, options) {
8
8
  var _a, _b;
9
9
  return new Fuse(
10
10
  (_a = vue.toValue(data)) != null ? _a : [],
11
- (_b = vue.toValue(options)) == null ? undefined : _b.fuseOptions
11
+ (_b = vue.toValue(options)) == null ? void 0 : _b.fuseOptions
12
12
  );
13
13
  };
14
14
  const fuse = vue.ref(createFuse());
15
15
  vue.watch(
16
16
  () => {
17
17
  var _a;
18
- return (_a = vue.toValue(options)) == null ? undefined : _a.fuseOptions;
18
+ return (_a = vue.toValue(options)) == null ? void 0 : _a.fuseOptions;
19
19
  },
20
20
  () => {
21
21
  fuse.value = createFuse();
@@ -31,10 +31,10 @@ function useFuse(search, data, options) {
31
31
  );
32
32
  const results = vue.computed(() => {
33
33
  const resolved = vue.toValue(options);
34
- if ((resolved == null ? undefined : resolved.matchAllWhenSearchEmpty) && !vue.toValue(search))
34
+ if ((resolved == null ? void 0 : resolved.matchAllWhenSearchEmpty) && !vue.toValue(search))
35
35
  return vue.toValue(data).map((item, index) => ({ item, refIndex: index }));
36
- const limit = resolved == null ? undefined : resolved.resultLimit;
37
- return fuse.value.search(vue.toValue(search), limit ? { limit } : undefined);
36
+ const limit = resolved == null ? void 0 : resolved.resultLimit;
37
+ return fuse.value.search(vue.toValue(search), limit ? { limit } : void 0);
38
38
  });
39
39
  return {
40
40
  fuse,
package/useFuse.iife.js CHANGED
@@ -6,14 +6,14 @@
6
6
  var _a, _b;
7
7
  return new Fuse(
8
8
  (_a = vue.toValue(data)) != null ? _a : [],
9
- (_b = vue.toValue(options)) == null ? undefined : _b.fuseOptions
9
+ (_b = vue.toValue(options)) == null ? void 0 : _b.fuseOptions
10
10
  );
11
11
  };
12
12
  const fuse = vue.ref(createFuse());
13
13
  vue.watch(
14
14
  () => {
15
15
  var _a;
16
- return (_a = vue.toValue(options)) == null ? undefined : _a.fuseOptions;
16
+ return (_a = vue.toValue(options)) == null ? void 0 : _a.fuseOptions;
17
17
  },
18
18
  () => {
19
19
  fuse.value = createFuse();
@@ -29,10 +29,10 @@
29
29
  );
30
30
  const results = vue.computed(() => {
31
31
  const resolved = vue.toValue(options);
32
- if ((resolved == null ? undefined : resolved.matchAllWhenSearchEmpty) && !vue.toValue(search))
32
+ if ((resolved == null ? void 0 : resolved.matchAllWhenSearchEmpty) && !vue.toValue(search))
33
33
  return vue.toValue(data).map((item, index) => ({ item, refIndex: index }));
34
- const limit = resolved == null ? undefined : resolved.resultLimit;
35
- return fuse.value.search(vue.toValue(search), limit ? { limit } : undefined);
34
+ const limit = resolved == null ? void 0 : resolved.resultLimit;
35
+ return fuse.value.search(vue.toValue(search), limit ? { limit } : void 0);
36
36
  });
37
37
  return {
38
38
  fuse,
@@ -1 +1 @@
1
- (function(o,i,e){"use strict";function c(r,l,s){const a=()=>{var t,u;return new i((t=e.toValue(l))!=null?t:[],(u=e.toValue(s))==null?void 0:u.fuseOptions)},n=e.ref(a());e.watch(()=>{var t;return(t=e.toValue(s))==null?void 0:t.fuseOptions},()=>{n.value=a()},{deep:!0}),e.watch(()=>e.toValue(l),t=>{n.value.setCollection(t)},{deep:!0});const d=e.computed(()=>{const t=e.toValue(s);if(t?.matchAllWhenSearchEmpty&&!e.toValue(r))return e.toValue(l).map((f,V)=>({item:f,refIndex:V}));const u=t?.resultLimit;return n.value.search(e.toValue(r),u?{limit:u}:void 0)});return{fuse:n,results:d}}o.useFuse=c})(this.VueUse=this.VueUse||{},Fuse,Vue);
1
+ (function(a,i,e){"use strict";function c(o,s,n){const r=()=>{var t,u;return new i((t=e.toValue(s))!=null?t:[],(u=e.toValue(n))==null?void 0:u.fuseOptions)},l=e.ref(r());e.watch(()=>{var t;return(t=e.toValue(n))==null?void 0:t.fuseOptions},()=>{l.value=r()},{deep:!0}),e.watch(()=>e.toValue(s),t=>{l.value.setCollection(t)},{deep:!0});const V=e.computed(()=>{const t=e.toValue(n);if(t?.matchAllWhenSearchEmpty&&!e.toValue(o))return e.toValue(s).map((d,f)=>({item:d,refIndex:f}));const u=t?.resultLimit;return l.value.search(e.toValue(o),u?{limit:u}:void 0)});return{fuse:l,results:V}}a.useFuse=c})(this.VueUse=this.VueUse||{},Fuse,Vue);
package/useFuse.mjs CHANGED
@@ -6,14 +6,14 @@ function useFuse(search, data, options) {
6
6
  var _a, _b;
7
7
  return new Fuse(
8
8
  (_a = toValue(data)) != null ? _a : [],
9
- (_b = toValue(options)) == null ? undefined : _b.fuseOptions
9
+ (_b = toValue(options)) == null ? void 0 : _b.fuseOptions
10
10
  );
11
11
  };
12
12
  const fuse = ref(createFuse());
13
13
  watch(
14
14
  () => {
15
15
  var _a;
16
- return (_a = toValue(options)) == null ? undefined : _a.fuseOptions;
16
+ return (_a = toValue(options)) == null ? void 0 : _a.fuseOptions;
17
17
  },
18
18
  () => {
19
19
  fuse.value = createFuse();
@@ -29,10 +29,10 @@ function useFuse(search, data, options) {
29
29
  );
30
30
  const results = computed(() => {
31
31
  const resolved = toValue(options);
32
- if ((resolved == null ? undefined : resolved.matchAllWhenSearchEmpty) && !toValue(search))
32
+ if ((resolved == null ? void 0 : resolved.matchAllWhenSearchEmpty) && !toValue(search))
33
33
  return toValue(data).map((item, index) => ({ item, refIndex: index }));
34
- const limit = resolved == null ? undefined : resolved.resultLimit;
35
- return fuse.value.search(toValue(search), limit ? { limit } : undefined);
34
+ const limit = resolved == null ? void 0 : resolved.resultLimit;
35
+ return fuse.value.search(toValue(search), limit ? { limit } : void 0);
36
36
  });
37
37
  return {
38
38
  fuse,
package/useJwt.cjs CHANGED
@@ -12,7 +12,7 @@ function useJwt(encodedJwt, options = {}) {
12
12
  try {
13
13
  return jwtDecode.jwtDecode(encodedJwt2, options2);
14
14
  } catch (err) {
15
- onError == null ? undefined : onError(err);
15
+ onError == null ? void 0 : onError(err);
16
16
  return fallbackValue;
17
17
  }
18
18
  };
package/useJwt.iife.js CHANGED
@@ -10,7 +10,7 @@
10
10
  try {
11
11
  return jwtDecode.jwtDecode(encodedJwt2, options2);
12
12
  } catch (err) {
13
- onError == null ? undefined : onError(err);
13
+ onError == null ? void 0 : onError(err);
14
14
  return fallbackValue;
15
15
  }
16
16
  };
@@ -1 +1 @@
1
- (function(c,n,e){"use strict";function o(t,a={}){const{onError:u,fallbackValue:l=null}=a,r=(i,h)=>{try{return n.jwtDecode(i,h)}catch(V){return u?.(V),l}},s=e.computed(()=>r(e.toValue(t),{header:!0})),d=e.computed(()=>r(e.toValue(t)));return{header:s,payload:d}}c.useJwt=o})(this.VueUse=this.VueUse||{},jwt_decode,Vue);
1
+ (function(u,c,t){"use strict";function n(e,a={}){const{onError:o,fallbackValue:l=null}=a,r=(i,h)=>{try{return c.jwtDecode(i,h)}catch(V){return o?.(V),l}},s=t.computed(()=>r(t.toValue(e),{header:!0})),d=t.computed(()=>r(t.toValue(e)));return{header:s,payload:d}}u.useJwt=n})(this.VueUse=this.VueUse||{},jwt_decode,Vue);
package/useJwt.mjs CHANGED
@@ -10,7 +10,7 @@ function useJwt(encodedJwt, options = {}) {
10
10
  try {
11
11
  return jwtDecode(encodedJwt2, options2);
12
12
  } catch (err) {
13
- onError == null ? undefined : onError(err);
13
+ onError == null ? void 0 : onError(err);
14
14
  return fallbackValue;
15
15
  }
16
16
  };
@@ -14,16 +14,16 @@ function useSortable(el, list, options = {}) {
14
14
  };
15
15
  const start = () => {
16
16
  const target = typeof el === "string" ? document?.querySelector(el) : core.unrefElement(el);
17
- if (!target || sortable !== undefined)
17
+ if (!target || sortable !== void 0)
18
18
  return;
19
19
  sortable = new Sortable(target, { ...defaultOptions, ...resetOptions });
20
20
  };
21
21
  const stop = () => {
22
22
  sortable?.destroy();
23
- sortable = undefined;
23
+ sortable = void 0;
24
24
  };
25
25
  const option = (name, value) => {
26
- if (value !== undefined)
26
+ if (value !== void 0)
27
27
  sortable?.option(name, value);
28
28
  else
29
29
  return sortable?.option(name);
@@ -1,4 +1,4 @@
1
- import { tryOnMounted, tryOnScopeDispose, unrefElement, defaultDocument, useVModel } from '@vueuse/core';
1
+ import { defaultDocument, tryOnMounted, tryOnScopeDispose, unrefElement, useVModel } from '@vueuse/core';
2
2
  import { isRef, toValue, nextTick, defineComponent, ref, reactive, h } from 'vue';
3
3
  import Sortable from 'sortablejs';
4
4
 
@@ -12,16 +12,16 @@ function useSortable(el, list, options = {}) {
12
12
  };
13
13
  const start = () => {
14
14
  const target = typeof el === "string" ? document?.querySelector(el) : unrefElement(el);
15
- if (!target || sortable !== undefined)
15
+ if (!target || sortable !== void 0)
16
16
  return;
17
17
  sortable = new Sortable(target, { ...defaultOptions, ...resetOptions });
18
18
  };
19
19
  const stop = () => {
20
20
  sortable?.destroy();
21
- sortable = undefined;
21
+ sortable = void 0;
22
22
  };
23
23
  const option = (name, value) => {
24
- if (value !== undefined)
24
+ if (value !== void 0)
25
25
  sortable?.option(name, value);
26
26
  else
27
27
  return sortable?.option(name);
package/useSortable.cjs CHANGED
@@ -13,20 +13,20 @@ function useSortable(el, list, options = {}) {
13
13
  }
14
14
  };
15
15
  const start = () => {
16
- const target = typeof el === "string" ? document == null ? undefined : document.querySelector(el) : core.unrefElement(el);
17
- if (!target || sortable !== undefined)
16
+ const target = typeof el === "string" ? document == null ? void 0 : document.querySelector(el) : core.unrefElement(el);
17
+ if (!target || sortable !== void 0)
18
18
  return;
19
19
  sortable = new Sortable(target, { ...defaultOptions, ...resetOptions });
20
20
  };
21
21
  const stop = () => {
22
- sortable == null ? undefined : sortable.destroy();
23
- sortable = undefined;
22
+ sortable == null ? void 0 : sortable.destroy();
23
+ sortable = void 0;
24
24
  };
25
25
  const option = (name, value) => {
26
- if (value !== undefined)
27
- sortable == null ? undefined : sortable.option(name, value);
26
+ if (value !== void 0)
27
+ sortable == null ? void 0 : sortable.option(name, value);
28
28
  else
29
- return sortable == null ? undefined : sortable.option(name);
29
+ return sortable == null ? void 0 : sortable.option(name);
30
30
  };
31
31
  core.tryOnMounted(start);
32
32
  core.tryOnScopeDispose(stop);
@@ -10,20 +10,20 @@
10
10
  }
11
11
  };
12
12
  const start = () => {
13
- const target = typeof el === "string" ? document == null ? undefined : document.querySelector(el) : core.unrefElement(el);
14
- if (!target || sortable !== undefined)
13
+ const target = typeof el === "string" ? document == null ? void 0 : document.querySelector(el) : core.unrefElement(el);
14
+ if (!target || sortable !== void 0)
15
15
  return;
16
16
  sortable = new Sortable(target, { ...defaultOptions, ...resetOptions });
17
17
  };
18
18
  const stop = () => {
19
- sortable == null ? undefined : sortable.destroy();
20
- sortable = undefined;
19
+ sortable == null ? void 0 : sortable.destroy();
20
+ sortable = void 0;
21
21
  };
22
22
  const option = (name, value) => {
23
- if (value !== undefined)
24
- sortable == null ? undefined : sortable.option(name, value);
23
+ if (value !== void 0)
24
+ sortable == null ? void 0 : sortable.option(name, value);
25
25
  else
26
- return sortable == null ? undefined : sortable.option(name);
26
+ return sortable == null ? void 0 : sortable.option(name);
27
27
  };
28
28
  core.tryOnMounted(start);
29
29
  core.tryOnScopeDispose(stop);
@@ -1 +1 @@
1
- (function(s,d,V,l){"use strict";function h(n,i,o={}){let e;const{document:r=d.defaultDocument,...u}=o,f={onUpdate:t=>{m(i,t.oldIndex,t.newIndex,t)}},p=()=>{const t=typeof n=="string"?r?.querySelector(n):d.unrefElement(n);!t||e!==void 0||(e=new V(t,{...f,...u}))},y=()=>{e?.destroy(),e=void 0},S=(t,N)=>{if(N!==void 0)e?.option(t,N);else return e?.option(t)};return d.tryOnMounted(p),d.tryOnScopeDispose(y),{stop:y,start:p,option:S}}function c(n,i,o){const e=n.children[o];n.insertBefore(i,e)}function a(n){n.parentNode&&n.parentNode.removeChild(n)}function m(n,i,o,e=null){e!=null&&(a(e.item),c(e.from,e.item,i));const r=l.isRef(n),u=r?[...l.toValue(n)]:l.toValue(n);if(o>=0&&o<u.length){const f=u.splice(i,1)[0];l.nextTick(()=>{u.splice(o,0,f),r&&(n.value=u)})}}s.insertNodeAt=c,s.moveArrayElement=m,s.removeNode=a,s.useSortable=h})(this.VueUse=this.VueUse||{},VueUse,Sortable,Vue);
1
+ (function(l,u,N,d){"use strict";function V(t,i,o={}){let e;const{document:s=u.defaultDocument,...r}=o,c={onUpdate:n=>{m(i,n.oldIndex,n.newIndex,n)}},p=()=>{const n=typeof t=="string"?s?.querySelector(t):u.unrefElement(t);!n||e!==void 0||(e=new N(n,{...c,...r}))},v=()=>{e?.destroy(),e=void 0},h=(n,y)=>{if(y!==void 0)e?.option(n,y);else return e?.option(n)};return u.tryOnMounted(p),u.tryOnScopeDispose(v),{stop:v,start:p,option:h}}function f(t,i,o){const e=t.children[o];t.insertBefore(i,e)}function a(t){t.parentNode&&t.parentNode.removeChild(t)}function m(t,i,o,e=null){e!=null&&(a(e.item),f(e.from,e.item,i));const s=d.isRef(t),r=s?[...d.toValue(t)]:d.toValue(t);if(o>=0&&o<r.length){const c=r.splice(i,1)[0];d.nextTick(()=>{r.splice(o,0,c),s&&(t.value=r)})}}l.insertNodeAt=f,l.moveArrayElement=m,l.removeNode=a,l.useSortable=V})(this.VueUse=this.VueUse||{},VueUse,Sortable,Vue);
package/useSortable.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { tryOnMounted, tryOnScopeDispose, unrefElement, defaultDocument } from '@vueuse/core';
1
+ import { defaultDocument, tryOnMounted, tryOnScopeDispose, unrefElement } from '@vueuse/core';
2
2
  import Sortable from 'sortablejs';
3
3
  import { isRef, toValue, nextTick } from 'vue';
4
4
 
@@ -11,20 +11,20 @@ function useSortable(el, list, options = {}) {
11
11
  }
12
12
  };
13
13
  const start = () => {
14
- const target = typeof el === "string" ? document == null ? undefined : document.querySelector(el) : unrefElement(el);
15
- if (!target || sortable !== undefined)
14
+ const target = typeof el === "string" ? document == null ? void 0 : document.querySelector(el) : unrefElement(el);
15
+ if (!target || sortable !== void 0)
16
16
  return;
17
17
  sortable = new Sortable(target, { ...defaultOptions, ...resetOptions });
18
18
  };
19
19
  const stop = () => {
20
- sortable == null ? undefined : sortable.destroy();
21
- sortable = undefined;
20
+ sortable == null ? void 0 : sortable.destroy();
21
+ sortable = void 0;
22
22
  };
23
23
  const option = (name, value) => {
24
- if (value !== undefined)
25
- sortable == null ? undefined : sortable.option(name, value);
24
+ if (value !== void 0)
25
+ sortable == null ? void 0 : sortable.option(name, value);
26
26
  else
27
- return sortable == null ? undefined : sortable.option(name);
27
+ return sortable == null ? void 0 : sortable.option(name);
28
28
  };
29
29
  tryOnMounted(start);
30
30
  tryOnScopeDispose(stop);