vuesp-components 2.1.5 → 2.1.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. package/dist/components/block/service/BlockService.vue.d.ts +2 -2
  2. package/dist/components/block/service/types.d.ts +2 -2
  3. package/dist/components/block/service/types.d.ts.map +1 -1
  4. package/dist/components/dashboard/cards/CardBase.vue.d.ts +2 -0
  5. package/dist/components/dashboard/cards/CardBase.vue.d.ts.map +1 -1
  6. package/dist/components/dashboard/cards/CardButton.vue.d.ts +2 -0
  7. package/dist/components/dashboard/cards/CardButton.vue.d.ts.map +1 -1
  8. package/dist/components/dashboard/cards/CardDate.vue.d.ts +2 -0
  9. package/dist/components/dashboard/cards/CardDate.vue.d.ts.map +1 -1
  10. package/dist/components/dashboard/cards/CardDimmer.vue.d.ts +2 -0
  11. package/dist/components/dashboard/cards/CardDimmer.vue.d.ts.map +1 -1
  12. package/dist/components/dashboard/cards/CardInfo.vue.d.ts +2 -0
  13. package/dist/components/dashboard/cards/CardInfo.vue.d.ts.map +1 -1
  14. package/dist/components/dashboard/cards/CardInput.vue.d.ts +2 -0
  15. package/dist/components/dashboard/cards/CardInput.vue.d.ts.map +1 -1
  16. package/dist/components/dashboard/cards/CardList.vue.d.ts +2 -0
  17. package/dist/components/dashboard/cards/CardList.vue.d.ts.map +1 -1
  18. package/dist/components/dashboard/cards/types.d.ts +1 -1
  19. package/dist/components/dashboard/cards/types.d.ts.map +1 -1
  20. package/dist/components/dashboard/edit/ItemEdit.vue.d.ts +1 -1
  21. package/dist/components/dashboard/edit/ItemEdit.vue.d.ts.map +1 -1
  22. package/dist/components/dashboard/edit/types.d.ts +5 -4
  23. package/dist/components/dashboard/edit/types.d.ts.map +1 -1
  24. package/dist/components/script/editor/ScriptEditor.vue.d.ts +2 -0
  25. package/dist/components/script/editor/ScriptEditor.vue.d.ts.map +1 -1
  26. package/dist/components/script/editor/types.d.ts +2 -1
  27. package/dist/components/script/editor/types.d.ts.map +1 -1
  28. package/dist/components/ui/autocomplete/VAutocomplete.vue.d.ts +17 -20
  29. package/dist/components/ui/autocomplete/VAutocomplete.vue.d.ts.map +1 -1
  30. package/dist/components/ui/autocomplete/types.d.ts +4 -4
  31. package/dist/components/ui/autocomplete/types.d.ts.map +1 -1
  32. package/dist/components/ui/dialog/VDialog.vue.d.ts.map +1 -1
  33. package/dist/components/ui/drag-drop/VDragDrop.vue.d.ts.map +1 -1
  34. package/dist/components/ui/list/VListObject.vue.d.ts.map +1 -1
  35. package/dist/components/ui/select/VSelect.vue.d.ts +0 -1
  36. package/dist/components/ui/select/VSelect.vue.d.ts.map +1 -1
  37. package/dist/components/ui/text-field/VTextField.vue.d.ts.map +1 -1
  38. package/dist/composables/index.es.js +50 -49
  39. package/dist/composables/types.d.ts +1 -0
  40. package/dist/composables/types.d.ts.map +1 -1
  41. package/dist/composables/useForms.d.ts.map +1 -1
  42. package/dist/dashboard/types.d.ts +1 -1
  43. package/dist/dashboard/types.d.ts.map +1 -1
  44. package/dist/helpers/general.d.ts +1 -0
  45. package/dist/helpers/general.d.ts.map +1 -1
  46. package/dist/helpers/index.es.js +17 -16
  47. package/dist/index.d.ts +2 -2
  48. package/dist/index.d.ts.map +1 -1
  49. package/dist/index.es.js +1354 -1328
  50. package/dist/style.css +1 -1
  51. package/dist/types/components.d.ts +2 -2
  52. package/dist/types/components.d.ts.map +1 -1
  53. package/dist/useSwipeDown-BctVX4c1.js +561 -0
  54. package/package.json +3 -3
  55. package/dist/useSwipeDown-DCYgiAUA.js +0 -448
@@ -0,0 +1,561 @@
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
+ function X(e) {
3
+ return Z() ? (ee(e), !0) : !1;
4
+ }
5
+ const D = /* @__PURE__ */ new WeakMap(), ie = /* @__NO_SIDE_EFFECTS__ */ (...e) => {
6
+ var o;
7
+ const t = e[0], n = (o = K()) == null ? void 0 : o.proxy;
8
+ if (n == null && !V())
9
+ throw new Error("injectLocal must be called in setup");
10
+ return n && D.has(n) && t in D.get(n) ? D.get(n)[t] : te(...e);
11
+ }, _ = typeof window < "u" && typeof document < "u";
12
+ typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
13
+ const se = Object.prototype.toString, ae = (e) => se.call(e) === "[object Object]", C = () => {
14
+ }, ue = /* @__PURE__ */ le();
15
+ function le() {
16
+ var e, o;
17
+ return _ && ((e = window == null ? void 0 : window.navigator) == null ? void 0 : e.userAgent) && (/iP(?:ad|hone|od)/.test(window.navigator.userAgent) || ((o = window == null ? void 0 : window.navigator) == null ? void 0 : o.maxTouchPoints) > 2 && /iPad|Macintosh/.test(window == null ? void 0 : window.navigator.userAgent));
18
+ }
19
+ function ce(e, o) {
20
+ function t(...n) {
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
+ });
24
+ }
25
+ return t;
26
+ }
27
+ function fe(e, o = {}) {
28
+ let t, n, v = C;
29
+ const s = (r) => {
30
+ clearTimeout(r), v(), v = C;
31
+ };
32
+ let d;
33
+ return (r) => {
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
+ n && s(n), n = void 0, g(r());
40
+ }, a);
41
+ });
42
+ };
43
+ }
44
+ function de(e) {
45
+ let o;
46
+ function t() {
47
+ return o || (o = e()), o;
48
+ }
49
+ return t.reset = async () => {
50
+ const n = o;
51
+ o = void 0, n && await n;
52
+ }, t;
53
+ }
54
+ function me(e, o) {
55
+ var t;
56
+ if (typeof e == "number")
57
+ return e + o;
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
+ }
61
+ function j(e) {
62
+ return e.endsWith("rem") ? Number.parseFloat(e) * 16 : Number.parseFloat(e);
63
+ }
64
+ function F(e) {
65
+ return Array.isArray(e) ? e : [e];
66
+ }
67
+ function ve(e) {
68
+ return K();
69
+ }
70
+ // @__NO_SIDE_EFFECTS__
71
+ function Me(e, o = 200, t = {}) {
72
+ return ce(
73
+ fe(o, t),
74
+ e
75
+ );
76
+ }
77
+ function pe(e, o = !0, t) {
78
+ ve() ? q(e, t) : o ? e() : z(e);
79
+ }
80
+ function he(e, o, t = {}) {
81
+ const {
82
+ immediate: n = !0,
83
+ immediateCallback: v = !1
84
+ } = t, s = E(!1);
85
+ let d;
86
+ function c() {
87
+ d && (clearTimeout(d), d = void 0);
88
+ }
89
+ function r() {
90
+ s.value = !1, c();
91
+ }
92
+ function a(...m) {
93
+ v && e(), c(), s.value = !0, d = setTimeout(() => {
94
+ s.value = !1, d = void 0, e(...m);
95
+ }, x(o));
96
+ }
97
+ return n && (s.value = !0, _ && a()), X(r), {
98
+ isPending: U(s),
99
+ start: a,
100
+ stop: r
101
+ };
102
+ }
103
+ function we(e, o, t) {
104
+ return G(
105
+ e,
106
+ o,
107
+ {
108
+ ...t,
109
+ immediate: !0
110
+ }
111
+ );
112
+ }
113
+ const R = _ ? window : void 0, H = _ ? window.navigator : void 0;
114
+ function W(e) {
115
+ var o;
116
+ const t = x(e);
117
+ return (o = t == null ? void 0 : t.$el) != null ? o : t;
118
+ }
119
+ function T(...e) {
120
+ const o = [], t = () => {
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;
125
+ }), s = we(
126
+ () => {
127
+ var c, r;
128
+ return [
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])),
132
+ // @ts-expect-error - TypeScript gets the correct types, but somehow still complains
133
+ x(v.value ? e[3] : e[2])
134
+ ];
135
+ },
136
+ ([c, r, a, m]) => {
137
+ if (t(), !(c != null && c.length) || !(r != null && r.length) || !(a != null && a.length))
138
+ return;
139
+ const g = ae(m) ? { ...m } : m;
140
+ o.push(
141
+ ...c.flatMap(
142
+ (y) => r.flatMap(
143
+ (l) => a.map((f) => n(y, l, f, g))
144
+ )
145
+ )
146
+ );
147
+ },
148
+ { flush: "post" }
149
+ ), d = () => {
150
+ s(), t();
151
+ };
152
+ return X(t), d;
153
+ }
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;
157
+ if (!n)
158
+ return c ? { stop: C, cancel: C, trigger: C } : C;
159
+ if (ue && !Y) {
160
+ Y = !0;
161
+ const i = { passive: !0 };
162
+ Array.from(n.document.body.children).forEach((u) => u.addEventListener("click", C, i)), n.document.documentElement.addEventListener("click", C, i);
163
+ }
164
+ let r = !0;
165
+ const a = (i) => x(v).some((u) => {
166
+ if (typeof u == "string")
167
+ return Array.from(n.document.querySelectorAll(u)).some((p) => p === i.target || i.composedPath().includes(p));
168
+ {
169
+ const p = W(u);
170
+ return p && (i.target === p || i.composedPath().includes(p));
171
+ }
172
+ });
173
+ function m(i) {
174
+ const u = x(i);
175
+ return u && u.$.subTree.shapeFlag === 16;
176
+ }
177
+ function g(i, u) {
178
+ const p = x(i), w = p.$.subTree && p.$.subTree.children;
179
+ return w == null || !Array.isArray(w) ? !1 : w.some((S) => S.el === u.target || u.composedPath().includes(S.el));
180
+ }
181
+ const y = (i) => {
182
+ const u = W(e);
183
+ if (i.target != null && !(!(u instanceof Element) && m(e) && g(e, i)) && !(!u || u === i.target || i.composedPath().includes(u))) {
184
+ if ("detail" in i && i.detail === 0 && (r = !a(i)), !r) {
185
+ r = !0;
186
+ return;
187
+ }
188
+ o(i);
189
+ }
190
+ };
191
+ let l = !1;
192
+ const f = [
193
+ T(n, "click", (i) => {
194
+ l || (l = !0, setTimeout(() => {
195
+ l = !1;
196
+ }, 0), y(i));
197
+ }, { passive: !0, capture: s }),
198
+ T(n, "pointerdown", (i) => {
199
+ const u = W(e);
200
+ r = !a(i) && !!(u && !i.composedPath().includes(u));
201
+ }, { passive: !0 }),
202
+ d && T(n, "blur", (i) => {
203
+ setTimeout(() => {
204
+ var u;
205
+ const p = W(e);
206
+ ((u = n.document.activeElement) == null ? void 0 : u.tagName) === "IFRAME" && !(p != null && p.contains(n.document.activeElement)) && o(i);
207
+ }, 0);
208
+ }, { passive: !0 })
209
+ ].filter(Boolean), b = () => f.forEach((i) => i());
210
+ return c ? {
211
+ stop: b,
212
+ cancel: () => {
213
+ r = !1;
214
+ },
215
+ trigger: (i) => {
216
+ r = !0, y(i), r = !1;
217
+ }
218
+ } : b;
219
+ }
220
+ // @__NO_SIDE_EFFECTS__
221
+ function N(e) {
222
+ return M(() => !!e());
223
+ }
224
+ const ye = Symbol("vueuse-ssr-width");
225
+ // @__NO_SIDE_EFFECTS__
226
+ function Q() {
227
+ const e = V() ? /* @__PURE__ */ ie(ye, null) : null;
228
+ return typeof e == "number" ? e : void 0;
229
+ }
230
+ function L(e, o = {}) {
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;
233
+ };
234
+ return ne(() => {
235
+ if (s.value) {
236
+ s.value = !v.value;
237
+ const a = x(e).split(",");
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;
242
+ });
243
+ return;
244
+ }
245
+ v.value && (d.value = t.matchMedia(x(e)), c.value = d.value.matches);
246
+ }), T(d, "change", r, { passive: !0 }), M(() => c.value);
247
+ }
248
+ const ge = {
249
+ sm: 640,
250
+ md: 768,
251
+ lg: 1024,
252
+ xl: 1280,
253
+ "2xl": 1536
254
+ };
255
+ // @__NO_SIDE_EFFECTS__
256
+ function be(e, o = {}) {
257
+ function t(l, f) {
258
+ let b = x(e[x(l)]);
259
+ return f != null && (b = me(b, f)), typeof b == "number" && (b = `${b}px`), b;
260
+ }
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;
265
+ }
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),
268
+ enumerable: !0,
269
+ configurable: !0
270
+ }), l), {});
271
+ function y() {
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));
274
+ }
275
+ return Object.assign(g, {
276
+ greaterOrEqual: a,
277
+ smallerOrEqual: m,
278
+ greater(l) {
279
+ return L(() => `(min-width: ${t(l, 0.1)})`, o);
280
+ },
281
+ smaller(l) {
282
+ return L(() => `(max-width: ${t(l, -0.1)})`, o);
283
+ },
284
+ between(l, f) {
285
+ return L(() => `(min-width: ${t(l)}) and (max-width: ${t(f, -0.1)})`, o);
286
+ },
287
+ isGreater(l) {
288
+ return r("min", t(l, 0.1));
289
+ },
290
+ isGreaterOrEqual(l) {
291
+ return r("min", t(l));
292
+ },
293
+ isSmaller(l) {
294
+ return r("max", t(l, -0.1));
295
+ },
296
+ isSmallerOrEqual(l) {
297
+ return r("max", t(l));
298
+ },
299
+ isInBetween(l, f) {
300
+ return r("min", t(l)) && r("max", t(f, -0.1));
301
+ },
302
+ current: y,
303
+ active() {
304
+ const l = y();
305
+ return M(() => l.value.length === 0 ? "" : l.value.at(v === "min-width" ? -1 : 0));
306
+ }
307
+ });
308
+ }
309
+ // @__NO_SIDE_EFFECTS__
310
+ function B(e, o = {}) {
311
+ const {
312
+ controls: t = !1,
313
+ navigator: n = H
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";
317
+ };
318
+ T(s, "change", r, { passive: !0 });
319
+ const a = de(async () => {
320
+ if (v.value) {
321
+ if (!s.value)
322
+ try {
323
+ s.value = await n.permissions.query(d);
324
+ } catch {
325
+ s.value = void 0;
326
+ } finally {
327
+ r();
328
+ }
329
+ if (t)
330
+ return re(s.value);
331
+ }
332
+ });
333
+ return a(), t ? {
334
+ state: c,
335
+ isSupported: v,
336
+ query: a
337
+ } : c;
338
+ }
339
+ function Ce(e = {}) {
340
+ const {
341
+ navigator: o = H,
342
+ read: t = !1,
343
+ source: n,
344
+ copiedDuring: v = 1500,
345
+ legacy: s = !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 });
347
+ async function l() {
348
+ let p = !(d.value && u(c.value));
349
+ if (!p)
350
+ try {
351
+ m.value = await o.clipboard.readText();
352
+ } catch {
353
+ p = !0;
354
+ }
355
+ p && (m.value = i());
356
+ }
357
+ a.value && t && T(["copy", "cut"], l, { passive: !0 });
358
+ async function f(p = x(n)) {
359
+ if (a.value && p != null) {
360
+ let w = !(d.value && u(r.value));
361
+ if (!w)
362
+ try {
363
+ await o.clipboard.writeText(p);
364
+ } catch {
365
+ w = !0;
366
+ }
367
+ w && b(p), m.value = p, g.value = !0, y.start();
368
+ }
369
+ }
370
+ function b(p) {
371
+ const w = document.createElement("textarea");
372
+ w.value = p ?? "", w.style.position = "absolute", w.style.opacity = "0", document.body.appendChild(w), w.select(), document.execCommand("copy"), w.remove();
373
+ }
374
+ function i() {
375
+ var p, w, S;
376
+ return (S = (w = (p = document == null ? void 0 : document.getSelection) == null ? void 0 : p.call(document)) == null ? void 0 : w.toString()) != null ? S : "";
377
+ }
378
+ function u(p) {
379
+ return p === "granted" || p === "prompt";
380
+ }
381
+ return {
382
+ isSupported: a,
383
+ text: m,
384
+ copied: g,
385
+ copy: f
386
+ };
387
+ }
388
+ const Se = {
389
+ ctrl: "control",
390
+ command: "meta",
391
+ cmd: "meta",
392
+ option: "alt",
393
+ up: "arrowup",
394
+ down: "arrowdown",
395
+ left: "arrowleft",
396
+ right: "arrowright"
397
+ };
398
+ function xe(e = {}) {
399
+ const {
400
+ reactive: o = !1,
401
+ target: t = R,
402
+ aliasMap: n = Se,
403
+ passive: v = !0,
404
+ onEventFired: s = C
405
+ } = e, d = $(/* @__PURE__ */ new Set()), c = {
406
+ toJSON() {
407
+ return {};
408
+ },
409
+ current: d
410
+ }, r = o ? $(c) : c, a = /* @__PURE__ */ new Set(), m = /* @__PURE__ */ new Set(), g = /* @__PURE__ */ new Set();
411
+ function y(i, u) {
412
+ i in r && (o ? r[i] = u : r[i].value = u);
413
+ }
414
+ function l() {
415
+ d.clear();
416
+ for (const i of g)
417
+ y(i, !1);
418
+ }
419
+ function f(i, u) {
420
+ var p, w;
421
+ const S = (p = i.key) == null ? void 0 : p.toLowerCase(), k = [(w = i.code) == null ? void 0 : w.toLowerCase(), S].filter(Boolean);
422
+ S && (u ? d.add(S) : d.delete(S));
423
+ for (const h of k)
424
+ g.add(h), y(h, u);
425
+ if (S === "shift" && !u) {
426
+ const h = Array.from(m), O = h.indexOf("shift");
427
+ h.forEach((P, J) => {
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));
431
+ S === "meta" && !u ? (a.forEach((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));
434
+ }
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 });
436
+ const b = new Proxy(
437
+ r,
438
+ {
439
+ get(i, u, p) {
440
+ if (typeof u != "string")
441
+ return Reflect.get(i, u, p);
442
+ if (u = u.toLowerCase(), u in n && (u = n[u]), !(u in r))
443
+ if (/[+_-]/.test(u)) {
444
+ const S = u.split(/[+_-]/g).map((A) => A.trim());
445
+ r[u] = M(() => S.map((A) => x(b[A])).every(Boolean));
446
+ } else
447
+ r[u] = E(!1);
448
+ const w = Reflect.get(i, u, p);
449
+ return o ? x(w) : w;
450
+ }
451
+ }
452
+ );
453
+ return b;
454
+ }
455
+ function Ee(e, o = {}) {
456
+ const {
457
+ threshold: t = 50,
458
+ onSwipe: n,
459
+ onSwipeEnd: v,
460
+ onSwipeStart: s,
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;
464
+ }, p = (h, O) => {
465
+ r.x = h, r.y = O;
466
+ }, w = { passive: d, capture: !d }, S = (h) => {
467
+ f.value && (v == null || v(h, b.value)), f.value = !1;
468
+ }, A = [
469
+ T(e, "touchstart", (h) => {
470
+ if (h.touches.length !== 1)
471
+ return;
472
+ const [O, P] = i(h);
473
+ u(O, P), p(O, P), s == null || s(h);
474
+ }, w),
475
+ T(e, "touchmove", (h) => {
476
+ if (h.touches.length !== 1)
477
+ return;
478
+ const [O, P] = i(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));
480
+ }, w),
481
+ T(e, ["touchend", "touchcancel"], S, w)
482
+ ];
483
+ return {
484
+ isSwiping: f,
485
+ direction: b,
486
+ coordsStart: c,
487
+ coordsEnd: r,
488
+ lengthX: a,
489
+ lengthY: m,
490
+ stop: () => A.forEach((h) => h()),
491
+ // TODO: Remove in the next major version
492
+ isPassiveEventSupported: !0
493
+ };
494
+ }
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"));
499
+ });
500
+ const d = (r) => {
501
+ n.value = !1, setTimeout(() => {
502
+ t.value = !1;
503
+ }, 50), setTimeout(() => {
504
+ e("close", r || new Event("close"));
505
+ }, 300), v.value && clearTimeout(v.value);
506
+ }, c = () => e("open", t.value);
507
+ return q(() => {
508
+ setTimeout(() => {
509
+ t.value = !0;
510
+ }, 300), setTimeout(() => {
511
+ n.value = !0;
512
+ }, 500), o && (v.value = setTimeout(() => {
513
+ d();
514
+ }, o * 1e3));
515
+ }), {
516
+ show: t,
517
+ overlay: n,
518
+ onClose: d,
519
+ onOpen: c
520
+ };
521
+ }, Ae = (e, o, t) => {
522
+ const n = M(() => {
523
+ var a;
524
+ return (a = o.value) == null ? void 0 : a.clientHeight;
525
+ }), v = E("translateY(0)"), s = E(1), d = E(!1);
526
+ if ((/* @__PURE__ */ be(ge)).greaterOrEqual("lg")) {
527
+ const { lengthY: a } = Ee(e, {
528
+ passive: !1,
529
+ onSwipeStart() {
530
+ d.value = !0;
531
+ },
532
+ onSwipe() {
533
+ if (n.value)
534
+ if (a.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);
537
+ } else
538
+ v.value = "translateY(0)", s.value = 1;
539
+ },
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);
544
+ }
545
+ });
546
+ }
547
+ return {
548
+ isSwiping: d,
549
+ transform: v,
550
+ opacity: s
551
+ };
552
+ };
553
+ export {
554
+ Ae as a,
555
+ be as b,
556
+ ge as c,
557
+ Me as d,
558
+ Ce as e,
559
+ Oe as o,
560
+ Pe as u
561
+ };
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "2.1.5",
2
+ "version": "2.1.7",
3
3
  "name": "vuesp-components",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
@@ -85,10 +85,10 @@
85
85
  "unplugin-vue-components": "^32.1.0",
86
86
  "vite": "^5.0.0",
87
87
  "vite-plugin-dts": "~4.5.0",
88
- "vue": "3.5.39",
88
+ "vue": "3.5.41",
89
89
  "vue-tsc": "^2.2.8"
90
90
  },
91
91
  "peerDependencies": {
92
- "vue": "^3.5.0"
92
+ "vue": "3.5.41"
93
93
  }
94
94
  }