@kiva/kv-components 5.2.2 → 5.3.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,5 +1,5 @@
1
- import { toRefs as T, ref as u, watch as L, resolveComponent as B, openBlock as p, createElementBlock as g, normalizeClass as c, withModifiers as E, createElementVNode as d, normalizeStyle as _, createVNode as k, createCommentVNode as S, renderSlot as z } from "vue";
2
- import { mdiClose as F, mdiLaunch as N } from "@mdi/js";
1
+ import { toRefs as T, ref as v, watch as E, resolveComponent as B, openBlock as g, createElementBlock as S, normalizeClass as c, withModifiers as _, createElementVNode as d, normalizeStyle as z, createVNode as b, createCommentVNode as C, renderSlot as F } from "vue";
2
+ import { mdiClose as K, mdiLaunch as N } from "@mdi/js";
3
3
  import V from "./KvMaterialIcon.js";
4
4
  import j from "../_virtual/_plugin-vue_export-helper.js";
5
5
  const G = {
@@ -46,75 +46,79 @@ const G = {
46
46
  emits: [
47
47
  "side-sheet-closed"
48
48
  ],
49
- setup(w, { emit: e }) {
49
+ setup(w, { emit: o }) {
50
50
  const {
51
- visible: n,
51
+ visible: a,
52
52
  kvTrackFunction: t,
53
53
  trackEventCategory: f,
54
54
  animationSourceElement: r
55
- } = T(w), l = u(!1), i = u({}), a = u({}), v = () => {
56
- const s = "tw-overflow-hidden";
57
- l.value ? document.body.classList.add(s) : document.body.classList.remove(s);
58
- }, b = () => {
59
- l.value = !1, v(), t.value(f.value, "click", "side-sheet-closed"), r.value && (a.value = {
55
+ } = T(w), n = v(!1), i = v({}), s = v({});
56
+ let u = null;
57
+ const m = () => {
58
+ const l = "tw-overflow-hidden";
59
+ n.value ? document.body.classList.add(l) : document.body.classList.remove(l);
60
+ }, y = () => {
61
+ n.value = !1, m(), t.value(f.value, "click", "side-sheet-closed"), r.value && (s.value = {
60
62
  ...i.value,
61
63
  transition: "all 0.5s ease-in-out"
62
64
  }), setTimeout(() => {
63
- e("side-sheet-closed");
64
- }, "700");
65
- }, C = () => {
66
- e("go-to-link");
65
+ o("side-sheet-closed");
66
+ }, "700"), document.removeEventListener("keyup", u);
67
+ }, x = () => {
68
+ o("go-to-link");
67
69
  };
68
- return L(n, () => {
69
- var s;
70
- if (n.value) {
71
- setTimeout(() => {
72
- l.value = !0, v();
70
+ return u = (l) => {
71
+ l && l.key === "Escape" && y();
72
+ }, E(a, () => {
73
+ var l;
74
+ if (a.value) {
75
+ document.addEventListener("keyup", u), setTimeout(() => {
76
+ n.value = !0, m();
73
77
  }, 100);
74
- const o = (s = r.value) == null ? void 0 : s.getBoundingClientRect(), m = (o == null ? void 0 : o.top) ?? 0, x = (o == null ? void 0 : o.left) ?? 0, y = (o == null ? void 0 : o.width) ?? 0, h = (o == null ? void 0 : o.height) ?? 0;
75
- m || x || y || h ? (i.value = {
78
+ const e = (l = r.value) == null ? void 0 : l.getBoundingClientRect(), h = (e == null ? void 0 : e.top) ?? 0, L = (e == null ? void 0 : e.left) ?? 0, p = (e == null ? void 0 : e.width) ?? 0, k = (e == null ? void 0 : e.height) ?? 0;
79
+ h || L || p || k ? (i.value = {
76
80
  position: "fixed",
77
- top: `${m}px`,
78
- width: `${y}px`,
79
- height: `${h}px`
80
- }, a.value = {
81
+ top: `${h}px`,
82
+ width: `${p}px`,
83
+ height: `${k}px`
84
+ }, s.value = {
81
85
  ...i.value,
82
86
  transition: "none"
83
87
  }, setTimeout(() => {
84
- a.value = {
88
+ s.value = {
85
89
  top: "0",
86
90
  width: "100vw",
87
91
  height: "100%",
88
92
  transition: "all 0.5s ease-in-out"
89
93
  };
90
- }, 10)) : a.value = {};
94
+ }, 10)) : s.value = {};
91
95
  }
92
96
  }), {
93
- mdiClose: F,
97
+ mdiClose: K,
94
98
  mdiLaunch: N,
95
- open: l,
96
- closeSideSheet: b,
97
- goToLink: C,
98
- modalStyles: a
99
+ open: n,
100
+ closeSideSheet: y,
101
+ goToLink: x,
102
+ modalStyles: s
99
103
  };
100
104
  }
101
105
  };
102
- function K(w, e, n, t, f, r) {
103
- const l = B("kv-material-icon");
104
- return n.visible ? (p(), g("div", {
106
+ function M(w, o, a, t, f, r) {
107
+ const n = B("kv-material-icon");
108
+ return a.visible ? (g(), S("div", {
105
109
  key: 0,
106
110
  class: c(["tw-block lg:tw-mt-0 tw-fixed tw-inset-0 tw-bg-black tw-transition-all md:tw-duration-150 tw-z-modal", {
107
111
  "tw-bg-opacity-0 tw-delay-300": !t.open,
108
112
  "tw-bg-opacity-low": t.open
109
113
  }]),
110
- onClick: e[2] || (e[2] = E((...i) => t.closeSideSheet && t.closeSideSheet(...i), ["self"]))
114
+ onClick: o[2] || (o[2] = _((...i) => t.closeSideSheet && t.closeSideSheet(...i), ["self"]))
111
115
  }, [
112
116
  d("div", {
113
117
  class: c(["tw-fixed tw-right-0 tw-transition-all tw-duration-300 tw-bg-white tw-overflow-y-auto tw-p-2", {
114
118
  "tw-w-0 tw-delay-200 tw-opacity-0": !t.open,
115
119
  "lg:tw-w-1/2 tw-w-full tw-opacity-full": t.open
116
120
  }]),
117
- style: _(t.modalStyles)
121
+ style: z(t.modalStyles)
118
122
  }, [
119
123
  d("div", {
120
124
  class: c(["tw-flex tw-justify-between tw-transition-opacity tw-duration-500 tw-delay-200", {
@@ -124,23 +128,23 @@ function K(w, e, n, t, f, r) {
124
128
  }, [
125
129
  d("button", {
126
130
  class: "hover:tw-text-action-highlight",
127
- onClick: e[0] || (e[0] = (...i) => t.closeSideSheet && t.closeSideSheet(...i))
131
+ onClick: o[0] || (o[0] = (...i) => t.closeSideSheet && t.closeSideSheet(...i))
128
132
  }, [
129
- k(l, {
133
+ b(n, {
130
134
  class: "tw-w-3 tw-h-3",
131
135
  icon: t.mdiClose
132
136
  }, null, 8, ["icon"])
133
137
  ]),
134
- n.showGoToLink ? (p(), g("button", {
138
+ a.showGoToLink ? (g(), S("button", {
135
139
  key: 0,
136
140
  class: "hover:tw-text-action-highlight",
137
- onClick: e[1] || (e[1] = (...i) => t.goToLink && t.goToLink(...i))
141
+ onClick: o[1] || (o[1] = (...i) => t.goToLink && t.goToLink(...i))
138
142
  }, [
139
- k(l, {
143
+ b(n, {
140
144
  class: "tw-w-3 tw-h-3",
141
145
  icon: t.mdiLaunch
142
146
  }, null, 8, ["icon"])
143
- ])) : S("", !0)
147
+ ])) : C("", !0)
144
148
  ], 2),
145
149
  d("div", {
146
150
  class: c(["tw-p-4 tw-overflow-y-auto tw-transition-opacity tw-duration-500 tw-delay-200 tw-overscroll-y-contain", {
@@ -148,12 +152,12 @@ function K(w, e, n, t, f, r) {
148
152
  "tw-opacity-full": t.open
149
153
  }])
150
154
  }, [
151
- z(w.$slots, "default")
155
+ F(w.$slots, "default")
152
156
  ], 2)
153
157
  ], 6)
154
- ], 2)) : S("", !0);
158
+ ], 2)) : C("", !0);
155
159
  }
156
- const q = /* @__PURE__ */ j(G, [["render", K]]);
160
+ const q = /* @__PURE__ */ j(G, [["render", M]]);
157
161
  export {
158
162
  q as default
159
163
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kiva/kv-components",
3
- "version": "5.2.2",
3
+ "version": "5.3.0",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -106,5 +106,5 @@
106
106
  "embla-carousel-fade",
107
107
  "popper.js"
108
108
  ],
109
- "gitHead": "3e9d271029c51e2da39556b26570a333930801fe"
109
+ "gitHead": "0ae6ed1e95e7c01158eb795403c22fa2dba68c51"
110
110
  }