vuesp-components 2.1.5 → 2.1.6

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 (49) 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.map +1 -1
  25. package/dist/components/ui/autocomplete/VAutocomplete.vue.d.ts +17 -20
  26. package/dist/components/ui/autocomplete/VAutocomplete.vue.d.ts.map +1 -1
  27. package/dist/components/ui/autocomplete/types.d.ts +4 -4
  28. package/dist/components/ui/autocomplete/types.d.ts.map +1 -1
  29. package/dist/components/ui/dialog/VDialog.vue.d.ts.map +1 -1
  30. package/dist/components/ui/drag-drop/VDragDrop.vue.d.ts.map +1 -1
  31. package/dist/components/ui/list/VListObject.vue.d.ts.map +1 -1
  32. package/dist/components/ui/select/VSelect.vue.d.ts +0 -1
  33. package/dist/components/ui/select/VSelect.vue.d.ts.map +1 -1
  34. package/dist/components/ui/text-field/VTextField.vue.d.ts.map +1 -1
  35. package/dist/composables/index.es.js +1 -1
  36. package/dist/dashboard/types.d.ts +1 -1
  37. package/dist/dashboard/types.d.ts.map +1 -1
  38. package/dist/helpers/general.d.ts +1 -0
  39. package/dist/helpers/general.d.ts.map +1 -1
  40. package/dist/helpers/index.es.js +17 -16
  41. package/dist/index.d.ts +2 -2
  42. package/dist/index.d.ts.map +1 -1
  43. package/dist/index.es.js +1569 -1494
  44. package/dist/style.css +1 -1
  45. package/dist/types/components.d.ts +2 -2
  46. package/dist/types/components.d.ts.map +1 -1
  47. package/dist/useSwipeDown-CZyt34x6.js +575 -0
  48. package/package.json +3 -3
  49. package/dist/useSwipeDown-DCYgiAUA.js +0 -448
@@ -1,448 +0,0 @@
1
- import { onMounted as Y, nextTick as X, watch as B, getCurrentScope as H, onScopeDispose as Q, getCurrentInstance as _, toValue as S, hasInjectionContext as G, inject as J, reactive as I, computed as x, shallowRef as P, watchEffect as U, unref as z, ref as D } from "vue";
2
- function Z(e) {
3
- return H() ? (Q(e), !0) : !1;
4
- }
5
- const R = /* @__PURE__ */ new WeakMap(), ee = /* @__NO_SIDE_EFFECTS__ */ (...e) => {
6
- var s;
7
- const t = e[0], n = (s = _()) == null ? void 0 : s.proxy;
8
- if (n == null && !G())
9
- throw new Error("injectLocal must be called in setup");
10
- return n && R.has(n) && t in R.get(n) ? R.get(n)[t] : J(...e);
11
- }, q = typeof window < "u" && typeof document < "u";
12
- typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
13
- const te = Object.prototype.toString, ne = (e) => te.call(e) === "[object Object]", T = () => {
14
- }, oe = /* @__PURE__ */ re();
15
- function re() {
16
- var e, s;
17
- return q && ((e = window == null ? void 0 : window.navigator) == null ? void 0 : e.userAgent) && (/iP(?:ad|hone|od)/.test(window.navigator.userAgent) || ((s = window == null ? void 0 : window.navigator) == null ? void 0 : s.maxTouchPoints) > 2 && /iPad|Macintosh/.test(window == null ? void 0 : window.navigator.userAgent));
18
- }
19
- function se(e, s) {
20
- function t(...n) {
21
- return new Promise((d, c) => {
22
- Promise.resolve(e(() => s.apply(this, n), { fn: s, thisArg: this, args: n })).then(d).catch(c);
23
- });
24
- }
25
- return t;
26
- }
27
- function ie(e, s = {}) {
28
- let t, n, d = T;
29
- const c = (r) => {
30
- clearTimeout(r), d(), d = T;
31
- };
32
- let h;
33
- return (r) => {
34
- const l = S(e), m = S(s.maxWait);
35
- return t && c(t), l <= 0 || m !== void 0 && m <= 0 ? (n && (c(n), n = void 0), Promise.resolve(r())) : new Promise((g, p) => {
36
- d = s.rejectOnCancel ? p : g, h = r, m && !n && (n = setTimeout(() => {
37
- t && c(t), n = void 0, g(h());
38
- }, m)), t = setTimeout(() => {
39
- n && c(n), n = void 0, g(r());
40
- }, l);
41
- });
42
- };
43
- }
44
- function ue(e, s) {
45
- var t;
46
- if (typeof e == "number")
47
- return e + s;
48
- const n = ((t = e.match(/^-?\d+\.?\d*/)) == null ? void 0 : t[0]) || "", d = e.slice(n.length), c = Number.parseFloat(n) + s;
49
- return Number.isNaN(c) ? e : c + d;
50
- }
51
- function j(e) {
52
- return e.endsWith("rem") ? Number.parseFloat(e) * 16 : Number.parseFloat(e);
53
- }
54
- function F(e) {
55
- return Array.isArray(e) ? e : [e];
56
- }
57
- function ae(e) {
58
- return _();
59
- }
60
- // @__NO_SIDE_EFFECTS__
61
- function ye(e, s = 200, t = {}) {
62
- return se(
63
- ie(s, t),
64
- e
65
- );
66
- }
67
- function le(e, s = !0, t) {
68
- ae() ? Y(e, t) : s ? e() : X(e);
69
- }
70
- function ce(e, s, t) {
71
- return B(
72
- e,
73
- s,
74
- {
75
- ...t,
76
- immediate: !0
77
- }
78
- );
79
- }
80
- const $ = q ? window : void 0;
81
- function L(e) {
82
- var s;
83
- const t = S(e);
84
- return (s = t == null ? void 0 : t.$el) != null ? s : t;
85
- }
86
- function M(...e) {
87
- const s = [], t = () => {
88
- s.forEach((f) => f()), s.length = 0;
89
- }, n = (f, r, l, m) => (f.addEventListener(r, l, m), () => f.removeEventListener(r, l, m)), d = x(() => {
90
- const f = F(S(e[0])).filter((r) => r != null);
91
- return f.every((r) => typeof r != "string") ? f : void 0;
92
- }), c = ce(
93
- () => {
94
- var f, r;
95
- return [
96
- (r = (f = d.value) == null ? void 0 : f.map((l) => L(l))) != null ? r : [$].filter((l) => l != null),
97
- F(S(d.value ? e[1] : e[0])),
98
- F(z(d.value ? e[2] : e[1])),
99
- // @ts-expect-error - TypeScript gets the correct types, but somehow still complains
100
- S(d.value ? e[3] : e[2])
101
- ];
102
- },
103
- ([f, r, l, m]) => {
104
- if (t(), !(f != null && f.length) || !(r != null && r.length) || !(l != null && l.length))
105
- return;
106
- const g = ne(m) ? { ...m } : m;
107
- s.push(
108
- ...f.flatMap(
109
- (p) => r.flatMap(
110
- (i) => l.map((a) => n(p, i, a, g))
111
- )
112
- )
113
- );
114
- },
115
- { flush: "post" }
116
- ), h = () => {
117
- c(), t();
118
- };
119
- return Z(t), h;
120
- }
121
- let N = !1;
122
- function be(e, s, t = {}) {
123
- const { window: n = $, ignore: d = [], capture: c = !0, detectIframe: h = !1, controls: f = !1 } = t;
124
- if (!n)
125
- return f ? { stop: T, cancel: T, trigger: T } : T;
126
- if (oe && !N) {
127
- N = !0;
128
- const o = { passive: !0 };
129
- Array.from(n.document.body.children).forEach((u) => u.addEventListener("click", T, o)), n.document.documentElement.addEventListener("click", T, o);
130
- }
131
- let r = !0;
132
- const l = (o) => S(d).some((u) => {
133
- if (typeof u == "string")
134
- return Array.from(n.document.querySelectorAll(u)).some((w) => w === o.target || o.composedPath().includes(w));
135
- {
136
- const w = L(u);
137
- return w && (o.target === w || o.composedPath().includes(w));
138
- }
139
- });
140
- function m(o) {
141
- const u = S(o);
142
- return u && u.$.subTree.shapeFlag === 16;
143
- }
144
- function g(o, u) {
145
- const w = S(o), b = w.$.subTree && w.$.subTree.children;
146
- return b == null || !Array.isArray(b) ? !1 : b.some((E) => E.el === u.target || u.composedPath().includes(E.el));
147
- }
148
- const p = (o) => {
149
- const u = L(e);
150
- if (o.target != null && !(!(u instanceof Element) && m(e) && g(e, o)) && !(!u || u === o.target || o.composedPath().includes(u))) {
151
- if ("detail" in o && o.detail === 0 && (r = !l(o)), !r) {
152
- r = !0;
153
- return;
154
- }
155
- s(o);
156
- }
157
- };
158
- let i = !1;
159
- const a = [
160
- M(n, "click", (o) => {
161
- i || (i = !0, setTimeout(() => {
162
- i = !1;
163
- }, 0), p(o));
164
- }, { passive: !0, capture: c }),
165
- M(n, "pointerdown", (o) => {
166
- const u = L(e);
167
- r = !l(o) && !!(u && !o.composedPath().includes(u));
168
- }, { passive: !0 }),
169
- h && M(n, "blur", (o) => {
170
- setTimeout(() => {
171
- var u;
172
- const w = L(e);
173
- ((u = n.document.activeElement) == null ? void 0 : u.tagName) === "IFRAME" && !(w != null && w.contains(n.document.activeElement)) && s(o);
174
- }, 0);
175
- }, { passive: !0 })
176
- ].filter(Boolean), y = () => a.forEach((o) => o());
177
- return f ? {
178
- stop: y,
179
- cancel: () => {
180
- r = !1;
181
- },
182
- trigger: (o) => {
183
- r = !0, p(o), r = !1;
184
- }
185
- } : y;
186
- }
187
- // @__NO_SIDE_EFFECTS__
188
- function fe(e) {
189
- return x(() => !!e());
190
- }
191
- const de = Symbol("vueuse-ssr-width");
192
- // @__NO_SIDE_EFFECTS__
193
- function K() {
194
- const e = G() ? /* @__PURE__ */ ee(de, null) : null;
195
- return typeof e == "number" ? e : void 0;
196
- }
197
- function A(e, s = {}) {
198
- const { window: t = $, ssrWidth: n = /* @__PURE__ */ K() } = s, d = /* @__PURE__ */ fe(() => t && "matchMedia" in t && typeof t.matchMedia == "function"), c = P(typeof n == "number"), h = P(), f = P(!1), r = (l) => {
199
- f.value = l.matches;
200
- };
201
- return U(() => {
202
- if (c.value) {
203
- c.value = !d.value;
204
- const l = S(e).split(",");
205
- f.value = l.some((m) => {
206
- const g = m.includes("not all"), p = m.match(/\(\s*min-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/), i = m.match(/\(\s*max-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/);
207
- let a = !!(p || i);
208
- return p && a && (a = n >= j(p[1])), i && a && (a = n <= j(i[1])), g ? !a : a;
209
- });
210
- return;
211
- }
212
- d.value && (h.value = t.matchMedia(S(e)), f.value = h.value.matches);
213
- }), M(h, "change", r, { passive: !0 }), x(() => f.value);
214
- }
215
- const me = {
216
- sm: 640,
217
- md: 768,
218
- lg: 1024,
219
- xl: 1280,
220
- "2xl": 1536
221
- };
222
- // @__NO_SIDE_EFFECTS__
223
- function he(e, s = {}) {
224
- function t(i, a) {
225
- let y = S(e[S(i)]);
226
- return a != null && (y = ue(y, a)), typeof y == "number" && (y = `${y}px`), y;
227
- }
228
- const { window: n = $, strategy: d = "min-width", ssrWidth: c = /* @__PURE__ */ K() } = s, h = typeof c == "number", f = h ? P(!1) : { value: !0 };
229
- h && le(() => f.value = !!n);
230
- function r(i, a) {
231
- return !f.value && h ? i === "min" ? c >= j(a) : c <= j(a) : n ? n.matchMedia(`(${i}-width: ${a})`).matches : !1;
232
- }
233
- const l = (i) => A(() => `(min-width: ${t(i)})`, s), m = (i) => A(() => `(max-width: ${t(i)})`, s), g = Object.keys(e).reduce((i, a) => (Object.defineProperty(i, a, {
234
- get: () => d === "min-width" ? l(a) : m(a),
235
- enumerable: !0,
236
- configurable: !0
237
- }), i), {});
238
- function p() {
239
- const i = Object.keys(e).map((a) => [a, g[a], j(t(a))]).sort((a, y) => a[2] - y[2]);
240
- return x(() => i.filter(([, a]) => a.value).map(([a]) => a));
241
- }
242
- return Object.assign(g, {
243
- greaterOrEqual: l,
244
- smallerOrEqual: m,
245
- greater(i) {
246
- return A(() => `(min-width: ${t(i, 0.1)})`, s);
247
- },
248
- smaller(i) {
249
- return A(() => `(max-width: ${t(i, -0.1)})`, s);
250
- },
251
- between(i, a) {
252
- return A(() => `(min-width: ${t(i)}) and (max-width: ${t(a, -0.1)})`, s);
253
- },
254
- isGreater(i) {
255
- return r("min", t(i, 0.1));
256
- },
257
- isGreaterOrEqual(i) {
258
- return r("min", t(i));
259
- },
260
- isSmaller(i) {
261
- return r("max", t(i, -0.1));
262
- },
263
- isSmallerOrEqual(i) {
264
- return r("max", t(i));
265
- },
266
- isInBetween(i, a) {
267
- return r("min", t(i)) && r("max", t(a, -0.1));
268
- },
269
- current: p,
270
- active() {
271
- const i = p();
272
- return x(() => i.value.length === 0 ? "" : i.value.at(d === "min-width" ? -1 : 0));
273
- }
274
- });
275
- }
276
- const ve = {
277
- ctrl: "control",
278
- command: "meta",
279
- cmd: "meta",
280
- option: "alt",
281
- up: "arrowup",
282
- down: "arrowdown",
283
- left: "arrowleft",
284
- right: "arrowright"
285
- };
286
- function pe(e = {}) {
287
- const {
288
- reactive: s = !1,
289
- target: t = $,
290
- aliasMap: n = ve,
291
- passive: d = !0,
292
- onEventFired: c = T
293
- } = e, h = I(/* @__PURE__ */ new Set()), f = {
294
- toJSON() {
295
- return {};
296
- },
297
- current: h
298
- }, r = s ? I(f) : f, l = /* @__PURE__ */ new Set(), m = /* @__PURE__ */ new Set(), g = /* @__PURE__ */ new Set();
299
- function p(o, u) {
300
- o in r && (s ? r[o] = u : r[o].value = u);
301
- }
302
- function i() {
303
- h.clear();
304
- for (const o of g)
305
- p(o, !1);
306
- }
307
- function a(o, u) {
308
- var w, b;
309
- const E = (w = o.key) == null ? void 0 : w.toLowerCase(), k = [(b = o.code) == null ? void 0 : b.toLowerCase(), E].filter(Boolean);
310
- E && (u ? h.add(E) : h.delete(E));
311
- for (const v of k)
312
- g.add(v), p(v, u);
313
- if (E === "shift" && !u) {
314
- const v = Array.from(m), O = v.indexOf("shift");
315
- v.forEach((C, V) => {
316
- V >= O && (h.delete(C), p(C, !1));
317
- }), m.clear();
318
- } else typeof o.getModifierState == "function" && o.getModifierState("Shift") && u && [...h, ...k].forEach((v) => m.add(v));
319
- E === "meta" && !u ? (l.forEach((v) => {
320
- h.delete(v), p(v, !1);
321
- }), l.clear()) : typeof o.getModifierState == "function" && o.getModifierState("Meta") && u && [...h, ...k].forEach((v) => l.add(v));
322
- }
323
- M(t, "keydown", (o) => (a(o, !0), c(o)), { passive: d }), M(t, "keyup", (o) => (a(o, !1), c(o)), { passive: d }), M("blur", i, { passive: d }), M("focus", i, { passive: d });
324
- const y = new Proxy(
325
- r,
326
- {
327
- get(o, u, w) {
328
- if (typeof u != "string")
329
- return Reflect.get(o, u, w);
330
- if (u = u.toLowerCase(), u in n && (u = n[u]), !(u in r))
331
- if (/[+_-]/.test(u)) {
332
- const E = u.split(/[+_-]/g).map((W) => W.trim());
333
- r[u] = x(() => E.map((W) => S(y[W])).every(Boolean));
334
- } else
335
- r[u] = P(!1);
336
- const b = Reflect.get(o, u, w);
337
- return s ? S(b) : b;
338
- }
339
- }
340
- );
341
- return y;
342
- }
343
- function we(e, s = {}) {
344
- const {
345
- threshold: t = 50,
346
- onSwipe: n,
347
- onSwipeEnd: d,
348
- onSwipeStart: c,
349
- passive: h = !0
350
- } = s, f = I({ x: 0, y: 0 }), r = I({ x: 0, y: 0 }), l = x(() => f.x - r.x), m = x(() => f.y - r.y), { max: g, abs: p } = Math, i = x(() => g(p(l.value), p(m.value)) >= t), a = P(!1), y = x(() => i.value ? p(l.value) > p(m.value) ? l.value > 0 ? "left" : "right" : m.value > 0 ? "up" : "down" : "none"), o = (v) => [v.touches[0].clientX, v.touches[0].clientY], u = (v, O) => {
351
- f.x = v, f.y = O;
352
- }, w = (v, O) => {
353
- r.x = v, r.y = O;
354
- }, b = { passive: h, capture: !h }, E = (v) => {
355
- a.value && (d == null || d(v, y.value)), a.value = !1;
356
- }, W = [
357
- M(e, "touchstart", (v) => {
358
- if (v.touches.length !== 1)
359
- return;
360
- const [O, C] = o(v);
361
- u(O, C), w(O, C), c == null || c(v);
362
- }, b),
363
- M(e, "touchmove", (v) => {
364
- if (v.touches.length !== 1)
365
- return;
366
- const [O, C] = o(v);
367
- w(O, C), b.capture && !b.passive && Math.abs(l.value) > Math.abs(m.value) && v.preventDefault(), !a.value && i.value && (a.value = !0), a.value && (n == null || n(v));
368
- }, b),
369
- M(e, ["touchend", "touchcancel"], E, b)
370
- ];
371
- return {
372
- isSwiping: a,
373
- direction: y,
374
- coordsStart: f,
375
- coordsEnd: r,
376
- lengthX: l,
377
- lengthY: m,
378
- stop: () => W.forEach((v) => v()),
379
- // TODO: Remove in the next major version
380
- isPassiveEventSupported: !0
381
- };
382
- }
383
- const Se = (e, s) => {
384
- const t = D(!1), n = D(!1), d = D(null), c = pe();
385
- c != null && c.escape && B(c.escape, () => {
386
- h(new Event("close"));
387
- });
388
- const h = (r) => {
389
- n.value = !1, setTimeout(() => {
390
- t.value = !1;
391
- }, 50), setTimeout(() => {
392
- e("close", r || new Event("close"));
393
- }, 300), d.value && clearTimeout(d.value);
394
- }, f = () => e("open", t.value);
395
- return Y(() => {
396
- setTimeout(() => {
397
- t.value = !0;
398
- }, 300), setTimeout(() => {
399
- n.value = !0;
400
- }, 500), s && (d.value = setTimeout(() => {
401
- h();
402
- }, s * 1e3));
403
- }), {
404
- show: t,
405
- overlay: n,
406
- onClose: h,
407
- onOpen: f
408
- };
409
- }, Ee = (e, s, t) => {
410
- const n = x(() => {
411
- var l;
412
- return (l = s.value) == null ? void 0 : l.clientHeight;
413
- }), d = P("translateY(0)"), c = P(1), h = P(!1);
414
- if ((/* @__PURE__ */ he(me)).greaterOrEqual("lg")) {
415
- const { lengthY: l } = we(e, {
416
- passive: !1,
417
- onSwipeStart() {
418
- h.value = !0;
419
- },
420
- onSwipe() {
421
- if (n.value)
422
- if (l.value < 0) {
423
- const m = Math.abs(l.value);
424
- d.value = `translateY(${m}px)`, c.value = 1.1 - m / n.value, c.value < 0.3 && (c.value = 0);
425
- } else
426
- d.value = "translateY(0)", c.value = 1;
427
- },
428
- onSwipeEnd(m) {
429
- h.value = !1, l.value < 0 && n.value && Math.abs(l.value) / n.value >= 0.5 ? (c.value = 0, setTimeout(() => {
430
- t(m);
431
- }, 100)) : (d.value = "translateY(0)", c.value = 1);
432
- }
433
- });
434
- }
435
- return {
436
- isSwiping: h,
437
- transform: d,
438
- opacity: c
439
- };
440
- };
441
- export {
442
- Ee as a,
443
- he as b,
444
- me as c,
445
- ye as d,
446
- be as o,
447
- Se as u
448
- };