@kiva/kv-components 6.36.0 → 6.37.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 +47 -47
- package/package.json +2 -2
package/dist/vue/KvSideSheet.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { toRefs as P, ref as r, reactive as Q, computed as j, onMounted as X, onUnmounted as Y, watch as g, resolveComponent as Z, openBlock as p, createElementBlock as k, normalizeClass as b, withModifiers as $, createElementVNode as w, normalizeStyle as H, createVNode as z, createCommentVNode as x, toDisplayString as ee, renderSlot as
|
|
2
|
-
import { mdiArrowLeft as
|
|
1
|
+
import { toRefs as P, ref as r, reactive as Q, computed as j, onMounted as X, onUnmounted as Y, watch as g, resolveComponent as Z, openBlock as p, createElementBlock as k, normalizeClass as b, withModifiers as $, createElementVNode as w, normalizeStyle as H, createVNode as z, createCommentVNode as x, toDisplayString as ee, renderSlot as U, nextTick as te } from "vue";
|
|
2
|
+
import { mdiArrowLeft as ne, mdiClose as oe, mdiOpenInNew as ie } from "@mdi/js";
|
|
3
3
|
import le from "./KvMaterialIcon.js";
|
|
4
4
|
import se from "../_virtual/_plugin-vue_export-helper.js";
|
|
5
5
|
const ae = {
|
|
@@ -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: (n) => typeof n == "string" ? /^(\d+px|[\d.]+%|auto|inherit|initial)$/.test(n) : typeof n == "object" ? Object.keys(n).every((o) => ["default", "sm", "md", "lg", "xl", "2xl"].includes(o) && /^(\d+px|[\d.]+%|auto|inherit|initial)$/.test(n[o])) : !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,20 +76,20 @@ const ae = {
|
|
|
76
76
|
}
|
|
77
77
|
},
|
|
78
78
|
emits: ["side-sheet-closed", "go-to-link"],
|
|
79
|
-
setup(
|
|
79
|
+
setup(n, { emit: o, slots: i }) {
|
|
80
80
|
const {
|
|
81
81
|
visible: t,
|
|
82
|
-
kvTrackFunction:
|
|
83
|
-
trackEventCategory:
|
|
82
|
+
kvTrackFunction: I,
|
|
83
|
+
trackEventCategory: M,
|
|
84
84
|
widthDimensions: l,
|
|
85
85
|
hideHeadlineBgOnMobile: d
|
|
86
|
-
} = P(
|
|
86
|
+
} = P(n), c = r(!1), a = r({}), O = r(null), m = r(null), y = r(null), _ = r(null), N = r(null), S = r(null), B = r(null), v = Q({
|
|
87
87
|
headline: 0,
|
|
88
88
|
controls: 0
|
|
89
|
-
}),
|
|
90
|
-
const e =
|
|
89
|
+
}), V = j(() => {
|
|
90
|
+
const e = _.value - (d.value ? 0 : v.headline) - v.controls;
|
|
91
91
|
return Math.max(e, 0);
|
|
92
|
-
}),
|
|
92
|
+
}), W = j(() => {
|
|
93
93
|
if (typeof l.value == "string")
|
|
94
94
|
return l.value;
|
|
95
95
|
const e = {
|
|
@@ -98,15 +98,15 @@ const ae = {
|
|
|
98
98
|
lg: 1024,
|
|
99
99
|
xl: 1280,
|
|
100
100
|
"2xl": 1536
|
|
101
|
-
}, s =
|
|
101
|
+
}, s = N.value || window.innerWidth, f = Object.keys(l.value).filter((u) => u !== "default").sort((u, L) => e[L] - 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;
|
|
105
105
|
return (...u) => {
|
|
106
106
|
clearTimeout(f), f = setTimeout(() => e(...u), s);
|
|
107
107
|
};
|
|
108
|
-
},
|
|
109
|
-
|
|
108
|
+
}, C = () => {
|
|
109
|
+
_.value = window.innerHeight, N.value = window.innerWidth, setTimeout(() => {
|
|
110
110
|
te(() => {
|
|
111
111
|
var e;
|
|
112
112
|
if (y.value) {
|
|
@@ -121,24 +121,24 @@ const ae = {
|
|
|
121
121
|
v.controls = 0;
|
|
122
122
|
});
|
|
123
123
|
}, 300);
|
|
124
|
-
},
|
|
124
|
+
}, E = A(C, 100), T = () => {
|
|
125
125
|
const e = "tw-overflow-hidden";
|
|
126
126
|
c.value ? document.body.classList.add(e) : document.body.classList.remove(e);
|
|
127
127
|
}, K = () => {
|
|
128
|
-
c.value = !1,
|
|
129
|
-
|
|
130
|
-
}, 300), document.removeEventListener("keyup",
|
|
128
|
+
c.value = !1, T(), I.value(M.value, "click", "side-sheet-closed"), setTimeout(() => {
|
|
129
|
+
o("side-sheet-closed");
|
|
130
|
+
}, 300), document.removeEventListener("keyup", R);
|
|
131
131
|
}, G = () => {
|
|
132
|
-
|
|
133
|
-
},
|
|
132
|
+
o("go-to-link");
|
|
133
|
+
}, R = (e) => {
|
|
134
134
|
(e == null ? void 0 : e.key) === "Escape" && K();
|
|
135
135
|
};
|
|
136
136
|
X(() => {
|
|
137
137
|
setTimeout(() => {
|
|
138
|
-
|
|
139
|
-
}, 100), m.value && (S.value = new ResizeObserver(
|
|
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
140
|
}), Y(() => {
|
|
141
|
-
S.value && S.value.disconnect(), B.value && B.value.disconnect(), window.removeEventListener("resize",
|
|
141
|
+
S.value && S.value.disconnect(), B.value && B.value.disconnect(), window.removeEventListener("resize", E);
|
|
142
142
|
const e = document.getElementById("side-sheet-styles");
|
|
143
143
|
e && e.remove();
|
|
144
144
|
}), g(() => {
|
|
@@ -146,17 +146,17 @@ const ae = {
|
|
|
146
146
|
return (e = i.controls) == null ? void 0 : e.call(i);
|
|
147
147
|
}, () => {
|
|
148
148
|
setTimeout(() => {
|
|
149
|
-
|
|
149
|
+
C();
|
|
150
150
|
}, 100);
|
|
151
151
|
}, { deep: !0 });
|
|
152
152
|
const q = j(() => ({
|
|
153
|
-
width:
|
|
153
|
+
width: W.value
|
|
154
154
|
}));
|
|
155
155
|
g(t, (e) => {
|
|
156
|
-
typeof window < "u" && (e ? (document.addEventListener("keyup",
|
|
157
|
-
c.value = !0,
|
|
158
|
-
}, 10)) : (c.value = !1,
|
|
159
|
-
}, { immediate: !0 }), g(
|
|
156
|
+
typeof window < "u" && (e ? (document.addEventListener("keyup", R), a.value = {}, setTimeout(() => {
|
|
157
|
+
c.value = !0, T(), C();
|
|
158
|
+
}, 10)) : (c.value = !1, T(), document.removeEventListener("keyup", R), a.value = {}));
|
|
159
|
+
}, { immediate: !0 }), g(W, (e) => {
|
|
160
160
|
c.value && t.value && a.value && Object.keys(a.value).length > 0 && (a.value = {
|
|
161
161
|
...a.value,
|
|
162
162
|
width: e,
|
|
@@ -170,7 +170,7 @@ const ae = {
|
|
|
170
170
|
}, 50));
|
|
171
171
|
});
|
|
172
172
|
const D = () => {
|
|
173
|
-
if (typeof l.value == "object" &&
|
|
173
|
+
if (typeof l.value == "object" && O.value) {
|
|
174
174
|
const e = "side-sheet-styles";
|
|
175
175
|
let s = document.getElementById(e);
|
|
176
176
|
s || (s = document.createElement("style"), s.id = e, document.head.appendChild(s));
|
|
@@ -180,17 +180,17 @@ const ae = {
|
|
|
180
180
|
lg: "1024px",
|
|
181
181
|
xl: "1280px",
|
|
182
182
|
"2xl": "1536px"
|
|
183
|
-
},
|
|
183
|
+
}, L = Object.keys(l.value).filter((h) => h !== "default").sort((h, J) => {
|
|
184
184
|
const F = ["sm", "md", "lg", "xl", "2xl"];
|
|
185
185
|
return F.indexOf(h) - F.indexOf(J);
|
|
186
186
|
}).map((h) => `
|
|
187
187
|
@media (min-width: ${f[h]}) {
|
|
188
|
-
#side-sheet-${
|
|
188
|
+
#side-sheet-${n.trackEventCategory || "default"} {
|
|
189
189
|
width: ${l.value[h]} !important;
|
|
190
190
|
}
|
|
191
191
|
}
|
|
192
192
|
`).join("");
|
|
193
|
-
s.textContent =
|
|
193
|
+
s.textContent = L, O.value.id = `side-sheet-${n.trackEventCategory || "default"}`;
|
|
194
194
|
}
|
|
195
195
|
};
|
|
196
196
|
return g(l, () => {
|
|
@@ -199,21 +199,21 @@ const ae = {
|
|
|
199
199
|
e && D();
|
|
200
200
|
}), {
|
|
201
201
|
closeSideSheet: K,
|
|
202
|
-
contentHeight:
|
|
202
|
+
contentHeight: V,
|
|
203
203
|
controlsRef: m,
|
|
204
204
|
headlineRef: y,
|
|
205
|
-
sideSheetRef:
|
|
205
|
+
sideSheetRef: O,
|
|
206
206
|
sideSheetStyles: q,
|
|
207
207
|
goToLink: G,
|
|
208
|
-
mdiArrowLeft:
|
|
209
|
-
mdiClose:
|
|
210
|
-
|
|
208
|
+
mdiArrowLeft: ne,
|
|
209
|
+
mdiClose: oe,
|
|
210
|
+
mdiOpenInNew: ie,
|
|
211
211
|
modalStyles: a,
|
|
212
212
|
open: c
|
|
213
213
|
};
|
|
214
214
|
}
|
|
215
215
|
}, de = { class: "tw-flex tw-gap-1.5" }, re = { key: 1 }, ce = { class: "tw-flex tw-gap-1.5" };
|
|
216
|
-
function ue(
|
|
216
|
+
function ue(n, o, i, t, I, M) {
|
|
217
217
|
const l = Z("kv-material-icon");
|
|
218
218
|
return i.visible ? (p(), k("div", {
|
|
219
219
|
key: 0,
|
|
@@ -221,14 +221,14 @@ function ue(o, n, i, t, M, _) {
|
|
|
221
221
|
"tw-bg-opacity-0 tw-delay-300": !t.open,
|
|
222
222
|
"tw-bg-opacity-low": t.open
|
|
223
223
|
}]),
|
|
224
|
-
onClick:
|
|
224
|
+
onClick: o[3] || (o[3] = $((...d) => t.closeSideSheet && t.closeSideSheet(...d), ["self"]))
|
|
225
225
|
}, [
|
|
226
226
|
w("div", {
|
|
227
227
|
ref: "sideSheetRef",
|
|
228
228
|
class: b(["tw-fixed tw-right-0 tw-transition-all tw-duration-300 tw-bg-white", {
|
|
229
229
|
"tw-translate-x-full": !t.open,
|
|
230
230
|
"tw-translate-x-0": t.open,
|
|
231
|
-
"tw-h-full":
|
|
231
|
+
"tw-h-full": n.$slots.controls
|
|
232
232
|
}]),
|
|
233
233
|
style: H(t.sideSheetStyles)
|
|
234
234
|
}, [
|
|
@@ -248,7 +248,7 @@ function ue(o, n, i, t, M, _) {
|
|
|
248
248
|
i.showBackButton ? (p(), k("button", {
|
|
249
249
|
key: 0,
|
|
250
250
|
class: "hover:tw-text-action-highlight tw-flex tw-items-center tw-justify-center",
|
|
251
|
-
onClick:
|
|
251
|
+
onClick: o[0] || (o[0] = (...d) => t.closeSideSheet && t.closeSideSheet(...d))
|
|
252
252
|
}, [
|
|
253
253
|
z(l, {
|
|
254
254
|
class: "tw-w-3 tw-h-3",
|
|
@@ -261,16 +261,16 @@ function ue(o, n, i, t, M, _) {
|
|
|
261
261
|
i.showGoToLink ? (p(), k("button", {
|
|
262
262
|
key: 0,
|
|
263
263
|
class: "hover:tw-text-action-highlight tw-flex tw-items-center tw-justify-center",
|
|
264
|
-
onClick:
|
|
264
|
+
onClick: o[1] || (o[1] = (...d) => t.goToLink && t.goToLink(...d))
|
|
265
265
|
}, [
|
|
266
266
|
z(l, {
|
|
267
267
|
class: "tw-w-3 tw-h-3",
|
|
268
|
-
icon: t.
|
|
268
|
+
icon: t.mdiOpenInNew
|
|
269
269
|
}, null, 8, ["icon"])
|
|
270
270
|
])) : x("", !0),
|
|
271
271
|
w("button", {
|
|
272
272
|
class: "hover:tw-text-action-highlight tw-flex tw-items-center tw-justify-center",
|
|
273
|
-
onClick:
|
|
273
|
+
onClick: o[2] || (o[2] = (...d) => t.closeSideSheet && t.closeSideSheet(...d))
|
|
274
274
|
}, [
|
|
275
275
|
z(l, {
|
|
276
276
|
class: "tw-w-3 tw-h-3",
|
|
@@ -290,10 +290,10 @@ function ue(o, n, i, t, M, _) {
|
|
|
290
290
|
"tw-opacity-full": t.open
|
|
291
291
|
}])
|
|
292
292
|
}, [
|
|
293
|
-
|
|
293
|
+
U(n.$slots, "default")
|
|
294
294
|
], 2)
|
|
295
295
|
], 4),
|
|
296
|
-
|
|
296
|
+
n.$slots.controls ? (p(), k("div", {
|
|
297
297
|
key: 0,
|
|
298
298
|
ref: "controlsRef",
|
|
299
299
|
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,7 +302,7 @@ function ue(o, n, i, t, M, _) {
|
|
|
302
302
|
}]),
|
|
303
303
|
style: { "z-index": "999" }
|
|
304
304
|
}, [
|
|
305
|
-
|
|
305
|
+
U(n.$slots, "controls")
|
|
306
306
|
], 2)) : x("", !0)
|
|
307
307
|
], 4)
|
|
308
308
|
], 6)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kiva/kv-components",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.37.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": "8fdfc97f384073089161f4631c5ca0929ac989c4"
|
|
115
115
|
}
|