@stonecrop/utilities 0.4.16 → 0.4.18
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/utilities.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { watch as T, getCurrentScope as K, onScopeDispose as V, computed as y, shallowRef as
|
|
1
|
+
import { watch as T, getCurrentScope as K, onScopeDispose as V, computed as y, shallowRef as k, toValue as $, watchEffect as j, unref as B, getCurrentInstance as q, onMounted as N, ref as F, onBeforeUnmount as G } from "vue";
|
|
2
2
|
function A(e) {
|
|
3
3
|
return K() ? (V(e), !0) : !1;
|
|
4
4
|
}
|
|
@@ -61,8 +61,8 @@ function b(...e) {
|
|
|
61
61
|
return A(n), l;
|
|
62
62
|
}
|
|
63
63
|
function ee() {
|
|
64
|
-
const e =
|
|
65
|
-
return t &&
|
|
64
|
+
const e = k(!1), t = q();
|
|
65
|
+
return t && N(() => {
|
|
66
66
|
e.value = !0;
|
|
67
67
|
}, t), e;
|
|
68
68
|
}
|
|
@@ -164,7 +164,7 @@ function le(e = {}) {
|
|
|
164
164
|
}
|
|
165
165
|
const se = "focusin", re = "focusout", ie = ":focus-within";
|
|
166
166
|
function ce(e, t = {}) {
|
|
167
|
-
const { window: n = C } = t, o = y(() => v(e)), a =
|
|
167
|
+
const { window: n = C } = t, o = y(() => v(e)), a = k(!1), r = y(() => a.value), l = le(t);
|
|
168
168
|
if (!n || !l.value)
|
|
169
169
|
return { focused: r };
|
|
170
170
|
const s = { passive: !0 };
|
|
@@ -174,7 +174,7 @@ function ce(e, t = {}) {
|
|
|
174
174
|
}, s), { focused: r };
|
|
175
175
|
}
|
|
176
176
|
function ae(e, { window: t = C, scrollTarget: n } = {}) {
|
|
177
|
-
const o =
|
|
177
|
+
const o = F(!1), a = () => {
|
|
178
178
|
if (!t) return;
|
|
179
179
|
const r = t.document, l = v(e);
|
|
180
180
|
if (!l)
|
|
@@ -417,11 +417,11 @@ function ge(e) {
|
|
|
417
417
|
}
|
|
418
418
|
}
|
|
419
419
|
}, r = [];
|
|
420
|
-
|
|
420
|
+
N(() => {
|
|
421
421
|
for (const l of e) {
|
|
422
422
|
const s = t(l), i = o(l), u = a(l), c = s ? [s] : i;
|
|
423
423
|
for (const p of c) {
|
|
424
|
-
const { focused: f } = ce(
|
|
424
|
+
const { focused: f } = ce(F(p)), d = T(f, (m) => {
|
|
425
425
|
m ? p.addEventListener("keydown", u) : p.removeEventListener("keydown", u);
|
|
426
426
|
});
|
|
427
427
|
r.push(d);
|