@kiva/kv-components 6.16.0 → 6.16.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.
@@ -1,10 +1,10 @@
1
- import { toRefs as T, ref as f, 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
- import V from "./KvMaterialIcon.js";
4
- import j from "../_virtual/_plugin-vue_export-helper.js";
1
+ import { toRefs as T, ref as h, watch as B, resolveComponent as _, openBlock as d, createElementBlock as f, normalizeClass as r, withModifiers as j, createElementVNode as a, normalizeStyle as V, createVNode as v, toDisplayString as z, createCommentVNode as u, renderSlot as C } from "vue";
2
+ import { mdiClose as F, mdiArrowLeft as K, mdiExportVariant as N } from "@mdi/js";
3
+ import R from "./KvMaterialIcon.js";
4
+ import A from "../_virtual/_plugin-vue_export-helper.js";
5
5
  const G = {
6
6
  components: {
7
- KvMaterialIcon: V
7
+ KvMaterialIcon: R
8
8
  },
9
9
  props: {
10
10
  /**
@@ -41,6 +41,13 @@ const G = {
41
41
  animationSourceElement: {
42
42
  type: Object,
43
43
  default: () => ({})
44
+ },
45
+ /**
46
+ * The headline of the side sheet
47
+ */
48
+ headline: {
49
+ type: String,
50
+ default: ""
44
51
  }
45
52
  },
46
53
  emits: [
@@ -48,116 +55,146 @@ const G = {
48
55
  ],
49
56
  setup(w, { emit: o }) {
50
57
  const {
51
- visible: a,
58
+ visible: s,
52
59
  kvTrackFunction: t,
53
- trackEventCategory: m,
54
- animationSourceElement: r
55
- } = T(w), n = f(!1), i = f({}), s = f({});
56
- let u = null;
57
- const v = () => {
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, v(), t.value(m.value, "click", "side-sheet-closed"), r.value && (s.value = {
60
+ trackEventCategory: p,
61
+ animationSourceElement: y
62
+ } = T(w), l = h(!1), i = h({}), c = h({});
63
+ let m = null;
64
+ const g = () => {
65
+ const n = "tw-overflow-hidden";
66
+ l.value ? document.body.classList.add(n) : document.body.classList.remove(n);
67
+ }, k = () => {
68
+ l.value = !1, g(), t.value(p.value, "click", "side-sheet-closed"), y.value && (c.value = {
62
69
  ...i.value,
63
70
  transition: "all 0.5s ease-in-out"
64
71
  }), setTimeout(() => {
65
72
  o("side-sheet-closed");
66
- }, "700"), document.removeEventListener("keyup", u);
67
- }, x = () => {
73
+ }, "700"), document.removeEventListener("keyup", m);
74
+ }, E = () => {
68
75
  o("go-to-link");
69
76
  };
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, v();
77
+ return m = (n) => {
78
+ n && n.key === "Escape" && k();
79
+ }, B(s, () => {
80
+ var n;
81
+ if (s.value) {
82
+ document.addEventListener("keyup", m), setTimeout(() => {
83
+ l.value = !0, g();
77
84
  }, 100);
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 = {
85
+ const e = (n = y.value) == null ? void 0 : n.getBoundingClientRect(), S = (e == null ? void 0 : e.top) ?? 0, L = (e == null ? void 0 : e.left) ?? 0, b = (e == null ? void 0 : e.width) ?? 0, x = (e == null ? void 0 : e.height) ?? 0;
86
+ S || L || b || x ? (i.value = {
80
87
  position: "fixed",
81
- top: `${h}px`,
82
- width: `${p}px`,
83
- height: `${k}px`
84
- }, s.value = {
88
+ top: `${S}px`,
89
+ width: `${b}px`,
90
+ height: `${x}px`
91
+ }, c.value = {
85
92
  ...i.value,
86
93
  transition: "none"
87
94
  }, setTimeout(() => {
88
- s.value = {
95
+ c.value = {
89
96
  top: "0",
90
97
  width: "100%",
91
98
  height: "100%",
92
99
  transition: "all 0.5s ease-in-out"
93
100
  };
94
- }, 10)) : s.value = {};
101
+ }, 10)) : c.value = {};
95
102
  }
96
103
  }), {
97
- mdiClose: K,
98
- mdiLaunch: N,
99
- open: n,
100
- closeSideSheet: y,
101
- goToLink: x,
102
- modalStyles: s
104
+ mdiClose: F,
105
+ mdiArrowLeft: K,
106
+ mdiExportVariant: N,
107
+ open: l,
108
+ closeSideSheet: k,
109
+ goToLink: E,
110
+ modalStyles: c
103
111
  };
104
112
  }
105
- };
106
- function M(w, o, a, t, m, r) {
107
- const n = B("kv-material-icon");
108
- return a.visible ? (g(), S("div", {
113
+ }, M = { class: "tw-flex tw-items-cente tw-gap-1.5" }, D = { key: 0 }, I = { class: "tw-flex tw-items-cente tw-gap-1.5" };
114
+ function O(w, o, s, t, p, y) {
115
+ const l = _("kv-material-icon");
116
+ return s.visible ? (d(), f("div", {
109
117
  key: 0,
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", {
118
+ class: r(["tw-block lg:tw-mt-0 tw-fixed tw-inset-0 tw-bg-black tw-transition-all md:tw-duration-150 tw-z-modal", {
111
119
  "tw-bg-opacity-0 tw-delay-300": !t.open,
112
120
  "tw-bg-opacity-low": t.open
113
121
  }]),
114
- onClick: o[2] || (o[2] = _((...i) => t.closeSideSheet && t.closeSideSheet(...i), ["self"]))
122
+ onClick: o[3] || (o[3] = j((...i) => t.closeSideSheet && t.closeSideSheet(...i), ["self"]))
115
123
  }, [
116
- d("div", {
117
- class: c(["tw-fixed tw-right-0 tw-transition-all tw-duration-300 tw-bg-white tw-overflow-y-auto tw-p-2", {
124
+ a("div", {
125
+ class: r(["tw-fixed tw-right-0 tw-transition-all tw-duration-300 tw-bg-white tw-overflow-y-auto", {
118
126
  "tw-w-0 tw-delay-200 tw-opacity-0": !t.open,
119
- "lg:tw-w-1/2 tw-w-full tw-opacity-full": t.open
120
- }]),
121
- style: z(t.modalStyles)
127
+ "lg:tw-w-1/2 tw-w-full tw-opacity-full": t.open,
128
+ "tw-h-full": w.$slots.controls
129
+ }])
122
130
  }, [
123
- d("div", {
124
- class: c(["tw-flex tw-justify-between tw-transition-opacity tw-duration-500 tw-delay-200", {
125
- "tw-opacity-0": !t.open,
126
- "tw-opacity-full": t.open
127
- }])
131
+ a("div", {
132
+ class: "tw-relative tw-h-full",
133
+ style: V(t.modalStyles)
128
134
  }, [
129
- d("button", {
130
- class: "hover:tw-text-action-highlight",
131
- onClick: o[0] || (o[0] = (...i) => t.closeSideSheet && t.closeSideSheet(...i))
135
+ a("div", {
136
+ class: r(["tw-flex tw-justify-between tw-transition-opacity tw-duration-500 tw-delay-200 tw-px-3 tw-py-2 tw-border-b tw-border-tertiary", {
137
+ "tw-opacity-0": !t.open,
138
+ "tw-opacity-full": t.open
139
+ }])
132
140
  }, [
133
- b(n, {
134
- class: "tw-w-3 tw-h-3",
135
- icon: t.mdiClose
136
- }, null, 8, ["icon"])
137
- ]),
138
- a.showGoToLink ? (g(), S("button", {
141
+ a("div", M, [
142
+ a("button", {
143
+ class: "hover:tw-text-action-highlight tw-flex tw-items-center tw-justify-center",
144
+ onClick: o[0] || (o[0] = (...i) => t.closeSideSheet && t.closeSideSheet(...i))
145
+ }, [
146
+ v(l, {
147
+ class: "tw-w-3 tw-h-3",
148
+ icon: t.mdiArrowLeft
149
+ }, null, 8, ["icon"])
150
+ ]),
151
+ s.headline ? (d(), f("h2", D, z(s.headline), 1)) : u("", !0)
152
+ ]),
153
+ a("div", I, [
154
+ s.showGoToLink ? (d(), f("button", {
155
+ key: 0,
156
+ class: "hover:tw-text-action-highlight tw-flex tw-items-center tw-justify-center",
157
+ onClick: o[1] || (o[1] = (...i) => t.goToLink && t.goToLink(...i))
158
+ }, [
159
+ v(l, {
160
+ class: "tw-w-3 tw-h-3",
161
+ icon: t.mdiExportVariant
162
+ }, null, 8, ["icon"])
163
+ ])) : u("", !0),
164
+ a("button", {
165
+ class: "hover:tw-text-action-highlight tw-flex tw-items-center tw-justify-center",
166
+ onClick: o[2] || (o[2] = (...i) => t.closeSideSheet && t.closeSideSheet(...i))
167
+ }, [
168
+ v(l, {
169
+ class: "tw-w-3 tw-h-3",
170
+ icon: t.mdiClose
171
+ }, null, 8, ["icon"])
172
+ ])
173
+ ])
174
+ ], 2),
175
+ a("div", {
176
+ class: r(["tw-p-4 tw-overflow-y-auto tw-transition-opacity tw-duration-500 tw-delay-200 tw-overscroll-y-contain", {
177
+ "tw-opacity-0": !t.open,
178
+ "tw-opacity-full": t.open
179
+ }])
180
+ }, [
181
+ C(w.$slots, "default")
182
+ ], 2),
183
+ w.$slots.controls ? (d(), f("div", {
139
184
  key: 0,
140
- class: "hover:tw-text-action-highlight",
141
- onClick: o[1] || (o[1] = (...i) => t.goToLink && t.goToLink(...i))
185
+ ref: "controlsRef",
186
+ class: r(["tw-absolute tw-border-t tw-border-tertiary tw-w-full tw-bottom-0 tw-bg-white", {
187
+ "tw-opacity-0": !t.open,
188
+ "tw-opacity-full": t.open
189
+ }])
142
190
  }, [
143
- b(n, {
144
- class: "tw-w-3 tw-h-3",
145
- icon: t.mdiLaunch
146
- }, null, 8, ["icon"])
147
- ])) : C("", !0)
148
- ], 2),
149
- d("div", {
150
- class: c(["tw-p-4 tw-overflow-y-auto tw-transition-opacity tw-duration-500 tw-delay-200 tw-overscroll-y-contain", {
151
- "tw-opacity-0": !t.open,
152
- "tw-opacity-full": t.open
153
- }])
154
- }, [
155
- F(w.$slots, "default")
156
- ], 2)
157
- ], 6)
158
- ], 2)) : C("", !0);
191
+ C(w.$slots, "controls")
192
+ ], 2)) : u("", !0)
193
+ ], 4)
194
+ ], 2)
195
+ ], 2)) : u("", !0);
159
196
  }
160
- const q = /* @__PURE__ */ j(G, [["render", M]]);
197
+ const P = /* @__PURE__ */ A(G, [["render", O]]);
161
198
  export {
162
- q as default
199
+ P as default
163
200
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kiva/kv-components",
3
- "version": "6.16.0",
3
+ "version": "6.16.1",
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": "6b563c82fd8270b4df50c76da70eed7f2c82b908"
114
+ "gitHead": "32f1282d50bf96e83e8c71163104588a5c1252f3"
115
115
  }