adverich-kun-ui 0.1.176 → 0.1.178
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 { useAttrs as B, computed as r, createBlock as l, openBlock as a, resolveDynamicComponent as o, mergeProps as C, unref as j, withCtx as
|
|
2
|
-
import { RouterLink as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
const
|
|
1
|
+
import { useSlots as z, useAttrs as B, computed as r, createBlock as l, openBlock as a, resolveDynamicComponent as o, mergeProps as C, unref as j, withCtx as I, createElementVNode as p, renderSlot as i, createCommentVNode as c, createVNode as A, normalizeClass as O, createElementBlock as f, createTextVNode as N, toDisplayString as V, h as W } from "vue";
|
|
2
|
+
import { RouterLink as F } from "vue-router";
|
|
3
|
+
import T from "../../../KunLoaderCircular/src/components/KunLoaderCircular.vue.js";
|
|
4
|
+
import D from "../../../KunIcon/src/components/KunIcon.vue.js";
|
|
5
|
+
const E = { class: "relative flex items-center justify-center w-full h-full" }, L = { class: "absolute inset-0 flex items-center justify-center z-10" }, q = {
|
|
6
6
|
key: 0,
|
|
7
7
|
class: "mr-2 flex items-center"
|
|
8
|
-
},
|
|
8
|
+
}, K = {
|
|
9
9
|
key: 1,
|
|
10
10
|
class: "truncate flex items-center justify-center"
|
|
11
|
-
},
|
|
11
|
+
}, P = {
|
|
12
12
|
key: 2,
|
|
13
13
|
class: "ml-2 flex items-center"
|
|
14
|
-
},
|
|
14
|
+
}, M = {
|
|
15
15
|
__name: "KunBtn",
|
|
16
16
|
props: {
|
|
17
17
|
text: String,
|
|
@@ -46,10 +46,11 @@ const T = { class: "relative flex items-center justify-center w-full h-full" },
|
|
|
46
46
|
ring: Boolean,
|
|
47
47
|
icon: [Boolean, String, Function, Object, Array],
|
|
48
48
|
prependIcon: [String, Function, Object, Array],
|
|
49
|
-
appendIcon: [String, Function, Object, Array]
|
|
49
|
+
appendIcon: [String, Function, Object, Array],
|
|
50
|
+
iconSize: { type: String, default: null }
|
|
50
51
|
},
|
|
51
52
|
setup(n) {
|
|
52
|
-
const t = n, u = B(),
|
|
53
|
+
const x = z(), t = n, u = B(), g = r(() => !!t.to || !!t.href), m = r(() => !g.value), h = r(() => t.href ? "a" : t.to ? F : "button"), d = (e) => !e || e === !1 || e === !0 && !t.icon ? null : W(D, {
|
|
53
54
|
icon: e,
|
|
54
55
|
size: v.value,
|
|
55
56
|
color: t.textColor ?? "text-font-color",
|
|
@@ -84,6 +85,7 @@ const T = { class: "relative flex items-center justify-center w-full h-full" },
|
|
|
84
85
|
return "px-3 py-2 text-sm";
|
|
85
86
|
}
|
|
86
87
|
}, v = r(() => {
|
|
88
|
+
if (t.iconSize) return t.iconSize;
|
|
87
89
|
switch (t.size) {
|
|
88
90
|
case "xxs":
|
|
89
91
|
return "text-xs";
|
|
@@ -120,7 +122,7 @@ const T = { class: "relative flex items-center justify-center w-full h-full" },
|
|
|
120
122
|
default:
|
|
121
123
|
return `${e} ${s}`;
|
|
122
124
|
}
|
|
123
|
-
}),
|
|
125
|
+
}), S = r(() => !!t.text), $ = r(() => {
|
|
124
126
|
const e = [
|
|
125
127
|
"inline-flex items-center justify-center break-keep transition-all whitespace-nowrap",
|
|
126
128
|
y(t.size),
|
|
@@ -164,36 +166,36 @@ const T = { class: "relative flex items-center justify-center w-full h-full" },
|
|
|
164
166
|
"active:scale-[.98]",
|
|
165
167
|
"transition duration-100 ease-in-out",
|
|
166
168
|
"cursor-pointer"
|
|
167
|
-
) : (e.push("pointer-events-none"), t.disabled && e.push("opacity-50 cursor-not-allowed")),
|
|
168
|
-
}), w = r(() => !!t.icon && !t.text &&
|
|
169
|
-
return (e, s) => (a(), l(o(
|
|
170
|
-
class:
|
|
169
|
+
) : (e.push("pointer-events-none"), t.disabled && e.push("opacity-50 cursor-not-allowed")), S.value && e.push(t.minWidth), u.class && e.push(u.class), e.filter(Boolean);
|
|
170
|
+
}), w = r(() => !!t.icon && !t.text && !x.default);
|
|
171
|
+
return (e, s) => (a(), l(o(h.value), C(b.value, {
|
|
172
|
+
class: $.value,
|
|
171
173
|
style: j(u).style,
|
|
172
|
-
disabled:
|
|
174
|
+
disabled: m.value && (n.loading || n.disabled)
|
|
173
175
|
}), {
|
|
174
|
-
default:
|
|
175
|
-
p("div",
|
|
176
|
+
default: I(() => [
|
|
177
|
+
p("div", E, [
|
|
176
178
|
n.loading ? i(e.$slots, "loader", { key: 0 }, () => [
|
|
177
|
-
p("div",
|
|
178
|
-
|
|
179
|
+
p("div", L, [
|
|
180
|
+
A(T, {
|
|
179
181
|
size: "20",
|
|
180
182
|
width: "5"
|
|
181
183
|
})
|
|
182
184
|
])
|
|
183
185
|
]) : c("", !0),
|
|
184
186
|
p("div", {
|
|
185
|
-
class:
|
|
187
|
+
class: O([{ "opacity-50": n.loading }, "flex items-center justify-center w-full h-full"])
|
|
186
188
|
}, [
|
|
187
|
-
e.$slots.prepend || n.prependIcon ? (a(), f("span",
|
|
189
|
+
e.$slots.prepend || n.prependIcon ? (a(), f("span", q, [
|
|
188
190
|
i(e.$slots, "prepend"),
|
|
189
191
|
(a(), l(o(d(n.prependIcon))))
|
|
190
192
|
])) : c("", !0),
|
|
191
|
-
n.text || e.$slots.default || n.icon ? (a(), f("span",
|
|
193
|
+
n.text || e.$slots.default || n.icon ? (a(), f("span", K, [
|
|
192
194
|
n.icon && !n.text && !e.$slots.default ? (a(), l(o(d(n.icon)), { key: 0 })) : i(e.$slots, "default", { key: 1 }, () => [
|
|
193
|
-
|
|
195
|
+
N(V(n.text), 1)
|
|
194
196
|
])
|
|
195
197
|
])) : c("", !0),
|
|
196
|
-
e.$slots.append || n.appendIcon ? (a(), f("span",
|
|
198
|
+
e.$slots.append || n.appendIcon ? (a(), f("span", P, [
|
|
197
199
|
i(e.$slots, "append"),
|
|
198
200
|
(a(), l(o(d(n.appendIcon))))
|
|
199
201
|
])) : c("", !0)
|
|
@@ -205,5 +207,5 @@ const T = { class: "relative flex items-center justify-center w-full h-full" },
|
|
|
205
207
|
}
|
|
206
208
|
};
|
|
207
209
|
export {
|
|
208
|
-
|
|
210
|
+
M as default
|
|
209
211
|
};
|