vuesp-components 2.1.6 → 2.1.8

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,4 +1,4 @@
1
- import { watch as N, shallowRef as E, shallowReadonly as U, onMounted as G, nextTick as z, toValue as x, getCurrentScope as Z, onScopeDispose as ee, getCurrentInstance as K, hasInjectionContext as V, inject as te, computed as M, reactive as $, watchEffect as ne, unref as oe, toRaw as re, ref as I } from "vue";
1
+ import { shallowRef as E, shallowReadonly as U, onMounted as q, nextTick as z, toValue as x, getCurrentScope as Z, onScopeDispose as ee, watch as G, getCurrentInstance as K, hasInjectionContext as V, inject as te, computed as M, reactive as $, watchEffect as ne, unref as oe, toRaw as re, ref as I } from "vue";
2
2
  function X(e) {
3
3
  return Z() ? (ee(e), !0) : !1;
4
4
  }
@@ -18,24 +18,24 @@ function le() {
18
18
  }
19
19
  function ce(e, o) {
20
20
  function t(...n) {
21
- return new Promise((f, s) => {
22
- Promise.resolve(e(() => o.apply(this, n), { fn: o, thisArg: this, args: n })).then(f).catch(s);
21
+ return new Promise((v, s) => {
22
+ Promise.resolve(e(() => o.apply(this, n), { fn: o, thisArg: this, args: n })).then(v).catch(s);
23
23
  });
24
24
  }
25
25
  return t;
26
26
  }
27
27
  function fe(e, o = {}) {
28
- let t, n, f = C;
28
+ let t, n, v = C;
29
29
  const s = (r) => {
30
- clearTimeout(r), f(), f = C;
30
+ clearTimeout(r), v(), v = C;
31
31
  };
32
- let c;
32
+ let d;
33
33
  return (r) => {
34
- const a = x(e), v = x(o.maxWait);
35
- return t && s(t), a <= 0 || v !== void 0 && v <= 0 ? (n && (s(n), n = void 0), Promise.resolve(r())) : new Promise((g, y) => {
36
- f = o.rejectOnCancel ? y : g, c = r, v && !n && (n = setTimeout(() => {
37
- t && s(t), n = void 0, g(c());
38
- }, v)), t = setTimeout(() => {
34
+ const a = x(e), m = x(o.maxWait);
35
+ return t && s(t), a <= 0 || m !== void 0 && m <= 0 ? (n && (s(n), n = void 0), Promise.resolve(r())) : new Promise((g, y) => {
36
+ v = o.rejectOnCancel ? y : g, d = r, m && !n && (n = setTimeout(() => {
37
+ t && s(t), n = void 0, g(d());
38
+ }, m)), t = setTimeout(() => {
39
39
  n && s(n), n = void 0, g(r());
40
40
  }, a);
41
41
  });
@@ -55,8 +55,8 @@ function me(e, o) {
55
55
  var t;
56
56
  if (typeof e == "number")
57
57
  return e + o;
58
- const n = ((t = e.match(/^-?\d+\.?\d*/)) == null ? void 0 : t[0]) || "", f = e.slice(n.length), s = Number.parseFloat(n) + o;
59
- return Number.isNaN(s) ? e : s + f;
58
+ const n = ((t = e.match(/^-?\d+\.?\d*/)) == null ? void 0 : t[0]) || "", v = e.slice(n.length), s = Number.parseFloat(n) + o;
59
+ return Number.isNaN(s) ? e : s + v;
60
60
  }
61
61
  function j(e) {
62
62
  return e.endsWith("rem") ? Number.parseFloat(e) * 16 : Number.parseFloat(e);
@@ -75,23 +75,23 @@ function Me(e, o = 200, t = {}) {
75
75
  );
76
76
  }
77
77
  function pe(e, o = !0, t) {
78
- ve() ? G(e, t) : o ? e() : z(e);
78
+ ve() ? q(e, t) : o ? e() : z(e);
79
79
  }
80
80
  function he(e, o, t = {}) {
81
81
  const {
82
82
  immediate: n = !0,
83
- immediateCallback: f = !1
83
+ immediateCallback: v = !1
84
84
  } = t, s = E(!1);
85
- let c;
86
- function d() {
87
- c && (clearTimeout(c), c = void 0);
85
+ let d;
86
+ function c() {
87
+ d && (clearTimeout(d), d = void 0);
88
88
  }
89
89
  function r() {
90
- s.value = !1, d();
90
+ s.value = !1, c();
91
91
  }
92
- function a(...v) {
93
- f && e(), d(), s.value = !0, c = setTimeout(() => {
94
- s.value = !1, c = void 0, e(...v);
92
+ function a(...m) {
93
+ v && e(), c(), s.value = !0, d = setTimeout(() => {
94
+ s.value = !1, d = void 0, e(...m);
95
95
  }, x(o));
96
96
  }
97
97
  return n && (s.value = !0, _ && a()), X(r), {
@@ -101,7 +101,7 @@ function he(e, o, t = {}) {
101
101
  };
102
102
  }
103
103
  function we(e, o, t) {
104
- return N(
104
+ return G(
105
105
  e,
106
106
  o,
107
107
  {
@@ -110,18 +110,6 @@ function we(e, o, t) {
110
110
  }
111
111
  );
112
112
  }
113
- function Oe(e, o, t) {
114
- return N(
115
- e,
116
- (f, s, c) => {
117
- f && o(f, s, c);
118
- },
119
- {
120
- ...t,
121
- once: !1
122
- }
123
- );
124
- }
125
113
  const R = _ ? window : void 0, H = _ ? window.navigator : void 0;
126
114
  function W(e) {
127
115
  var o;
@@ -130,51 +118,51 @@ function W(e) {
130
118
  }
131
119
  function T(...e) {
132
120
  const o = [], t = () => {
133
- o.forEach((d) => d()), o.length = 0;
134
- }, n = (d, r, a, v) => (d.addEventListener(r, a, v), () => d.removeEventListener(r, a, v)), f = M(() => {
135
- const d = F(x(e[0])).filter((r) => r != null);
136
- return d.every((r) => typeof r != "string") ? d : void 0;
121
+ o.forEach((c) => c()), o.length = 0;
122
+ }, n = (c, r, a, m) => (c.addEventListener(r, a, m), () => c.removeEventListener(r, a, m)), v = M(() => {
123
+ const c = F(x(e[0])).filter((r) => r != null);
124
+ return c.every((r) => typeof r != "string") ? c : void 0;
137
125
  }), s = we(
138
126
  () => {
139
- var d, r;
127
+ var c, r;
140
128
  return [
141
- (r = (d = f.value) == null ? void 0 : d.map((a) => W(a))) != null ? r : [R].filter((a) => a != null),
142
- F(x(f.value ? e[1] : e[0])),
143
- F(oe(f.value ? e[2] : e[1])),
129
+ (r = (c = v.value) == null ? void 0 : c.map((a) => W(a))) != null ? r : [R].filter((a) => a != null),
130
+ F(x(v.value ? e[1] : e[0])),
131
+ F(oe(v.value ? e[2] : e[1])),
144
132
  // @ts-expect-error - TypeScript gets the correct types, but somehow still complains
145
- x(f.value ? e[3] : e[2])
133
+ x(v.value ? e[3] : e[2])
146
134
  ];
147
135
  },
148
- ([d, r, a, v]) => {
149
- if (t(), !(d != null && d.length) || !(r != null && r.length) || !(a != null && a.length))
136
+ ([c, r, a, m]) => {
137
+ if (t(), !(c != null && c.length) || !(r != null && r.length) || !(a != null && a.length))
150
138
  return;
151
- const g = ae(v) ? { ...v } : v;
139
+ const g = ae(m) ? { ...m } : m;
152
140
  o.push(
153
- ...d.flatMap(
141
+ ...c.flatMap(
154
142
  (y) => r.flatMap(
155
- (l) => a.map((m) => n(y, l, m, g))
143
+ (l) => a.map((f) => n(y, l, f, g))
156
144
  )
157
145
  )
158
146
  );
159
147
  },
160
148
  { flush: "post" }
161
- ), c = () => {
149
+ ), d = () => {
162
150
  s(), t();
163
151
  };
164
- return X(t), c;
152
+ return X(t), d;
165
153
  }
166
- let B = !1;
167
- function Ce(e, o, t = {}) {
168
- const { window: n = R, ignore: f = [], capture: s = !0, detectIframe: c = !1, controls: d = !1 } = t;
154
+ let Y = !1;
155
+ function Oe(e, o, t = {}) {
156
+ const { window: n = R, ignore: v = [], capture: s = !0, detectIframe: d = !1, controls: c = !1 } = t;
169
157
  if (!n)
170
- return d ? { stop: C, cancel: C, trigger: C } : C;
171
- if (ue && !B) {
172
- B = !0;
158
+ return c ? { stop: C, cancel: C, trigger: C } : C;
159
+ if (ue && !Y) {
160
+ Y = !0;
173
161
  const i = { passive: !0 };
174
162
  Array.from(n.document.body.children).forEach((u) => u.addEventListener("click", C, i)), n.document.documentElement.addEventListener("click", C, i);
175
163
  }
176
164
  let r = !0;
177
- const a = (i) => x(f).some((u) => {
165
+ const a = (i) => x(v).some((u) => {
178
166
  if (typeof u == "string")
179
167
  return Array.from(n.document.querySelectorAll(u)).some((p) => p === i.target || i.composedPath().includes(p));
180
168
  {
@@ -182,7 +170,7 @@ function Ce(e, o, t = {}) {
182
170
  return p && (i.target === p || i.composedPath().includes(p));
183
171
  }
184
172
  });
185
- function v(i) {
173
+ function m(i) {
186
174
  const u = x(i);
187
175
  return u && u.$.subTree.shapeFlag === 16;
188
176
  }
@@ -192,7 +180,7 @@ function Ce(e, o, t = {}) {
192
180
  }
193
181
  const y = (i) => {
194
182
  const u = W(e);
195
- if (i.target != null && !(!(u instanceof Element) && v(e) && g(e, i)) && !(!u || u === i.target || i.composedPath().includes(u))) {
183
+ if (i.target != null && !(!(u instanceof Element) && m(e) && g(e, i)) && !(!u || u === i.target || i.composedPath().includes(u))) {
196
184
  if ("detail" in i && i.detail === 0 && (r = !a(i)), !r) {
197
185
  r = !0;
198
186
  return;
@@ -201,7 +189,7 @@ function Ce(e, o, t = {}) {
201
189
  }
202
190
  };
203
191
  let l = !1;
204
- const m = [
192
+ const f = [
205
193
  T(n, "click", (i) => {
206
194
  l || (l = !0, setTimeout(() => {
207
195
  l = !1;
@@ -211,15 +199,15 @@ function Ce(e, o, t = {}) {
211
199
  const u = W(e);
212
200
  r = !a(i) && !!(u && !i.composedPath().includes(u));
213
201
  }, { passive: !0 }),
214
- c && T(n, "blur", (i) => {
202
+ d && T(n, "blur", (i) => {
215
203
  setTimeout(() => {
216
204
  var u;
217
205
  const p = W(e);
218
206
  ((u = n.document.activeElement) == null ? void 0 : u.tagName) === "IFRAME" && !(p != null && p.contains(n.document.activeElement)) && o(i);
219
207
  }, 0);
220
208
  }, { passive: !0 })
221
- ].filter(Boolean), b = () => m.forEach((i) => i());
222
- return d ? {
209
+ ].filter(Boolean), b = () => f.forEach((i) => i());
210
+ return c ? {
223
211
  stop: b,
224
212
  cancel: () => {
225
213
  r = !1;
@@ -230,7 +218,7 @@ function Ce(e, o, t = {}) {
230
218
  } : b;
231
219
  }
232
220
  // @__NO_SIDE_EFFECTS__
233
- function Y(e) {
221
+ function N(e) {
234
222
  return M(() => !!e());
235
223
  }
236
224
  const ye = Symbol("vueuse-ssr-width");
@@ -240,22 +228,22 @@ function Q() {
240
228
  return typeof e == "number" ? e : void 0;
241
229
  }
242
230
  function L(e, o = {}) {
243
- const { window: t = R, ssrWidth: n = /* @__PURE__ */ Q() } = o, f = /* @__PURE__ */ Y(() => t && "matchMedia" in t && typeof t.matchMedia == "function"), s = E(typeof n == "number"), c = E(), d = E(!1), r = (a) => {
244
- d.value = a.matches;
231
+ const { window: t = R, ssrWidth: n = /* @__PURE__ */ Q() } = o, v = /* @__PURE__ */ N(() => t && "matchMedia" in t && typeof t.matchMedia == "function"), s = E(typeof n == "number"), d = E(), c = E(!1), r = (a) => {
232
+ c.value = a.matches;
245
233
  };
246
234
  return ne(() => {
247
235
  if (s.value) {
248
- s.value = !f.value;
236
+ s.value = !v.value;
249
237
  const a = x(e).split(",");
250
- d.value = a.some((v) => {
251
- const g = v.includes("not all"), y = v.match(/\(\s*min-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/), l = v.match(/\(\s*max-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/);
252
- let m = !!(y || l);
253
- return y && m && (m = n >= j(y[1])), l && m && (m = n <= j(l[1])), g ? !m : m;
238
+ c.value = a.some((m) => {
239
+ const g = m.includes("not all"), y = m.match(/\(\s*min-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/), l = m.match(/\(\s*max-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/);
240
+ let f = !!(y || l);
241
+ return y && f && (f = n >= j(y[1])), l && f && (f = n <= j(l[1])), g ? !f : f;
254
242
  });
255
243
  return;
256
244
  }
257
- f.value && (c.value = t.matchMedia(x(e)), d.value = c.value.matches);
258
- }), T(c, "change", r, { passive: !0 }), M(() => d.value);
245
+ v.value && (d.value = t.matchMedia(x(e)), c.value = d.value.matches);
246
+ }), T(d, "change", r, { passive: !0 }), M(() => c.value);
259
247
  }
260
248
  const ge = {
261
249
  sm: 640,
@@ -266,35 +254,35 @@ const ge = {
266
254
  };
267
255
  // @__NO_SIDE_EFFECTS__
268
256
  function be(e, o = {}) {
269
- function t(l, m) {
257
+ function t(l, f) {
270
258
  let b = x(e[x(l)]);
271
- return m != null && (b = me(b, m)), typeof b == "number" && (b = `${b}px`), b;
259
+ return f != null && (b = me(b, f)), typeof b == "number" && (b = `${b}px`), b;
272
260
  }
273
- const { window: n = R, strategy: f = "min-width", ssrWidth: s = /* @__PURE__ */ Q() } = o, c = typeof s == "number", d = c ? E(!1) : { value: !0 };
274
- c && pe(() => d.value = !!n);
275
- function r(l, m) {
276
- return !d.value && c ? l === "min" ? s >= j(m) : s <= j(m) : n ? n.matchMedia(`(${l}-width: ${m})`).matches : !1;
261
+ const { window: n = R, strategy: v = "min-width", ssrWidth: s = /* @__PURE__ */ Q() } = o, d = typeof s == "number", c = d ? E(!1) : { value: !0 };
262
+ d && pe(() => c.value = !!n);
263
+ function r(l, f) {
264
+ return !c.value && d ? l === "min" ? s >= j(f) : s <= j(f) : n ? n.matchMedia(`(${l}-width: ${f})`).matches : !1;
277
265
  }
278
- const a = (l) => L(() => `(min-width: ${t(l)})`, o), v = (l) => L(() => `(max-width: ${t(l)})`, o), g = Object.keys(e).reduce((l, m) => (Object.defineProperty(l, m, {
279
- get: () => f === "min-width" ? a(m) : v(m),
266
+ const a = (l) => L(() => `(min-width: ${t(l)})`, o), m = (l) => L(() => `(max-width: ${t(l)})`, o), g = Object.keys(e).reduce((l, f) => (Object.defineProperty(l, f, {
267
+ get: () => v === "min-width" ? a(f) : m(f),
280
268
  enumerable: !0,
281
269
  configurable: !0
282
270
  }), l), {});
283
271
  function y() {
284
- const l = Object.keys(e).map((m) => [m, g[m], j(t(m))]).sort((m, b) => m[2] - b[2]);
285
- return M(() => l.filter(([, m]) => m.value).map(([m]) => m));
272
+ const l = Object.keys(e).map((f) => [f, g[f], j(t(f))]).sort((f, b) => f[2] - b[2]);
273
+ return M(() => l.filter(([, f]) => f.value).map(([f]) => f));
286
274
  }
287
275
  return Object.assign(g, {
288
276
  greaterOrEqual: a,
289
- smallerOrEqual: v,
277
+ smallerOrEqual: m,
290
278
  greater(l) {
291
279
  return L(() => `(min-width: ${t(l, 0.1)})`, o);
292
280
  },
293
281
  smaller(l) {
294
282
  return L(() => `(max-width: ${t(l, -0.1)})`, o);
295
283
  },
296
- between(l, m) {
297
- return L(() => `(min-width: ${t(l)}) and (max-width: ${t(m, -0.1)})`, o);
284
+ between(l, f) {
285
+ return L(() => `(min-width: ${t(l)}) and (max-width: ${t(f, -0.1)})`, o);
298
286
  },
299
287
  isGreater(l) {
300
288
  return r("min", t(l, 0.1));
@@ -308,31 +296,31 @@ function be(e, o = {}) {
308
296
  isSmallerOrEqual(l) {
309
297
  return r("max", t(l));
310
298
  },
311
- isInBetween(l, m) {
312
- return r("min", t(l)) && r("max", t(m, -0.1));
299
+ isInBetween(l, f) {
300
+ return r("min", t(l)) && r("max", t(f, -0.1));
313
301
  },
314
302
  current: y,
315
303
  active() {
316
304
  const l = y();
317
- return M(() => l.value.length === 0 ? "" : l.value.at(f === "min-width" ? -1 : 0));
305
+ return M(() => l.value.length === 0 ? "" : l.value.at(v === "min-width" ? -1 : 0));
318
306
  }
319
307
  });
320
308
  }
321
309
  // @__NO_SIDE_EFFECTS__
322
- function q(e, o = {}) {
310
+ function B(e, o = {}) {
323
311
  const {
324
312
  controls: t = !1,
325
313
  navigator: n = H
326
- } = o, f = /* @__PURE__ */ Y(() => n && "permissions" in n), s = E(), c = typeof e == "string" ? { name: e } : e, d = E(), r = () => {
327
- var v, g;
328
- d.value = (g = (v = s.value) == null ? void 0 : v.state) != null ? g : "prompt";
314
+ } = o, v = /* @__PURE__ */ N(() => n && "permissions" in n), s = E(), d = typeof e == "string" ? { name: e } : e, c = E(), r = () => {
315
+ var m, g;
316
+ c.value = (g = (m = s.value) == null ? void 0 : m.state) != null ? g : "prompt";
329
317
  };
330
318
  T(s, "change", r, { passive: !0 });
331
319
  const a = de(async () => {
332
- if (f.value) {
320
+ if (v.value) {
333
321
  if (!s.value)
334
322
  try {
335
- s.value = await n.permissions.query(c);
323
+ s.value = await n.permissions.query(d);
336
324
  } catch {
337
325
  s.value = void 0;
338
326
  } finally {
@@ -343,40 +331,40 @@ function q(e, o = {}) {
343
331
  }
344
332
  });
345
333
  return a(), t ? {
346
- state: d,
347
- isSupported: f,
334
+ state: c,
335
+ isSupported: v,
348
336
  query: a
349
- } : d;
337
+ } : c;
350
338
  }
351
- function Pe(e = {}) {
339
+ function Ce(e = {}) {
352
340
  const {
353
341
  navigator: o = H,
354
342
  read: t = !1,
355
343
  source: n,
356
- copiedDuring: f = 1500,
344
+ copiedDuring: v = 1500,
357
345
  legacy: s = !1
358
- } = e, c = /* @__PURE__ */ Y(() => o && "clipboard" in o), d = /* @__PURE__ */ q("clipboard-read"), r = /* @__PURE__ */ q("clipboard-write"), a = M(() => c.value || s), v = E(""), g = E(!1), y = he(() => g.value = !1, f, { immediate: !1 });
346
+ } = e, d = /* @__PURE__ */ N(() => o && "clipboard" in o), c = /* @__PURE__ */ B("clipboard-read"), r = /* @__PURE__ */ B("clipboard-write"), a = M(() => d.value || s), m = E(""), g = E(!1), y = he(() => g.value = !1, v, { immediate: !1 });
359
347
  async function l() {
360
- let p = !(c.value && u(d.value));
348
+ let p = !(d.value && u(c.value));
361
349
  if (!p)
362
350
  try {
363
- v.value = await o.clipboard.readText();
351
+ m.value = await o.clipboard.readText();
364
352
  } catch {
365
353
  p = !0;
366
354
  }
367
- p && (v.value = i());
355
+ p && (m.value = i());
368
356
  }
369
357
  a.value && t && T(["copy", "cut"], l, { passive: !0 });
370
- async function m(p = x(n)) {
358
+ async function f(p = x(n)) {
371
359
  if (a.value && p != null) {
372
- let w = !(c.value && u(r.value));
360
+ let w = !(d.value && u(r.value));
373
361
  if (!w)
374
362
  try {
375
363
  await o.clipboard.writeText(p);
376
364
  } catch {
377
365
  w = !0;
378
366
  }
379
- w && b(p), v.value = p, g.value = !0, y.start();
367
+ w && b(p), m.value = p, g.value = !0, y.start();
380
368
  }
381
369
  }
382
370
  function b(p) {
@@ -392,9 +380,9 @@ function Pe(e = {}) {
392
380
  }
393
381
  return {
394
382
  isSupported: a,
395
- text: v,
383
+ text: m,
396
384
  copied: g,
397
- copy: m
385
+ copy: f
398
386
  };
399
387
  }
400
388
  const Se = {
@@ -412,39 +400,39 @@ function xe(e = {}) {
412
400
  reactive: o = !1,
413
401
  target: t = R,
414
402
  aliasMap: n = Se,
415
- passive: f = !0,
403
+ passive: v = !0,
416
404
  onEventFired: s = C
417
- } = e, c = $(/* @__PURE__ */ new Set()), d = {
405
+ } = e, d = $(/* @__PURE__ */ new Set()), c = {
418
406
  toJSON() {
419
407
  return {};
420
408
  },
421
- current: c
422
- }, r = o ? $(d) : d, a = /* @__PURE__ */ new Set(), v = /* @__PURE__ */ new Set(), g = /* @__PURE__ */ new Set();
409
+ current: d
410
+ }, r = o ? $(c) : c, a = /* @__PURE__ */ new Set(), m = /* @__PURE__ */ new Set(), g = /* @__PURE__ */ new Set();
423
411
  function y(i, u) {
424
412
  i in r && (o ? r[i] = u : r[i].value = u);
425
413
  }
426
414
  function l() {
427
- c.clear();
415
+ d.clear();
428
416
  for (const i of g)
429
417
  y(i, !1);
430
418
  }
431
- function m(i, u) {
419
+ function f(i, u) {
432
420
  var p, w;
433
421
  const S = (p = i.key) == null ? void 0 : p.toLowerCase(), k = [(w = i.code) == null ? void 0 : w.toLowerCase(), S].filter(Boolean);
434
- S && (u ? c.add(S) : c.delete(S));
422
+ S && (u ? d.add(S) : d.delete(S));
435
423
  for (const h of k)
436
424
  g.add(h), y(h, u);
437
425
  if (S === "shift" && !u) {
438
- const h = Array.from(v), O = h.indexOf("shift");
426
+ const h = Array.from(m), O = h.indexOf("shift");
439
427
  h.forEach((P, J) => {
440
- J >= O && (c.delete(P), y(P, !1));
441
- }), v.clear();
442
- } else typeof i.getModifierState == "function" && i.getModifierState("Shift") && u && [...c, ...k].forEach((h) => v.add(h));
428
+ J >= O && (d.delete(P), y(P, !1));
429
+ }), m.clear();
430
+ } else typeof i.getModifierState == "function" && i.getModifierState("Shift") && u && [...d, ...k].forEach((h) => m.add(h));
443
431
  S === "meta" && !u ? (a.forEach((h) => {
444
- c.delete(h), y(h, !1);
445
- }), a.clear()) : typeof i.getModifierState == "function" && i.getModifierState("Meta") && u && [...c, ...k].forEach((h) => a.add(h));
432
+ d.delete(h), y(h, !1);
433
+ }), a.clear()) : typeof i.getModifierState == "function" && i.getModifierState("Meta") && u && [...d, ...k].forEach((h) => a.add(h));
446
434
  }
447
- T(t, "keydown", (i) => (m(i, !0), s(i)), { passive: f }), T(t, "keyup", (i) => (m(i, !1), s(i)), { passive: f }), T("blur", l, { passive: f }), T("focus", l, { passive: f });
435
+ T(t, "keydown", (i) => (f(i, !0), s(i)), { passive: v }), T(t, "keyup", (i) => (f(i, !1), s(i)), { passive: v }), T("blur", l, { passive: v }), T("focus", l, { passive: v });
448
436
  const b = new Proxy(
449
437
  r,
450
438
  {
@@ -468,15 +456,15 @@ function Ee(e, o = {}) {
468
456
  const {
469
457
  threshold: t = 50,
470
458
  onSwipe: n,
471
- onSwipeEnd: f,
459
+ onSwipeEnd: v,
472
460
  onSwipeStart: s,
473
- passive: c = !0
474
- } = o, d = $({ x: 0, y: 0 }), r = $({ x: 0, y: 0 }), a = M(() => d.x - r.x), v = M(() => d.y - r.y), { max: g, abs: y } = Math, l = M(() => g(y(a.value), y(v.value)) >= t), m = E(!1), b = M(() => l.value ? y(a.value) > y(v.value) ? a.value > 0 ? "left" : "right" : v.value > 0 ? "up" : "down" : "none"), i = (h) => [h.touches[0].clientX, h.touches[0].clientY], u = (h, O) => {
475
- d.x = h, d.y = O;
461
+ passive: d = !0
462
+ } = o, c = $({ x: 0, y: 0 }), r = $({ x: 0, y: 0 }), a = M(() => c.x - r.x), m = M(() => c.y - r.y), { max: g, abs: y } = Math, l = M(() => g(y(a.value), y(m.value)) >= t), f = E(!1), b = M(() => l.value ? y(a.value) > y(m.value) ? a.value > 0 ? "left" : "right" : m.value > 0 ? "up" : "down" : "none"), i = (h) => [h.touches[0].clientX, h.touches[0].clientY], u = (h, O) => {
463
+ c.x = h, c.y = O;
476
464
  }, p = (h, O) => {
477
465
  r.x = h, r.y = O;
478
- }, w = { passive: c, capture: !c }, S = (h) => {
479
- m.value && (f == null || f(h, b.value)), m.value = !1;
466
+ }, w = { passive: d, capture: !d }, S = (h) => {
467
+ f.value && (v == null || v(h, b.value)), f.value = !1;
480
468
  }, A = [
481
469
  T(e, "touchstart", (h) => {
482
470
  if (h.touches.length !== 1)
@@ -488,88 +476,86 @@ function Ee(e, o = {}) {
488
476
  if (h.touches.length !== 1)
489
477
  return;
490
478
  const [O, P] = i(h);
491
- p(O, P), w.capture && !w.passive && Math.abs(a.value) > Math.abs(v.value) && h.preventDefault(), !m.value && l.value && (m.value = !0), m.value && (n == null || n(h));
479
+ p(O, P), w.capture && !w.passive && Math.abs(a.value) > Math.abs(m.value) && h.preventDefault(), !f.value && l.value && (f.value = !0), f.value && (n == null || n(h));
492
480
  }, w),
493
481
  T(e, ["touchend", "touchcancel"], S, w)
494
482
  ];
495
483
  return {
496
- isSwiping: m,
484
+ isSwiping: f,
497
485
  direction: b,
498
- coordsStart: d,
486
+ coordsStart: c,
499
487
  coordsEnd: r,
500
488
  lengthX: a,
501
- lengthY: v,
489
+ lengthY: m,
502
490
  stop: () => A.forEach((h) => h()),
503
491
  // TODO: Remove in the next major version
504
492
  isPassiveEventSupported: !0
505
493
  };
506
494
  }
507
- const Ae = (e, o) => {
508
- const t = I(!1), n = I(!1), f = I(null), s = xe();
509
- s != null && s.escape && N(s.escape, () => {
510
- c(new Event("close"));
495
+ const Pe = (e, o) => {
496
+ const t = I(!1), n = I(!1), v = I(null), s = xe();
497
+ s != null && s.escape && G(s.escape, () => {
498
+ d(new Event("close"));
511
499
  });
512
- const c = (r) => {
500
+ const d = (r) => {
513
501
  n.value = !1, setTimeout(() => {
514
502
  t.value = !1;
515
503
  }, 50), setTimeout(() => {
516
504
  e("close", r || new Event("close"));
517
- }, 300), f.value && clearTimeout(f.value);
518
- }, d = () => e("open", t.value);
519
- return G(() => {
505
+ }, 300), v.value && clearTimeout(v.value);
506
+ }, c = () => e("open", t.value);
507
+ return q(() => {
520
508
  setTimeout(() => {
521
509
  t.value = !0;
522
510
  }, 300), setTimeout(() => {
523
511
  n.value = !0;
524
- }, 500), o && (f.value = setTimeout(() => {
525
- c();
512
+ }, 500), o && (v.value = setTimeout(() => {
513
+ d();
526
514
  }, o * 1e3));
527
515
  }), {
528
516
  show: t,
529
517
  overlay: n,
530
- onClose: c,
531
- onOpen: d
518
+ onClose: d,
519
+ onOpen: c
532
520
  };
533
- }, Le = (e, o, t) => {
521
+ }, Ae = (e, o, t) => {
534
522
  const n = M(() => {
535
523
  var a;
536
524
  return (a = o.value) == null ? void 0 : a.clientHeight;
537
- }), f = E("translateY(0)"), s = E(1), c = E(!1);
525
+ }), v = E("translateY(0)"), s = E(1), d = E(!1);
538
526
  if ((/* @__PURE__ */ be(ge)).greaterOrEqual("lg")) {
539
527
  const { lengthY: a } = Ee(e, {
540
528
  passive: !1,
541
529
  onSwipeStart() {
542
- c.value = !0;
530
+ d.value = !0;
543
531
  },
544
532
  onSwipe() {
545
533
  if (n.value)
546
534
  if (a.value < 0) {
547
- const v = Math.abs(a.value);
548
- f.value = `translateY(${v}px)`, s.value = 1.1 - v / n.value, s.value < 0.3 && (s.value = 0);
535
+ const m = Math.abs(a.value);
536
+ v.value = `translateY(${m}px)`, s.value = 1.1 - m / n.value, s.value < 0.3 && (s.value = 0);
549
537
  } else
550
- f.value = "translateY(0)", s.value = 1;
538
+ v.value = "translateY(0)", s.value = 1;
551
539
  },
552
- onSwipeEnd(v) {
553
- c.value = !1, a.value < 0 && n.value && Math.abs(a.value) / n.value >= 0.5 ? (s.value = 0, setTimeout(() => {
554
- t(v);
555
- }, 100)) : (f.value = "translateY(0)", s.value = 1);
540
+ onSwipeEnd(m) {
541
+ d.value = !1, a.value < 0 && n.value && Math.abs(a.value) / n.value >= 0.5 ? (s.value = 0, setTimeout(() => {
542
+ t(m);
543
+ }, 100)) : (v.value = "translateY(0)", s.value = 1);
556
544
  }
557
545
  });
558
546
  }
559
547
  return {
560
- isSwiping: c,
561
- transform: f,
548
+ isSwiping: d,
549
+ transform: v,
562
550
  opacity: s
563
551
  };
564
552
  };
565
553
  export {
566
- Le as a,
554
+ Ae as a,
567
555
  be as b,
568
556
  ge as c,
569
557
  Me as d,
570
- Pe as e,
571
- xe as f,
572
- Ce as o,
573
- Ae as u,
574
- Oe as w
558
+ Ce as e,
559
+ Oe as o,
560
+ Pe as u
575
561
  };
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "2.1.6",
2
+ "version": "2.1.8",
3
3
  "name": "vuesp-components",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",