@kiva/kv-components 8.5.6 → 8.6.0
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/vue/KvLightbox2.js +16 -16
- package/package.json +2 -2
package/dist/vue/KvLightbox2.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { toRefs as h, ref as
|
|
1
|
+
import { toRefs as h, ref as u, nextTick as k, computed as x, watch as S, onMounted as C, onBeforeUnmount as B } from "vue";
|
|
2
2
|
import { mdiClose as E } from "@mdi/js";
|
|
3
3
|
import { useFocusTrap as L } from "@vueuse/integrations/useFocusTrap";
|
|
4
4
|
import { hideOthers as w } from "../vendor/aria-hidden/dist/es2015/index.js";
|
|
@@ -57,16 +57,16 @@ const A = {
|
|
|
57
57
|
],
|
|
58
58
|
setup(v, { emit: g }) {
|
|
59
59
|
const {
|
|
60
|
-
visible:
|
|
60
|
+
visible: o,
|
|
61
61
|
variant: d,
|
|
62
62
|
preventClose: p
|
|
63
|
-
} = h(v),
|
|
63
|
+
} = h(v), n = u(null), t = u(null), m = u(null), a = u(null), i = u(null);
|
|
64
64
|
k(() => {
|
|
65
65
|
const {
|
|
66
66
|
activate: e,
|
|
67
67
|
deactivate: l
|
|
68
68
|
} = L([
|
|
69
|
-
|
|
69
|
+
n.value,
|
|
70
70
|
// This lightbox
|
|
71
71
|
'[role="alert"]'
|
|
72
72
|
// Any open toasts/alerts on the page
|
|
@@ -77,36 +77,36 @@ const A = {
|
|
|
77
77
|
a.value = e, i.value = l;
|
|
78
78
|
});
|
|
79
79
|
let c = null, s = null;
|
|
80
|
-
const b = x(() => d.value === "alert" ? "alertdialog" : "dialog"),
|
|
80
|
+
const b = x(() => d.value === "alert" ? "alertdialog" : "dialog"), r = (e = "") => {
|
|
81
81
|
var l;
|
|
82
|
-
|
|
82
|
+
n.value && t.value && ((l = i.value) == null || l.call(i), t.value.scrollTop = 0, I(t.value)), P(), c && (c(), c = null), document.removeEventListener("keyup", s), o.value && g("lightbox-closed", { type: e });
|
|
83
83
|
};
|
|
84
84
|
s = (e) => {
|
|
85
|
-
e && e.key === "Escape" && !p.value &&
|
|
85
|
+
e && e.key === "Escape" && !p.value && r();
|
|
86
86
|
};
|
|
87
87
|
const y = () => {
|
|
88
|
-
p.value ||
|
|
88
|
+
p.value || r("background-click");
|
|
89
89
|
}, f = () => {
|
|
90
|
-
|
|
90
|
+
o.value && (document.addEventListener("keyup", s), k(() => {
|
|
91
91
|
var e;
|
|
92
|
-
if (
|
|
92
|
+
if (n.value && t.value && ((e = a.value) == null || e.call(a), c = w(n.value), K(t.value)), q(), d.value === "alert") {
|
|
93
93
|
const l = m.value.querySelector("button");
|
|
94
94
|
l && l.focus();
|
|
95
95
|
}
|
|
96
96
|
}));
|
|
97
97
|
};
|
|
98
|
-
return S(
|
|
99
|
-
|
|
98
|
+
return S(o, () => {
|
|
99
|
+
o.value ? f() : r();
|
|
100
100
|
}), C(() => {
|
|
101
|
-
|
|
102
|
-
}), B(() =>
|
|
101
|
+
o.value && f();
|
|
102
|
+
}), B(() => r()), {
|
|
103
103
|
mdiClose: E,
|
|
104
104
|
role: b,
|
|
105
|
-
kvLightbox:
|
|
105
|
+
kvLightbox: n,
|
|
106
106
|
kvLightboxBody: t,
|
|
107
107
|
onKeyUp: s,
|
|
108
108
|
onScreenClick: y,
|
|
109
|
-
hide:
|
|
109
|
+
hide: r,
|
|
110
110
|
show: f,
|
|
111
111
|
controlsRef: m
|
|
112
112
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kiva/kv-components",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.6.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -125,5 +125,5 @@
|
|
|
125
125
|
"embla-carousel-fade",
|
|
126
126
|
"popper.js"
|
|
127
127
|
],
|
|
128
|
-
"gitHead": "
|
|
128
|
+
"gitHead": "63acdc66fbaed58ad53c37f709ac8793be9398ea"
|
|
129
129
|
}
|