adverich-kun-ui 0.1.309 → 0.1.310
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,5 +1,5 @@
|
|
|
1
|
-
import { computed as
|
|
2
|
-
const
|
|
1
|
+
import { computed as l, createElementBlock as i, openBlock as a, renderSlot as u, createCommentVNode as s, mergeProps as d, toDisplayString as p } from "vue";
|
|
2
|
+
const m = { class: "relative inline-block" }, g = { key: 0 }, y = /* @__PURE__ */ Object.assign({ inheritAttrs: !1 }, {
|
|
3
3
|
__name: "KunBadge",
|
|
4
4
|
props: {
|
|
5
5
|
text: { type: [String, Number], default: "" },
|
|
@@ -9,32 +9,76 @@ const f = { class: "relative inline-block" }, p = { key: 0 }, m = /* @__PURE__ *
|
|
|
9
9
|
fontWeight: { type: String, default: "font-bold" },
|
|
10
10
|
rounded: { type: String, default: "rounded-full" },
|
|
11
11
|
dot: { type: Boolean, default: !1 },
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
visible: { type: Boolean, default: !0 },
|
|
13
|
+
position: {
|
|
14
|
+
type: String,
|
|
15
|
+
default: "top right",
|
|
16
|
+
validator: (t) => [
|
|
17
|
+
"top left",
|
|
18
|
+
"top center",
|
|
19
|
+
"top right",
|
|
20
|
+
"center left",
|
|
21
|
+
"center center",
|
|
22
|
+
"center right",
|
|
23
|
+
"bottom left",
|
|
24
|
+
"bottom center",
|
|
25
|
+
"bottom right"
|
|
26
|
+
].includes(t)
|
|
27
|
+
},
|
|
28
|
+
ejeX: { type: Number, default: 0 },
|
|
29
|
+
// desplazamiento horizontal
|
|
30
|
+
ejeY: { type: Number, default: 0 }
|
|
31
|
+
// desplazamiento vertical
|
|
15
32
|
},
|
|
16
|
-
setup(
|
|
17
|
-
const
|
|
33
|
+
setup(t) {
|
|
34
|
+
const e = t;
|
|
35
|
+
l(() => [
|
|
18
36
|
"absolute -top-1 -right-1 flex items-center justify-center px-2 py-1",
|
|
19
37
|
"transform translate-x-1/2 -translate-y-1/2",
|
|
20
38
|
"min-w-[20px] min-h-[20px]",
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
39
|
+
e.bgColor,
|
|
40
|
+
e.textColor,
|
|
41
|
+
e.textSize,
|
|
42
|
+
e.fontWeight,
|
|
43
|
+
e.rounded
|
|
26
44
|
].filter(Boolean));
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
45
|
+
const c = l(() => {
|
|
46
|
+
const o = {
|
|
47
|
+
top: "top-0",
|
|
48
|
+
center: "top-1/2",
|
|
49
|
+
bottom: "bottom-0",
|
|
50
|
+
left: "left-0",
|
|
51
|
+
right: "right-0",
|
|
52
|
+
"center-x": "left-1/2",
|
|
53
|
+
"center-y": "top-1/2"
|
|
54
|
+
}, [n, r] = e.position.split(" ");
|
|
55
|
+
return [
|
|
56
|
+
o[n] || "",
|
|
57
|
+
r === "center" ? "left-1/2" : o[r],
|
|
58
|
+
n === "center" ? "top-1/2" : "",
|
|
59
|
+
"absolute",
|
|
60
|
+
"transform",
|
|
61
|
+
r === "center" ? "-translate-x-1/2" : "",
|
|
62
|
+
n === "center" ? "-translate-y-1/2" : ""
|
|
63
|
+
].filter(Boolean);
|
|
64
|
+
}), f = l(() => ({
|
|
65
|
+
transform: `
|
|
66
|
+
${e.position.includes("center") ? "translate(-50%, -50%)" : ""}
|
|
67
|
+
translate(${e.ejeX}px, ${e.ejeY}px)
|
|
68
|
+
`.trim()
|
|
69
|
+
}));
|
|
70
|
+
return (o, n) => (a(), i("div", m, [
|
|
71
|
+
u(o.$slots, "default"),
|
|
72
|
+
t.visible ? (a(), i("div", d({
|
|
30
73
|
key: 0,
|
|
31
|
-
class:
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
74
|
+
class: [...c.value, t.bgColor, t.textColor, t.textSize, t.fontWeight, t.rounded, "px-2 py-1 min-w-[20px] min-h-[20px] flex items-center justify-center"],
|
|
75
|
+
style: f.value
|
|
76
|
+
}, o.$attrs), [
|
|
77
|
+
t.dot ? s("", !0) : (a(), i("span", g, p(t.text), 1))
|
|
78
|
+
], 16)) : s("", !0)
|
|
35
79
|
]));
|
|
36
80
|
}
|
|
37
81
|
});
|
|
38
82
|
export {
|
|
39
|
-
|
|
83
|
+
y as default
|
|
40
84
|
};
|