vuesp-components 2.1.3 → 2.1.4

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