adverich-kun-ui 0.1.347 → 0.1.348
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,17 +1,17 @@
|
|
|
1
|
-
import { useSlots as C, useAttrs as j, computed as r, createBlock as l, openBlock as a, resolveDynamicComponent as o, mergeProps as
|
|
2
|
-
import { RouterLink as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
const
|
|
1
|
+
import { useSlots as C, useAttrs as j, computed as r, ref as I, createBlock as l, openBlock as a, resolveDynamicComponent as o, mergeProps as A, unref as O, withCtx as N, createElementVNode as f, renderSlot as i, createCommentVNode as c, createVNode as V, normalizeClass as W, createElementBlock as p, createTextVNode as E, toDisplayString as F, h as T } from "vue";
|
|
2
|
+
import { RouterLink as D } from "vue-router";
|
|
3
|
+
import L from "../../../KunLoaderCircular/src/components/KunLoaderCircular.vue.js";
|
|
4
|
+
import q from "../../../KunIcon/src/components/KunIcon.vue.js";
|
|
5
|
+
const K = { class: "relative flex items-center justify-center w-full h-full" }, P = { class: "absolute inset-0 flex items-center justify-center z-10" }, R = {
|
|
6
6
|
key: 0,
|
|
7
7
|
class: "mr-2 flex items-center"
|
|
8
|
-
},
|
|
8
|
+
}, G = {
|
|
9
9
|
key: 1,
|
|
10
10
|
class: "truncate flex items-center justify-center"
|
|
11
|
-
},
|
|
11
|
+
}, H = {
|
|
12
12
|
key: 2,
|
|
13
13
|
class: "ml-2 flex items-center"
|
|
14
|
-
},
|
|
14
|
+
}, X = {
|
|
15
15
|
__name: "KunBtn",
|
|
16
16
|
props: {
|
|
17
17
|
text: String,
|
|
@@ -50,7 +50,7 @@ const q = { class: "relative flex items-center justify-center w-full h-full" },
|
|
|
50
50
|
iconSize: { type: String, default: null }
|
|
51
51
|
},
|
|
52
52
|
setup(n, { expose: g }) {
|
|
53
|
-
const m = C(), t = n, u = j(), h = r(() => !!t.to || !!t.href), b = r(() => !h.value), y = r(() => t.href ? "a" : t.to ?
|
|
53
|
+
const m = C(), t = n, u = j(), h = r(() => !!t.to || !!t.href), b = r(() => !h.value), y = r(() => t.href ? "a" : t.to ? D : "button"), d = (e) => !e || e === !1 || e === !0 && !t.icon ? null : T(q, {
|
|
54
54
|
icon: e,
|
|
55
55
|
size: S.value,
|
|
56
56
|
color: t.textColor ?? "text-font-color",
|
|
@@ -167,40 +167,40 @@ const q = { class: "relative flex items-center justify-center w-full h-full" },
|
|
|
167
167
|
"transition duration-100 ease-in-out",
|
|
168
168
|
"cursor-pointer"
|
|
169
169
|
) : (e.push("pointer-events-none"), t.disabled && e.push("opacity-50 cursor-not-allowed")), w.value && e.push(t.minWidth), e.filter(Boolean);
|
|
170
|
-
}), x = r(() => !!t.icon && !t.text && !m.default), B =
|
|
170
|
+
}), x = r(() => !!t.icon && !t.text && !m.default), B = I(null);
|
|
171
171
|
return g({
|
|
172
172
|
focus: () => {
|
|
173
173
|
var e, s;
|
|
174
174
|
return (s = (e = B.value) == null ? void 0 : e.focus) == null ? void 0 : s.call(e);
|
|
175
175
|
}
|
|
176
|
-
}), (e, s) => (a(), l(o(y.value),
|
|
176
|
+
}), (e, s) => (a(), l(o(y.value), A(v.value, {
|
|
177
177
|
class: z.value,
|
|
178
|
-
style:
|
|
178
|
+
style: O(u).style,
|
|
179
179
|
disabled: b.value && (n.loading || n.disabled)
|
|
180
180
|
}), {
|
|
181
|
-
default:
|
|
182
|
-
f("div",
|
|
181
|
+
default: N(() => [
|
|
182
|
+
f("div", K, [
|
|
183
183
|
n.loading ? i(e.$slots, "loader", { key: 0 }, () => [
|
|
184
|
-
f("div",
|
|
185
|
-
|
|
184
|
+
f("div", P, [
|
|
185
|
+
V(L, {
|
|
186
186
|
size: "20",
|
|
187
187
|
width: "5"
|
|
188
188
|
})
|
|
189
189
|
])
|
|
190
190
|
]) : c("", !0),
|
|
191
191
|
f("div", {
|
|
192
|
-
class:
|
|
192
|
+
class: W([{ "opacity-50": n.loading }, "flex items-center justify-center w-full h-full"])
|
|
193
193
|
}, [
|
|
194
|
-
e.$slots.prepend || n.prependIcon ? (a(), p("span",
|
|
194
|
+
e.$slots.prepend || n.prependIcon ? (a(), p("span", R, [
|
|
195
195
|
i(e.$slots, "prepend"),
|
|
196
196
|
(a(), l(o(d(n.prependIcon))))
|
|
197
197
|
])) : c("", !0),
|
|
198
|
-
n.text || e.$slots.default || n.icon ? (a(), p("span",
|
|
198
|
+
n.text || e.$slots.default || n.icon ? (a(), p("span", G, [
|
|
199
199
|
n.icon && !n.text && !e.$slots.default ? (a(), l(o(d(n.icon)), { key: 0 })) : i(e.$slots, "default", { key: 1 }, () => [
|
|
200
|
-
|
|
200
|
+
E(F(n.text), 1)
|
|
201
201
|
])
|
|
202
202
|
])) : c("", !0),
|
|
203
|
-
e.$slots.append || n.appendIcon ? (a(), p("span",
|
|
203
|
+
e.$slots.append || n.appendIcon ? (a(), p("span", H, [
|
|
204
204
|
i(e.$slots, "append"),
|
|
205
205
|
(a(), l(o(d(n.appendIcon))))
|
|
206
206
|
])) : c("", !0)
|
|
@@ -212,5 +212,5 @@ const q = { class: "relative flex items-center justify-center w-full h-full" },
|
|
|
212
212
|
}
|
|
213
213
|
};
|
|
214
214
|
export {
|
|
215
|
-
|
|
215
|
+
X as default
|
|
216
216
|
};
|