vuesp-components 2.1.4 → 2.1.5
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.
- package/dist/components/block/index.d.ts +5 -1
- package/dist/components/block/index.d.ts.map +1 -1
- package/dist/components/block/scan/BlockScan.vue.d.ts +11 -0
- package/dist/components/block/scan/BlockScan.vue.d.ts.map +1 -0
- package/dist/components/block/scan/types.d.ts +9 -0
- package/dist/components/block/scan/types.d.ts.map +1 -0
- package/dist/components/block/service/BlockService.vue.d.ts +13 -0
- package/dist/components/block/service/BlockService.vue.d.ts.map +1 -0
- package/dist/components/block/service/types.d.ts +10 -0
- package/dist/components/block/service/types.d.ts.map +1 -0
- package/dist/components/block/status/BlockStatus.vue.d.ts +34 -0
- package/dist/components/block/status/BlockStatus.vue.d.ts.map +1 -0
- package/dist/components/block/status/types.d.ts +5 -0
- package/dist/components/block/status/types.d.ts.map +1 -0
- package/dist/components/block/update/BlockUpdate.vue.d.ts +24 -0
- package/dist/components/block/update/BlockUpdate.vue.d.ts.map +1 -0
- package/dist/components/block/update/types.d.ts +4 -0
- package/dist/components/block/update/types.d.ts.map +1 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/script/editor/ScriptEditor.vue.d.ts +8 -0
- package/dist/components/script/editor/ScriptEditor.vue.d.ts.map +1 -0
- package/dist/components/script/editor/format.d.ts +3 -0
- package/dist/components/script/editor/format.d.ts.map +1 -0
- package/dist/components/script/editor/highlighters/index.d.ts +2 -0
- package/dist/components/script/editor/highlighters/index.d.ts.map +1 -0
- package/dist/components/script/editor/plugins/autoSemicolon.d.ts +3 -0
- package/dist/components/script/editor/plugins/autoSemicolon.d.ts.map +1 -0
- package/dist/components/script/editor/plugins/autocomplete.d.ts +4 -0
- package/dist/components/script/editor/plugins/autocomplete.d.ts.map +1 -0
- package/dist/components/script/editor/plugins/index.d.ts +3 -0
- package/dist/components/script/editor/plugins/index.d.ts.map +1 -0
- package/dist/components/script/editor/plugins/render/index.d.ts +7 -0
- package/dist/components/script/editor/plugins/render/index.d.ts.map +1 -0
- package/dist/components/script/editor/plugins/suggestions.d.ts +3 -0
- package/dist/components/script/editor/plugins/suggestions.d.ts.map +1 -0
- package/dist/components/script/editor/plugins/types.d.ts +24 -0
- package/dist/components/script/editor/plugins/types.d.ts.map +1 -0
- package/dist/components/script/editor/types.d.ts +9 -0
- package/dist/components/script/editor/types.d.ts.map +1 -0
- package/dist/components/script/index.d.ts +4 -0
- package/dist/components/script/index.d.ts.map +1 -0
- package/dist/components/script/types.d.ts +4 -0
- package/dist/components/script/types.d.ts.map +1 -0
- package/dist/components/script/viewDocs/ScriptViewDocs.vue.d.ts +13 -0
- package/dist/components/script/viewDocs/ScriptViewDocs.vue.d.ts.map +1 -0
- package/dist/components/script/viewDocs/types.d.ts +4 -0
- package/dist/components/script/viewDocs/types.d.ts.map +1 -0
- package/dist/components/types.d.ts +2 -0
- package/dist/components/types.d.ts.map +1 -0
- package/dist/composables/index.es.js +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.es.js +2252 -1395
- package/dist/style.css +1 -1
- package/dist/types/components.d.ts +1 -0
- package/dist/types/components.d.ts.map +1 -1
- package/dist/{useSwipeDown-BHSNKbwG.js → useSwipeDown-DCYgiAUA.js} +105 -103
- package/package.json +3 -2
|
@@ -1,18 +1,20 @@
|
|
|
1
|
-
import { onMounted as Y, nextTick as
|
|
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
2
|
function Z(e) {
|
|
3
3
|
return H() ? (Q(e), !0) : !1;
|
|
4
4
|
}
|
|
5
5
|
const R = /* @__PURE__ */ new WeakMap(), ee = /* @__NO_SIDE_EFFECTS__ */ (...e) => {
|
|
6
6
|
var s;
|
|
7
7
|
const t = e[0], n = (s = _()) == null ? void 0 : s.proxy;
|
|
8
|
-
if (n == null && !
|
|
8
|
+
if (n == null && !G())
|
|
9
9
|
throw new Error("injectLocal must be called in setup");
|
|
10
10
|
return n && R.has(n) && t in R.get(n) ? R.get(n)[t] : J(...e);
|
|
11
|
-
},
|
|
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 = () => {
|
|
12
14
|
}, oe = /* @__PURE__ */ re();
|
|
13
15
|
function re() {
|
|
14
16
|
var e, s;
|
|
15
|
-
return
|
|
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));
|
|
16
18
|
}
|
|
17
19
|
function se(e, s) {
|
|
18
20
|
function t(...n) {
|
|
@@ -27,12 +29,12 @@ function ie(e, s = {}) {
|
|
|
27
29
|
const c = (r) => {
|
|
28
30
|
clearTimeout(r), d(), d = T;
|
|
29
31
|
};
|
|
30
|
-
let
|
|
32
|
+
let h;
|
|
31
33
|
return (r) => {
|
|
32
|
-
const l =
|
|
34
|
+
const l = S(e), m = S(s.maxWait);
|
|
33
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) => {
|
|
34
|
-
d = s.rejectOnCancel ? p : g,
|
|
35
|
-
t && c(t), n = void 0, g(
|
|
36
|
+
d = s.rejectOnCancel ? p : g, h = r, m && !n && (n = setTimeout(() => {
|
|
37
|
+
t && c(t), n = void 0, g(h());
|
|
36
38
|
}, m)), t = setTimeout(() => {
|
|
37
39
|
n && c(n), n = void 0, g(r());
|
|
38
40
|
}, l);
|
|
@@ -46,7 +48,7 @@ function ue(e, s) {
|
|
|
46
48
|
const n = ((t = e.match(/^-?\d+\.?\d*/)) == null ? void 0 : t[0]) || "", d = e.slice(n.length), c = Number.parseFloat(n) + s;
|
|
47
49
|
return Number.isNaN(c) ? e : c + d;
|
|
48
50
|
}
|
|
49
|
-
function
|
|
51
|
+
function j(e) {
|
|
50
52
|
return e.endsWith("rem") ? Number.parseFloat(e) * 16 : Number.parseFloat(e);
|
|
51
53
|
}
|
|
52
54
|
function F(e) {
|
|
@@ -63,7 +65,7 @@ function ye(e, s = 200, t = {}) {
|
|
|
63
65
|
);
|
|
64
66
|
}
|
|
65
67
|
function le(e, s = !0, t) {
|
|
66
|
-
ae() ? Y(e, t) : s ? e() :
|
|
68
|
+
ae() ? Y(e, t) : s ? e() : X(e);
|
|
67
69
|
}
|
|
68
70
|
function ce(e, s, t) {
|
|
69
71
|
return B(
|
|
@@ -75,27 +77,27 @@ function ce(e, s, t) {
|
|
|
75
77
|
}
|
|
76
78
|
);
|
|
77
79
|
}
|
|
78
|
-
const $ =
|
|
79
|
-
function
|
|
80
|
+
const $ = q ? window : void 0;
|
|
81
|
+
function L(e) {
|
|
80
82
|
var s;
|
|
81
|
-
const t =
|
|
83
|
+
const t = S(e);
|
|
82
84
|
return (s = t == null ? void 0 : t.$el) != null ? s : t;
|
|
83
85
|
}
|
|
84
86
|
function M(...e) {
|
|
85
87
|
const s = [], t = () => {
|
|
86
88
|
s.forEach((f) => f()), s.length = 0;
|
|
87
89
|
}, n = (f, r, l, m) => (f.addEventListener(r, l, m), () => f.removeEventListener(r, l, m)), d = x(() => {
|
|
88
|
-
const f = F(
|
|
90
|
+
const f = F(S(e[0])).filter((r) => r != null);
|
|
89
91
|
return f.every((r) => typeof r != "string") ? f : void 0;
|
|
90
92
|
}), c = ce(
|
|
91
93
|
() => {
|
|
92
94
|
var f, r;
|
|
93
95
|
return [
|
|
94
|
-
(r = (f = d.value) == null ? void 0 : f.map((l) =>
|
|
95
|
-
F(
|
|
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])),
|
|
96
98
|
F(z(d.value ? e[2] : e[1])),
|
|
97
99
|
// @ts-expect-error - TypeScript gets the correct types, but somehow still complains
|
|
98
|
-
|
|
100
|
+
S(d.value ? e[3] : e[2])
|
|
99
101
|
];
|
|
100
102
|
},
|
|
101
103
|
([f, r, l, m]) => {
|
|
@@ -111,14 +113,14 @@ function M(...e) {
|
|
|
111
113
|
);
|
|
112
114
|
},
|
|
113
115
|
{ flush: "post" }
|
|
114
|
-
),
|
|
116
|
+
), h = () => {
|
|
115
117
|
c(), t();
|
|
116
118
|
};
|
|
117
|
-
return Z(t),
|
|
119
|
+
return Z(t), h;
|
|
118
120
|
}
|
|
119
121
|
let N = !1;
|
|
120
|
-
function
|
|
121
|
-
const { window: n = $, ignore: d = [], capture: c = !0, detectIframe:
|
|
122
|
+
function be(e, s, t = {}) {
|
|
123
|
+
const { window: n = $, ignore: d = [], capture: c = !0, detectIframe: h = !1, controls: f = !1 } = t;
|
|
122
124
|
if (!n)
|
|
123
125
|
return f ? { stop: T, cancel: T, trigger: T } : T;
|
|
124
126
|
if (oe && !N) {
|
|
@@ -127,24 +129,24 @@ function Se(e, s, t = {}) {
|
|
|
127
129
|
Array.from(n.document.body.children).forEach((u) => u.addEventListener("click", T, o)), n.document.documentElement.addEventListener("click", T, o);
|
|
128
130
|
}
|
|
129
131
|
let r = !0;
|
|
130
|
-
const l = (o) =>
|
|
132
|
+
const l = (o) => S(d).some((u) => {
|
|
131
133
|
if (typeof u == "string")
|
|
132
134
|
return Array.from(n.document.querySelectorAll(u)).some((w) => w === o.target || o.composedPath().includes(w));
|
|
133
135
|
{
|
|
134
|
-
const w =
|
|
136
|
+
const w = L(u);
|
|
135
137
|
return w && (o.target === w || o.composedPath().includes(w));
|
|
136
138
|
}
|
|
137
139
|
});
|
|
138
140
|
function m(o) {
|
|
139
|
-
const u =
|
|
141
|
+
const u = S(o);
|
|
140
142
|
return u && u.$.subTree.shapeFlag === 16;
|
|
141
143
|
}
|
|
142
144
|
function g(o, u) {
|
|
143
|
-
const w =
|
|
144
|
-
return
|
|
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));
|
|
145
147
|
}
|
|
146
148
|
const p = (o) => {
|
|
147
|
-
const u =
|
|
149
|
+
const u = L(e);
|
|
148
150
|
if (o.target != null && !(!(u instanceof Element) && m(e) && g(e, o)) && !(!u || u === o.target || o.composedPath().includes(u))) {
|
|
149
151
|
if ("detail" in o && o.detail === 0 && (r = !l(o)), !r) {
|
|
150
152
|
r = !0;
|
|
@@ -161,13 +163,13 @@ function Se(e, s, t = {}) {
|
|
|
161
163
|
}, 0), p(o));
|
|
162
164
|
}, { passive: !0, capture: c }),
|
|
163
165
|
M(n, "pointerdown", (o) => {
|
|
164
|
-
const u =
|
|
166
|
+
const u = L(e);
|
|
165
167
|
r = !l(o) && !!(u && !o.composedPath().includes(u));
|
|
166
168
|
}, { passive: !0 }),
|
|
167
|
-
|
|
169
|
+
h && M(n, "blur", (o) => {
|
|
168
170
|
setTimeout(() => {
|
|
169
171
|
var u;
|
|
170
|
-
const w =
|
|
172
|
+
const w = L(e);
|
|
171
173
|
((u = n.document.activeElement) == null ? void 0 : u.tagName) === "IFRAME" && !(w != null && w.contains(n.document.activeElement)) && s(o);
|
|
172
174
|
}, 0);
|
|
173
175
|
}, { passive: !0 })
|
|
@@ -188,27 +190,27 @@ function fe(e) {
|
|
|
188
190
|
}
|
|
189
191
|
const de = Symbol("vueuse-ssr-width");
|
|
190
192
|
// @__NO_SIDE_EFFECTS__
|
|
191
|
-
function
|
|
192
|
-
const e =
|
|
193
|
+
function K() {
|
|
194
|
+
const e = G() ? /* @__PURE__ */ ee(de, null) : null;
|
|
193
195
|
return typeof e == "number" ? e : void 0;
|
|
194
196
|
}
|
|
195
|
-
function
|
|
196
|
-
const { window: t = $, ssrWidth: n = /* @__PURE__ */
|
|
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) => {
|
|
197
199
|
f.value = l.matches;
|
|
198
200
|
};
|
|
199
201
|
return U(() => {
|
|
200
202
|
if (c.value) {
|
|
201
203
|
c.value = !d.value;
|
|
202
|
-
const l =
|
|
204
|
+
const l = S(e).split(",");
|
|
203
205
|
f.value = l.some((m) => {
|
|
204
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*)\)/);
|
|
205
207
|
let a = !!(p || i);
|
|
206
|
-
return p && a && (a = n >=
|
|
208
|
+
return p && a && (a = n >= j(p[1])), i && a && (a = n <= j(i[1])), g ? !a : a;
|
|
207
209
|
});
|
|
208
210
|
return;
|
|
209
211
|
}
|
|
210
|
-
d.value && (
|
|
211
|
-
}), M(
|
|
212
|
+
d.value && (h.value = t.matchMedia(S(e)), f.value = h.value.matches);
|
|
213
|
+
}), M(h, "change", r, { passive: !0 }), x(() => f.value);
|
|
212
214
|
}
|
|
213
215
|
const me = {
|
|
214
216
|
sm: 640,
|
|
@@ -218,36 +220,36 @@ const me = {
|
|
|
218
220
|
"2xl": 1536
|
|
219
221
|
};
|
|
220
222
|
// @__NO_SIDE_EFFECTS__
|
|
221
|
-
function
|
|
223
|
+
function he(e, s = {}) {
|
|
222
224
|
function t(i, a) {
|
|
223
|
-
let y =
|
|
225
|
+
let y = S(e[S(i)]);
|
|
224
226
|
return a != null && (y = ue(y, a)), typeof y == "number" && (y = `${y}px`), y;
|
|
225
227
|
}
|
|
226
|
-
const { window: n = $, strategy: d = "min-width", ssrWidth: c = /* @__PURE__ */
|
|
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);
|
|
228
230
|
function r(i, a) {
|
|
229
|
-
return !f.value &&
|
|
231
|
+
return !f.value && h ? i === "min" ? c >= j(a) : c <= j(a) : n ? n.matchMedia(`(${i}-width: ${a})`).matches : !1;
|
|
230
232
|
}
|
|
231
|
-
const l = (i) =>
|
|
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, {
|
|
232
234
|
get: () => d === "min-width" ? l(a) : m(a),
|
|
233
235
|
enumerable: !0,
|
|
234
236
|
configurable: !0
|
|
235
237
|
}), i), {});
|
|
236
238
|
function p() {
|
|
237
|
-
const i = Object.keys(e).map((a) => [a, g[a],
|
|
239
|
+
const i = Object.keys(e).map((a) => [a, g[a], j(t(a))]).sort((a, y) => a[2] - y[2]);
|
|
238
240
|
return x(() => i.filter(([, a]) => a.value).map(([a]) => a));
|
|
239
241
|
}
|
|
240
242
|
return Object.assign(g, {
|
|
241
243
|
greaterOrEqual: l,
|
|
242
244
|
smallerOrEqual: m,
|
|
243
245
|
greater(i) {
|
|
244
|
-
return
|
|
246
|
+
return A(() => `(min-width: ${t(i, 0.1)})`, s);
|
|
245
247
|
},
|
|
246
248
|
smaller(i) {
|
|
247
|
-
return
|
|
249
|
+
return A(() => `(max-width: ${t(i, -0.1)})`, s);
|
|
248
250
|
},
|
|
249
251
|
between(i, a) {
|
|
250
|
-
return
|
|
252
|
+
return A(() => `(min-width: ${t(i)}) and (max-width: ${t(a, -0.1)})`, s);
|
|
251
253
|
},
|
|
252
254
|
isGreater(i) {
|
|
253
255
|
return r("min", t(i, 0.1));
|
|
@@ -271,7 +273,7 @@ function ve(e, s = {}) {
|
|
|
271
273
|
}
|
|
272
274
|
});
|
|
273
275
|
}
|
|
274
|
-
const
|
|
276
|
+
const ve = {
|
|
275
277
|
ctrl: "control",
|
|
276
278
|
command: "meta",
|
|
277
279
|
cmd: "meta",
|
|
@@ -285,38 +287,38 @@ function pe(e = {}) {
|
|
|
285
287
|
const {
|
|
286
288
|
reactive: s = !1,
|
|
287
289
|
target: t = $,
|
|
288
|
-
aliasMap: n =
|
|
290
|
+
aliasMap: n = ve,
|
|
289
291
|
passive: d = !0,
|
|
290
292
|
onEventFired: c = T
|
|
291
|
-
} = e,
|
|
293
|
+
} = e, h = I(/* @__PURE__ */ new Set()), f = {
|
|
292
294
|
toJSON() {
|
|
293
295
|
return {};
|
|
294
296
|
},
|
|
295
|
-
current:
|
|
296
|
-
}, r = s ?
|
|
297
|
+
current: h
|
|
298
|
+
}, r = s ? I(f) : f, l = /* @__PURE__ */ new Set(), m = /* @__PURE__ */ new Set(), g = /* @__PURE__ */ new Set();
|
|
297
299
|
function p(o, u) {
|
|
298
300
|
o in r && (s ? r[o] = u : r[o].value = u);
|
|
299
301
|
}
|
|
300
302
|
function i() {
|
|
301
|
-
|
|
303
|
+
h.clear();
|
|
302
304
|
for (const o of g)
|
|
303
305
|
p(o, !1);
|
|
304
306
|
}
|
|
305
307
|
function a(o, u) {
|
|
306
|
-
var w,
|
|
307
|
-
const E = (w = o.key) == null ? void 0 : w.toLowerCase(),
|
|
308
|
-
E && (u ?
|
|
309
|
-
for (const
|
|
310
|
-
g.add(
|
|
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);
|
|
311
313
|
if (E === "shift" && !u) {
|
|
312
|
-
const
|
|
313
|
-
|
|
314
|
-
|
|
314
|
+
const v = Array.from(m), O = v.indexOf("shift");
|
|
315
|
+
v.forEach((C, V) => {
|
|
316
|
+
V >= O && (h.delete(C), p(C, !1));
|
|
315
317
|
}), m.clear();
|
|
316
|
-
} else typeof o.getModifierState == "function" && o.getModifierState("Shift") && u && [...
|
|
317
|
-
E === "meta" && !u ? (l.forEach((
|
|
318
|
-
|
|
319
|
-
}), l.clear()) : typeof o.getModifierState == "function" && o.getModifierState("Meta") && u && [...
|
|
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));
|
|
320
322
|
}
|
|
321
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 });
|
|
322
324
|
const y = new Proxy(
|
|
@@ -327,12 +329,12 @@ function pe(e = {}) {
|
|
|
327
329
|
return Reflect.get(o, u, w);
|
|
328
330
|
if (u = u.toLowerCase(), u in n && (u = n[u]), !(u in r))
|
|
329
331
|
if (/[+_-]/.test(u)) {
|
|
330
|
-
const E = u.split(/[+_-]/g).map((
|
|
331
|
-
r[u] = x(() => E.map((
|
|
332
|
+
const E = u.split(/[+_-]/g).map((W) => W.trim());
|
|
333
|
+
r[u] = x(() => E.map((W) => S(y[W])).every(Boolean));
|
|
332
334
|
} else
|
|
333
335
|
r[u] = P(!1);
|
|
334
|
-
const
|
|
335
|
-
return s ? b
|
|
336
|
+
const b = Reflect.get(o, u, w);
|
|
337
|
+
return s ? S(b) : b;
|
|
336
338
|
}
|
|
337
339
|
}
|
|
338
340
|
);
|
|
@@ -344,27 +346,27 @@ function we(e, s = {}) {
|
|
|
344
346
|
onSwipe: n,
|
|
345
347
|
onSwipeEnd: d,
|
|
346
348
|
onSwipeStart: c,
|
|
347
|
-
passive:
|
|
348
|
-
} = s, f =
|
|
349
|
-
f.x =
|
|
350
|
-
}, w = (
|
|
351
|
-
r.x =
|
|
352
|
-
},
|
|
353
|
-
a.value && (d == null || d(
|
|
354
|
-
},
|
|
355
|
-
M(e, "touchstart", (
|
|
356
|
-
if (
|
|
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)
|
|
357
359
|
return;
|
|
358
|
-
const [O, C] = o(
|
|
359
|
-
u(O, C), w(O, C), c == null || c(
|
|
360
|
-
},
|
|
361
|
-
M(e, "touchmove", (
|
|
362
|
-
if (
|
|
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)
|
|
363
365
|
return;
|
|
364
|
-
const [O, C] = o(
|
|
365
|
-
w(O, C),
|
|
366
|
-
},
|
|
367
|
-
M(e, ["touchend", "touchcancel"], E,
|
|
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)
|
|
368
370
|
];
|
|
369
371
|
return {
|
|
370
372
|
isSwiping: a,
|
|
@@ -373,17 +375,17 @@ function we(e, s = {}) {
|
|
|
373
375
|
coordsEnd: r,
|
|
374
376
|
lengthX: l,
|
|
375
377
|
lengthY: m,
|
|
376
|
-
stop: () =>
|
|
378
|
+
stop: () => W.forEach((v) => v()),
|
|
377
379
|
// TODO: Remove in the next major version
|
|
378
380
|
isPassiveEventSupported: !0
|
|
379
381
|
};
|
|
380
382
|
}
|
|
381
|
-
const
|
|
383
|
+
const Se = (e, s) => {
|
|
382
384
|
const t = D(!1), n = D(!1), d = D(null), c = pe();
|
|
383
385
|
c != null && c.escape && B(c.escape, () => {
|
|
384
|
-
|
|
386
|
+
h(new Event("close"));
|
|
385
387
|
});
|
|
386
|
-
const
|
|
388
|
+
const h = (r) => {
|
|
387
389
|
n.value = !1, setTimeout(() => {
|
|
388
390
|
t.value = !1;
|
|
389
391
|
}, 50), setTimeout(() => {
|
|
@@ -396,24 +398,24 @@ const be = (e, s) => {
|
|
|
396
398
|
}, 300), setTimeout(() => {
|
|
397
399
|
n.value = !0;
|
|
398
400
|
}, 500), s && (d.value = setTimeout(() => {
|
|
399
|
-
|
|
401
|
+
h();
|
|
400
402
|
}, s * 1e3));
|
|
401
403
|
}), {
|
|
402
404
|
show: t,
|
|
403
405
|
overlay: n,
|
|
404
|
-
onClose:
|
|
406
|
+
onClose: h,
|
|
405
407
|
onOpen: f
|
|
406
408
|
};
|
|
407
409
|
}, Ee = (e, s, t) => {
|
|
408
410
|
const n = x(() => {
|
|
409
411
|
var l;
|
|
410
412
|
return (l = s.value) == null ? void 0 : l.clientHeight;
|
|
411
|
-
}), d = P("translateY(0)"), c = P(1),
|
|
412
|
-
if ((/* @__PURE__ */
|
|
413
|
+
}), d = P("translateY(0)"), c = P(1), h = P(!1);
|
|
414
|
+
if ((/* @__PURE__ */ he(me)).greaterOrEqual("lg")) {
|
|
413
415
|
const { lengthY: l } = we(e, {
|
|
414
416
|
passive: !1,
|
|
415
417
|
onSwipeStart() {
|
|
416
|
-
|
|
418
|
+
h.value = !0;
|
|
417
419
|
},
|
|
418
420
|
onSwipe() {
|
|
419
421
|
if (n.value)
|
|
@@ -424,23 +426,23 @@ const be = (e, s) => {
|
|
|
424
426
|
d.value = "translateY(0)", c.value = 1;
|
|
425
427
|
},
|
|
426
428
|
onSwipeEnd(m) {
|
|
427
|
-
|
|
429
|
+
h.value = !1, l.value < 0 && n.value && Math.abs(l.value) / n.value >= 0.5 ? (c.value = 0, setTimeout(() => {
|
|
428
430
|
t(m);
|
|
429
431
|
}, 100)) : (d.value = "translateY(0)", c.value = 1);
|
|
430
432
|
}
|
|
431
433
|
});
|
|
432
434
|
}
|
|
433
435
|
return {
|
|
434
|
-
isSwiping:
|
|
436
|
+
isSwiping: h,
|
|
435
437
|
transform: d,
|
|
436
438
|
opacity: c
|
|
437
439
|
};
|
|
438
440
|
};
|
|
439
441
|
export {
|
|
440
442
|
Ee as a,
|
|
441
|
-
|
|
443
|
+
he as b,
|
|
442
444
|
me as c,
|
|
443
445
|
ye as d,
|
|
444
|
-
|
|
445
|
-
|
|
446
|
+
be as o,
|
|
447
|
+
Se as u
|
|
446
448
|
};
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "2.1.
|
|
2
|
+
"version": "2.1.5",
|
|
3
3
|
"name": "vuesp-components",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.js",
|
|
@@ -62,7 +62,8 @@
|
|
|
62
62
|
"license": "MIT",
|
|
63
63
|
"dependencies": {
|
|
64
64
|
"@vueuse/core": "^13.9.0",
|
|
65
|
-
"tslib": "^2.3.0"
|
|
65
|
+
"tslib": "^2.3.0",
|
|
66
|
+
"yace": "1.1.0"
|
|
66
67
|
},
|
|
67
68
|
"devDependencies": {
|
|
68
69
|
"@eslint/js": "^9.39.1",
|