@citruslime/vue-utils 1.2.2-beta.0 → 1.3.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,99 +1,107 @@
1
- import { replacePlaceholders as Z } from "@citruslime/utils";
2
- import { computed as ce, ref as D, readonly as ye, unref as he, getCurrentScope as me, onScopeDispose as Oe, watch as G, isRef as fe, shallowRef as L, reactive as ve, toRefs as we } from "vue";
3
- const Je = [
1
+ import { replacePlaceholders as Y } from "@citruslime/utils";
2
+ import { toRef as se, readonly as re, customRef as le, ref as $, getCurrentScope as ce, onScopeDispose as fe, unref as de, watch as I, isRef as oe, shallowRef as q, computed as pe, reactive as he, toRefs as me } from "vue";
3
+ const He = [
4
4
  "GET",
5
5
  "POST",
6
6
  "PUT",
7
7
  "DELETE"
8
8
  ];
9
- function Me(e, t, n = null, s = null) {
9
+ function $e(e, t, n = null, s = null) {
10
10
  return {
11
11
  url: e,
12
12
  type: t,
13
- headers: n ?? de,
14
- hasBody: ge(t, s)
13
+ headers: n ?? ae,
14
+ hasBody: ye(t, s)
15
15
  };
16
16
  }
17
- function de() {
17
+ function ae() {
18
18
  return {
19
19
  accept: "application/json",
20
20
  "content-type": "application/json"
21
21
  };
22
22
  }
23
- function ge(e, t) {
23
+ function ye(e, t) {
24
24
  return !!(t === null && (e === "PUT" || e === "POST") || t);
25
25
  }
26
- var ee;
27
- const z = typeof window < "u";
28
- z && ((ee = window == null ? void 0 : window.navigator) != null && ee.userAgent) && /iP(ad|hone|od)/.test(window.navigator.userAgent);
29
- function E(e) {
30
- return typeof e == "function" ? e() : he(e);
31
- }
32
- function te(e, t = !1, n = "Timeout") {
33
- return new Promise((s, a) => {
34
- setTimeout(t ? () => a(n) : s, e);
35
- });
36
- }
37
- function be(e) {
38
- return e;
39
- }
40
- function Pe(e, ...t) {
41
- return t.some((n) => n in e);
42
- }
43
- function pe(e) {
44
- return me() ? (Oe(e), !0) : !1;
26
+ function ie(e) {
27
+ return ce() ? (fe(e), !0) : !1;
45
28
  }
46
- function W() {
47
- const e = [], t = (a) => {
48
- const r = e.indexOf(a);
49
- r !== -1 && e.splice(r, 1);
29
+ function L() {
30
+ const e = /* @__PURE__ */ new Set(), t = (a) => {
31
+ e.delete(a);
50
32
  };
51
33
  return {
52
34
  on: (a) => {
53
- e.push(a);
35
+ e.add(a);
54
36
  const r = () => t(a);
55
- return pe(r), {
37
+ return ie(r), {
56
38
  off: r
57
39
  };
58
40
  },
59
41
  off: t,
60
- trigger: (a) => {
61
- e.forEach((r) => r(a));
62
- }
42
+ trigger: (a) => Promise.all(Array.from(e).map((r) => r(a)))
63
43
  };
64
44
  }
65
- function V(e) {
66
- return typeof e == "function" ? ce(e) : D(e);
45
+ function O(e) {
46
+ return typeof e == "function" ? e() : de(e);
67
47
  }
68
- function q(e, t = !1) {
69
- function n(i, { flush: u = "sync", deep: h = !1, timeout: d, throwOnTimeout: F } = {}) {
70
- let p = null;
71
- const N = [new Promise((I) => {
72
- p = G(e, (j) => {
73
- i(j) !== t && (p == null || p(), I(j));
74
- }, {
75
- flush: u,
76
- deep: h,
77
- immediate: !0
78
- });
48
+ const ue = typeof window < "u", ve = () => {
49
+ };
50
+ function Z(e, t = !1, n = "Timeout") {
51
+ return new Promise((s, a) => {
52
+ setTimeout(t ? () => a(n) : s, e);
53
+ });
54
+ }
55
+ function we(e, ...t) {
56
+ return t.some((n) => n in e);
57
+ }
58
+ function R(...e) {
59
+ if (e.length !== 1)
60
+ return se(...e);
61
+ const t = e[0];
62
+ return typeof t == "function" ? re(le(() => ({ get: t, set: ve }))) : $(t);
63
+ }
64
+ function k(e, t = !1) {
65
+ function n(i, { flush: u = "sync", deep: h = !1, timeout: p, throwOnTimeout: F } = {}) {
66
+ let y = null;
67
+ const D = [new Promise((E) => {
68
+ y = I(
69
+ e,
70
+ (_) => {
71
+ i(_) !== t && (y == null || y(), E(_));
72
+ },
73
+ {
74
+ flush: u,
75
+ deep: h,
76
+ immediate: !0
77
+ }
78
+ );
79
79
  })];
80
- return d != null && N.push(te(d, F).then(() => E(e)).finally(() => p == null ? void 0 : p())), Promise.race(N);
80
+ return p != null && D.push(
81
+ Z(p, F).then(() => O(e)).finally(() => y == null ? void 0 : y())
82
+ ), Promise.race(D);
81
83
  }
82
84
  function s(i, u) {
83
- if (!fe(i))
84
- return n((j) => j === i, u);
85
- const { flush: h = "sync", deep: d = !1, timeout: F, throwOnTimeout: p } = u ?? {};
86
- let v = null;
87
- const I = [new Promise((j) => {
88
- v = G([e, i], ([P, S]) => {
89
- t !== (P === S) && (v == null || v(), j(P));
90
- }, {
91
- flush: h,
92
- deep: d,
93
- immediate: !0
94
- });
85
+ if (!oe(i))
86
+ return n((_) => _ === i, u);
87
+ const { flush: h = "sync", deep: p = !1, timeout: F, throwOnTimeout: y } = u ?? {};
88
+ let w = null;
89
+ const E = [new Promise((_) => {
90
+ w = I(
91
+ [e, i],
92
+ ([j, S]) => {
93
+ t !== (j === S) && (w == null || w(), _(j));
94
+ },
95
+ {
96
+ flush: h,
97
+ deep: p,
98
+ immediate: !0
99
+ }
100
+ );
95
101
  })];
96
- return F != null && I.push(te(F, p).then(() => E(e)).finally(() => (v == null || v(), E(e)))), Promise.race(I);
102
+ return F != null && E.push(
103
+ Z(F, y).then(() => O(e)).finally(() => (w == null || w(), O(e)))
104
+ ), Promise.race(E);
97
105
  }
98
106
  function a(i) {
99
107
  return n((u) => !!u, i);
@@ -104,90 +112,89 @@ function q(e, t = !1) {
104
112
  function o(i) {
105
113
  return s(void 0, i);
106
114
  }
107
- function g(i) {
115
+ function b(i) {
108
116
  return n(Number.isNaN, i);
109
117
  }
110
- function y(i, u) {
118
+ function d(i, u) {
111
119
  return n((h) => {
112
- const d = Array.from(h);
113
- return d.includes(i) || d.includes(E(i));
120
+ const p = Array.from(h);
121
+ return p.includes(i) || p.includes(O(i));
114
122
  }, u);
115
123
  }
116
- function O(i) {
117
- return b(1, i);
124
+ function v(i) {
125
+ return g(1, i);
118
126
  }
119
- function b(i = 1, u) {
127
+ function g(i = 1, u) {
120
128
  let h = -1;
121
129
  return n(() => (h += 1, h >= i), u);
122
130
  }
123
- return Array.isArray(E(e)) ? {
131
+ return Array.isArray(O(e)) ? {
124
132
  toMatch: n,
125
- toContains: y,
126
- changed: O,
127
- changedTimes: b,
133
+ toContains: d,
134
+ changed: v,
135
+ changedTimes: g,
128
136
  get not() {
129
- return q(e, !t);
137
+ return k(e, !t);
130
138
  }
131
139
  } : {
132
140
  toMatch: n,
133
141
  toBe: s,
134
142
  toBeTruthy: a,
135
143
  toBeNull: r,
136
- toBeNaN: g,
144
+ toBeNaN: b,
137
145
  toBeUndefined: o,
138
- changed: O,
139
- changedTimes: b,
146
+ changed: v,
147
+ changedTimes: g,
140
148
  get not() {
141
- return q(e, !t);
149
+ return k(e, !t);
142
150
  }
143
151
  };
144
152
  }
145
- function Te(e) {
146
- return q(e);
153
+ function Pe(e) {
154
+ return k(e);
147
155
  }
148
- function _e(e, t, n = {}) {
156
+ function be(e, t, n = {}) {
149
157
  const {
150
158
  immediate: s = !0
151
- } = n, a = D(!1);
159
+ } = n, a = $(!1);
152
160
  let r = null;
153
161
  function o() {
154
162
  r && (clearTimeout(r), r = null);
155
163
  }
156
- function g() {
164
+ function b() {
157
165
  a.value = !1, o();
158
166
  }
159
- function y(...O) {
167
+ function d(...v) {
160
168
  o(), a.value = !0, r = setTimeout(() => {
161
- a.value = !1, r = null, e(...O);
162
- }, E(t));
169
+ a.value = !1, r = null, e(...v);
170
+ }, O(t));
163
171
  }
164
- return s && (a.value = !0, z && y()), pe(g), {
165
- isPending: ye(a),
166
- start: y,
167
- stop: g
172
+ return s && (a.value = !0, ue && d()), ie(b), {
173
+ isPending: re(a),
174
+ start: d,
175
+ stop: b
168
176
  };
169
177
  }
170
- const Ee = z ? window : void 0, ne = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, re = "__vueuse_ssr_handlers__";
171
- ne[re] = ne[re] || {};
172
- var Fe = Object.defineProperty, Ie = Object.defineProperties, je = Object.getOwnPropertyDescriptors, oe = Object.getOwnPropertySymbols, Ne = Object.prototype.hasOwnProperty, Se = Object.prototype.propertyIsEnumerable, ae = (e, t, n) => t in e ? Fe(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, f = (e, t) => {
178
+ const ge = ue ? window : void 0;
179
+ var Te = Object.defineProperty, Oe = Object.defineProperties, Fe = Object.getOwnPropertyDescriptors, ee = Object.getOwnPropertySymbols, Ee = Object.prototype.hasOwnProperty, _e = Object.prototype.propertyIsEnumerable, te = (e, t, n) => t in e ? Te(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, f = (e, t) => {
173
180
  for (var n in t || (t = {}))
174
- Ne.call(t, n) && ae(e, n, t[n]);
175
- if (oe)
176
- for (var n of oe(t))
177
- Se.call(t, n) && ae(e, n, t[n]);
181
+ Ee.call(t, n) && te(e, n, t[n]);
182
+ if (ee)
183
+ for (var n of ee(t))
184
+ _e.call(t, n) && te(e, n, t[n]);
178
185
  return e;
179
- }, H = (e, t) => Ie(e, je(t));
180
- const Be = {
186
+ }, N = (e, t) => Oe(e, Fe(t));
187
+ const je = {
181
188
  json: "application/json",
182
189
  text: "text/plain"
183
190
  };
184
- function ie(e) {
185
- return e && Pe(e, "immediate", "refetch", "initialData", "timeout", "beforeFetch", "afterFetch", "onFetchError", "fetch");
191
+ function ne(e) {
192
+ return e && we(e, "immediate", "refetch", "initialData", "timeout", "beforeFetch", "afterFetch", "onFetchError", "fetch");
186
193
  }
187
- function k(e) {
194
+ function W(e) {
188
195
  return typeof Headers < "u" && e instanceof Headers ? Object.fromEntries([...e.entries()]) : e;
189
196
  }
190
- function Ce(e, ...t) {
197
+ function De(e, ...t) {
191
198
  var n;
192
199
  const s = typeof AbortController == "function";
193
200
  let a = {}, r = { immediate: !0, refetch: !1, timeout: 0 };
@@ -196,191 +203,163 @@ function Ce(e, ...t) {
196
203
  type: "text",
197
204
  payload: void 0
198
205
  };
199
- t.length > 0 && (ie(t[0]) ? r = f(f({}, r), t[0]) : a = t[0]), t.length > 1 && ie(t[1]) && (r = f(f({}, r), t[1]));
206
+ t.length > 0 && (ne(t[0]) ? r = f(f({}, r), t[0]) : a = t[0]), t.length > 1 && ne(t[1]) && (r = f(f({}, r), t[1]));
200
207
  const {
201
- fetch: g = (n = Ee) == null ? void 0 : n.fetch,
202
- initialData: y,
203
- timeout: O
204
- } = r, b = W(), i = W(), u = W(), h = D(!1), d = D(!1), F = D(!1), p = D(null), v = L(null), N = L(null), I = L(y), j = ce(() => s && d.value);
205
- let P, S;
206
- const J = () => {
207
- s && P && (P.abort(), P = void 0);
208
- }, M = (l) => {
209
- d.value = l, h.value = !l;
210
- };
211
- O && (S = _e(J, O, { immediate: !1 }));
212
- const $ = async (l = !1) => {
213
- var w;
214
- M(!0), N.value = null, p.value = null, F.value = !1, s && (J(), P = new AbortController(), P.signal.onabort = () => F.value = !0, a = H(f({}, a), {
215
- signal: P.signal
208
+ fetch: b = (n = ge) == null ? void 0 : n.fetch,
209
+ initialData: d,
210
+ timeout: v
211
+ } = r, g = L(), i = L(), u = L(), h = $(!1), p = $(!1), F = $(!1), y = $(null), w = q(null), D = q(null), E = q(d || null), _ = pe(() => s && p.value);
212
+ let j, S;
213
+ const M = () => {
214
+ s && (j == null || j.abort(), j = new AbortController(), j.signal.onabort = () => F.value = !0, a = N(f({}, a), {
215
+ signal: j.signal
216
216
  }));
217
+ }, K = (l) => {
218
+ p.value = l, h.value = !l;
219
+ };
220
+ v && (S = be(M, v, { immediate: !1 }));
221
+ const U = async (l = !1) => {
222
+ var P;
223
+ M(), K(!0), D.value = null, y.value = null, F.value = !1;
217
224
  const m = {
218
225
  method: o.method,
219
226
  headers: {}
220
227
  };
221
228
  if (o.payload) {
222
- const Q = k(m.headers);
223
- o.payloadType && (Q["Content-Type"] = (w = Be[o.payloadType]) != null ? w : o.payloadType);
224
- const U = E(o.payload);
225
- m.body = o.payloadType === "json" ? JSON.stringify(U) : U;
229
+ const J = W(m.headers);
230
+ o.payloadType && (J["Content-Type"] = (P = je[o.payloadType]) != null ? P : o.payloadType);
231
+ const G = O(o.payload);
232
+ m.body = o.payloadType === "json" ? JSON.stringify(G) : G;
226
233
  }
227
- let C = !1;
234
+ let H = !1;
228
235
  const T = {
229
- url: E(e),
236
+ url: O(e),
230
237
  options: f(f({}, m), a),
231
238
  cancel: () => {
232
- C = !0;
239
+ H = !0;
233
240
  }
234
241
  };
235
- if (r.beforeFetch && Object.assign(T, await r.beforeFetch(T)), C || !g)
236
- return M(!1), Promise.resolve(null);
237
- let _ = null;
238
- return S && S.start(), new Promise((Q, U) => {
239
- var X;
240
- g(T.url, H(f(f({}, m), T.options), {
241
- headers: f(f({}, k(m.headers)), k((X = T.options) == null ? void 0 : X.headers))
242
- })).then(async (c) => {
243
- if (v.value = c, p.value = c.status, _ = await c[o.type](), r.afterFetch && p.value >= 200 && p.value < 300 && ({ data: _ } = await r.afterFetch({ data: _, response: c })), I.value = _, !c.ok)
244
- throw new Error(c.statusText);
245
- return b.trigger(c), Q(c);
242
+ if (r.beforeFetch && Object.assign(T, await r.beforeFetch(T)), H || !b)
243
+ return K(!1), Promise.resolve(null);
244
+ let B = null;
245
+ return S && S.start(), new Promise((J, G) => {
246
+ var Q;
247
+ b(
248
+ T.url,
249
+ N(f(f({}, m), T.options), {
250
+ headers: f(f({}, W(m.headers)), W((Q = T.options) == null ? void 0 : Q.headers))
251
+ })
252
+ ).then(async (c) => {
253
+ if (w.value = c, y.value = c.status, B = await c[o.type](), !c.ok)
254
+ throw E.value = d || null, new Error(c.statusText);
255
+ return r.afterFetch && ({ data: B } = await r.afterFetch({ data: B, response: c })), E.value = B, g.trigger(c), J(c);
246
256
  }).catch(async (c) => {
247
- let Y = c.message || c.name;
248
- return r.onFetchError && ({ data: _, error: Y } = await r.onFetchError({ data: _, error: c, response: v.value })), I.value = _, N.value = Y, i.trigger(c), l ? U(c) : Q(null);
257
+ let X = c.message || c.name;
258
+ return r.onFetchError && ({ error: X } = await r.onFetchError({ data: B, error: c, response: w.value })), D.value = X, i.trigger(c), l ? G(c) : J(null);
249
259
  }).finally(() => {
250
- M(!1), S && S.stop(), u.trigger(null);
260
+ K(!1), S && S.stop(), u.trigger(null);
251
261
  });
252
262
  });
253
- }, R = V(r.refetch);
254
- G([
255
- R,
256
- V(e)
257
- ], ([l]) => l && $(), { deep: !0 });
263
+ }, z = R(r.refetch);
264
+ I(
265
+ [
266
+ z,
267
+ R(e)
268
+ ],
269
+ ([l]) => l && U(),
270
+ { deep: !0 }
271
+ );
258
272
  const x = {
259
273
  isFinished: h,
260
- statusCode: p,
261
- response: v,
262
- error: N,
263
- data: I,
264
- isFetching: d,
265
- canAbort: j,
274
+ statusCode: y,
275
+ response: w,
276
+ error: D,
277
+ data: E,
278
+ isFetching: p,
279
+ canAbort: _,
266
280
  aborted: F,
267
- abort: J,
268
- execute: $,
269
- onFetchResponse: b.on,
281
+ abort: M,
282
+ execute: U,
283
+ onFetchResponse: g.on,
270
284
  onFetchError: i.on,
271
285
  onFetchFinally: u.on,
272
- get: B("GET"),
273
- put: B("PUT"),
274
- post: B("POST"),
275
- delete: B("DELETE"),
276
- patch: B("PATCH"),
277
- head: B("HEAD"),
278
- options: B("OPTIONS"),
279
- json: A("json"),
280
- text: A("text"),
281
- blob: A("blob"),
282
- arrayBuffer: A("arrayBuffer"),
283
- formData: A("formData")
286
+ // method
287
+ get: A("GET"),
288
+ put: A("PUT"),
289
+ post: A("POST"),
290
+ delete: A("DELETE"),
291
+ patch: A("PATCH"),
292
+ head: A("HEAD"),
293
+ options: A("OPTIONS"),
294
+ // type
295
+ json: C("json"),
296
+ text: C("text"),
297
+ blob: C("blob"),
298
+ arrayBuffer: C("arrayBuffer"),
299
+ formData: C("formData")
284
300
  };
285
- function B(l) {
286
- return (w, m) => {
287
- if (!d.value) {
288
- o.method = l, o.payload = w, o.payloadType = m, fe(o.payload) && G([
289
- R,
290
- V(o.payload)
291
- ], ([T]) => T && $(), { deep: !0 });
292
- const C = E(o.payload);
293
- return !m && C && Object.getPrototypeOf(C) === Object.prototype && !(C instanceof FormData) && (o.payloadType = "json"), H(f({}, x), {
294
- then(T, _) {
295
- return K().then(T, _);
301
+ function A(l) {
302
+ return (P, m) => {
303
+ if (!p.value) {
304
+ o.method = l, o.payload = P, o.payloadType = m, oe(o.payload) && I(
305
+ [
306
+ z,
307
+ R(o.payload)
308
+ ],
309
+ ([T]) => T && U(),
310
+ { deep: !0 }
311
+ );
312
+ const H = O(o.payload);
313
+ return !m && H && Object.getPrototypeOf(H) === Object.prototype && !(H instanceof FormData) && (o.payloadType = "json"), N(f({}, x), {
314
+ then(T, B) {
315
+ return V().then(T, B);
296
316
  }
297
317
  });
298
318
  }
299
319
  };
300
320
  }
301
- function K() {
302
- return new Promise((l, w) => {
303
- Te(h).toBe(!0).then(() => l(x)).catch((m) => w(m));
321
+ function V() {
322
+ return new Promise((l, P) => {
323
+ Pe(h).toBe(!0).then(() => l(x)).catch((m) => P(m));
304
324
  });
305
325
  }
306
- function A(l) {
326
+ function C(l) {
307
327
  return () => {
308
- if (!d.value)
309
- return o.type = l, H(f({}, x), {
310
- then(w, m) {
311
- return K().then(w, m);
328
+ if (!p.value)
329
+ return o.type = l, N(f({}, x), {
330
+ then(P, m) {
331
+ return V().then(P, m);
312
332
  }
313
333
  });
314
334
  };
315
335
  }
316
- return r.immediate && setTimeout($, 0), H(f({}, x), {
317
- then(l, w) {
318
- return K().then(l, w);
336
+ return r.immediate && Promise.resolve().then(() => U()), N(f({}, x), {
337
+ then(l, P) {
338
+ return V().then(l, P);
319
339
  }
320
340
  });
321
341
  }
322
- var ue;
323
- (function(e) {
324
- e.UP = "UP", e.RIGHT = "RIGHT", e.DOWN = "DOWN", e.LEFT = "LEFT", e.NONE = "NONE";
325
- })(ue || (ue = {}));
326
- var De = Object.defineProperty, se = Object.getOwnPropertySymbols, Ae = Object.prototype.hasOwnProperty, He = Object.prototype.propertyIsEnumerable, le = (e, t, n) => t in e ? De(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, $e = (e, t) => {
327
- for (var n in t || (t = {}))
328
- Ae.call(t, n) && le(e, n, t[n]);
329
- if (se)
330
- for (var n of se(t))
331
- He.call(t, n) && le(e, n, t[n]);
332
- return e;
333
- };
334
- const xe = {
335
- easeInSine: [0.12, 0, 0.39, 0],
336
- easeOutSine: [0.61, 1, 0.88, 1],
337
- easeInOutSine: [0.37, 0, 0.63, 1],
338
- easeInQuad: [0.11, 0, 0.5, 0],
339
- easeOutQuad: [0.5, 1, 0.89, 1],
340
- easeInOutQuad: [0.45, 0, 0.55, 1],
341
- easeInCubic: [0.32, 0, 0.67, 0],
342
- easeOutCubic: [0.33, 1, 0.68, 1],
343
- easeInOutCubic: [0.65, 0, 0.35, 1],
344
- easeInQuart: [0.5, 0, 0.75, 0],
345
- easeOutQuart: [0.25, 1, 0.5, 1],
346
- easeInOutQuart: [0.76, 0, 0.24, 1],
347
- easeInQuint: [0.64, 0, 0.78, 0],
348
- easeOutQuint: [0.22, 1, 0.36, 1],
349
- easeInOutQuint: [0.83, 0, 0.17, 1],
350
- easeInExpo: [0.7, 0, 0.84, 0],
351
- easeOutExpo: [0.16, 1, 0.3, 1],
352
- easeInOutExpo: [0.87, 0, 0.13, 1],
353
- easeInCirc: [0.55, 0, 1, 0.45],
354
- easeOutCirc: [0, 0.55, 0.45, 1],
355
- easeInOutCirc: [0.85, 0, 0.15, 1],
356
- easeInBack: [0.36, 0, 0.66, -0.56],
357
- easeOutBack: [0.34, 1.56, 0.64, 1],
358
- easeInOutBack: [0.68, -0.6, 0.32, 1.6]
359
- };
360
- $e({
361
- linear: be
362
- }, xe);
363
- function Ke(e, t) {
342
+ function Ce(e, t) {
364
343
  const n = {};
365
344
  return Object.keys(e).forEach((a) => {
366
345
  n[a] = (...r) => {
367
- const o = e[a], g = o.type;
368
- let y = `/api/${o.url}`;
369
- o.hasBody ? y = Z(y, ...r.splice(1)) : y = Z(y, ...r);
370
- const O = {
371
- ...de(),
346
+ const o = e[a], b = o.type;
347
+ let d = `/api/${o.url}`;
348
+ o.hasBody ? d = Y(d, ...r.splice(1)) : d = Y(d, ...r);
349
+ const v = {
350
+ ...ae(),
372
351
  ...o.headers()
373
- }, b = Ce(
374
- y,
352
+ }, g = De(
353
+ d,
375
354
  {
376
- method: g
355
+ method: b
377
356
  },
378
357
  {
379
358
  immediate: !1,
380
359
  beforeFetch({ options: u }) {
381
360
  return u.headers = {
382
361
  ...u.headers,
383
- ...O
362
+ ...v
384
363
  }, o.hasBody && r.length && (u.body = JSON.stringify(r[0])), {
385
364
  options: u
386
365
  };
@@ -391,19 +370,19 @@ function Ke(e, t) {
391
370
  }
392
371
  );
393
372
  return {
394
- ...Qe(O) === "application/json" ? b.json() : b.text()
373
+ ...Se(v) === "application/json" ? g.json() : g.text()
395
374
  };
396
375
  };
397
376
  }), n;
398
377
  }
399
- function Qe(e) {
378
+ function Se(e) {
400
379
  return e.accept ?? "*/*";
401
380
  }
402
- function Le(e) {
381
+ function Ne(e) {
403
382
  return JSON.parse(JSON.stringify(e));
404
383
  }
405
- function We(e = 500) {
406
- const t = ve({
384
+ function Ue(e = 500) {
385
+ const t = he({
407
386
  debouncer: null,
408
387
  timeout: e
409
388
  });
@@ -411,15 +390,15 @@ function We(e = 500) {
411
390
  t.debouncer !== null && window.clearTimeout(t.debouncer), t.debouncer = window.setTimeout(() => s(...a), t.timeout);
412
391
  }
413
392
  return {
414
- ...we(t),
393
+ ...me(t),
415
394
  debounce: n
416
395
  };
417
396
  }
418
397
  export {
419
- Le as copy,
420
- Me as createEndpoint,
421
- de as getDefaultHeaders,
422
- Je as requestTypes,
423
- Ke as useApi,
424
- We as useDebouncer
398
+ Ne as copy,
399
+ $e as createEndpoint,
400
+ ae as getDefaultHeaders,
401
+ He as requestTypes,
402
+ Ce as useApi,
403
+ Ue as useDebouncer
425
404
  };
@@ -1 +1 @@
1
- (function(p,A){typeof exports=="object"&&typeof module<"u"?A(exports,require("@citruslime/utils"),require("vue")):typeof define=="function"&&define.amd?define(["exports","@citruslime/utils","vue"],A):(p=typeof globalThis<"u"?globalThis:p||self,A(p.CitrusLimeVueUtils={},p.CLUtils,p.Vue))})(this,function(p,A,u){"use strict";const fe=["GET","POST","PUT","DELETE"];function de(e,t,n=null,l=null){return{url:e,type:t,headers:n??M,hasBody:pe(t,l)}}function M(){return{accept:"application/json","content-type":"application/json"}}function pe(e,t){return!!(t===null&&(e==="PUT"||e==="POST")||t)}var X;const q=typeof window<"u";q&&((X=window==null?void 0:window.navigator)!=null&&X.userAgent)&&/iP(ad|hone|od)/.test(window.navigator.userAgent);function T(e){return typeof e=="function"?e():u.unref(e)}function Y(e,t=!1,n="Timeout"){return new Promise((l,a)=>{setTimeout(t?()=>a(n):l,e)})}function he(e){return e}function ye(e,...t){return t.some(n=>n in e)}function Z(e){return u.getCurrentScope()?(u.onScopeDispose(e),!0):!1}function J(){const e=[],t=a=>{const r=e.indexOf(a);r!==-1&&e.splice(r,1)};return{on:a=>{e.push(a);const r=()=>t(a);return Z(r),{off:r}},off:t,trigger:a=>{e.forEach(r=>r(a))}}}function V(e){return typeof e=="function"?u.computed(e):u.ref(e)}function K(e,t=!1){function n(i,{flush:s="sync",deep:O=!1,timeout:h,throwOnTimeout:I}={}){let y=null;const D=[new Promise(S=>{y=u.watch(e,C=>{i(C)!==t&&(y==null||y(),S(C))},{flush:s,deep:O,immediate:!0})})];return h!=null&&D.push(Y(h,I).then(()=>T(e)).finally(()=>y==null?void 0:y())),Promise.race(D)}function l(i,s){if(!u.isRef(i))return n(C=>C===i,s);const{flush:O="sync",deep:h=!1,timeout:I,throwOnTimeout:y}=s??{};let b=null;const S=[new Promise(C=>{b=u.watch([e,i],([E,N])=>{t!==(E===N)&&(b==null||b(),C(E))},{flush:O,deep:h,immediate:!0})})];return I!=null&&S.push(Y(I,y).then(()=>T(e)).finally(()=>(b==null||b(),T(e)))),Promise.race(S)}function a(i){return n(s=>!!s,i)}function r(i){return l(null,i)}function o(i){return l(void 0,i)}function _(i){return n(Number.isNaN,i)}function m(i,s){return n(O=>{const h=Array.from(O);return h.includes(i)||h.includes(T(i))},s)}function g(i){return v(1,i)}function v(i=1,s){let O=-1;return n(()=>(O+=1,O>=i),s)}return Array.isArray(T(e))?{toMatch:n,toContains:m,changed:g,changedTimes:v,get not(){return K(e,!t)}}:{toMatch:n,toBe:l,toBeTruthy:a,toBeNull:r,toBeNaN:_,toBeUndefined:o,changed:g,changedTimes:v,get not(){return K(e,!t)}}}function me(e){return K(e)}function Oe(e,t,n={}){const{immediate:l=!0}=n,a=u.ref(!1);let r=null;function o(){r&&(clearTimeout(r),r=null)}function _(){a.value=!1,o()}function m(...g){o(),a.value=!0,r=setTimeout(()=>{a.value=!1,r=null,e(...g)},T(t))}return l&&(a.value=!0,q&&m()),Z(_),{isPending:u.readonly(a),start:m,stop:_}}const we=q?window:void 0,ee=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},te="__vueuse_ssr_handlers__";ee[te]=ee[te]||{};var ge=Object.defineProperty,be=Object.defineProperties,Pe=Object.getOwnPropertyDescriptors,ne=Object.getOwnPropertySymbols,Te=Object.prototype.hasOwnProperty,_e=Object.prototype.propertyIsEnumerable,re=(e,t,n)=>t in e?ge(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,c=(e,t)=>{for(var n in t||(t={}))Te.call(t,n)&&re(e,n,t[n]);if(ne)for(var n of ne(t))_e.call(t,n)&&re(e,n,t[n]);return e},U=(e,t)=>be(e,Pe(t));const ve={json:"application/json",text:"text/plain"};function oe(e){return e&&ye(e,"immediate","refetch","initialData","timeout","beforeFetch","afterFetch","onFetchError","fetch")}function R(e){return typeof Headers<"u"&&e instanceof Headers?Object.fromEntries([...e.entries()]):e}function Ee(e,...t){var n;const l=typeof AbortController=="function";let a={},r={immediate:!0,refetch:!1,timeout:0};const o={method:"GET",type:"text",payload:void 0};t.length>0&&(oe(t[0])?r=c(c({},r),t[0]):a=t[0]),t.length>1&&oe(t[1])&&(r=c(c({},r),t[1]));const{fetch:_=(n=we)==null?void 0:n.fetch,initialData:m,timeout:g}=r,v=J(),i=J(),s=J(),O=u.ref(!1),h=u.ref(!1),I=u.ref(!1),y=u.ref(null),b=u.shallowRef(null),D=u.shallowRef(null),S=u.shallowRef(m),C=u.computed(()=>l&&h.value);let E,N;const W=()=>{l&&E&&(E.abort(),E=void 0)},k=f=>{h.value=f,O.value=!f};g&&(N=Oe(W,g,{immediate:!1}));const Q=async(f=!1)=>{var P;k(!0),D.value=null,y.value=null,I.value=!1,l&&(W(),E=new AbortController,E.signal.onabort=()=>I.value=!0,a=U(c({},a),{signal:E.signal}));const w={method:o.method,headers:{}};if(o.payload){const G=R(w.headers);o.payloadType&&(G["Content-Type"]=(P=ve[o.payloadType])!=null?P:o.payloadType);const L=T(o.payload);w.body=o.payloadType==="json"?JSON.stringify(L):L}let H=!1;const F={url:T(e),options:c(c({},w),a),cancel:()=>{H=!0}};if(r.beforeFetch&&Object.assign(F,await r.beforeFetch(F)),H||!_)return k(!1),Promise.resolve(null);let j=null;return N&&N.start(),new Promise((G,L)=>{var le;_(F.url,U(c(c({},w),F.options),{headers:c(c({},R(w.headers)),R((le=F.options)==null?void 0:le.headers))})).then(async d=>{if(b.value=d,y.value=d.status,j=await d[o.type](),r.afterFetch&&y.value>=200&&y.value<300&&({data:j}=await r.afterFetch({data:j,response:d})),S.value=j,!d.ok)throw new Error(d.statusText);return v.trigger(d),G(d)}).catch(async d=>{let ce=d.message||d.name;return r.onFetchError&&({data:j,error:ce}=await r.onFetchError({data:j,error:d,response:b.value})),S.value=j,D.value=ce,i.trigger(d),f?L(d):G(null)}).finally(()=>{k(!1),N&&N.stop(),s.trigger(null)})})},ue=V(r.refetch);u.watch([ue,V(e)],([f])=>f&&Q(),{deep:!0});const x={isFinished:O,statusCode:y,response:b,error:D,data:S,isFetching:h,canAbort:C,aborted:I,abort:W,execute:Q,onFetchResponse:v.on,onFetchError:i.on,onFetchFinally:s.on,get:B("GET"),put:B("PUT"),post:B("POST"),delete:B("DELETE"),patch:B("PATCH"),head:B("HEAD"),options:B("OPTIONS"),json:$("json"),text:$("text"),blob:$("blob"),arrayBuffer:$("arrayBuffer"),formData:$("formData")};function B(f){return(P,w)=>{if(!h.value){o.method=f,o.payload=P,o.payloadType=w,u.isRef(o.payload)&&u.watch([ue,V(o.payload)],([F])=>F&&Q(),{deep:!0});const H=T(o.payload);return!w&&H&&Object.getPrototypeOf(H)===Object.prototype&&!(H instanceof FormData)&&(o.payloadType="json"),U(c({},x),{then(F,j){return z().then(F,j)}})}}}function z(){return new Promise((f,P)=>{me(O).toBe(!0).then(()=>f(x)).catch(w=>P(w))})}function $(f){return()=>{if(!h.value)return o.type=f,U(c({},x),{then(P,w){return z().then(P,w)}})}}return r.immediate&&setTimeout(Q,0),U(c({},x),{then(f,P){return z().then(f,P)}})}var ae;(function(e){e.UP="UP",e.RIGHT="RIGHT",e.DOWN="DOWN",e.LEFT="LEFT",e.NONE="NONE"})(ae||(ae={}));var Fe=Object.defineProperty,ie=Object.getOwnPropertySymbols,je=Object.prototype.hasOwnProperty,Ie=Object.prototype.propertyIsEnumerable,se=(e,t,n)=>t in e?Fe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Se=(e,t)=>{for(var n in t||(t={}))je.call(t,n)&&se(e,n,t[n]);if(ie)for(var n of ie(t))Ie.call(t,n)&&se(e,n,t[n]);return e};Se({linear:he},{easeInSine:[.12,0,.39,0],easeOutSine:[.61,1,.88,1],easeInOutSine:[.37,0,.63,1],easeInQuad:[.11,0,.5,0],easeOutQuad:[.5,1,.89,1],easeInOutQuad:[.45,0,.55,1],easeInCubic:[.32,0,.67,0],easeOutCubic:[.33,1,.68,1],easeInOutCubic:[.65,0,.35,1],easeInQuart:[.5,0,.75,0],easeOutQuart:[.25,1,.5,1],easeInOutQuart:[.76,0,.24,1],easeInQuint:[.64,0,.78,0],easeOutQuint:[.22,1,.36,1],easeInOutQuint:[.83,0,.17,1],easeInExpo:[.7,0,.84,0],easeOutExpo:[.16,1,.3,1],easeInOutExpo:[.87,0,.13,1],easeInCirc:[.55,0,1,.45],easeOutCirc:[0,.55,.45,1],easeInOutCirc:[.85,0,.15,1],easeInBack:[.36,0,.66,-.56],easeOutBack:[.34,1.56,.64,1],easeInOutBack:[.68,-.6,.32,1.6]});function Ce(e,t){const n={};return Object.keys(e).forEach(a=>{n[a]=(...r)=>{const o=e[a],_=o.type;let m=`/api/${o.url}`;o.hasBody?m=A.replacePlaceholders(m,...r.splice(1)):m=A.replacePlaceholders(m,...r);const g={...M(),...o.headers()},v=Ee(m,{method:_},{immediate:!1,beforeFetch({options:s}){return s.headers={...s.headers,...g},o.hasBody&&r.length&&(s.body=JSON.stringify(r[0])),{options:s}},onFetchError(s){return s!=null&&s.response&&t(s),s}});return{...De(g)==="application/json"?v.json():v.text()}}}),n}function De(e){return e.accept??"*/*"}function Ne(e){return JSON.parse(JSON.stringify(e))}function Be(e=500){const t=u.reactive({debouncer:null,timeout:e});function n(l,...a){t.debouncer!==null&&window.clearTimeout(t.debouncer),t.debouncer=window.setTimeout(()=>l(...a),t.timeout)}return{...u.toRefs(t),debounce:n}}p.copy=Ne,p.createEndpoint=de,p.getDefaultHeaders=M,p.requestTypes=fe,p.useApi=Ce,p.useDebouncer=Be,Object.defineProperty(p,Symbol.toStringTag,{value:"Module"})});
1
+ (function(p,$){typeof exports=="object"&&typeof module<"u"?$(exports,require("@citruslime/utils"),require("vue")):typeof define=="function"&&define.amd?define(["exports","@citruslime/utils","vue"],$):(p=typeof globalThis<"u"?globalThis:p||self,$(p.CitrusLimeVueUtils={},p.CLUtils,p.Vue))})(this,function(p,$,s){"use strict";const ie=["GET","POST","PUT","DELETE"];function ae(e,t,n=null,u=null){return{url:e,type:t,headers:n??I,hasBody:se(t,u)}}function I(){return{accept:"application/json","content-type":"application/json"}}function se(e,t){return!!(t===null&&(e==="PUT"||e==="POST")||t)}function Q(e){return s.getCurrentScope()?(s.onScopeDispose(e),!0):!1}function L(){const e=new Set,t=i=>{e.delete(i)};return{on:i=>{e.add(i);const r=()=>t(i);return Q(r),{off:r}},off:t,trigger:i=>Promise.all(Array.from(e).map(r=>r(i)))}}function O(e){return typeof e=="function"?e():s.unref(e)}const X=typeof window<"u",le=()=>{};function Y(e,t=!1,n="Timeout"){return new Promise((u,i)=>{setTimeout(t?()=>i(n):u,e)})}function ue(e,...t){return t.some(n=>n in e)}function R(...e){if(e.length!==1)return s.toRef(...e);const t=e[0];return typeof t=="function"?s.readonly(s.customRef(()=>({get:t,set:le}))):s.ref(t)}function K(e,t=!1){function n(a,{flush:l="sync",deep:m=!1,timeout:y,throwOnTimeout:v}={}){let T=null;const A=[new Promise(_=>{T=s.watch(e,D=>{a(D)!==t&&(T==null||T(),_(D))},{flush:l,deep:m,immediate:!0})})];return y!=null&&A.push(Y(y,v).then(()=>O(e)).finally(()=>T==null?void 0:T())),Promise.race(A)}function u(a,l){if(!s.isRef(a))return n(D=>D===a,l);const{flush:m="sync",deep:y=!1,timeout:v,throwOnTimeout:T}=l??{};let b=null;const _=[new Promise(D=>{b=s.watch([e,a],([S,B])=>{t!==(S===B)&&(b==null||b(),D(S))},{flush:m,deep:y,immediate:!0})})];return v!=null&&_.push(Y(v,T).then(()=>O(e)).finally(()=>(b==null||b(),O(e)))),Promise.race(_)}function i(a){return n(l=>!!l,a)}function r(a){return u(null,a)}function o(a){return u(void 0,a)}function F(a){return n(Number.isNaN,a)}function h(a,l){return n(m=>{const y=Array.from(m);return y.includes(a)||y.includes(O(a))},l)}function P(a){return E(1,a)}function E(a=1,l){let m=-1;return n(()=>(m+=1,m>=a),l)}return Array.isArray(O(e))?{toMatch:n,toContains:h,changed:P,changedTimes:E,get not(){return K(e,!t)}}:{toMatch:n,toBe:u,toBeTruthy:i,toBeNull:r,toBeNaN:F,toBeUndefined:o,changed:P,changedTimes:E,get not(){return K(e,!t)}}}function ce(e){return K(e)}function fe(e,t,n={}){const{immediate:u=!0}=n,i=s.ref(!1);let r=null;function o(){r&&(clearTimeout(r),r=null)}function F(){i.value=!1,o()}function h(...P){o(),i.value=!0,r=setTimeout(()=>{i.value=!1,r=null,e(...P)},O(t))}return u&&(i.value=!0,X&&h()),Q(F),{isPending:s.readonly(i),start:h,stop:F}}const de=X?window:void 0;var pe=Object.defineProperty,he=Object.defineProperties,ye=Object.getOwnPropertyDescriptors,Z=Object.getOwnPropertySymbols,me=Object.prototype.hasOwnProperty,we=Object.prototype.propertyIsEnumerable,ee=(e,t,n)=>t in e?pe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,c=(e,t)=>{for(var n in t||(t={}))me.call(t,n)&&ee(e,n,t[n]);if(Z)for(var n of Z(t))we.call(t,n)&&ee(e,n,t[n]);return e},U=(e,t)=>he(e,ye(t));const Te={json:"application/json",text:"text/plain"};function te(e){return e&&ue(e,"immediate","refetch","initialData","timeout","beforeFetch","afterFetch","onFetchError","fetch")}function W(e){return typeof Headers<"u"&&e instanceof Headers?Object.fromEntries([...e.entries()]):e}function Pe(e,...t){var n;const u=typeof AbortController=="function";let i={},r={immediate:!0,refetch:!1,timeout:0};const o={method:"GET",type:"text",payload:void 0};t.length>0&&(te(t[0])?r=c(c({},r),t[0]):i=t[0]),t.length>1&&te(t[1])&&(r=c(c({},r),t[1]));const{fetch:F=(n=de)==null?void 0:n.fetch,initialData:h,timeout:P}=r,E=L(),a=L(),l=L(),m=s.ref(!1),y=s.ref(!1),v=s.ref(!1),T=s.ref(null),b=s.shallowRef(null),A=s.shallowRef(null),_=s.shallowRef(h||null),D=s.computed(()=>u&&y.value);let S,B;const k=()=>{u&&(S==null||S.abort(),S=new AbortController,S.signal.onabort=()=>v.value=!0,i=U(c({},i),{signal:S.signal}))},x=f=>{y.value=f,m.value=!f};P&&(B=fe(k,P,{immediate:!1}));const J=async(f=!1)=>{var g;k(),x(!0),A.value=null,T.value=null,v.value=!1;const w={method:o.method,headers:{}};if(o.payload){const V=W(w.headers);o.payloadType&&(V["Content-Type"]=(g=Te[o.payloadType])!=null?g:o.payloadType);const G=O(o.payload);w.body=o.payloadType==="json"?JSON.stringify(G):G}let N=!1;const j={url:O(e),options:c(c({},w),i),cancel:()=>{N=!0}};if(r.beforeFetch&&Object.assign(j,await r.beforeFetch(j)),N||!F)return x(!1),Promise.resolve(null);let C=null;return B&&B.start(),new Promise((V,G)=>{var re;F(j.url,U(c(c({},w),j.options),{headers:c(c({},W(w.headers)),W((re=j.options)==null?void 0:re.headers))})).then(async d=>{if(b.value=d,T.value=d.status,C=await d[o.type](),!d.ok)throw _.value=h||null,new Error(d.statusText);return r.afterFetch&&({data:C}=await r.afterFetch({data:C,response:d})),_.value=C,E.trigger(d),V(d)}).catch(async d=>{let oe=d.message||d.name;return r.onFetchError&&({error:oe}=await r.onFetchError({data:C,error:d,response:b.value})),A.value=oe,a.trigger(d),f?G(d):V(null)}).finally(()=>{x(!1),B&&B.stop(),l.trigger(null)})})},ne=R(r.refetch);s.watch([ne,R(e)],([f])=>f&&J(),{deep:!0});const M={isFinished:m,statusCode:T,response:b,error:A,data:_,isFetching:y,canAbort:D,aborted:v,abort:k,execute:J,onFetchResponse:E.on,onFetchError:a.on,onFetchFinally:l.on,get:H("GET"),put:H("PUT"),post:H("POST"),delete:H("DELETE"),patch:H("PATCH"),head:H("HEAD"),options:H("OPTIONS"),json:q("json"),text:q("text"),blob:q("blob"),arrayBuffer:q("arrayBuffer"),formData:q("formData")};function H(f){return(g,w)=>{if(!y.value){o.method=f,o.payload=g,o.payloadType=w,s.isRef(o.payload)&&s.watch([ne,R(o.payload)],([j])=>j&&J(),{deep:!0});const N=O(o.payload);return!w&&N&&Object.getPrototypeOf(N)===Object.prototype&&!(N instanceof FormData)&&(o.payloadType="json"),U(c({},M),{then(j,C){return z().then(j,C)}})}}}function z(){return new Promise((f,g)=>{ce(m).toBe(!0).then(()=>f(M)).catch(w=>g(w))})}function q(f){return()=>{if(!y.value)return o.type=f,U(c({},M),{then(g,w){return z().then(g,w)}})}}return r.immediate&&Promise.resolve().then(()=>J()),U(c({},M),{then(f,g){return z().then(f,g)}})}function be(e,t){const n={};return Object.keys(e).forEach(i=>{n[i]=(...r)=>{const o=e[i],F=o.type;let h=`/api/${o.url}`;o.hasBody?h=$.replacePlaceholders(h,...r.splice(1)):h=$.replacePlaceholders(h,...r);const P={...I(),...o.headers()},E=Pe(h,{method:F},{immediate:!1,beforeFetch({options:l}){return l.headers={...l.headers,...P},o.hasBody&&r.length&&(l.body=JSON.stringify(r[0])),{options:l}},onFetchError(l){return l!=null&&l.response&&t(l),l}});return{...ge(P)==="application/json"?E.json():E.text()}}}),n}function ge(e){return e.accept??"*/*"}function Oe(e){return JSON.parse(JSON.stringify(e))}function Fe(e=500){const t=s.reactive({debouncer:null,timeout:e});function n(u,...i){t.debouncer!==null&&window.clearTimeout(t.debouncer),t.debouncer=window.setTimeout(()=>u(...i),t.timeout)}return{...s.toRefs(t),debounce:n}}p.copy=Oe,p.createEndpoint=ae,p.getDefaultHeaders=I,p.requestTypes=ie,p.useApi=be,p.useDebouncer=Fe,Object.defineProperty(p,Symbol.toStringTag,{value:"Module"})});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@citruslime/vue-utils",
3
- "version": "1.2.2-beta.0",
3
+ "version": "1.3.0-beta.0",
4
4
  "type": "module",
5
5
  "author": {
6
6
  "name": "Citrus-Lime Ltd",
@@ -28,13 +28,15 @@
28
28
  }
29
29
  },
30
30
  "scripts": {
31
- "build": "vite build && copyfiles -u 2 \"dist/src/**/*\" dist && del-cli dist/src"
31
+ "build": "run-p build-source build-types",
32
+ "build-source": "vite build",
33
+ "build-types": "vue-tsc --declaration --emitDeclarationOnly --declarationDir ./dist --project ./tsconfig.app.json --composite false"
32
34
  },
33
35
  "dependencies": {
34
36
  "@citruslime/utils": "^1.1.2-beta.0"
35
37
  },
36
38
  "peerDependencies": {
37
- "@vueuse/core": "^9.13.0",
39
+ "@vueuse/core": "^10.1.2",
38
40
  "vue": "^3.2.47"
39
41
  }
40
42
  }