adverich-kun-ui 0.1.346 → 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
|
|
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,
|
|
@@ -49,13 +49,13 @@ const E = { class: "relative flex items-center justify-center w-full h-full" },
|
|
|
49
49
|
appendIcon: [String, Function, Object, Array],
|
|
50
50
|
iconSize: { type: String, default: null }
|
|
51
51
|
},
|
|
52
|
-
setup(n) {
|
|
53
|
-
const
|
|
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 ? D : "button"), d = (e) => !e || e === !1 || e === !0 && !t.icon ? null : T(q, {
|
|
54
54
|
icon: e,
|
|
55
|
-
size:
|
|
55
|
+
size: S.value,
|
|
56
56
|
color: t.textColor ?? "text-font-color",
|
|
57
57
|
disabled: t.disabled
|
|
58
|
-
}),
|
|
58
|
+
}), v = r(() => t.href ? {
|
|
59
59
|
href: t.href,
|
|
60
60
|
target: t.target ?? "_self",
|
|
61
61
|
rel: t.target === "_blank" ? "noopener noreferrer" : null
|
|
@@ -65,7 +65,7 @@ const E = { class: "relative flex items-center justify-center w-full h-full" },
|
|
|
65
65
|
} : {
|
|
66
66
|
type: "button",
|
|
67
67
|
disabled: t.loading || t.disabled
|
|
68
|
-
}),
|
|
68
|
+
}), k = (e) => {
|
|
69
69
|
switch (e) {
|
|
70
70
|
case "xxs":
|
|
71
71
|
return "px-1 py-1 text-xs";
|
|
@@ -84,7 +84,7 @@ const E = { class: "relative flex items-center justify-center w-full h-full" },
|
|
|
84
84
|
default:
|
|
85
85
|
return "px-3 py-2 text-sm";
|
|
86
86
|
}
|
|
87
|
-
},
|
|
87
|
+
}, S = r(() => {
|
|
88
88
|
if (t.iconSize) return t.iconSize;
|
|
89
89
|
switch (t.size) {
|
|
90
90
|
case "xxs":
|
|
@@ -104,7 +104,7 @@ const E = { class: "relative flex items-center justify-center w-full h-full" },
|
|
|
104
104
|
default:
|
|
105
105
|
return "text-base";
|
|
106
106
|
}
|
|
107
|
-
}),
|
|
107
|
+
}), $ = r(() => {
|
|
108
108
|
const e = t.bgColor, s = t.textColor;
|
|
109
109
|
switch (t.variant) {
|
|
110
110
|
case "default":
|
|
@@ -122,14 +122,14 @@ const E = { class: "relative flex items-center justify-center w-full h-full" },
|
|
|
122
122
|
default:
|
|
123
123
|
return `${e} ${s}`;
|
|
124
124
|
}
|
|
125
|
-
}),
|
|
125
|
+
}), w = r(() => !!t.text), z = r(() => {
|
|
126
126
|
const e = [
|
|
127
127
|
"inline-flex items-center justify-center break-keep transition-all whitespace-nowrap",
|
|
128
|
-
x.value ? "" :
|
|
128
|
+
x.value ? "" : k(t.size),
|
|
129
129
|
t.fontWeight,
|
|
130
130
|
t.rounded,
|
|
131
131
|
t.textAlign,
|
|
132
|
-
|
|
132
|
+
$.value,
|
|
133
133
|
"relative"
|
|
134
134
|
// 🔹 Hace que los hijos `absolute` se posicionen correctamente
|
|
135
135
|
];
|
|
@@ -166,36 +166,41 @@ const E = { class: "relative flex items-center justify-center w-full h-full" },
|
|
|
166
166
|
"active:scale-[.98]",
|
|
167
167
|
"transition duration-100 ease-in-out",
|
|
168
168
|
"cursor-pointer"
|
|
169
|
-
) : (e.push("pointer-events-none"), t.disabled && e.push("opacity-50 cursor-not-allowed")),
|
|
170
|
-
}), x = r(() => !!t.icon && !t.text && !
|
|
171
|
-
return (
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
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 = I(null);
|
|
171
|
+
return g({
|
|
172
|
+
focus: () => {
|
|
173
|
+
var e, s;
|
|
174
|
+
return (s = (e = B.value) == null ? void 0 : e.focus) == null ? void 0 : s.call(e);
|
|
175
|
+
}
|
|
176
|
+
}), (e, s) => (a(), l(o(y.value), A(v.value, {
|
|
177
|
+
class: z.value,
|
|
178
|
+
style: O(u).style,
|
|
179
|
+
disabled: b.value && (n.loading || n.disabled)
|
|
175
180
|
}), {
|
|
176
|
-
default:
|
|
177
|
-
|
|
181
|
+
default: N(() => [
|
|
182
|
+
f("div", K, [
|
|
178
183
|
n.loading ? i(e.$slots, "loader", { key: 0 }, () => [
|
|
179
|
-
|
|
180
|
-
|
|
184
|
+
f("div", P, [
|
|
185
|
+
V(L, {
|
|
181
186
|
size: "20",
|
|
182
187
|
width: "5"
|
|
183
188
|
})
|
|
184
189
|
])
|
|
185
190
|
]) : c("", !0),
|
|
186
|
-
|
|
187
|
-
class:
|
|
191
|
+
f("div", {
|
|
192
|
+
class: W([{ "opacity-50": n.loading }, "flex items-center justify-center w-full h-full"])
|
|
188
193
|
}, [
|
|
189
|
-
e.$slots.prepend || n.prependIcon ? (a(),
|
|
194
|
+
e.$slots.prepend || n.prependIcon ? (a(), p("span", R, [
|
|
190
195
|
i(e.$slots, "prepend"),
|
|
191
196
|
(a(), l(o(d(n.prependIcon))))
|
|
192
197
|
])) : c("", !0),
|
|
193
|
-
n.text || e.$slots.default || n.icon ? (a(),
|
|
198
|
+
n.text || e.$slots.default || n.icon ? (a(), p("span", G, [
|
|
194
199
|
n.icon && !n.text && !e.$slots.default ? (a(), l(o(d(n.icon)), { key: 0 })) : i(e.$slots, "default", { key: 1 }, () => [
|
|
195
|
-
|
|
200
|
+
E(F(n.text), 1)
|
|
196
201
|
])
|
|
197
202
|
])) : c("", !0),
|
|
198
|
-
e.$slots.append || n.appendIcon ? (a(),
|
|
203
|
+
e.$slots.append || n.appendIcon ? (a(), p("span", H, [
|
|
199
204
|
i(e.$slots, "append"),
|
|
200
205
|
(a(), l(o(d(n.appendIcon))))
|
|
201
206
|
])) : c("", !0)
|
|
@@ -207,5 +212,5 @@ const E = { class: "relative flex items-center justify-center w-full h-full" },
|
|
|
207
212
|
}
|
|
208
213
|
};
|
|
209
214
|
export {
|
|
210
|
-
|
|
215
|
+
X as default
|
|
211
216
|
};
|