@me-framework/me-ui-antdv-next 0.0.24 → 0.0.28
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.
- package/README.md +41 -0
- package/dist/base/index.css +1 -0
- package/dist/base/index.js +0 -0
- package/dist/base.d.ts +1 -0
- package/dist/body/index.css +1 -0
- package/dist/body/index.js +153 -0
- package/dist/{components/body → body}/index.vue.d.ts +3 -3
- package/dist/box/index.css +1 -0
- package/dist/box/index.js +170 -0
- package/dist/breadcrumb/index.css +1 -0
- package/dist/breadcrumb/index.js +99 -0
- package/dist/card/index.css +1 -0
- package/dist/card/index.js +154 -0
- package/dist/chunks/icon-CXjgApCy.js +156 -0
- package/dist/chunks/input-icon-selector-BrrR4KK6.js +228 -0
- package/dist/chunks/message-D2zYiiQe.js +290 -0
- package/dist/chunks/modal-KBZYtIHD.js +178 -0
- package/dist/icon/index.css +1 -0
- package/dist/icon/index.js +27 -0
- package/dist/index.d.ts +34 -34
- package/dist/input-gps/index.css +1 -0
- package/dist/input-gps/index.js +303 -0
- package/dist/{components/input-gps → input-gps}/index.vue.d.ts +3 -1
- package/dist/{components/input-gps → input-gps}/map.vue.d.ts +1 -1
- package/dist/{components/input-gps → input-gps}/types.d.ts +9 -5
- package/dist/input-icon-selector/index.css +1 -0
- package/dist/input-icon-selector/index.js +2 -0
- package/dist/input-radio/index.css +1 -0
- package/dist/input-radio/index.js +96 -0
- package/dist/{components/input-radio → input-radio}/index.vue.d.ts +3 -3
- package/dist/load-json/index.css +1 -0
- package/dist/load-json/index.js +211 -0
- package/dist/login-page/index.css +1 -0
- package/dist/login-page/index.js +272 -0
- package/dist/me-ui-antdv-next.js +62 -48
- package/dist/me-ui-antdv-next.umd.cjs +2 -2
- package/dist/menu/index.css +1 -0
- package/dist/menu/index.js +465 -0
- package/dist/message/index.css +1 -0
- package/dist/message/index.js +2 -0
- package/dist/modal/index.css +1 -0
- package/dist/modal/index.js +2 -0
- package/dist/nav/index.css +1 -0
- package/dist/nav/index.js +560 -0
- package/dist/resolver/index.d.ts +7 -0
- package/dist/resolver/index.js +39 -0
- package/dist/resolver/resolver-map.d.ts +6 -0
- package/dist/resolver/resolver-type.d.ts +19 -0
- package/dist/resolver.d.ts +2 -0
- package/dist/shims-vue.d.ts +3 -0
- package/dist/skeleton/index.css +1 -0
- package/dist/skeleton/index.js +141 -0
- package/dist/{me-ui-antdv-next.css → style.css} +1 -1
- package/dist/styles/base.d.ts +0 -0
- package/dist/tree-menu/index.css +1 -0
- package/dist/tree-menu/index.js +890 -0
- package/package.json +18 -9
- package/dist/{components/body → body}/index.d.ts +0 -0
- package/dist/{components/body → body}/types.d.ts +0 -0
- package/dist/{components/box → box}/index.d.ts +0 -0
- package/dist/{components/box → box}/index.vue.d.ts +2 -2
- package/dist/{components/box → box}/types.d.ts +0 -0
- package/dist/{components/breadcrumb → breadcrumb}/index.d.ts +0 -0
- package/dist/{components/breadcrumb → breadcrumb}/index.vue.d.ts +0 -0
- package/dist/{components/breadcrumb → breadcrumb}/types.d.ts +0 -0
- package/dist/{components/card → card}/index.d.ts +0 -0
- package/dist/{components/card → card}/index.vue.d.ts +4 -4
- package/dist/{components/card → card}/types.d.ts +0 -0
- package/dist/{components/icon → icon}/index.d.ts +0 -0
- package/dist/{components/icon → icon}/index.vue.d.ts +2 -2
- package/dist/{components/icon → icon}/types.d.ts +0 -0
- package/dist/{components/input-gps → input-gps}/index.d.ts +0 -0
- package/dist/{components/input-icon-selector → input-icon-selector}/index.d.ts +0 -0
- package/dist/{components/input-icon-selector → input-icon-selector}/index.vue.d.ts +5 -5
- package/dist/{components/input-icon-selector → input-icon-selector}/types.d.ts +0 -0
- package/dist/{components/input-radio → input-radio}/index.d.ts +0 -0
- package/dist/{components/input-radio → input-radio}/types.d.ts +0 -0
- package/dist/{components/load-json → load-json}/index.d.ts +0 -0
- package/dist/{components/load-json → load-json}/index.vue.d.ts +1 -1
- package/dist/{components/load-json → load-json}/types.d.ts +0 -0
- package/dist/{components/login-page → login-page}/index.d.ts +0 -0
- package/dist/{components/login-page → login-page}/index.vue.d.ts +0 -0
- package/dist/{components/login-page → login-page}/types.d.ts +0 -0
- package/dist/{components/menu → menu}/MenuTreeItem.vue.d.ts +0 -0
- package/dist/{components/menu → menu}/index.d.ts +0 -0
- package/dist/{components/menu → menu}/index.vue.d.ts +2 -2
- package/dist/{components/menu → menu}/types.d.ts +0 -0
- package/dist/{components/message → message}/index.d.ts +0 -0
- package/dist/{components/message → message}/index.vue.d.ts +4 -4
- package/dist/{components/message → message}/types.d.ts +0 -0
- package/dist/{components/modal → modal}/index.d.ts +0 -0
- package/dist/{components/modal → modal}/index.vue.d.ts +5 -5
- package/dist/{components/modal → modal}/types.d.ts +0 -0
- package/dist/{components/nav → nav}/composables/useNavDrag.d.ts +0 -0
- package/dist/{components/nav → nav}/composables/useNavScroll.d.ts +0 -0
- package/dist/{components/nav → nav}/index.d.ts +0 -0
- package/dist/{components/nav → nav}/index.vue.d.ts +5 -5
- package/dist/{components/nav → nav}/types.d.ts +0 -0
- package/dist/{components/skeleton → skeleton}/index.d.ts +0 -0
- package/dist/{components/skeleton → skeleton}/index.vue.d.ts +0 -0
- package/dist/{components/skeleton → skeleton}/types.d.ts +0 -0
- package/dist/{components/tree-menu → tree-menu}/TreeMenuActions.vue.d.ts +0 -0
- package/dist/{components/tree-menu → tree-menu}/TreeMenuCard.vue.d.ts +1 -1
- package/dist/{components/tree-menu → tree-menu}/TreeMenuEdit.vue.d.ts +2 -2
- package/dist/{components/tree-menu → tree-menu}/TreeMenuNode.vue.d.ts +0 -0
- package/dist/{components/tree-menu → tree-menu}/index.d.ts +0 -0
- package/dist/{components/tree-menu → tree-menu}/index.vue.d.ts +3 -3
- /package/dist/{components/tree-menu → tree-menu}/types.d.ts +0 -0
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
import { computed as e, createBlock as t, createCommentVNode as n, createElementBlock as r, createElementVNode as i, createVNode as a, defineComponent as o, mergeProps as s, normalizeClass as c, openBlock as l, ref as u, renderSlot as d, resolveComponent as f, resolveDynamicComponent as p, toDisplayString as m, unref as h, useSlots as g, vShow as _, watch as v, withCtx as y, withDirectives as b } from "vue";
|
|
2
|
+
import { ChevronDown as x, Maximize2 as S, Minimize2 as C } from "@lucide/vue";
|
|
3
|
+
//#region src/components/card/index.vue?vue&type=script&setup=true&lang.ts
|
|
4
|
+
var w = { class: "me-card__title-wrapper" }, T = { class: "me-card__title" }, E = { class: "me-card__actions" }, D = { class: "me-card__content" }, O = { class: "me-card__body" }, k = {
|
|
5
|
+
key: 0,
|
|
6
|
+
class: "me-card__footer"
|
|
7
|
+
}, A = /* @__PURE__ */ o({
|
|
8
|
+
name: "MeCard",
|
|
9
|
+
__name: "index",
|
|
10
|
+
props: {
|
|
11
|
+
title: {
|
|
12
|
+
type: String,
|
|
13
|
+
default: ""
|
|
14
|
+
},
|
|
15
|
+
collapsible: {
|
|
16
|
+
type: Boolean,
|
|
17
|
+
default: !1
|
|
18
|
+
},
|
|
19
|
+
defaultCollapsed: {
|
|
20
|
+
type: Boolean,
|
|
21
|
+
default: !1
|
|
22
|
+
},
|
|
23
|
+
collapsed: {
|
|
24
|
+
type: Boolean,
|
|
25
|
+
default: void 0
|
|
26
|
+
},
|
|
27
|
+
fullscreenable: {
|
|
28
|
+
type: Boolean,
|
|
29
|
+
default: !1
|
|
30
|
+
},
|
|
31
|
+
fullscreen: {
|
|
32
|
+
type: Boolean,
|
|
33
|
+
default: void 0
|
|
34
|
+
},
|
|
35
|
+
defaultFullscreen: {
|
|
36
|
+
type: Boolean,
|
|
37
|
+
default: !1
|
|
38
|
+
},
|
|
39
|
+
height: {
|
|
40
|
+
type: [String, Number],
|
|
41
|
+
default: ""
|
|
42
|
+
},
|
|
43
|
+
loading: {
|
|
44
|
+
type: Boolean,
|
|
45
|
+
default: void 0
|
|
46
|
+
},
|
|
47
|
+
defaultLoading: {
|
|
48
|
+
type: Boolean,
|
|
49
|
+
default: !1
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
emits: [
|
|
53
|
+
"update:collapsed",
|
|
54
|
+
"collapse-change",
|
|
55
|
+
"update:fullscreen",
|
|
56
|
+
"fullscreen-change",
|
|
57
|
+
"update:loading",
|
|
58
|
+
"loading-change"
|
|
59
|
+
],
|
|
60
|
+
setup(o, { emit: A }) {
|
|
61
|
+
let j = o, M = A, N = g(), P = e(() => !!N.footer), F = u(j.defaultLoading), I = e(() => j.loading !== void 0), L = e(() => I.value ? j.loading : F.value);
|
|
62
|
+
v(() => j.loading, (e) => {
|
|
63
|
+
e !== void 0 && (F.value = e);
|
|
64
|
+
});
|
|
65
|
+
let R = e(() => {
|
|
66
|
+
if (!j.height) return 3;
|
|
67
|
+
let e = typeof j.height == "number" ? j.height : parseFloat(j.height);
|
|
68
|
+
if (isNaN(e)) return 3;
|
|
69
|
+
let t = e - 48;
|
|
70
|
+
return Math.max(2, Math.floor(t / 32));
|
|
71
|
+
}), z = e(() => {
|
|
72
|
+
let e = {};
|
|
73
|
+
return j.height && !W.value && (e.height = typeof j.height == "number" ? `${j.height}px` : j.height), e;
|
|
74
|
+
}), B = u(j.defaultCollapsed), V = e(() => j.collapsed !== void 0), H = e(() => V.value ? j.collapsed : B.value);
|
|
75
|
+
v(() => j.collapsed, (e) => {
|
|
76
|
+
e !== void 0 && (B.value = e);
|
|
77
|
+
});
|
|
78
|
+
let U = () => {
|
|
79
|
+
let e = !H.value;
|
|
80
|
+
V.value || (B.value = e), M("update:collapsed", e), M("collapse-change", e);
|
|
81
|
+
}, W = u(j.defaultFullscreen), G = e(() => j.fullscreen !== void 0), K = e(() => G.value ? j.fullscreen : W.value);
|
|
82
|
+
v(() => j.fullscreen, (e) => {
|
|
83
|
+
e !== void 0 && (W.value = e);
|
|
84
|
+
});
|
|
85
|
+
let q = () => {
|
|
86
|
+
let e = !K.value;
|
|
87
|
+
G.value || (W.value = e), M("update:fullscreen", e), M("fullscreen-change", e);
|
|
88
|
+
}, J = e(() => {
|
|
89
|
+
let { title: e, collapsible: t, defaultCollapsed: n, collapsed: r, fullscreenable: i, fullscreen: a, defaultFullscreen: o, height: s, loading: c, defaultLoading: l, ...u } = j;
|
|
90
|
+
return { ...u };
|
|
91
|
+
});
|
|
92
|
+
return (e, o) => {
|
|
93
|
+
let u = f("a-button"), g = f("a-skeleton"), v = f("a-card");
|
|
94
|
+
return l(), t(v, s(J.value, {
|
|
95
|
+
style: z.value,
|
|
96
|
+
class: ["me-card", {
|
|
97
|
+
"me-card--collapsed": B.value,
|
|
98
|
+
"me-card--fullscreen": W.value,
|
|
99
|
+
"me-card--collapsible": j.collapsible,
|
|
100
|
+
"me-card--fullscreenable": j.fullscreenable,
|
|
101
|
+
"me-card--has-height": !!j.height,
|
|
102
|
+
"me-card--has-footer": P.value,
|
|
103
|
+
"me-card--loading": L.value
|
|
104
|
+
}]
|
|
105
|
+
}), {
|
|
106
|
+
title: y(() => [i("div", w, [d(e.$slots, "title", {}, () => [i("span", T, m(j.title), 1)]), i("div", E, [
|
|
107
|
+
d(e.$slots, "actions"),
|
|
108
|
+
d(e.$slots, "extra"),
|
|
109
|
+
j.fullscreenable ? (l(), t(u, {
|
|
110
|
+
key: 0,
|
|
111
|
+
type: "text",
|
|
112
|
+
size: "small",
|
|
113
|
+
class: "me-card__action-btn",
|
|
114
|
+
onClick: q
|
|
115
|
+
}, {
|
|
116
|
+
default: y(() => [(l(), t(p(W.value ? h(C) : h(S)), { size: 16 }))]),
|
|
117
|
+
_: 1
|
|
118
|
+
})) : n("", !0),
|
|
119
|
+
j.collapsible ? (l(), t(u, {
|
|
120
|
+
key: 1,
|
|
121
|
+
type: "text",
|
|
122
|
+
size: "small",
|
|
123
|
+
class: c(["me-card__action-btn", { "me-card__collapse-btn--collapsed": B.value }]),
|
|
124
|
+
onClick: U
|
|
125
|
+
}, {
|
|
126
|
+
default: y(() => [a(h(x), {
|
|
127
|
+
size: 16,
|
|
128
|
+
class: "me-card__collapse-icon"
|
|
129
|
+
})]),
|
|
130
|
+
_: 1
|
|
131
|
+
}, 8, ["class"])) : n("", !0)
|
|
132
|
+
])])]),
|
|
133
|
+
default: y(() => [b(i("div", D, [i("div", O, [L.value ? (l(), t(g, {
|
|
134
|
+
key: 0,
|
|
135
|
+
active: "",
|
|
136
|
+
rows: R.value,
|
|
137
|
+
title: !1
|
|
138
|
+
}, {
|
|
139
|
+
default: y(() => [d(e.$slots, "default")]),
|
|
140
|
+
_: 3
|
|
141
|
+
}, 8, ["rows"])) : d(e.$slots, "default", {}, void 0, void 0, 1)]), P.value ? (l(), r("div", k, [d(e.$slots, "footer")])) : n("", !0)], 512), [[_, !B.value]])]),
|
|
142
|
+
_: 3
|
|
143
|
+
}, 16, ["style", "class"]);
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
});
|
|
147
|
+
//#endregion
|
|
148
|
+
//#region src/components/card/index.ts
|
|
149
|
+
A.install = (e) => {
|
|
150
|
+
e.component("MeCard", A);
|
|
151
|
+
};
|
|
152
|
+
var j = A;
|
|
153
|
+
//#endregion
|
|
154
|
+
export { A as MeCard, j as default };
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
import { computed as e, createBlock as t, createCommentVNode as n, createElementBlock as r, createElementVNode as i, defineComponent as a, mergeProps as o, openBlock as s, renderSlot as c, resolveDynamicComponent as l, useAttrs as u } from "vue";
|
|
2
|
+
import * as d from "@lucide/vue";
|
|
3
|
+
//#region src/components/icon/index.vue?vue&type=script&setup=true&lang.ts
|
|
4
|
+
var f = ["href"], p = [
|
|
5
|
+
"width",
|
|
6
|
+
"height",
|
|
7
|
+
"stroke"
|
|
8
|
+
], m = [
|
|
9
|
+
"src",
|
|
10
|
+
"width",
|
|
11
|
+
"height"
|
|
12
|
+
], h = /* @__PURE__ */ a({
|
|
13
|
+
name: "MeIcon",
|
|
14
|
+
inheritAttrs: !1,
|
|
15
|
+
__name: "index",
|
|
16
|
+
props: {
|
|
17
|
+
name: {
|
|
18
|
+
type: [String, Object],
|
|
19
|
+
default: ""
|
|
20
|
+
},
|
|
21
|
+
type: {
|
|
22
|
+
type: String,
|
|
23
|
+
default: "auto"
|
|
24
|
+
},
|
|
25
|
+
size: {
|
|
26
|
+
type: [Number, String],
|
|
27
|
+
default: 16
|
|
28
|
+
},
|
|
29
|
+
color: {
|
|
30
|
+
type: String,
|
|
31
|
+
default: void 0
|
|
32
|
+
},
|
|
33
|
+
bgColor: {
|
|
34
|
+
type: String,
|
|
35
|
+
default: void 0
|
|
36
|
+
},
|
|
37
|
+
radius: {
|
|
38
|
+
type: [Number, String],
|
|
39
|
+
default: 0
|
|
40
|
+
},
|
|
41
|
+
strokeWidth: {
|
|
42
|
+
type: Number,
|
|
43
|
+
default: 2
|
|
44
|
+
},
|
|
45
|
+
iconfontPrefix: {
|
|
46
|
+
type: String,
|
|
47
|
+
default: "iconfont"
|
|
48
|
+
},
|
|
49
|
+
iconfontMode: {
|
|
50
|
+
type: String,
|
|
51
|
+
default: "class"
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
setup(a) {
|
|
55
|
+
let h = a, g = u(), _ = e(() => {
|
|
56
|
+
let e = {}, t = [
|
|
57
|
+
"name",
|
|
58
|
+
"type",
|
|
59
|
+
"size",
|
|
60
|
+
"color",
|
|
61
|
+
"bgColor",
|
|
62
|
+
"radius",
|
|
63
|
+
"strokeWidth",
|
|
64
|
+
"iconfontPrefix",
|
|
65
|
+
"iconfontMode"
|
|
66
|
+
];
|
|
67
|
+
for (let [n, r] of Object.entries(g)) t.includes(n) || (e[n] = r);
|
|
68
|
+
return e;
|
|
69
|
+
}), v = e(() => {
|
|
70
|
+
if (h.type !== "auto") return h.type;
|
|
71
|
+
if (typeof h.name == "object" && h.name !== null) return "lucide";
|
|
72
|
+
let e = String(h.name || "");
|
|
73
|
+
return e.startsWith("ri-") ? "remixicon" : e.startsWith("icon-") ? "iconfont" : e.endsWith(".svg") || e.includes("/") ? "svg-file" : e ? "lucide" : "auto";
|
|
74
|
+
}), y = e(() => {
|
|
75
|
+
if (v.value !== "lucide") return null;
|
|
76
|
+
if (typeof h.name == "object" && h.name !== null) return h.name;
|
|
77
|
+
let e = String(h.name || "");
|
|
78
|
+
if (!e) return null;
|
|
79
|
+
if (d[e]) return d[e];
|
|
80
|
+
let t = b(e);
|
|
81
|
+
return d[t] ? d[t] : null;
|
|
82
|
+
});
|
|
83
|
+
function b(e) {
|
|
84
|
+
return e.replace(/[-_]+(.)?/g, (e, t) => t ? t.toUpperCase() : "").replace(/^(.)/, (e) => e.toUpperCase());
|
|
85
|
+
}
|
|
86
|
+
let x = e(() => {
|
|
87
|
+
let e = {};
|
|
88
|
+
return h.color && (e.color = h.color), h.size && (e.fontSize = typeof h.size == "number" ? `${h.size}px` : h.size), h.bgColor && (e.backgroundColor = h.bgColor), h.radius && (e.borderRadius = typeof h.radius == "number" ? `${h.radius}px` : h.radius), e;
|
|
89
|
+
}), S = e(() => {
|
|
90
|
+
let e = {};
|
|
91
|
+
return h.color && (e.color = h.color), h.size && (e.width = typeof h.size == "number" ? `${h.size}px` : h.size, e.height = typeof h.size == "number" ? `${h.size}px` : h.size), h.bgColor && (e.backgroundColor = h.bgColor), h.radius && (e.borderRadius = typeof h.radius == "number" ? `${h.radius}px` : h.radius), e;
|
|
92
|
+
});
|
|
93
|
+
return (e, a) => v.value === "lucide" && y.value ? (s(), t(l(y.value), o({
|
|
94
|
+
key: 0,
|
|
95
|
+
size: h.size,
|
|
96
|
+
color: h.color,
|
|
97
|
+
"stroke-width": h.strokeWidth,
|
|
98
|
+
class: ["me-icon", "me-icon--lucide"],
|
|
99
|
+
style: x.value
|
|
100
|
+
}, _.value), null, 16, [
|
|
101
|
+
"size",
|
|
102
|
+
"color",
|
|
103
|
+
"stroke-width",
|
|
104
|
+
"style"
|
|
105
|
+
])) : v.value === "remixicon" ? (s(), r("i", o({
|
|
106
|
+
key: 1,
|
|
107
|
+
class: [
|
|
108
|
+
"me-icon",
|
|
109
|
+
"me-icon--remixicon",
|
|
110
|
+
h.name
|
|
111
|
+
],
|
|
112
|
+
style: x.value
|
|
113
|
+
}, _.value), null, 16)) : v.value === "iconfont" && h.iconfontMode === "class" ? (s(), r("i", o({
|
|
114
|
+
key: 2,
|
|
115
|
+
class: [
|
|
116
|
+
"me-icon",
|
|
117
|
+
"me-icon--iconfont",
|
|
118
|
+
"me-icon--iconfont-class",
|
|
119
|
+
h.iconfontPrefix,
|
|
120
|
+
h.name
|
|
121
|
+
],
|
|
122
|
+
style: x.value
|
|
123
|
+
}, _.value), null, 16)) : v.value === "iconfont" && h.iconfontMode === "symbol" ? (s(), r("svg", o({
|
|
124
|
+
key: 3,
|
|
125
|
+
class: [
|
|
126
|
+
"me-icon",
|
|
127
|
+
"me-icon--iconfont",
|
|
128
|
+
"me-icon--iconfont-symbol",
|
|
129
|
+
h.iconfontPrefix
|
|
130
|
+
],
|
|
131
|
+
style: S.value,
|
|
132
|
+
"aria-hidden": "true"
|
|
133
|
+
}, _.value), [i("use", { href: `#${h.name}` }, null, 8, f)], 16)) : v.value === "svg" ? (s(), r("svg", o({
|
|
134
|
+
key: 4,
|
|
135
|
+
class: ["me-icon", "me-icon--svg"],
|
|
136
|
+
style: x.value,
|
|
137
|
+
width: h.size,
|
|
138
|
+
height: h.size,
|
|
139
|
+
viewBox: "0 0 24 24",
|
|
140
|
+
fill: "none",
|
|
141
|
+
stroke: h.color || "currentColor",
|
|
142
|
+
"stroke-width": "2",
|
|
143
|
+
"stroke-linecap": "round",
|
|
144
|
+
"stroke-linejoin": "round"
|
|
145
|
+
}, _.value), [c(e.$slots, "default")], 16, p)) : v.value === "svg-file" ? (s(), r("img", o({
|
|
146
|
+
key: 5,
|
|
147
|
+
src: h.name,
|
|
148
|
+
class: ["me-icon", "me-icon--svg-file"],
|
|
149
|
+
style: x.value,
|
|
150
|
+
width: h.size,
|
|
151
|
+
height: h.size
|
|
152
|
+
}, _.value), null, 16, m)) : n("", !0);
|
|
153
|
+
}
|
|
154
|
+
});
|
|
155
|
+
//#endregion
|
|
156
|
+
export { h as t };
|
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
import { t as e } from "./icon-CXjgApCy.js";
|
|
2
|
+
import { Fragment as t, computed as n, createBlock as r, createCommentVNode as i, createElementBlock as a, createElementVNode as o, createTextVNode as s, createVNode as c, defineComponent as l, normalizeClass as u, normalizeStyle as d, onMounted as f, openBlock as p, ref as m, renderList as h, renderSlot as g, resolveComponent as _, unref as v, watch as y, withCtx as b } from "vue";
|
|
3
|
+
import * as x from "@lucide/vue";
|
|
4
|
+
import S from "remixicon/fonts/remixicon.symbol.svg";
|
|
5
|
+
//#region src/components/input-icon-selector/index.vue?vue&type=script&setup=true&lang.ts
|
|
6
|
+
var C = { class: "me-input-icon-selector__search" }, w = {
|
|
7
|
+
key: 0,
|
|
8
|
+
class: "me-input-icon-selector__list"
|
|
9
|
+
}, T = ["title", "onClick"], E = {
|
|
10
|
+
key: 1,
|
|
11
|
+
class: "me-input-icon-selector__empty"
|
|
12
|
+
}, D = { class: "me-input-icon-selector__footer" }, O = {
|
|
13
|
+
key: 0,
|
|
14
|
+
href: "https://remixicon.com/",
|
|
15
|
+
target: "_blank",
|
|
16
|
+
class: "me-input-icon-selector__link"
|
|
17
|
+
}, k = {
|
|
18
|
+
key: 1,
|
|
19
|
+
href: "https://lucide.dev/icons/",
|
|
20
|
+
target: "_blank",
|
|
21
|
+
class: "me-input-icon-selector__link"
|
|
22
|
+
}, A = { key: 2 }, j = /* @__PURE__ */ l({
|
|
23
|
+
name: "MeInputIconSelector",
|
|
24
|
+
__name: "index",
|
|
25
|
+
props: {
|
|
26
|
+
modelValue: { default: "" },
|
|
27
|
+
sources: { default: () => [
|
|
28
|
+
"lucide",
|
|
29
|
+
"remixicon",
|
|
30
|
+
"iconfont"
|
|
31
|
+
] },
|
|
32
|
+
iconfontData: { default: () => [] },
|
|
33
|
+
placeholder: { default: "请选择图标" },
|
|
34
|
+
searchPlaceholder: { default: "搜索图标" },
|
|
35
|
+
pageSize: { default: 30 },
|
|
36
|
+
popoverWidth: { default: 280 },
|
|
37
|
+
disabled: {
|
|
38
|
+
type: Boolean,
|
|
39
|
+
default: !1
|
|
40
|
+
},
|
|
41
|
+
size: { default: "middle" },
|
|
42
|
+
clearable: {
|
|
43
|
+
type: Boolean,
|
|
44
|
+
default: !0
|
|
45
|
+
},
|
|
46
|
+
iconfontPrefix: { default: "iconfont" },
|
|
47
|
+
iconfontMode: { default: "class" }
|
|
48
|
+
},
|
|
49
|
+
emits: ["update:modelValue", "change"],
|
|
50
|
+
setup(l, { emit: j }) {
|
|
51
|
+
let M = l, N = j, P = m(!1), F = m(""), I = m(1), L = m("lucide"), R = n(() => {
|
|
52
|
+
if (typeof M.popoverWidth == "number") return M.popoverWidth;
|
|
53
|
+
let e = parseInt(M.popoverWidth, 10);
|
|
54
|
+
return isNaN(e) ? 280 : e;
|
|
55
|
+
}), z = n(() => Object.keys(x).filter((e) => {
|
|
56
|
+
if (!/^[A-Z]/.test(e)) return !1;
|
|
57
|
+
let t = x[e];
|
|
58
|
+
return typeof t != "object" && typeof t != "function" || e === "icons" || e === "createLucideIcon" || e === "default" ? !1 : t && (t.render || t.setup || t.__name) ? !0 : typeof t == "function" || typeof t == "object";
|
|
59
|
+
})), B = m([]), V = !1;
|
|
60
|
+
function H() {
|
|
61
|
+
typeof document > "u" || V || (V = !0, fetch(S).then((e) => e.text()).then((e) => {
|
|
62
|
+
let t = new DOMParser().parseFromString(e, "image/svg+xml").querySelectorAll("symbol[id^=\"ri-\"]");
|
|
63
|
+
B.value = Array.from(t).map((e) => e.getAttribute("id") || "");
|
|
64
|
+
}).catch((e) => {
|
|
65
|
+
console.warn("[MeInputIconSelector] Failed to load remixicon list:", e), V = !1;
|
|
66
|
+
}));
|
|
67
|
+
}
|
|
68
|
+
f(() => {
|
|
69
|
+
H();
|
|
70
|
+
});
|
|
71
|
+
let U = {
|
|
72
|
+
lucide: {
|
|
73
|
+
label: "Lucide",
|
|
74
|
+
get data() {
|
|
75
|
+
return z.value;
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
remixicon: {
|
|
79
|
+
label: "Remixicon",
|
|
80
|
+
get data() {
|
|
81
|
+
return B.value;
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
iconfont: {
|
|
85
|
+
label: "Iconfont",
|
|
86
|
+
data: []
|
|
87
|
+
}
|
|
88
|
+
}, W = n(() => M.sources.map((e) => ({
|
|
89
|
+
key: e,
|
|
90
|
+
label: U[e].label
|
|
91
|
+
})));
|
|
92
|
+
y(() => M.sources, (e) => {
|
|
93
|
+
e.includes(L.value) || (L.value = e[0] || "lucide");
|
|
94
|
+
}, { immediate: !0 });
|
|
95
|
+
let G = n(() => L.value === "iconfont" ? M.iconfontData : U[L.value].data), K = n(() => {
|
|
96
|
+
let e = F.value.trim().toLowerCase();
|
|
97
|
+
return e ? G.value.filter((t) => t.toLowerCase().includes(e)) : G.value;
|
|
98
|
+
}), q = n(() => {
|
|
99
|
+
let e = (I.value - 1) * M.pageSize, t = e + M.pageSize;
|
|
100
|
+
return K.value.slice(e, t);
|
|
101
|
+
});
|
|
102
|
+
y(F, () => {
|
|
103
|
+
I.value = 1;
|
|
104
|
+
}), y(L, () => {
|
|
105
|
+
I.value = 1, F.value = "";
|
|
106
|
+
});
|
|
107
|
+
function J(e) {
|
|
108
|
+
N("update:modelValue", e), N("change", e), P.value = !1;
|
|
109
|
+
}
|
|
110
|
+
function Y(e) {
|
|
111
|
+
let t = typeof e == "string" ? e : e.target?.value || "";
|
|
112
|
+
N("update:modelValue", t), N("change", t);
|
|
113
|
+
}
|
|
114
|
+
function X() {
|
|
115
|
+
N("update:modelValue", ""), N("change", "");
|
|
116
|
+
}
|
|
117
|
+
return (n, f) => {
|
|
118
|
+
let m = _("a-space-addon"), y = _("a-input"), x = _("a-tab-pane"), S = _("a-tabs"), j = _("a-pagination"), N = _("a-button"), z = _("a-popover"), B = _("a-space-compact");
|
|
119
|
+
return p(), r(B, {
|
|
120
|
+
class: "me-input-icon-selector",
|
|
121
|
+
style: { width: "100%" }
|
|
122
|
+
}, {
|
|
123
|
+
default: b(() => [
|
|
124
|
+
l.modelValue ? (p(), r(m, { key: 0 }, {
|
|
125
|
+
default: b(() => [c(v(e), {
|
|
126
|
+
name: l.modelValue,
|
|
127
|
+
size: 16
|
|
128
|
+
}, null, 8, ["name"])]),
|
|
129
|
+
_: 1
|
|
130
|
+
})) : i("", !0),
|
|
131
|
+
c(y, {
|
|
132
|
+
value: l.modelValue,
|
|
133
|
+
placeholder: M.placeholder,
|
|
134
|
+
disabled: M.disabled,
|
|
135
|
+
size: M.size,
|
|
136
|
+
"allow-clear": M.clearable,
|
|
137
|
+
style: { width: "100%" },
|
|
138
|
+
"onUpdate:value": Y,
|
|
139
|
+
onChange: Y,
|
|
140
|
+
onClear: X
|
|
141
|
+
}, null, 8, [
|
|
142
|
+
"value",
|
|
143
|
+
"placeholder",
|
|
144
|
+
"disabled",
|
|
145
|
+
"size",
|
|
146
|
+
"allow-clear"
|
|
147
|
+
]),
|
|
148
|
+
c(z, {
|
|
149
|
+
open: P.value,
|
|
150
|
+
"onUpdate:open": f[3] ||= (e) => P.value = e,
|
|
151
|
+
trigger: "click",
|
|
152
|
+
placement: "bottomRight",
|
|
153
|
+
"overlay-class-name": "me-input-icon-selector-popover"
|
|
154
|
+
}, {
|
|
155
|
+
content: b(() => [o("div", {
|
|
156
|
+
class: "me-input-icon-selector__popover",
|
|
157
|
+
style: d({ width: R.value + "px" })
|
|
158
|
+
}, [
|
|
159
|
+
o("div", C, [c(y, {
|
|
160
|
+
value: F.value,
|
|
161
|
+
"onUpdate:value": f[0] ||= (e) => F.value = e,
|
|
162
|
+
"allow-clear": "",
|
|
163
|
+
placeholder: M.searchPlaceholder,
|
|
164
|
+
size: "small"
|
|
165
|
+
}, null, 8, ["value", "placeholder"])]),
|
|
166
|
+
c(S, {
|
|
167
|
+
activeKey: L.value,
|
|
168
|
+
"onUpdate:activeKey": f[1] ||= (e) => L.value = e,
|
|
169
|
+
class: "me-input-icon-selector__tabs",
|
|
170
|
+
size: "small"
|
|
171
|
+
}, {
|
|
172
|
+
default: b(() => [(p(!0), a(t, null, h(W.value, (e) => (p(), r(x, {
|
|
173
|
+
key: e.key,
|
|
174
|
+
tab: e.label
|
|
175
|
+
}, null, 8, ["tab"]))), 128))]),
|
|
176
|
+
_: 1
|
|
177
|
+
}, 8, ["activeKey"]),
|
|
178
|
+
q.value.length > 0 ? (p(), a("div", w, [(p(!0), a(t, null, h(q.value, (t, n) => (p(), a("div", {
|
|
179
|
+
key: n,
|
|
180
|
+
class: u(["icon-item", { "is-active": t === l.modelValue }]),
|
|
181
|
+
title: t,
|
|
182
|
+
onClick: (e) => J(t)
|
|
183
|
+
}, [c(v(e), {
|
|
184
|
+
name: t,
|
|
185
|
+
type: L.value,
|
|
186
|
+
size: 18,
|
|
187
|
+
"iconfont-prefix": M.iconfontPrefix,
|
|
188
|
+
"iconfont-mode": M.iconfontMode
|
|
189
|
+
}, null, 8, [
|
|
190
|
+
"name",
|
|
191
|
+
"type",
|
|
192
|
+
"iconfont-prefix",
|
|
193
|
+
"iconfont-mode"
|
|
194
|
+
])], 10, T))), 128))])) : (p(), a("div", E, " 暂无匹配的图标 ")),
|
|
195
|
+
o("div", D, [L.value === "remixicon" ? (p(), a("a", O, " remixicon.com ")) : L.value === "lucide" ? (p(), a("a", k, " lucide.dev ")) : (p(), a("span", A)), c(j, {
|
|
196
|
+
current: I.value,
|
|
197
|
+
"onUpdate:current": f[2] ||= (e) => I.value = e,
|
|
198
|
+
"page-size": M.pageSize,
|
|
199
|
+
total: K.value.length,
|
|
200
|
+
size: "small",
|
|
201
|
+
simple: "",
|
|
202
|
+
class: "me-input-icon-selector__pagination"
|
|
203
|
+
}, null, 8, [
|
|
204
|
+
"current",
|
|
205
|
+
"page-size",
|
|
206
|
+
"total"
|
|
207
|
+
])])
|
|
208
|
+
], 4)]),
|
|
209
|
+
default: b(() => [g(n.$slots, "default", {}, () => [c(N, { size: M.size }, {
|
|
210
|
+
default: b(() => [...f[4] ||= [s("选择", -1)]]),
|
|
211
|
+
_: 1
|
|
212
|
+
}, 8, ["size"])])]),
|
|
213
|
+
_: 3
|
|
214
|
+
}, 8, ["open"])
|
|
215
|
+
]),
|
|
216
|
+
_: 3
|
|
217
|
+
});
|
|
218
|
+
};
|
|
219
|
+
}
|
|
220
|
+
});
|
|
221
|
+
//#endregion
|
|
222
|
+
//#region src/components/input-icon-selector/index.ts
|
|
223
|
+
j.install = (e) => {
|
|
224
|
+
e.component("MeInputIconSelector", j);
|
|
225
|
+
};
|
|
226
|
+
var M = j;
|
|
227
|
+
//#endregion
|
|
228
|
+
export { j as n, M as t };
|