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