@kiva/kv-components 6.21.1 → 6.22.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/KvSideSheet.js +48 -45
- package/package.json +2 -2
package/dist/vue/KvSideSheet.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { toRefs as
|
|
2
|
-
import { mdiArrowLeft as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
const
|
|
1
|
+
import { toRefs as P, ref as u, reactive as Q, computed as z, onMounted as Y, onUnmounted as j, watch as p, resolveComponent as Z, openBlock as k, createElementBlock as b, normalizeClass as x, withModifiers as $, createElementVNode as f, normalizeStyle as W, createVNode as _, createCommentVNode as S, toDisplayString as ee, renderSlot as U, nextTick as te } from "vue";
|
|
2
|
+
import { mdiArrowLeft as oe, mdiClose as ne, mdiExportVariant as ie } from "@mdi/js";
|
|
3
|
+
import le from "./KvMaterialIcon.js";
|
|
4
|
+
import ae from "../_virtual/_plugin-vue_export-helper.js";
|
|
5
|
+
const se = {
|
|
6
6
|
name: "KvSideSheet",
|
|
7
7
|
components: {
|
|
8
|
-
KvMaterialIcon:
|
|
8
|
+
KvMaterialIcon: le
|
|
9
9
|
},
|
|
10
10
|
props: {
|
|
11
11
|
/**
|
|
@@ -83,10 +83,10 @@ const ae = {
|
|
|
83
83
|
trackEventCategory: K,
|
|
84
84
|
animationSourceElement: h,
|
|
85
85
|
widthDimensions: i
|
|
86
|
-
} =
|
|
86
|
+
} = P(l), w = u(!1), B = u({}), s = u({}), L = u(null), m = u(null), y = u(null), A = u(null), M = u(window.innerHeight), D = u(window.innerWidth), v = Q({
|
|
87
87
|
headline: 0,
|
|
88
88
|
controls: 0
|
|
89
|
-
}),
|
|
89
|
+
}), G = z(() => {
|
|
90
90
|
const e = M.value - v.headline - v.controls;
|
|
91
91
|
return Math.max(e, 0);
|
|
92
92
|
}), C = z(() => {
|
|
@@ -100,14 +100,14 @@ const ae = {
|
|
|
100
100
|
"2xl": 1536
|
|
101
101
|
}, n = D.value || window.innerWidth, o = Object.keys(i.value).filter((d) => d !== "default").sort((d, g) => e[g] - e[d]).find((d) => n >= e[d]);
|
|
102
102
|
return o ? i.value[o] : i.value.default || "100%";
|
|
103
|
-
}),
|
|
103
|
+
}), X = (e, n) => {
|
|
104
104
|
let o;
|
|
105
105
|
return (...d) => {
|
|
106
106
|
clearTimeout(o), o = setTimeout(() => e(...d), n);
|
|
107
107
|
};
|
|
108
108
|
}, E = () => {
|
|
109
109
|
M.value = window.innerHeight, D.value = window.innerWidth, setTimeout(() => {
|
|
110
|
-
|
|
110
|
+
te(() => {
|
|
111
111
|
var e;
|
|
112
112
|
if (y.value) {
|
|
113
113
|
const n = y.value.getBoundingClientRect();
|
|
@@ -121,30 +121,30 @@ const ae = {
|
|
|
121
121
|
v.controls = 0;
|
|
122
122
|
});
|
|
123
123
|
}, 300);
|
|
124
|
-
},
|
|
124
|
+
}, R = X(E, 100), O = () => {
|
|
125
125
|
const e = "tw-overflow-hidden";
|
|
126
|
-
|
|
126
|
+
w.value ? document.body.classList.add(e) : document.body.classList.remove(e);
|
|
127
127
|
}, F = () => {
|
|
128
|
-
|
|
128
|
+
w.value = !1, O(), V.value(K.value, "click", "side-sheet-closed"), setTimeout(() => {
|
|
129
129
|
a("side-sheet-closed");
|
|
130
130
|
}, 300), document.removeEventListener("keyup", H);
|
|
131
|
-
},
|
|
131
|
+
}, q = () => {
|
|
132
132
|
a("go-to-link");
|
|
133
133
|
}, H = (e) => {
|
|
134
134
|
(e == null ? void 0 : e.key) === "Escape" && F();
|
|
135
135
|
};
|
|
136
|
-
|
|
136
|
+
Y(() => {
|
|
137
137
|
if (setTimeout(() => {
|
|
138
138
|
E();
|
|
139
139
|
}, 100), m.value) {
|
|
140
|
-
const e = new ResizeObserver(
|
|
140
|
+
const e = new ResizeObserver(R);
|
|
141
141
|
e.observe(m.value), j(() => e.disconnect());
|
|
142
142
|
}
|
|
143
143
|
if (y.value) {
|
|
144
|
-
const e = new ResizeObserver(
|
|
144
|
+
const e = new ResizeObserver(R);
|
|
145
145
|
e.observe(y.value), j(() => e.disconnect());
|
|
146
146
|
}
|
|
147
|
-
window.addEventListener("resize",
|
|
147
|
+
window.addEventListener("resize", R), j(() => window.removeEventListener("resize", R));
|
|
148
148
|
}), p(() => {
|
|
149
149
|
var e;
|
|
150
150
|
return (e = r.controls) == null ? void 0 : e.call(r);
|
|
@@ -153,21 +153,21 @@ const ae = {
|
|
|
153
153
|
E();
|
|
154
154
|
}, 100);
|
|
155
155
|
}, { deep: !0, immediate: !0 });
|
|
156
|
-
const
|
|
156
|
+
const J = z(() => ({
|
|
157
157
|
width: C.value
|
|
158
158
|
}));
|
|
159
159
|
p(t, (e) => {
|
|
160
160
|
var n;
|
|
161
161
|
if (e) {
|
|
162
162
|
document.addEventListener("keyup", H), s.value = {}, setTimeout(() => {
|
|
163
|
-
|
|
163
|
+
w.value = !0, O(), E();
|
|
164
164
|
}, 10);
|
|
165
|
-
const o = (n = h.value) == null ? void 0 : n.getBoundingClientRect(), d = (o == null ? void 0 : o.top) ?? 0, g = (o == null ? void 0 : o.left) ?? 0, c = (o == null ? void 0 : o.width) ?? 0,
|
|
166
|
-
o && (d || g || c ||
|
|
165
|
+
const o = (n = h.value) == null ? void 0 : n.getBoundingClientRect(), d = (o == null ? void 0 : o.top) ?? 0, g = (o == null ? void 0 : o.left) ?? 0, c = (o == null ? void 0 : o.width) ?? 0, T = (o == null ? void 0 : o.height) ?? 0;
|
|
166
|
+
o && (d || g || c || T) && (B.value = {
|
|
167
167
|
position: "fixed",
|
|
168
168
|
top: `${d}px`,
|
|
169
169
|
width: `${c}px`,
|
|
170
|
-
height: `${
|
|
170
|
+
height: `${T}px`,
|
|
171
171
|
transform: `translateX(${C.value})`
|
|
172
172
|
}, s.value = {
|
|
173
173
|
...B.value,
|
|
@@ -182,12 +182,12 @@ const ae = {
|
|
|
182
182
|
};
|
|
183
183
|
}, 10));
|
|
184
184
|
} else
|
|
185
|
-
|
|
185
|
+
w.value = !1, O(), document.removeEventListener("keyup", H), h.value && Object.keys(B.value).length > 0 ? s.value = {
|
|
186
186
|
...B.value,
|
|
187
187
|
transition: "all 0.3s ease-in-out"
|
|
188
188
|
} : s.value = {};
|
|
189
189
|
}, { immediate: !0 }), p(C, (e) => {
|
|
190
|
-
|
|
190
|
+
w.value && t.value && s.value && Object.keys(s.value).length > 0 && (s.value = {
|
|
191
191
|
...s.value,
|
|
192
192
|
width: e,
|
|
193
193
|
transition: "none"
|
|
@@ -210,9 +210,9 @@ const ae = {
|
|
|
210
210
|
lg: "1024px",
|
|
211
211
|
xl: "1280px",
|
|
212
212
|
"2xl": "1536px"
|
|
213
|
-
}, g = Object.keys(i.value).filter((c) => c !== "default").sort((c,
|
|
213
|
+
}, g = Object.keys(i.value).filter((c) => c !== "default").sort((c, T) => {
|
|
214
214
|
const N = ["sm", "md", "lg", "xl", "2xl"];
|
|
215
|
-
return N.indexOf(c) - N.indexOf(
|
|
215
|
+
return N.indexOf(c) - N.indexOf(T);
|
|
216
216
|
}).map((c) => `
|
|
217
217
|
@media (min-width: ${o[c]}) {
|
|
218
218
|
#side-sheet-${l.trackEventCategory || "default"} {
|
|
@@ -226,34 +226,35 @@ const ae = {
|
|
|
226
226
|
}
|
|
227
227
|
};
|
|
228
228
|
return p(i, () => {
|
|
229
|
-
|
|
230
|
-
}, { immediate: !0 }), p(
|
|
229
|
+
w.value && I();
|
|
230
|
+
}, { immediate: !0 }), p(w, (e) => {
|
|
231
231
|
e && I();
|
|
232
232
|
}), {
|
|
233
233
|
closeSideSheet: F,
|
|
234
|
-
contentHeight:
|
|
234
|
+
contentHeight: G,
|
|
235
235
|
controlsRef: m,
|
|
236
236
|
headlineRef: y,
|
|
237
|
+
contentRef: A,
|
|
237
238
|
sideSheetRef: L,
|
|
238
|
-
sideSheetStyles:
|
|
239
|
-
goToLink:
|
|
240
|
-
mdiArrowLeft:
|
|
241
|
-
mdiClose:
|
|
242
|
-
mdiExportVariant:
|
|
239
|
+
sideSheetStyles: J,
|
|
240
|
+
goToLink: q,
|
|
241
|
+
mdiArrowLeft: oe,
|
|
242
|
+
mdiClose: ne,
|
|
243
|
+
mdiExportVariant: ie,
|
|
243
244
|
modalStyles: s,
|
|
244
|
-
open:
|
|
245
|
+
open: w
|
|
245
246
|
};
|
|
246
247
|
}
|
|
247
|
-
},
|
|
248
|
-
function
|
|
249
|
-
const h =
|
|
248
|
+
}, re = { class: "tw-flex tw-gap-1.5" }, de = { key: 1 }, ce = { class: "tw-flex tw-gap-1.5" };
|
|
249
|
+
function ue(l, a, r, t, V, K) {
|
|
250
|
+
const h = Z("kv-material-icon");
|
|
250
251
|
return r.visible ? (k(), b("div", {
|
|
251
252
|
key: 0,
|
|
252
253
|
class: x(["tw-block lg:tw-mt-0 tw-fixed tw-inset-0 tw-bg-black tw-transition-all md:tw-duration-150 tw-z-modal", {
|
|
253
254
|
"tw-bg-opacity-0 tw-delay-300": !t.open,
|
|
254
255
|
"tw-bg-opacity-low": t.open
|
|
255
256
|
}]),
|
|
256
|
-
onClick: a[3] || (a[3] =
|
|
257
|
+
onClick: a[3] || (a[3] = $((...i) => t.closeSideSheet && t.closeSideSheet(...i), ["self"]))
|
|
257
258
|
}, [
|
|
258
259
|
f("div", {
|
|
259
260
|
ref: "sideSheetRef",
|
|
@@ -276,7 +277,7 @@ function ce(l, a, r, t, V, K) {
|
|
|
276
277
|
"tw-border-b": r.showHeadlineBorder
|
|
277
278
|
}])
|
|
278
279
|
}, [
|
|
279
|
-
f("div",
|
|
280
|
+
f("div", re, [
|
|
280
281
|
r.showBackButton ? (k(), b("button", {
|
|
281
282
|
key: 0,
|
|
282
283
|
class: "hover:tw-text-action-highlight tw-flex tw-items-center tw-justify-center",
|
|
@@ -287,9 +288,9 @@ function ce(l, a, r, t, V, K) {
|
|
|
287
288
|
icon: t.mdiArrowLeft
|
|
288
289
|
}, null, 8, ["icon"])
|
|
289
290
|
])) : S("", !0),
|
|
290
|
-
r.headline ? (k(), b("h2",
|
|
291
|
+
r.headline ? (k(), b("h2", de, ee(r.headline), 1)) : S("", !0)
|
|
291
292
|
]),
|
|
292
|
-
f("div",
|
|
293
|
+
f("div", ce, [
|
|
293
294
|
r.showGoToLink ? (k(), b("button", {
|
|
294
295
|
key: 0,
|
|
295
296
|
class: "hover:tw-text-action-highlight tw-flex tw-items-center tw-justify-center",
|
|
@@ -312,6 +313,8 @@ function ce(l, a, r, t, V, K) {
|
|
|
312
313
|
])
|
|
313
314
|
], 2),
|
|
314
315
|
f("div", {
|
|
316
|
+
id: "sidesheet-content",
|
|
317
|
+
ref: "contentRef",
|
|
315
318
|
class: "tw-overflow-y-auto tw-overscroll-y-contain",
|
|
316
319
|
style: W({ height: t.contentHeight + "px" })
|
|
317
320
|
}, [
|
|
@@ -339,7 +342,7 @@ function ce(l, a, r, t, V, K) {
|
|
|
339
342
|
], 6)
|
|
340
343
|
], 2)) : S("", !0);
|
|
341
344
|
}
|
|
342
|
-
const
|
|
345
|
+
const me = /* @__PURE__ */ ae(se, [["render", ue]]);
|
|
343
346
|
export {
|
|
344
|
-
|
|
347
|
+
me as default
|
|
345
348
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kiva/kv-components",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.22.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -111,5 +111,5 @@
|
|
|
111
111
|
"embla-carousel-fade",
|
|
112
112
|
"popper.js"
|
|
113
113
|
],
|
|
114
|
-
"gitHead": "
|
|
114
|
+
"gitHead": "a966746cbca329047a6c7f63f3a91af56857d7fb"
|
|
115
115
|
}
|