@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.
- package/dist/vue/KvSideSheet.js +49 -45
- package/package.json +2 -2
package/dist/vue/KvSideSheet.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { toRefs as T, ref as
|
|
2
|
-
import { mdiClose as
|
|
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:
|
|
49
|
+
setup(w, { emit: o }) {
|
|
50
50
|
const {
|
|
51
|
-
visible:
|
|
51
|
+
visible: a,
|
|
52
52
|
kvTrackFunction: t,
|
|
53
53
|
trackEventCategory: f,
|
|
54
54
|
animationSourceElement: r
|
|
55
|
-
} = T(w),
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
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
|
-
|
|
64
|
-
}, "700");
|
|
65
|
-
},
|
|
66
|
-
|
|
65
|
+
o("side-sheet-closed");
|
|
66
|
+
}, "700"), document.removeEventListener("keyup", u);
|
|
67
|
+
}, x = () => {
|
|
68
|
+
o("go-to-link");
|
|
67
69
|
};
|
|
68
|
-
return
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
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
|
|
75
|
-
|
|
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: `${
|
|
78
|
-
width: `${
|
|
79
|
-
height: `${
|
|
80
|
-
},
|
|
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
|
-
|
|
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)) :
|
|
94
|
+
}, 10)) : s.value = {};
|
|
91
95
|
}
|
|
92
96
|
}), {
|
|
93
|
-
mdiClose:
|
|
97
|
+
mdiClose: K,
|
|
94
98
|
mdiLaunch: N,
|
|
95
|
-
open:
|
|
96
|
-
closeSideSheet:
|
|
97
|
-
goToLink:
|
|
98
|
-
modalStyles:
|
|
99
|
+
open: n,
|
|
100
|
+
closeSideSheet: y,
|
|
101
|
+
goToLink: x,
|
|
102
|
+
modalStyles: s
|
|
99
103
|
};
|
|
100
104
|
}
|
|
101
105
|
};
|
|
102
|
-
function
|
|
103
|
-
const
|
|
104
|
-
return
|
|
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:
|
|
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:
|
|
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:
|
|
131
|
+
onClick: o[0] || (o[0] = (...i) => t.closeSideSheet && t.closeSideSheet(...i))
|
|
128
132
|
}, [
|
|
129
|
-
|
|
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
|
-
|
|
138
|
+
a.showGoToLink ? (g(), S("button", {
|
|
135
139
|
key: 0,
|
|
136
140
|
class: "hover:tw-text-action-highlight",
|
|
137
|
-
onClick:
|
|
141
|
+
onClick: o[1] || (o[1] = (...i) => t.goToLink && t.goToLink(...i))
|
|
138
142
|
}, [
|
|
139
|
-
|
|
143
|
+
b(n, {
|
|
140
144
|
class: "tw-w-3 tw-h-3",
|
|
141
145
|
icon: t.mdiLaunch
|
|
142
146
|
}, null, 8, ["icon"])
|
|
143
|
-
])) :
|
|
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
|
-
|
|
155
|
+
F(w.$slots, "default")
|
|
152
156
|
], 2)
|
|
153
157
|
], 6)
|
|
154
|
-
], 2)) :
|
|
158
|
+
], 2)) : C("", !0);
|
|
155
159
|
}
|
|
156
|
-
const q = /* @__PURE__ */ j(G, [["render",
|
|
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.
|
|
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": "
|
|
109
|
+
"gitHead": "0ae6ed1e95e7c01158eb795403c22fa2dba68c51"
|
|
110
110
|
}
|