@kiva/kv-components 6.22.0 → 6.22.1
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 +55 -57
- 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 J, ref as w, reactive as P, computed as z, onMounted as Q, onUnmounted as j, watch as p, resolveComponent as Y, openBlock as k, createElementBlock as b, normalizeClass as x, withModifiers as Z, createElementVNode as h, normalizeStyle as W, createVNode as _, createCommentVNode as S, toDisplayString as $, renderSlot as U, nextTick as ee } from "vue";
|
|
2
|
+
import { mdiArrowLeft as te, mdiClose as oe, mdiExportVariant as ne } from "@mdi/js";
|
|
3
|
+
import ie from "./KvMaterialIcon.js";
|
|
4
|
+
import le from "../_virtual/_plugin-vue_export-helper.js";
|
|
5
|
+
const ae = {
|
|
6
6
|
name: "KvSideSheet",
|
|
7
7
|
components: {
|
|
8
|
-
KvMaterialIcon:
|
|
8
|
+
KvMaterialIcon: ie
|
|
9
9
|
},
|
|
10
10
|
props: {
|
|
11
11
|
/**
|
|
@@ -81,12 +81,12 @@ const se = {
|
|
|
81
81
|
visible: t,
|
|
82
82
|
kvTrackFunction: V,
|
|
83
83
|
trackEventCategory: K,
|
|
84
|
-
animationSourceElement:
|
|
84
|
+
animationSourceElement: f,
|
|
85
85
|
widthDimensions: i
|
|
86
|
-
} =
|
|
86
|
+
} = J(l), u = w(!1), B = w({}), s = w({}), L = w(null), m = w(null), y = w(null), M = w(window.innerHeight), D = w(window.innerWidth), v = P({
|
|
87
87
|
headline: 0,
|
|
88
88
|
controls: 0
|
|
89
|
-
}),
|
|
89
|
+
}), A = 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 se = {
|
|
|
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
|
+
}), G = (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
|
+
ee(() => {
|
|
111
111
|
var e;
|
|
112
112
|
if (y.value) {
|
|
113
113
|
const n = y.value.getBoundingClientRect();
|
|
@@ -121,30 +121,30 @@ const se = {
|
|
|
121
121
|
v.controls = 0;
|
|
122
122
|
});
|
|
123
123
|
}, 300);
|
|
124
|
-
},
|
|
124
|
+
}, T = G(E, 100), O = () => {
|
|
125
125
|
const e = "tw-overflow-hidden";
|
|
126
|
-
|
|
126
|
+
u.value ? document.body.classList.add(e) : document.body.classList.remove(e);
|
|
127
127
|
}, F = () => {
|
|
128
|
-
|
|
128
|
+
u.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
|
+
}, X = () => {
|
|
132
132
|
a("go-to-link");
|
|
133
133
|
}, H = (e) => {
|
|
134
134
|
(e == null ? void 0 : e.key) === "Escape" && F();
|
|
135
135
|
};
|
|
136
|
-
|
|
136
|
+
Q(() => {
|
|
137
137
|
if (setTimeout(() => {
|
|
138
138
|
E();
|
|
139
139
|
}, 100), m.value) {
|
|
140
|
-
const e = new ResizeObserver(
|
|
140
|
+
const e = new ResizeObserver(T);
|
|
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(T);
|
|
145
145
|
e.observe(y.value), j(() => e.disconnect());
|
|
146
146
|
}
|
|
147
|
-
window.addEventListener("resize",
|
|
147
|
+
window.addEventListener("resize", T), j(() => window.removeEventListener("resize", T));
|
|
148
148
|
}), p(() => {
|
|
149
149
|
var e;
|
|
150
150
|
return (e = r.controls) == null ? void 0 : e.call(r);
|
|
@@ -153,21 +153,21 @@ const se = {
|
|
|
153
153
|
E();
|
|
154
154
|
}, 100);
|
|
155
155
|
}, { deep: !0, immediate: !0 });
|
|
156
|
-
const
|
|
156
|
+
const q = 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
|
+
u.value = !0, O(), E();
|
|
164
164
|
}, 10);
|
|
165
|
-
const o = (n =
|
|
166
|
-
o && (d || g || c ||
|
|
165
|
+
const o = (n = f.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, R = (o == null ? void 0 : o.height) ?? 0;
|
|
166
|
+
o && (d || g || c || R) && (B.value = {
|
|
167
167
|
position: "fixed",
|
|
168
168
|
top: `${d}px`,
|
|
169
169
|
width: `${c}px`,
|
|
170
|
-
height: `${
|
|
170
|
+
height: `${R}px`,
|
|
171
171
|
transform: `translateX(${C.value})`
|
|
172
172
|
}, s.value = {
|
|
173
173
|
...B.value,
|
|
@@ -182,12 +182,12 @@ const se = {
|
|
|
182
182
|
};
|
|
183
183
|
}, 10));
|
|
184
184
|
} else
|
|
185
|
-
|
|
185
|
+
u.value = !1, O(), document.removeEventListener("keyup", H), f.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
|
+
u.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 se = {
|
|
|
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, R) => {
|
|
214
214
|
const N = ["sm", "md", "lg", "xl", "2xl"];
|
|
215
|
-
return N.indexOf(c) - N.indexOf(
|
|
215
|
+
return N.indexOf(c) - N.indexOf(R);
|
|
216
216
|
}).map((c) => `
|
|
217
217
|
@media (min-width: ${o[c]}) {
|
|
218
218
|
#side-sheet-${l.trackEventCategory || "default"} {
|
|
@@ -226,37 +226,36 @@ const se = {
|
|
|
226
226
|
}
|
|
227
227
|
};
|
|
228
228
|
return p(i, () => {
|
|
229
|
-
|
|
230
|
-
}, { immediate: !0 }), p(
|
|
229
|
+
u.value && I();
|
|
230
|
+
}, { immediate: !0 }), p(u, (e) => {
|
|
231
231
|
e && I();
|
|
232
232
|
}), {
|
|
233
233
|
closeSideSheet: F,
|
|
234
|
-
contentHeight:
|
|
234
|
+
contentHeight: A,
|
|
235
235
|
controlsRef: m,
|
|
236
236
|
headlineRef: y,
|
|
237
|
-
contentRef: A,
|
|
238
237
|
sideSheetRef: L,
|
|
239
|
-
sideSheetStyles:
|
|
240
|
-
goToLink:
|
|
241
|
-
mdiArrowLeft:
|
|
242
|
-
mdiClose:
|
|
243
|
-
mdiExportVariant:
|
|
238
|
+
sideSheetStyles: q,
|
|
239
|
+
goToLink: X,
|
|
240
|
+
mdiArrowLeft: te,
|
|
241
|
+
mdiClose: oe,
|
|
242
|
+
mdiExportVariant: ne,
|
|
244
243
|
modalStyles: s,
|
|
245
|
-
open:
|
|
244
|
+
open: u
|
|
246
245
|
};
|
|
247
246
|
}
|
|
248
|
-
},
|
|
249
|
-
function
|
|
250
|
-
const
|
|
247
|
+
}, se = { class: "tw-flex tw-gap-1.5" }, re = { key: 1 }, de = { class: "tw-flex tw-gap-1.5" };
|
|
248
|
+
function ce(l, a, r, t, V, K) {
|
|
249
|
+
const f = Y("kv-material-icon");
|
|
251
250
|
return r.visible ? (k(), b("div", {
|
|
252
251
|
key: 0,
|
|
253
252
|
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", {
|
|
254
253
|
"tw-bg-opacity-0 tw-delay-300": !t.open,
|
|
255
254
|
"tw-bg-opacity-low": t.open
|
|
256
255
|
}]),
|
|
257
|
-
onClick: a[3] || (a[3] =
|
|
256
|
+
onClick: a[3] || (a[3] = Z((...i) => t.closeSideSheet && t.closeSideSheet(...i), ["self"]))
|
|
258
257
|
}, [
|
|
259
|
-
|
|
258
|
+
h("div", {
|
|
260
259
|
ref: "sideSheetRef",
|
|
261
260
|
class: x(["tw-fixed tw-right-0 tw-transition-all tw-duration-300 tw-bg-white tw-overflow-y-auto", {
|
|
262
261
|
"tw-translate-x-full": !t.open,
|
|
@@ -265,11 +264,11 @@ function ue(l, a, r, t, V, K) {
|
|
|
265
264
|
}]),
|
|
266
265
|
style: W(t.sideSheetStyles)
|
|
267
266
|
}, [
|
|
268
|
-
|
|
267
|
+
h("div", {
|
|
269
268
|
class: "tw-flex tw-flex-col tw-h-full",
|
|
270
269
|
style: W(t.modalStyles)
|
|
271
270
|
}, [
|
|
272
|
-
|
|
271
|
+
h("div", {
|
|
273
272
|
ref: "headlineRef",
|
|
274
273
|
class: x(["tw-flex tw-justify-between tw-transition-opacity tw-duration-200 tw-px-3 tw-py-2 tw-border-tertiary", {
|
|
275
274
|
"tw-opacity-0": !t.open,
|
|
@@ -277,48 +276,47 @@ function ue(l, a, r, t, V, K) {
|
|
|
277
276
|
"tw-border-b": r.showHeadlineBorder
|
|
278
277
|
}])
|
|
279
278
|
}, [
|
|
280
|
-
|
|
279
|
+
h("div", se, [
|
|
281
280
|
r.showBackButton ? (k(), b("button", {
|
|
282
281
|
key: 0,
|
|
283
282
|
class: "hover:tw-text-action-highlight tw-flex tw-items-center tw-justify-center",
|
|
284
283
|
onClick: a[0] || (a[0] = (...i) => t.closeSideSheet && t.closeSideSheet(...i))
|
|
285
284
|
}, [
|
|
286
|
-
_(
|
|
285
|
+
_(f, {
|
|
287
286
|
class: "tw-w-3 tw-h-3",
|
|
288
287
|
icon: t.mdiArrowLeft
|
|
289
288
|
}, null, 8, ["icon"])
|
|
290
289
|
])) : S("", !0),
|
|
291
|
-
r.headline ? (k(), b("h2",
|
|
290
|
+
r.headline ? (k(), b("h2", re, $(r.headline), 1)) : S("", !0)
|
|
292
291
|
]),
|
|
293
|
-
|
|
292
|
+
h("div", de, [
|
|
294
293
|
r.showGoToLink ? (k(), b("button", {
|
|
295
294
|
key: 0,
|
|
296
295
|
class: "hover:tw-text-action-highlight tw-flex tw-items-center tw-justify-center",
|
|
297
296
|
onClick: a[1] || (a[1] = (...i) => t.goToLink && t.goToLink(...i))
|
|
298
297
|
}, [
|
|
299
|
-
_(
|
|
298
|
+
_(f, {
|
|
300
299
|
class: "tw-w-3 tw-h-3",
|
|
301
300
|
icon: t.mdiExportVariant
|
|
302
301
|
}, null, 8, ["icon"])
|
|
303
302
|
])) : S("", !0),
|
|
304
|
-
|
|
303
|
+
h("button", {
|
|
305
304
|
class: "hover:tw-text-action-highlight tw-flex tw-items-center tw-justify-center",
|
|
306
305
|
onClick: a[2] || (a[2] = (...i) => t.closeSideSheet && t.closeSideSheet(...i))
|
|
307
306
|
}, [
|
|
308
|
-
_(
|
|
307
|
+
_(f, {
|
|
309
308
|
class: "tw-w-3 tw-h-3",
|
|
310
309
|
icon: t.mdiClose
|
|
311
310
|
}, null, 8, ["icon"])
|
|
312
311
|
])
|
|
313
312
|
])
|
|
314
313
|
], 2),
|
|
315
|
-
|
|
314
|
+
h("div", {
|
|
316
315
|
id: "sidesheet-content",
|
|
317
|
-
ref: "contentRef",
|
|
318
316
|
class: "tw-overflow-y-auto tw-overscroll-y-contain",
|
|
319
317
|
style: W({ height: t.contentHeight + "px" })
|
|
320
318
|
}, [
|
|
321
|
-
|
|
319
|
+
h("div", {
|
|
322
320
|
class: x(["tw-p-2 tw-transition-opacity tw-duration-200", {
|
|
323
321
|
"tw-opacity-0": !t.open,
|
|
324
322
|
"tw-opacity-full": t.open
|
|
@@ -342,7 +340,7 @@ function ue(l, a, r, t, V, K) {
|
|
|
342
340
|
], 6)
|
|
343
341
|
], 2)) : S("", !0);
|
|
344
342
|
}
|
|
345
|
-
const
|
|
343
|
+
const ve = /* @__PURE__ */ le(ae, [["render", ce]]);
|
|
346
344
|
export {
|
|
347
|
-
|
|
345
|
+
ve as default
|
|
348
346
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kiva/kv-components",
|
|
3
|
-
"version": "6.22.
|
|
3
|
+
"version": "6.22.1",
|
|
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": "2e79f200809fc5329546c0c1a75acbb1238d2c03"
|
|
115
115
|
}
|