@kiva/kv-components 6.56.2 → 6.57.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 +51 -49
- package/package.json +3 -3
package/dist/vue/KvSideSheet.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { toRefs as P, ref as
|
|
2
|
-
import { mdiArrowLeft as ne, mdiClose as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
const
|
|
1
|
+
import { toRefs as P, ref as c, reactive as Q, computed as j, onMounted as X, onBeforeUnmount as Y, onUnmounted as Z, watch as g, resolveComponent as $, openBlock as p, createElementBlock as k, normalizeClass as b, withModifiers as ee, createElementVNode as w, normalizeStyle as H, createVNode as z, createCommentVNode as x, toDisplayString as te, renderSlot as F, nextTick as oe } from "vue";
|
|
2
|
+
import { mdiArrowLeft as ne, mdiClose as ie, mdiOpenInNew as le } from "@mdi/js";
|
|
3
|
+
import se from "./KvMaterialIcon.js";
|
|
4
|
+
import ae from "../_virtual/_plugin-vue_export-helper.js";
|
|
5
|
+
const de = {
|
|
6
6
|
name: "KvSideSheet",
|
|
7
7
|
components: {
|
|
8
|
-
KvMaterialIcon:
|
|
8
|
+
KvMaterialIcon: se
|
|
9
9
|
},
|
|
10
10
|
props: {
|
|
11
11
|
/**
|
|
@@ -65,7 +65,7 @@ const ae = {
|
|
|
65
65
|
widthDimensions: {
|
|
66
66
|
type: [String, Object],
|
|
67
67
|
default: () => ({ default: "100%", md: "50%" }),
|
|
68
|
-
validator: (
|
|
68
|
+
validator: (o) => typeof o == "string" ? /^(\d+px|[\d.]+%|auto|inherit|initial)$/.test(o) : typeof o == "object" ? Object.keys(o).every((n) => ["default", "sm", "md", "lg", "xl", "2xl"].includes(n) && /^(\d+px|[\d.]+%|auto|inherit|initial)$/.test(o[n])) : !1
|
|
69
69
|
},
|
|
70
70
|
/**
|
|
71
71
|
* Whether to hide the background of the headline section on mobile (e.g., in Borrower Profile Sidesheet)
|
|
@@ -76,14 +76,14 @@ const ae = {
|
|
|
76
76
|
}
|
|
77
77
|
},
|
|
78
78
|
emits: ["side-sheet-closed", "go-to-link"],
|
|
79
|
-
setup(
|
|
79
|
+
setup(o, { emit: n, slots: i }) {
|
|
80
80
|
const {
|
|
81
81
|
visible: t,
|
|
82
82
|
kvTrackFunction: I,
|
|
83
83
|
trackEventCategory: M,
|
|
84
84
|
widthDimensions: l,
|
|
85
85
|
hideHeadlineBgOnMobile: d
|
|
86
|
-
} = P(
|
|
86
|
+
} = P(o), r = c(!1), a = c({}), O = c(null), m = c(null), y = c(null), _ = c(null), N = c(null), S = c(null), B = c(null), v = Q({
|
|
87
87
|
headline: 0,
|
|
88
88
|
controls: 0
|
|
89
89
|
}), V = j(() => {
|
|
@@ -98,7 +98,7 @@ const ae = {
|
|
|
98
98
|
lg: 1024,
|
|
99
99
|
xl: 1280,
|
|
100
100
|
"2xl": 1536
|
|
101
|
-
}, s = N.value || window.innerWidth, f = Object.keys(l.value).filter((u) => u !== "default").sort((u,
|
|
101
|
+
}, s = N.value || window.innerWidth, f = Object.keys(l.value).filter((u) => u !== "default").sort((u, R) => e[R] - e[u]).find((u) => s >= e[u]);
|
|
102
102
|
return f ? l.value[f] : l.value.default || "100%";
|
|
103
103
|
}), A = (e, s) => {
|
|
104
104
|
let f;
|
|
@@ -107,7 +107,7 @@ const ae = {
|
|
|
107
107
|
};
|
|
108
108
|
}, C = () => {
|
|
109
109
|
_.value = window.innerHeight, N.value = window.innerWidth, setTimeout(() => {
|
|
110
|
-
|
|
110
|
+
oe(() => {
|
|
111
111
|
var e;
|
|
112
112
|
if (y.value) {
|
|
113
113
|
const s = y.value.getBoundingClientRect();
|
|
@@ -123,14 +123,14 @@ const ae = {
|
|
|
123
123
|
}, 300);
|
|
124
124
|
}, E = A(C, 100), T = () => {
|
|
125
125
|
const e = "tw-overflow-hidden";
|
|
126
|
-
|
|
126
|
+
r.value ? document.body.classList.add(e) : document.body.classList.remove(e);
|
|
127
127
|
}, K = () => {
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
}, 300), document.removeEventListener("keyup",
|
|
128
|
+
r.value = !1, T(), I.value(M.value, "click", "side-sheet-closed"), setTimeout(() => {
|
|
129
|
+
n("side-sheet-closed");
|
|
130
|
+
}, 300), document.removeEventListener("keyup", L);
|
|
131
131
|
}, G = () => {
|
|
132
|
-
|
|
133
|
-
},
|
|
132
|
+
n("go-to-link");
|
|
133
|
+
}, L = (e) => {
|
|
134
134
|
(e == null ? void 0 : e.key) === "Escape" && K();
|
|
135
135
|
};
|
|
136
136
|
X(() => {
|
|
@@ -138,6 +138,8 @@ const ae = {
|
|
|
138
138
|
C();
|
|
139
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
140
|
}), Y(() => {
|
|
141
|
+
r.value && document.body.classList.remove("tw-overflow-hidden");
|
|
142
|
+
}), Z(() => {
|
|
141
143
|
S.value && S.value.disconnect(), B.value && B.value.disconnect(), window.removeEventListener("resize", E);
|
|
142
144
|
const e = document.getElementById("side-sheet-styles");
|
|
143
145
|
e && e.remove();
|
|
@@ -153,11 +155,11 @@ const ae = {
|
|
|
153
155
|
width: W.value
|
|
154
156
|
}));
|
|
155
157
|
g(t, (e) => {
|
|
156
|
-
typeof window < "u" && (e ? (document.addEventListener("keyup",
|
|
157
|
-
|
|
158
|
-
}, 10)) : (
|
|
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 = {}));
|
|
159
161
|
}, { immediate: !0 }), g(W, (e) => {
|
|
160
|
-
|
|
162
|
+
r.value && t.value && a.value && Object.keys(a.value).length > 0 && (a.value = {
|
|
161
163
|
...a.value,
|
|
162
164
|
width: e,
|
|
163
165
|
transition: "none"
|
|
@@ -169,7 +171,7 @@ const ae = {
|
|
|
169
171
|
});
|
|
170
172
|
}, 50));
|
|
171
173
|
});
|
|
172
|
-
const
|
|
174
|
+
const U = () => {
|
|
173
175
|
if (typeof l.value == "object" && O.value) {
|
|
174
176
|
const e = "side-sheet-styles";
|
|
175
177
|
let s = document.getElementById(e);
|
|
@@ -180,23 +182,23 @@ const ae = {
|
|
|
180
182
|
lg: "1024px",
|
|
181
183
|
xl: "1280px",
|
|
182
184
|
"2xl": "1536px"
|
|
183
|
-
},
|
|
184
|
-
const
|
|
185
|
-
return
|
|
185
|
+
}, R = Object.keys(l.value).filter((h) => h !== "default").sort((h, J) => {
|
|
186
|
+
const D = ["sm", "md", "lg", "xl", "2xl"];
|
|
187
|
+
return D.indexOf(h) - D.indexOf(J);
|
|
186
188
|
}).map((h) => `
|
|
187
189
|
@media (min-width: ${f[h]}) {
|
|
188
|
-
#side-sheet-${
|
|
190
|
+
#side-sheet-${o.trackEventCategory || "default"} {
|
|
189
191
|
width: ${l.value[h]} !important;
|
|
190
192
|
}
|
|
191
193
|
}
|
|
192
194
|
`).join("");
|
|
193
|
-
s.textContent =
|
|
195
|
+
s.textContent = R, O.value.id = `side-sheet-${o.trackEventCategory || "default"}`;
|
|
194
196
|
}
|
|
195
197
|
};
|
|
196
198
|
return g(l, () => {
|
|
197
|
-
|
|
198
|
-
}, { immediate: !0 }), g(
|
|
199
|
-
e &&
|
|
199
|
+
r.value && U();
|
|
200
|
+
}, { immediate: !0 }), g(r, (e) => {
|
|
201
|
+
e && U();
|
|
200
202
|
}), {
|
|
201
203
|
closeSideSheet: K,
|
|
202
204
|
contentHeight: V,
|
|
@@ -206,29 +208,29 @@ const ae = {
|
|
|
206
208
|
sideSheetStyles: q,
|
|
207
209
|
goToLink: G,
|
|
208
210
|
mdiArrowLeft: ne,
|
|
209
|
-
mdiClose:
|
|
210
|
-
mdiOpenInNew:
|
|
211
|
+
mdiClose: ie,
|
|
212
|
+
mdiOpenInNew: le,
|
|
211
213
|
modalStyles: a,
|
|
212
|
-
open:
|
|
214
|
+
open: r
|
|
213
215
|
};
|
|
214
216
|
}
|
|
215
|
-
},
|
|
216
|
-
function
|
|
217
|
-
const l =
|
|
217
|
+
}, re = { class: "tw-flex tw-gap-1.5" }, ce = { key: 1 }, ue = { class: "tw-flex tw-gap-1.5" };
|
|
218
|
+
function we(o, n, i, t, I, M) {
|
|
219
|
+
const l = $("kv-material-icon");
|
|
218
220
|
return i.visible ? (p(), k("div", {
|
|
219
221
|
key: 0,
|
|
220
222
|
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", {
|
|
221
223
|
"tw-bg-opacity-0 tw-delay-300": !t.open,
|
|
222
224
|
"tw-bg-opacity-low": t.open
|
|
223
225
|
}]),
|
|
224
|
-
onClick:
|
|
226
|
+
onClick: n[3] || (n[3] = ee((...d) => t.closeSideSheet && t.closeSideSheet(...d), ["self"]))
|
|
225
227
|
}, [
|
|
226
228
|
w("div", {
|
|
227
229
|
ref: "sideSheetRef",
|
|
228
230
|
class: b(["tw-fixed tw-right-0 tw-transition-all tw-duration-300 tw-bg-white", {
|
|
229
231
|
"tw-translate-x-full": !t.open,
|
|
230
232
|
"tw-translate-x-0": t.open,
|
|
231
|
-
"tw-h-full":
|
|
233
|
+
"tw-h-full": o.$slots.controls
|
|
232
234
|
}]),
|
|
233
235
|
style: H(t.sideSheetStyles)
|
|
234
236
|
}, [
|
|
@@ -244,24 +246,24 @@ function ue(n, o, i, t, I, M) {
|
|
|
244
246
|
"tw-border-b": i.showHeadlineBorder
|
|
245
247
|
}])
|
|
246
248
|
}, [
|
|
247
|
-
w("div",
|
|
249
|
+
w("div", re, [
|
|
248
250
|
i.showBackButton ? (p(), k("button", {
|
|
249
251
|
key: 0,
|
|
250
252
|
class: "hover:tw-text-action-highlight tw-flex tw-items-center tw-justify-center",
|
|
251
|
-
onClick:
|
|
253
|
+
onClick: n[0] || (n[0] = (...d) => t.closeSideSheet && t.closeSideSheet(...d))
|
|
252
254
|
}, [
|
|
253
255
|
z(l, {
|
|
254
256
|
class: "tw-w-3 tw-h-3",
|
|
255
257
|
icon: t.mdiArrowLeft
|
|
256
258
|
}, null, 8, ["icon"])
|
|
257
259
|
])) : x("", !0),
|
|
258
|
-
i.headline ? (p(), k("h3",
|
|
260
|
+
i.headline ? (p(), k("h3", ce, te(i.headline), 1)) : x("", !0)
|
|
259
261
|
]),
|
|
260
|
-
w("div",
|
|
262
|
+
w("div", ue, [
|
|
261
263
|
i.showGoToLink ? (p(), k("button", {
|
|
262
264
|
key: 0,
|
|
263
265
|
class: "hover:tw-text-action-highlight tw-flex tw-items-center tw-justify-center",
|
|
264
|
-
onClick:
|
|
266
|
+
onClick: n[1] || (n[1] = (...d) => t.goToLink && t.goToLink(...d))
|
|
265
267
|
}, [
|
|
266
268
|
z(l, {
|
|
267
269
|
class: "tw-w-3 tw-h-3",
|
|
@@ -270,7 +272,7 @@ function ue(n, o, i, t, I, M) {
|
|
|
270
272
|
])) : x("", !0),
|
|
271
273
|
w("button", {
|
|
272
274
|
class: "hover:tw-text-action-highlight tw-flex tw-items-center tw-justify-center",
|
|
273
|
-
onClick:
|
|
275
|
+
onClick: n[2] || (n[2] = (...d) => t.closeSideSheet && t.closeSideSheet(...d))
|
|
274
276
|
}, [
|
|
275
277
|
z(l, {
|
|
276
278
|
class: "tw-w-3 tw-h-3",
|
|
@@ -290,10 +292,10 @@ function ue(n, o, i, t, I, M) {
|
|
|
290
292
|
"tw-opacity-full": t.open
|
|
291
293
|
}])
|
|
292
294
|
}, [
|
|
293
|
-
|
|
295
|
+
F(o.$slots, "default")
|
|
294
296
|
], 2)
|
|
295
297
|
], 4),
|
|
296
|
-
|
|
298
|
+
o.$slots.controls ? (p(), k("div", {
|
|
297
299
|
key: 0,
|
|
298
300
|
ref: "controlsRef",
|
|
299
301
|
class: b(["tw-absolute tw-bottom-0 tw-w-full tw-border-t tw-border-tertiary tw-bg-white tw-transition-opacity tw-duration-200", {
|
|
@@ -302,13 +304,13 @@ function ue(n, o, i, t, I, M) {
|
|
|
302
304
|
}]),
|
|
303
305
|
style: { "z-index": "999" }
|
|
304
306
|
}, [
|
|
305
|
-
|
|
307
|
+
F(o.$slots, "controls")
|
|
306
308
|
], 2)) : x("", !0)
|
|
307
309
|
], 4)
|
|
308
310
|
], 6)
|
|
309
311
|
], 2)) : x("", !0);
|
|
310
312
|
}
|
|
311
|
-
const
|
|
313
|
+
const ye = /* @__PURE__ */ ae(de, [["render", we]]);
|
|
312
314
|
export {
|
|
313
|
-
|
|
315
|
+
ye as default
|
|
314
316
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kiva/kv-components",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.57.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"@babel/preset-env": "^7.24.8",
|
|
22
22
|
"@babel/preset-react": "^7.24.7",
|
|
23
23
|
"@babel/preset-typescript": "^7.24.7",
|
|
24
|
-
"@kiva/kv-tokens": "^3.
|
|
24
|
+
"@kiva/kv-tokens": "^3.5.0",
|
|
25
25
|
"@kiva/vite-plugin-vue-lib-css": "^2.0.0",
|
|
26
26
|
"@laynezh/vite-plugin-lib-assets": "^0.6.1",
|
|
27
27
|
"@mdi/js": "^7.4.47",
|
|
@@ -114,5 +114,5 @@
|
|
|
114
114
|
"embla-carousel-fade",
|
|
115
115
|
"popper.js"
|
|
116
116
|
],
|
|
117
|
-
"gitHead": "
|
|
117
|
+
"gitHead": "15bdecc29426c24efdaafb35efc0aa4f19e5a56f"
|
|
118
118
|
}
|