@kiva/kv-components 6.64.1 → 6.65.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
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { toRefs as
|
|
2
|
-
import { mdiArrowLeft as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
const
|
|
1
|
+
import { toRefs as Q, ref as c, reactive as X, computed as j, watch as g, onMounted as Y, onBeforeUnmount as Z, onUnmounted as $, resolveComponent as ee, openBlock as p, createElementBlock as k, normalizeClass as b, withModifiers as te, createElementVNode as w, normalizeStyle as H, createVNode as z, createCommentVNode as x, toDisplayString as ne, renderSlot as D, nextTick as oe } from "vue";
|
|
2
|
+
import { mdiArrowLeft as ie, mdiClose as le, mdiOpenInNew as se } from "@mdi/js";
|
|
3
|
+
import ae from "./KvMaterialIcon.js";
|
|
4
|
+
import de from "../_virtual/_plugin-vue_export-helper.js";
|
|
5
|
+
const re = {
|
|
6
6
|
name: "KvSideSheet",
|
|
7
7
|
components: {
|
|
8
|
-
KvMaterialIcon:
|
|
8
|
+
KvMaterialIcon: ae
|
|
9
9
|
},
|
|
10
10
|
props: {
|
|
11
11
|
/**
|
|
@@ -73,6 +73,13 @@ const de = {
|
|
|
73
73
|
hideHeadlineBgOnMobile: {
|
|
74
74
|
type: Boolean,
|
|
75
75
|
default: !1
|
|
76
|
+
},
|
|
77
|
+
/**
|
|
78
|
+
* Whether to animate the opening of the side sheet
|
|
79
|
+
* */
|
|
80
|
+
isAnimated: {
|
|
81
|
+
type: Boolean,
|
|
82
|
+
default: !0
|
|
76
83
|
}
|
|
77
84
|
},
|
|
78
85
|
emits: ["side-sheet-closed", "go-to-link"],
|
|
@@ -82,8 +89,9 @@ const de = {
|
|
|
82
89
|
kvTrackFunction: I,
|
|
83
90
|
trackEventCategory: M,
|
|
84
91
|
widthDimensions: l,
|
|
85
|
-
hideHeadlineBgOnMobile: d
|
|
86
|
-
|
|
92
|
+
hideHeadlineBgOnMobile: d,
|
|
93
|
+
isAnimated: F
|
|
94
|
+
} = Q(n), r = c(!F.value), a = c({}), O = c(null), m = c(null), y = c(null), _ = c(null), N = c(null), S = c(null), B = c(null), v = X({
|
|
87
95
|
headline: 0,
|
|
88
96
|
controls: 0
|
|
89
97
|
}), V = j(() => {
|
|
@@ -100,14 +108,14 @@ const de = {
|
|
|
100
108
|
"2xl": 1536
|
|
101
109
|
}, s = N.value || (typeof window < "u" ? window.innerWidth : 0), f = Object.keys(l.value).filter((u) => u !== "default").sort((u, R) => e[R] - e[u]).find((u) => s >= e[u]);
|
|
102
110
|
return f ? l.value[f] : l.value.default || "100%";
|
|
103
|
-
}),
|
|
111
|
+
}), G = (e, s) => {
|
|
104
112
|
let f;
|
|
105
113
|
return (...u) => {
|
|
106
114
|
clearTimeout(f), f = setTimeout(() => e(...u), s);
|
|
107
115
|
};
|
|
108
116
|
}, C = () => {
|
|
109
117
|
_.value = typeof window < "u" ? window.innerHeight : 0, N.value = typeof window < "u" ? window.innerWidth : 0, setTimeout(() => {
|
|
110
|
-
|
|
118
|
+
oe(() => {
|
|
111
119
|
var e;
|
|
112
120
|
if (y.value) {
|
|
113
121
|
const s = y.value.getBoundingClientRect();
|
|
@@ -121,57 +129,20 @@ const de = {
|
|
|
121
129
|
v.controls = 0;
|
|
122
130
|
});
|
|
123
131
|
}, 300);
|
|
124
|
-
}, E =
|
|
132
|
+
}, E = G(C, 100), T = () => {
|
|
125
133
|
const e = "tw-overflow-hidden";
|
|
126
134
|
r.value ? document.body.classList.add(e) : document.body.classList.remove(e);
|
|
127
|
-
},
|
|
135
|
+
}, A = () => {
|
|
128
136
|
r.value = !1, T(), I.value(M.value, "click", "side-sheet-closed"), setTimeout(() => {
|
|
129
137
|
o("side-sheet-closed");
|
|
130
138
|
}, 300), document.removeEventListener("keyup", L);
|
|
131
|
-
},
|
|
139
|
+
}, q = () => {
|
|
132
140
|
o("go-to-link");
|
|
133
141
|
}, L = (e) => {
|
|
134
|
-
(e == null ? void 0 : e.key) === "Escape" &&
|
|
135
|
-
}
|
|
136
|
-
X(() => {
|
|
137
|
-
setTimeout(() => {
|
|
138
|
-
C();
|
|
139
|
-
}, 100), m.value && (S.value = new ResizeObserver(E), S.value.observe(m.value)), y.value && (B.value = new ResizeObserver(E), B.value.observe(y.value)), window.addEventListener("resize", E);
|
|
140
|
-
}), Y(() => {
|
|
141
|
-
r.value && document.body.classList.remove("tw-overflow-hidden");
|
|
142
|
-
}), Z(() => {
|
|
143
|
-
S.value && S.value.disconnect(), B.value && B.value.disconnect(), window.removeEventListener("resize", E);
|
|
144
|
-
const e = document.getElementById("side-sheet-styles");
|
|
145
|
-
e && e.remove();
|
|
146
|
-
}), g(() => {
|
|
147
|
-
var e;
|
|
148
|
-
return (e = i.controls) == null ? void 0 : e.call(i);
|
|
149
|
-
}, () => {
|
|
150
|
-
setTimeout(() => {
|
|
151
|
-
C();
|
|
152
|
-
}, 100);
|
|
153
|
-
}, { deep: !0 });
|
|
154
|
-
const q = j(() => ({
|
|
142
|
+
(e == null ? void 0 : e.key) === "Escape" && A();
|
|
143
|
+
}, J = j(() => ({
|
|
155
144
|
width: W.value
|
|
156
|
-
}))
|
|
157
|
-
g(t, (e) => {
|
|
158
|
-
typeof window < "u" && (e ? (document.addEventListener("keyup", L), a.value = {}, setTimeout(() => {
|
|
159
|
-
r.value = !0, T(), C();
|
|
160
|
-
}, 10)) : (r.value = !1, T(), document.removeEventListener("keyup", L), a.value = {}));
|
|
161
|
-
}, { immediate: !0 }), g(W, (e) => {
|
|
162
|
-
r.value && t.value && a.value && Object.keys(a.value).length > 0 && (a.value = {
|
|
163
|
-
...a.value,
|
|
164
|
-
width: e,
|
|
165
|
-
transition: "none"
|
|
166
|
-
// No animation for resize
|
|
167
|
-
}, setTimeout(() => {
|
|
168
|
-
a.value && Object.keys(a.value).length > 0 && (a.value = {
|
|
169
|
-
...a.value,
|
|
170
|
-
transition: "all 0.3s ease-in-out"
|
|
171
|
-
});
|
|
172
|
-
}, 50));
|
|
173
|
-
});
|
|
174
|
-
const U = () => {
|
|
145
|
+
})), K = () => {
|
|
175
146
|
if (typeof l.value == "object" && O.value) {
|
|
176
147
|
const e = "side-sheet-styles";
|
|
177
148
|
let s = document.getElementById(e);
|
|
@@ -182,9 +153,9 @@ const de = {
|
|
|
182
153
|
lg: "1024px",
|
|
183
154
|
xl: "1280px",
|
|
184
155
|
"2xl": "1536px"
|
|
185
|
-
}, R = Object.keys(l.value).filter((h) => h !== "default").sort((h,
|
|
186
|
-
const
|
|
187
|
-
return
|
|
156
|
+
}, R = Object.keys(l.value).filter((h) => h !== "default").sort((h, P) => {
|
|
157
|
+
const U = ["sm", "md", "lg", "xl", "2xl"];
|
|
158
|
+
return U.indexOf(h) - U.indexOf(P);
|
|
188
159
|
}).map((h) => `
|
|
189
160
|
@media (min-width: ${f[h]}) {
|
|
190
161
|
#side-sheet-${n.trackEventCategory || "default"} {
|
|
@@ -195,35 +166,68 @@ const de = {
|
|
|
195
166
|
s.textContent = R, O.value.id = `side-sheet-${n.trackEventCategory || "default"}`;
|
|
196
167
|
}
|
|
197
168
|
};
|
|
198
|
-
return g(
|
|
199
|
-
|
|
169
|
+
return g(t, (e) => {
|
|
170
|
+
typeof window < "u" && (e ? (document.addEventListener("keyup", L), a.value = {}, setTimeout(() => {
|
|
171
|
+
r.value = !0, T(), C();
|
|
172
|
+
}, 10)) : (r.value = !1, T(), document.removeEventListener("keyup", L), a.value = {}));
|
|
173
|
+
}, { immediate: !0 }), g(() => {
|
|
174
|
+
var e;
|
|
175
|
+
return (e = i.controls) == null ? void 0 : e.call(i);
|
|
176
|
+
}, () => {
|
|
177
|
+
setTimeout(() => {
|
|
178
|
+
C();
|
|
179
|
+
}, 100);
|
|
180
|
+
}, { deep: !0 }), g(W, (e) => {
|
|
181
|
+
r.value && t.value && a.value && Object.keys(a.value).length > 0 && (a.value = {
|
|
182
|
+
...a.value,
|
|
183
|
+
width: e,
|
|
184
|
+
transition: "none"
|
|
185
|
+
// No animation for resize
|
|
186
|
+
}, setTimeout(() => {
|
|
187
|
+
a.value && Object.keys(a.value).length > 0 && (a.value = {
|
|
188
|
+
...a.value,
|
|
189
|
+
transition: "all 0.3s ease-in-out"
|
|
190
|
+
});
|
|
191
|
+
}, 50));
|
|
192
|
+
}), g(l, () => {
|
|
193
|
+
r.value && K();
|
|
200
194
|
}, { immediate: !0 }), g(r, (e) => {
|
|
201
|
-
e &&
|
|
195
|
+
e && K();
|
|
196
|
+
}), Y(() => {
|
|
197
|
+
setTimeout(() => {
|
|
198
|
+
C();
|
|
199
|
+
}, 100), m.value && (S.value = new ResizeObserver(E), S.value.observe(m.value)), y.value && (B.value = new ResizeObserver(E), B.value.observe(y.value)), window.addEventListener("resize", E);
|
|
200
|
+
}), Z(() => {
|
|
201
|
+
r.value && document.body.classList.remove("tw-overflow-hidden");
|
|
202
|
+
}), $(() => {
|
|
203
|
+
S.value && S.value.disconnect(), B.value && B.value.disconnect(), window.removeEventListener("resize", E);
|
|
204
|
+
const e = document.getElementById("side-sheet-styles");
|
|
205
|
+
e && e.remove();
|
|
202
206
|
}), {
|
|
203
|
-
closeSideSheet:
|
|
207
|
+
closeSideSheet: A,
|
|
204
208
|
contentHeight: V,
|
|
205
209
|
controlsRef: m,
|
|
206
210
|
headlineRef: y,
|
|
207
211
|
sideSheetRef: O,
|
|
208
|
-
sideSheetStyles:
|
|
209
|
-
goToLink:
|
|
210
|
-
mdiArrowLeft:
|
|
211
|
-
mdiClose:
|
|
212
|
-
mdiOpenInNew:
|
|
212
|
+
sideSheetStyles: J,
|
|
213
|
+
goToLink: q,
|
|
214
|
+
mdiArrowLeft: ie,
|
|
215
|
+
mdiClose: le,
|
|
216
|
+
mdiOpenInNew: se,
|
|
213
217
|
modalStyles: a,
|
|
214
218
|
open: r
|
|
215
219
|
};
|
|
216
220
|
}
|
|
217
|
-
},
|
|
218
|
-
function
|
|
219
|
-
const l =
|
|
221
|
+
}, ce = { class: "tw-flex tw-gap-1.5" }, ue = { key: 1 }, we = { class: "tw-flex tw-gap-1.5" };
|
|
222
|
+
function fe(n, o, i, t, I, M) {
|
|
223
|
+
const l = ee("kv-material-icon");
|
|
220
224
|
return i.visible ? (p(), k("div", {
|
|
221
225
|
key: 0,
|
|
222
226
|
class: b(["tw-block lg:tw-mt-0 tw-fixed tw-inset-0 tw-bg-black tw-transition-all md:tw-duration-150 tw-z-modal", {
|
|
223
227
|
"tw-bg-opacity-0 tw-delay-300": !t.open,
|
|
224
228
|
"tw-bg-opacity-low": t.open
|
|
225
229
|
}]),
|
|
226
|
-
onClick: o[3] || (o[3] =
|
|
230
|
+
onClick: o[3] || (o[3] = te((...d) => t.closeSideSheet && t.closeSideSheet(...d), ["self"]))
|
|
227
231
|
}, [
|
|
228
232
|
w("div", {
|
|
229
233
|
ref: "sideSheetRef",
|
|
@@ -246,7 +250,7 @@ function we(n, o, i, t, I, M) {
|
|
|
246
250
|
"tw-border-b": i.showHeadlineBorder
|
|
247
251
|
}])
|
|
248
252
|
}, [
|
|
249
|
-
w("div",
|
|
253
|
+
w("div", ce, [
|
|
250
254
|
i.showBackButton ? (p(), k("button", {
|
|
251
255
|
key: 0,
|
|
252
256
|
class: "hover:tw-text-action-highlight tw-flex tw-items-center tw-justify-center",
|
|
@@ -257,9 +261,9 @@ function we(n, o, i, t, I, M) {
|
|
|
257
261
|
icon: t.mdiArrowLeft
|
|
258
262
|
}, null, 8, ["icon"])
|
|
259
263
|
])) : x("", !0),
|
|
260
|
-
i.headline ? (p(), k("h3",
|
|
264
|
+
i.headline ? (p(), k("h3", ue, ne(i.headline), 1)) : x("", !0)
|
|
261
265
|
]),
|
|
262
|
-
w("div",
|
|
266
|
+
w("div", we, [
|
|
263
267
|
i.showGoToLink ? (p(), k("button", {
|
|
264
268
|
key: 0,
|
|
265
269
|
class: "hover:tw-text-action-highlight tw-flex tw-items-center tw-justify-center",
|
|
@@ -292,7 +296,7 @@ function we(n, o, i, t, I, M) {
|
|
|
292
296
|
"tw-opacity-full": t.open
|
|
293
297
|
}])
|
|
294
298
|
}, [
|
|
295
|
-
|
|
299
|
+
D(n.$slots, "default")
|
|
296
300
|
], 2)
|
|
297
301
|
], 4),
|
|
298
302
|
n.$slots.controls ? (p(), k("div", {
|
|
@@ -304,13 +308,13 @@ function we(n, o, i, t, I, M) {
|
|
|
304
308
|
}]),
|
|
305
309
|
style: { "z-index": "999" }
|
|
306
310
|
}, [
|
|
307
|
-
|
|
311
|
+
D(n.$slots, "controls")
|
|
308
312
|
], 2)) : x("", !0)
|
|
309
313
|
], 4)
|
|
310
314
|
], 6)
|
|
311
315
|
], 2)) : x("", !0);
|
|
312
316
|
}
|
|
313
|
-
const
|
|
317
|
+
const ge = /* @__PURE__ */ de(re, [["render", fe]]);
|
|
314
318
|
export {
|
|
315
|
-
|
|
319
|
+
ge as default
|
|
316
320
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.header-link[data-v-
|
|
1
|
+
.header-link[data-v-2a224640]{cursor:pointer;padding-top:1rem;padding-bottom:1rem;--tw-text-opacity: 1;color:rgba(var(--text-primary),var(--tw-text-opacity, 1));text-decoration-line:none}.header-link[data-v-2a224640]:hover{--tw-text-opacity: 1;color:rgba(var(--text-action),var(--tw-text-opacity, 1));text-decoration-line:none}[data-v-2a224640] .avatar div:first-child{display:flex}
|
|
@@ -10,7 +10,7 @@ import { throttle as ce } from "../../utils/throttle.js";
|
|
|
10
10
|
import { isLegacyPlaceholderAvatar as we } from "../../utils/imageUtils.js";
|
|
11
11
|
import "./KvHeaderLinkBar.css";
|
|
12
12
|
import fe from "../../_virtual/_plugin-vue_export-helper.js";
|
|
13
|
-
const Me = h(() => import("./KvHeaderMobileMenu.js")), R = h(() => import("./KvHeaderMyKivaMenu.js")), ke = h(() => import("./LendMenu/KvLendMenu.js")), he = h(() => import("./KvHeaderTakeActionMenu.js")), ge = h(() => import("./KvHeaderAboutMenu.js")), F =
|
|
13
|
+
const Me = h(() => import("./KvHeaderMobileMenu.js")), R = h(() => import("./KvHeaderMyKivaMenu.js")), ke = h(() => import("./LendMenu/KvLendMenu.js")), he = h(() => import("./KvHeaderTakeActionMenu.js")), ge = h(() => import("./KvHeaderAboutMenu.js")), F = 150, k = "avatar-menu", x = "menuButton", W = { top: "-3.75rem", width: "100%" }, A = "lendButton", be = {
|
|
14
14
|
components: {
|
|
15
15
|
KvMaterialIcon: ue,
|
|
16
16
|
KvIconBag: me,
|
|
@@ -285,7 +285,7 @@ function Ie(i, n, a, e, N, E) {
|
|
|
285
285
|
])
|
|
286
286
|
], 32);
|
|
287
287
|
}
|
|
288
|
-
const Pe = /* @__PURE__ */ fe(be, [["render", Ie], ["__scopeId", "data-v-
|
|
288
|
+
const Pe = /* @__PURE__ */ fe(be, [["render", Ie], ["__scopeId", "data-v-2a224640"]]);
|
|
289
289
|
export {
|
|
290
290
|
Pe as default
|
|
291
291
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kiva/kv-components",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.65.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -114,5 +114,5 @@
|
|
|
114
114
|
"embla-carousel-fade",
|
|
115
115
|
"popper.js"
|
|
116
116
|
],
|
|
117
|
-
"gitHead": "
|
|
117
|
+
"gitHead": "745926420b7f23d6d719f15a7faec84d0086dbad"
|
|
118
118
|
}
|