@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.
@@ -1,11 +1,11 @@
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
- import le from "./KvMaterialIcon.js";
4
- import se from "../_virtual/_plugin-vue_export-helper.js";
5
- const ae = {
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: le
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: (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
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(n, { emit: o, slots: i }) {
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(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({
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, L) => e[L] - e[u]).find((u) => s >= e[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
- te(() => {
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
- c.value ? document.body.classList.add(e) : document.body.classList.remove(e);
126
+ r.value ? document.body.classList.add(e) : document.body.classList.remove(e);
127
127
  }, K = () => {
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);
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
- o("go-to-link");
133
- }, R = (e) => {
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", R), a.value = {}, setTimeout(() => {
157
- c.value = !0, T(), C();
158
- }, 10)) : (c.value = !1, T(), document.removeEventListener("keyup", R), a.value = {}));
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
- c.value && t.value && a.value && Object.keys(a.value).length > 0 && (a.value = {
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 D = () => {
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
- }, L = Object.keys(l.value).filter((h) => h !== "default").sort((h, J) => {
184
- const F = ["sm", "md", "lg", "xl", "2xl"];
185
- return F.indexOf(h) - F.indexOf(J);
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-${n.trackEventCategory || "default"} {
190
+ #side-sheet-${o.trackEventCategory || "default"} {
189
191
  width: ${l.value[h]} !important;
190
192
  }
191
193
  }
192
194
  `).join("");
193
- s.textContent = L, O.value.id = `side-sheet-${n.trackEventCategory || "default"}`;
195
+ s.textContent = R, O.value.id = `side-sheet-${o.trackEventCategory || "default"}`;
194
196
  }
195
197
  };
196
198
  return g(l, () => {
197
- c.value && D();
198
- }, { immediate: !0 }), g(c, (e) => {
199
- e && D();
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: oe,
210
- mdiOpenInNew: ie,
211
+ mdiClose: ie,
212
+ mdiOpenInNew: le,
211
213
  modalStyles: a,
212
- open: c
214
+ open: r
213
215
  };
214
216
  }
215
- }, de = { class: "tw-flex tw-gap-1.5" }, re = { key: 1 }, ce = { class: "tw-flex tw-gap-1.5" };
216
- function ue(n, o, i, t, I, M) {
217
- const l = Z("kv-material-icon");
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: o[3] || (o[3] = $((...d) => t.closeSideSheet && t.closeSideSheet(...d), ["self"]))
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": n.$slots.controls
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", de, [
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: o[0] || (o[0] = (...d) => t.closeSideSheet && t.closeSideSheet(...d))
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", re, ee(i.headline), 1)) : x("", !0)
260
+ i.headline ? (p(), k("h3", ce, te(i.headline), 1)) : x("", !0)
259
261
  ]),
260
- w("div", ce, [
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: o[1] || (o[1] = (...d) => t.goToLink && t.goToLink(...d))
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: o[2] || (o[2] = (...d) => t.closeSideSheet && t.closeSideSheet(...d))
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
- U(n.$slots, "default")
295
+ F(o.$slots, "default")
294
296
  ], 2)
295
297
  ], 4),
296
- n.$slots.controls ? (p(), k("div", {
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
- U(n.$slots, "controls")
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 me = /* @__PURE__ */ se(ae, [["render", ue]]);
313
+ const ye = /* @__PURE__ */ ae(de, [["render", we]]);
312
314
  export {
313
- me as default
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.56.2",
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.4.1",
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": "580254ec8b85927b0f438c36ab69df3603c206e4"
117
+ "gitHead": "15bdecc29426c24efdaafb35efc0aa4f19e5a56f"
118
118
  }