adverich-kun-ui 0.1.499 → 0.1.501
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.
|
@@ -44,10 +44,11 @@ const R = { class: "absolute inset-0 flex items-center justify-center z-10" }, G
|
|
|
44
44
|
icon: [Boolean, String, Function, Object, Array],
|
|
45
45
|
prependIcon: [String, Function, Object, Array],
|
|
46
46
|
appendIcon: [String, Function, Object, Array],
|
|
47
|
-
iconSize: { type: String, default: null }
|
|
47
|
+
iconSize: { type: String, default: null },
|
|
48
|
+
focusColor: { type: String, default: null }
|
|
48
49
|
},
|
|
49
50
|
setup(n, { expose: v }) {
|
|
50
|
-
const
|
|
51
|
+
const g = O(), a = W(), t = n, k = r(() => !!t.to || !!t.href), S = r(() => !k.value), $ = r(() => t.href ? "a" : t.to ? H : "button"), f = (e) => !e || e === !1 || e === !0 && !t.icon ? null : q(P, {
|
|
51
52
|
icon: e,
|
|
52
53
|
size: z.value,
|
|
53
54
|
color: t.textColor ?? "text-font-color",
|
|
@@ -119,7 +120,7 @@ const R = { class: "absolute inset-0 flex items-center justify-center z-10" }, G
|
|
|
119
120
|
default:
|
|
120
121
|
return `${e} ${s}`;
|
|
121
122
|
}
|
|
122
|
-
}), j = r(() => !!t.text),
|
|
123
|
+
}), j = r(() => !!t.text), h = r(() => {
|
|
123
124
|
var e, s, o;
|
|
124
125
|
return ((e = a.class) == null ? void 0 : e.includes("w-")) || ((s = a.class) == null ? void 0 : s.includes("min-w-")) || ((o = a.class) == null ? void 0 : o.includes("max-w-"));
|
|
125
126
|
}), I = r(() => {
|
|
@@ -127,8 +128,8 @@ const R = { class: "absolute inset-0 flex items-center justify-center z-10" }, G
|
|
|
127
128
|
return ((e = a.class) == null ? void 0 : e.includes("h-")) || ((s = a.class) == null ? void 0 : s.includes("min-h-")) || ((o = a.class) == null ? void 0 : o.includes("max-h-"));
|
|
128
129
|
}), p = r(() => {
|
|
129
130
|
var s;
|
|
130
|
-
const e = ((s = t.text) == null ? void 0 : s.length) === 1 && !
|
|
131
|
-
return !!t.icon && !t.text && !
|
|
131
|
+
const e = ((s = t.text) == null ? void 0 : s.length) === 1 && !g.default && !t.icon;
|
|
132
|
+
return !!t.icon && !t.text && !g.default || e;
|
|
132
133
|
}), A = r(() => {
|
|
133
134
|
const e = [
|
|
134
135
|
"inline-flex items-center justify-center break-keep transition-all whitespace-nowrap",
|
|
@@ -171,8 +172,9 @@ const R = { class: "absolute inset-0 flex items-center justify-center z-10" }, G
|
|
|
171
172
|
t.ring ? "focus:ring-2 focus:ring-offset-2" : "",
|
|
172
173
|
"active:scale-[.98]",
|
|
173
174
|
"transition duration-100 ease-in-out",
|
|
174
|
-
"cursor-pointer"
|
|
175
|
-
|
|
175
|
+
"cursor-pointer",
|
|
176
|
+
t.focusColor ? `${t.focusColor}` : ""
|
|
177
|
+
) : (e.push("pointer-events-none"), t.disabled && e.push("opacity-50 cursor-not-allowed")), j.value && !p.value && !h.value && e.push(t.minWidth), e.filter(Boolean);
|
|
176
178
|
}), b = E(null);
|
|
177
179
|
return v({
|
|
178
180
|
focus: () => {
|
|
@@ -189,7 +191,7 @@ const R = { class: "absolute inset-0 flex items-center justify-center z-10" }, G
|
|
|
189
191
|
}), {
|
|
190
192
|
default: V(() => [
|
|
191
193
|
x("div", {
|
|
192
|
-
class: y(["relative flex items-center justify-center",
|
|
194
|
+
class: y(["relative flex items-center justify-center", h.value ? "" : "w-full", I.value ? "" : "h-full"])
|
|
193
195
|
}, [
|
|
194
196
|
n.loading ? u(e.$slots, "loader", { key: 0 }, () => [
|
|
195
197
|
x("div", R, [
|