color-star-custom-components 0.0.15 → 0.0.17
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/es/CustomSelect.mjs +1 -1
- package/es/IconRenderer.mjs +1 -1
- package/es/IconSelect.mjs +1 -1
- package/es/SearchBar.mjs +114 -117
- package/es/TreeShowSelect.mjs +26 -28
- package/es/assets/SearchBar.css +1 -1
- package/es/assets/TreeShowSelect.css +1 -1
- package/es/chunks/BatchImport.B5inubHt.js +173 -0
- package/es/chunks/CustomSelect.DvKTT1Kn.js +5 -0
- package/es/chunks/CustomTitle.BBrGK8vA.js +5 -0
- package/es/chunks/FileList.CLb0j2ca.js +5 -0
- package/es/chunks/GlassProxy.Dek3zo-k.js +176 -0
- package/es/chunks/IconEmpty.DoCNu0jY.js +5 -0
- package/es/chunks/IconRenderer.DbLSQXFZ.js +60 -0
- package/es/chunks/IconSelect.DjNvTfvM.js +162 -0
- package/es/chunks/SearchBar.Dw1qAtAa.js +582 -0
- package/es/chunks/TreeSelect.BkF207wh.js +5 -0
- package/es/chunks/TreeShowSelect.DuVWWk73.js +87 -0
- package/es/chunks/UploadFile.Cll5_hce.js +5 -0
- package/es/chunks/_plugin-vue_export-helper.BgwWMokO.js +6 -0
- package/es/chunks/chunk.CWVlkNTZ.js +18 -0
- package/es/chunks/config.SfJn1-ON.js +24 -0
- package/es/chunks/config.j-piuAWF.js +24 -0
- package/es/chunks/config.t_HHFoB9.js +18 -0
- package/es/chunks/global.31sZWaXJ.js +15282 -0
- package/es/chunks/global.BEeKea4u.js +1955 -0
- package/es/chunks/global.ChqJEry4.js +7973 -0
- package/es/chunks/global.CnGuevjX.js +8168 -0
- package/es/chunks/layout.4utLpDo3.js +120 -0
- package/es/chunks/layout.84FMC7pU.js +121 -0
- package/es/chunks/layout.BsFtxlIJ.js +31 -0
- package/es/chunks/layout.C5pEEv-d.js +207 -0
- package/es/chunks/layout.CokqBzin.js +338 -0
- package/es/chunks/layout.Dix22XYV.js +113 -0
- package/es/chunks/layout.FqoRQKdx.js +59 -0
- package/es/chunks/utils.BFFtVZUp.js +10 -0
- package/es/index.mjs +1 -1
- package/lib/CustomSelect.js +1 -1
- package/lib/IconRenderer.js +1 -1
- package/lib/IconSelect.js +1 -1
- package/lib/SearchBar.js +1 -1
- package/lib/TreeShowSelect.js +1 -1
- package/lib/assets/SearchBar.css +1 -1
- package/lib/assets/TreeShowSelect.css +1 -1
- package/lib/chunks/BatchImport.Be1Oddwm.js +1 -0
- package/lib/chunks/CustomSelect.qmizu8jb.js +1 -0
- package/lib/chunks/CustomTitle.C_V_RLwQ.js +1 -0
- package/lib/chunks/FileList.DK7Iz3hw.js +1 -0
- package/lib/chunks/GlassProxy.BurTd4Wo.js +1 -0
- package/lib/chunks/IconEmpty.MspO8cAH.js +1 -0
- package/lib/chunks/IconRenderer.CepZVN9N.js +1 -0
- package/lib/chunks/IconSelect.GFCG4dmy.js +1 -0
- package/lib/chunks/SearchBar.C1eP9H7z.js +1 -0
- package/lib/chunks/TreeSelect.CKdd24_v.js +1 -0
- package/lib/chunks/TreeShowSelect.D06Kgg9y.js +1 -0
- package/lib/chunks/UploadFile.FAeNJfgq.js +1 -0
- package/lib/chunks/_plugin-vue_export-helper.Bgn9wawX.js +1 -0
- package/lib/chunks/chunk.D6xVHP8F.js +1 -0
- package/lib/chunks/config.CQdd5R1R.js +1 -0
- package/lib/chunks/config.x7rWDsG1.js +1 -0
- package/lib/chunks/global.BwmaGr1r.js +1 -0
- package/lib/chunks/global.C-GuAavy.js +1 -0
- package/lib/chunks/global.CCgRKoj5.js +1 -0
- package/lib/chunks/layout.0C5st371.js +1 -0
- package/lib/chunks/layout.966lkT12.js +1 -0
- package/lib/chunks/layout.C4airLP9.js +1 -0
- package/lib/chunks/layout.ChiWtlly.js +1 -0
- package/lib/chunks/layout.DF2j_cdu.js +1 -0
- package/lib/chunks/layout.DjMFll_s.js +1 -0
- package/lib/chunks/layout.DutPtWqI.js +1 -0
- package/lib/chunks/utils.a5Y3RKNY.js +1 -0
- package/lib/index.js +1 -1
- package/package.json +7 -7
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
import { t as withInstall } from "./utils.BFFtVZUp.js";
|
|
2
|
+
import { t as _plugin_vue_export_helper_default } from "./_plugin-vue_export-helper.BgwWMokO.js";
|
|
3
|
+
import { t as layout_default$1 } from "./layout.FqoRQKdx.js";
|
|
4
|
+
import { n as getIconLibrary, r as iconLibraryMap, t as getIconComponent } from "./config.t_HHFoB9.js";
|
|
5
|
+
import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createSlots, createTextVNode, createVNode, markRaw, normalizeClass, onMounted, openBlock, ref, renderList, resolveDynamicComponent, shallowRef, unref, useCssVars, watch, withCtx } from "vue";
|
|
6
|
+
import { ElIcon, ElInput, ElPopover } from "element-plus";
|
|
7
|
+
import '../assets/IconSelect.css';var _hoisted_1 = { class: "icon-select-content flex flex-col overflow-hidden" }, _hoisted_2 = {
|
|
8
|
+
key: 0,
|
|
9
|
+
class: "no-data flex items-center justify-center w-full"
|
|
10
|
+
}, _hoisted_3 = {
|
|
11
|
+
key: 1,
|
|
12
|
+
class: "icon-select-grid overflow-y-auto display-grid"
|
|
13
|
+
}, _hoisted_4 = {
|
|
14
|
+
key: 0,
|
|
15
|
+
class: "loading-text flex items-center justify-center w-full"
|
|
16
|
+
}, _hoisted_5 = ["title", "onClick"];
|
|
17
|
+
const IconSelect = withInstall(/* @__PURE__ */ _plugin_vue_export_helper_default(/* @__PURE__ */ Object.assign({ name: "IconSelect" }, {
|
|
18
|
+
__name: "layout",
|
|
19
|
+
props: {
|
|
20
|
+
modelValue: {
|
|
21
|
+
type: String,
|
|
22
|
+
default: ""
|
|
23
|
+
},
|
|
24
|
+
placeholder: {
|
|
25
|
+
type: String,
|
|
26
|
+
default: "请选择图标"
|
|
27
|
+
},
|
|
28
|
+
width: {
|
|
29
|
+
type: Number,
|
|
30
|
+
default: 520
|
|
31
|
+
},
|
|
32
|
+
iconSize: {
|
|
33
|
+
type: Number,
|
|
34
|
+
default: 62
|
|
35
|
+
},
|
|
36
|
+
library: {
|
|
37
|
+
type: String,
|
|
38
|
+
default: iconLibraryMap.lingyun,
|
|
39
|
+
validator: (c) => Object.values(iconLibraryMap).includes(c)
|
|
40
|
+
},
|
|
41
|
+
iconSearch: {
|
|
42
|
+
type: Object,
|
|
43
|
+
default: null
|
|
44
|
+
},
|
|
45
|
+
iconAdd: {
|
|
46
|
+
type: Object,
|
|
47
|
+
default: null
|
|
48
|
+
},
|
|
49
|
+
iconEmpty: {
|
|
50
|
+
type: Object,
|
|
51
|
+
default: null
|
|
52
|
+
},
|
|
53
|
+
iconColor: {
|
|
54
|
+
type: String,
|
|
55
|
+
default: ""
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
emits: ["update:modelValue"],
|
|
59
|
+
setup(c, { emit: M }) {
|
|
60
|
+
useCssVars((M) => ({ v051e54a2: c.iconColor }));
|
|
61
|
+
let P = c, F = M, I = ref(!1), L = ref(""), R = ref(P.modelValue), z = ref(null), B = ref([]), V = ref(!1), H = shallowRef({
|
|
62
|
+
IconSearch: null,
|
|
63
|
+
IconAdd: null
|
|
64
|
+
}), U = async (c) => {
|
|
65
|
+
let M = c === "search" ? P.iconSearch : P.iconAdd;
|
|
66
|
+
if (M) return M;
|
|
67
|
+
try {
|
|
68
|
+
return (await import("color-message-lingyun-vue"))[c === "search" ? "IconSearch" : "IconAdd"];
|
|
69
|
+
} catch {
|
|
70
|
+
return console.warn(`color-message-lingyun-vue not found, ${c} icon will not be displayed`), null;
|
|
71
|
+
}
|
|
72
|
+
}, W = async () => {
|
|
73
|
+
let [c, M] = await Promise.all([U("search"), U("add")]);
|
|
74
|
+
return {
|
|
75
|
+
IconSearch: c,
|
|
76
|
+
IconAdd: M
|
|
77
|
+
};
|
|
78
|
+
}, G = async () => {
|
|
79
|
+
V.value = !0;
|
|
80
|
+
try {
|
|
81
|
+
let c = await getIconLibrary(P.library);
|
|
82
|
+
B.value = Object.entries(c).filter(([c]) => c.toLowerCase() && !["default", "icons"]?.includes(c)).map(([c, M]) => ({
|
|
83
|
+
name: c,
|
|
84
|
+
component: markRaw(M)
|
|
85
|
+
}));
|
|
86
|
+
} catch (c) {
|
|
87
|
+
console.error("Failed to load icons:", c), B.value = [];
|
|
88
|
+
} finally {
|
|
89
|
+
V.value = !1;
|
|
90
|
+
}
|
|
91
|
+
}, K = computed(() => L.value ? B.value.filter((c) => c.name.toLowerCase().includes(L.value.toLowerCase())) : B.value), q = async () => {
|
|
92
|
+
if (!R.value) {
|
|
93
|
+
z.value = null;
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
let c = await getIconComponent(P.library, R.value);
|
|
97
|
+
z.value = c ? markRaw(c) : null;
|
|
98
|
+
}, J = (c) => {
|
|
99
|
+
R.value = c.name, F("update:modelValue", c.name), I.value = !1;
|
|
100
|
+
};
|
|
101
|
+
return watch(() => P.modelValue, (c) => {
|
|
102
|
+
R.value = c, q();
|
|
103
|
+
}), watch(() => P.library, () => {
|
|
104
|
+
G(), q();
|
|
105
|
+
}), watch(() => R.value, () => {
|
|
106
|
+
q();
|
|
107
|
+
}), onMounted(async () => {
|
|
108
|
+
H.value = await W(), G(), q();
|
|
109
|
+
}), (M, N) => (openBlock(), createBlock(unref(ElPopover), {
|
|
110
|
+
visible: I.value,
|
|
111
|
+
"onUpdate:visible": N[1] ||= (c) => I.value = c,
|
|
112
|
+
placement: "bottom-start",
|
|
113
|
+
width: c.width,
|
|
114
|
+
trigger: "click"
|
|
115
|
+
}, {
|
|
116
|
+
reference: withCtx(() => [createElementVNode("div", { class: normalizeClass(["flex items-center pointer radius-16 justify-center w-icon-item", {
|
|
117
|
+
"select-icon-box bg-fcfdff text-202434 fz-14 flex-col": !z.value,
|
|
118
|
+
"icon-item": R.value
|
|
119
|
+
}]) }, [z.value ? (openBlock(), createBlock(unref(ElIcon), {
|
|
120
|
+
key: 0,
|
|
121
|
+
size: c.iconSize
|
|
122
|
+
}, {
|
|
123
|
+
default: withCtx(() => [(openBlock(), createBlock(resolveDynamicComponent(z.value)))]),
|
|
124
|
+
_: 1
|
|
125
|
+
}, 8, ["size"])) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [H.value.IconAdd ? (openBlock(), createBlock(unref(ElIcon), {
|
|
126
|
+
key: 0,
|
|
127
|
+
size: 16
|
|
128
|
+
}, {
|
|
129
|
+
default: withCtx(() => [(openBlock(), createBlock(resolveDynamicComponent(H.value.IconAdd)))]),
|
|
130
|
+
_: 1
|
|
131
|
+
})) : createCommentVNode("", !0), N[2] ||= createTextVNode(" 上传 ", -1)], 64))], 2)]),
|
|
132
|
+
default: withCtx(() => [createElementVNode("div", _hoisted_1, [createVNode(unref(ElInput), {
|
|
133
|
+
class: "mg-b-12",
|
|
134
|
+
modelValue: L.value,
|
|
135
|
+
"onUpdate:modelValue": N[0] ||= (c) => L.value = c,
|
|
136
|
+
placeholder: "搜索图标",
|
|
137
|
+
clearable: ""
|
|
138
|
+
}, createSlots({ _: 2 }, [H.value.IconSearch ? {
|
|
139
|
+
name: "prefix",
|
|
140
|
+
fn: withCtx(() => [createVNode(unref(ElIcon), { size: 16 }, {
|
|
141
|
+
default: withCtx(() => [(openBlock(), createBlock(resolveDynamicComponent(H.value.IconSearch)))]),
|
|
142
|
+
_: 1
|
|
143
|
+
})]),
|
|
144
|
+
key: "0"
|
|
145
|
+
} : void 0]), 1032, ["modelValue"]), K.value.length === 0 ? (openBlock(), createElementBlock("div", _hoisted_2, [createVNode(layout_default$1, {
|
|
146
|
+
icon: c.iconEmpty,
|
|
147
|
+
text: "未找到相关图标"
|
|
148
|
+
}, null, 8, ["icon"])])) : (openBlock(), createElementBlock("div", _hoisted_3, [V.value ? (openBlock(), createElementBlock("div", _hoisted_4, " 加载中... ")) : (openBlock(!0), createElementBlock(Fragment, { key: 1 }, renderList(K.value, (c) => (openBlock(), createElementBlock("div", {
|
|
149
|
+
key: c.name,
|
|
150
|
+
class: normalizeClass(["icon-item radius-8 justify-center items-center pointer flex w-icon-item", { active: R.value === c.name }]),
|
|
151
|
+
title: c.name,
|
|
152
|
+
onClick: (M) => J(c)
|
|
153
|
+
}, [createVNode(unref(ElIcon), { size: 50 }, {
|
|
154
|
+
default: withCtx(() => [(openBlock(), createBlock(resolveDynamicComponent(c.component)))]),
|
|
155
|
+
_: 2
|
|
156
|
+
}, 1024)], 10, _hoisted_5))), 128))]))])]),
|
|
157
|
+
_: 1
|
|
158
|
+
}, 8, ["visible", "width"]));
|
|
159
|
+
}
|
|
160
|
+
}), [["__scopeId", "data-v-4106dcd4"]]));
|
|
161
|
+
var IconSelect_default = IconSelect;
|
|
162
|
+
export { IconSelect_default as n, IconSelect as t };
|