vuesp-components 2.1.6 → 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.
- package/dist/components/script/editor/ScriptEditor.vue.d.ts +2 -0
- package/dist/components/script/editor/ScriptEditor.vue.d.ts.map +1 -1
- package/dist/components/script/editor/types.d.ts +2 -1
- package/dist/components/script/editor/types.d.ts.map +1 -1
- package/dist/composables/index.es.js +50 -49
- package/dist/composables/types.d.ts +1 -0
- package/dist/composables/types.d.ts.map +1 -1
- package/dist/composables/useForms.d.ts.map +1 -1
- package/dist/index.es.js +1259 -1308
- package/dist/{useSwipeDown-CZyt34x6.js → useSwipeDown-BctVX4c1.js} +150 -164
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
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((
|
|
22
|
-
Promise.resolve(e(() => o.apply(this, n), { fn: o, thisArg: this, args: n })).then(
|
|
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,
|
|
28
|
+
let t, n, v = C;
|
|
29
29
|
const s = (r) => {
|
|
30
|
-
clearTimeout(r),
|
|
30
|
+
clearTimeout(r), v(), v = C;
|
|
31
31
|
};
|
|
32
|
-
let
|
|
32
|
+
let d;
|
|
33
33
|
return (r) => {
|
|
34
|
-
const a = x(e),
|
|
35
|
-
return t && s(t), a <= 0 ||
|
|
36
|
-
|
|
37
|
-
t && s(t), n = void 0, g(
|
|
38
|
-
},
|
|
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]) || "",
|
|
59
|
-
return Number.isNaN(s) ? e : s +
|
|
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() ?
|
|
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:
|
|
83
|
+
immediateCallback: v = !1
|
|
84
84
|
} = t, s = E(!1);
|
|
85
|
-
let
|
|
86
|
-
function
|
|
87
|
-
|
|
85
|
+
let d;
|
|
86
|
+
function c() {
|
|
87
|
+
d && (clearTimeout(d), d = void 0);
|
|
88
88
|
}
|
|
89
89
|
function r() {
|
|
90
|
-
s.value = !1,
|
|
90
|
+
s.value = !1, c();
|
|
91
91
|
}
|
|
92
|
-
function a(...
|
|
93
|
-
|
|
94
|
-
s.value = !1,
|
|
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
|
|
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((
|
|
134
|
-
}, n = (
|
|
135
|
-
const
|
|
136
|
-
return
|
|
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
|
|
127
|
+
var c, r;
|
|
140
128
|
return [
|
|
141
|
-
(r = (
|
|
142
|
-
F(x(
|
|
143
|
-
F(oe(
|
|
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(
|
|
133
|
+
x(v.value ? e[3] : e[2])
|
|
146
134
|
];
|
|
147
135
|
},
|
|
148
|
-
([
|
|
149
|
-
if (t(), !(
|
|
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(
|
|
139
|
+
const g = ae(m) ? { ...m } : m;
|
|
152
140
|
o.push(
|
|
153
|
-
...
|
|
141
|
+
...c.flatMap(
|
|
154
142
|
(y) => r.flatMap(
|
|
155
|
-
(l) => a.map((
|
|
143
|
+
(l) => a.map((f) => n(y, l, f, g))
|
|
156
144
|
)
|
|
157
145
|
)
|
|
158
146
|
);
|
|
159
147
|
},
|
|
160
148
|
{ flush: "post" }
|
|
161
|
-
),
|
|
149
|
+
), d = () => {
|
|
162
150
|
s(), t();
|
|
163
151
|
};
|
|
164
|
-
return X(t),
|
|
152
|
+
return X(t), d;
|
|
165
153
|
}
|
|
166
|
-
let
|
|
167
|
-
function
|
|
168
|
-
const { window: n = R, ignore:
|
|
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
|
|
171
|
-
if (ue && !
|
|
172
|
-
|
|
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(
|
|
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
|
|
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) &&
|
|
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
|
|
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
|
-
|
|
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 = () =>
|
|
222
|
-
return
|
|
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
|
|
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,
|
|
244
|
-
|
|
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 = !
|
|
236
|
+
s.value = !v.value;
|
|
249
237
|
const a = x(e).split(",");
|
|
250
|
-
|
|
251
|
-
const g =
|
|
252
|
-
let
|
|
253
|
-
return y &&
|
|
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
|
-
|
|
258
|
-
}), T(
|
|
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,
|
|
257
|
+
function t(l, f) {
|
|
270
258
|
let b = x(e[x(l)]);
|
|
271
|
-
return
|
|
259
|
+
return f != null && (b = me(b, f)), typeof b == "number" && (b = `${b}px`), b;
|
|
272
260
|
}
|
|
273
|
-
const { window: n = R, strategy:
|
|
274
|
-
|
|
275
|
-
function r(l,
|
|
276
|
-
return !
|
|
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),
|
|
279
|
-
get: () =>
|
|
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((
|
|
285
|
-
return M(() => l.filter(([,
|
|
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:
|
|
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,
|
|
297
|
-
return L(() => `(min-width: ${t(l)}) and (max-width: ${t(
|
|
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,
|
|
312
|
-
return r("min", t(l)) && r("max", t(
|
|
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(
|
|
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
|
|
310
|
+
function B(e, o = {}) {
|
|
323
311
|
const {
|
|
324
312
|
controls: t = !1,
|
|
325
313
|
navigator: n = H
|
|
326
|
-
} = o,
|
|
327
|
-
var
|
|
328
|
-
|
|
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 (
|
|
320
|
+
if (v.value) {
|
|
333
321
|
if (!s.value)
|
|
334
322
|
try {
|
|
335
|
-
s.value = await n.permissions.query(
|
|
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:
|
|
347
|
-
isSupported:
|
|
334
|
+
state: c,
|
|
335
|
+
isSupported: v,
|
|
348
336
|
query: a
|
|
349
|
-
} :
|
|
337
|
+
} : c;
|
|
350
338
|
}
|
|
351
|
-
function
|
|
339
|
+
function Ce(e = {}) {
|
|
352
340
|
const {
|
|
353
341
|
navigator: o = H,
|
|
354
342
|
read: t = !1,
|
|
355
343
|
source: n,
|
|
356
|
-
copiedDuring:
|
|
344
|
+
copiedDuring: v = 1500,
|
|
357
345
|
legacy: s = !1
|
|
358
|
-
} = e,
|
|
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 = !(
|
|
348
|
+
let p = !(d.value && u(c.value));
|
|
361
349
|
if (!p)
|
|
362
350
|
try {
|
|
363
|
-
|
|
351
|
+
m.value = await o.clipboard.readText();
|
|
364
352
|
} catch {
|
|
365
353
|
p = !0;
|
|
366
354
|
}
|
|
367
|
-
p && (
|
|
355
|
+
p && (m.value = i());
|
|
368
356
|
}
|
|
369
357
|
a.value && t && T(["copy", "cut"], l, { passive: !0 });
|
|
370
|
-
async function
|
|
358
|
+
async function f(p = x(n)) {
|
|
371
359
|
if (a.value && p != null) {
|
|
372
|
-
let w = !(
|
|
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),
|
|
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:
|
|
383
|
+
text: m,
|
|
396
384
|
copied: g,
|
|
397
|
-
copy:
|
|
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:
|
|
403
|
+
passive: v = !0,
|
|
416
404
|
onEventFired: s = C
|
|
417
|
-
} = e,
|
|
405
|
+
} = e, d = $(/* @__PURE__ */ new Set()), c = {
|
|
418
406
|
toJSON() {
|
|
419
407
|
return {};
|
|
420
408
|
},
|
|
421
|
-
current:
|
|
422
|
-
}, r = o ? $(
|
|
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
|
-
|
|
415
|
+
d.clear();
|
|
428
416
|
for (const i of g)
|
|
429
417
|
y(i, !1);
|
|
430
418
|
}
|
|
431
|
-
function
|
|
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 ?
|
|
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(
|
|
426
|
+
const h = Array.from(m), O = h.indexOf("shift");
|
|
439
427
|
h.forEach((P, J) => {
|
|
440
|
-
J >= O && (
|
|
441
|
-
}),
|
|
442
|
-
} else typeof i.getModifierState == "function" && i.getModifierState("Shift") && u && [...
|
|
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
|
-
|
|
445
|
-
}), a.clear()) : typeof i.getModifierState == "function" && i.getModifierState("Meta") && u && [...
|
|
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) => (
|
|
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:
|
|
459
|
+
onSwipeEnd: v,
|
|
472
460
|
onSwipeStart: s,
|
|
473
|
-
passive:
|
|
474
|
-
} = o,
|
|
475
|
-
|
|
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:
|
|
479
|
-
|
|
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(
|
|
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:
|
|
484
|
+
isSwiping: f,
|
|
497
485
|
direction: b,
|
|
498
|
-
coordsStart:
|
|
486
|
+
coordsStart: c,
|
|
499
487
|
coordsEnd: r,
|
|
500
488
|
lengthX: a,
|
|
501
|
-
lengthY:
|
|
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
|
|
508
|
-
const t = I(!1), n = I(!1),
|
|
509
|
-
s != null && s.escape &&
|
|
510
|
-
|
|
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
|
|
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),
|
|
518
|
-
},
|
|
519
|
-
return
|
|
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 && (
|
|
525
|
-
|
|
512
|
+
}, 500), o && (v.value = setTimeout(() => {
|
|
513
|
+
d();
|
|
526
514
|
}, o * 1e3));
|
|
527
515
|
}), {
|
|
528
516
|
show: t,
|
|
529
517
|
overlay: n,
|
|
530
|
-
onClose:
|
|
531
|
-
onOpen:
|
|
518
|
+
onClose: d,
|
|
519
|
+
onOpen: c
|
|
532
520
|
};
|
|
533
|
-
},
|
|
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
|
-
}),
|
|
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
|
-
|
|
530
|
+
d.value = !0;
|
|
543
531
|
},
|
|
544
532
|
onSwipe() {
|
|
545
533
|
if (n.value)
|
|
546
534
|
if (a.value < 0) {
|
|
547
|
-
const
|
|
548
|
-
|
|
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
|
-
|
|
538
|
+
v.value = "translateY(0)", s.value = 1;
|
|
551
539
|
},
|
|
552
|
-
onSwipeEnd(
|
|
553
|
-
|
|
554
|
-
t(
|
|
555
|
-
}, 100)) : (
|
|
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:
|
|
561
|
-
transform:
|
|
548
|
+
isSwiping: d,
|
|
549
|
+
transform: v,
|
|
562
550
|
opacity: s
|
|
563
551
|
};
|
|
564
552
|
};
|
|
565
553
|
export {
|
|
566
|
-
|
|
554
|
+
Ae as a,
|
|
567
555
|
be as b,
|
|
568
556
|
ge as c,
|
|
569
557
|
Me as d,
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
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