ling-yun-custom-components 0.0.10
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/BatchImport.mjs +208 -0
- package/es/BuildComponents.mjs +190 -0
- package/es/CustomDialog.mjs +7 -0
- package/es/CustomDropdown.mjs +145 -0
- package/es/CustomPagination.mjs +7 -0
- package/es/CustomSelect.mjs +7 -0
- package/es/CustomTab.mjs +33 -0
- package/es/CustomTitle.mjs +7 -0
- package/es/FileList.mjs +7 -0
- package/es/GradientButton.mjs +120 -0
- package/es/IconEmpty.mjs +7 -0
- package/es/IconRenderer.mjs +42 -0
- package/es/IconSelect.mjs +120 -0
- package/es/PaginationTable.mjs +407 -0
- package/es/SearchBar.mjs +7 -0
- package/es/TreeSelect.mjs +406 -0
- package/es/TreeShowSelect.mjs +82 -0
- package/es/UpdatePasswordDialog.mjs +119 -0
- package/es/UploadFile.mjs +7 -0
- package/es/assets/BuildComponents.css +1 -0
- package/es/assets/CustomDropdown.css +1 -0
- package/es/assets/CustomTab.css +1 -0
- package/es/assets/GradientButton.css +1 -0
- package/es/assets/IconSelect.css +1 -0
- package/es/assets/PaginationTable.css +1 -0
- package/es/assets/TreeSelect.css +1 -0
- package/es/assets/TreeShowSelect.css +1 -0
- package/es/assets/UpdatePasswordDialog.css +1 -0
- package/es/assets/layout.css +0 -0
- package/es/assets/layout2.css +1 -0
- package/es/assets/layout3.css +1 -0
- package/es/assets/layout4.css +1 -0
- package/es/assets/layout5.css +1 -0
- package/es/assets/layout6.css +1 -0
- package/es/chunks/_plugin-vue_export-helper.CHgC5LLL.js +9 -0
- package/es/chunks/global.DVwnOczb.js +7828 -0
- package/es/chunks/index.D4Kbv-m1.js +8991 -0
- package/es/chunks/index.DfOANPhX.js +1729 -0
- package/es/chunks/index.DlooXR0t.js +9576 -0
- package/es/chunks/index.bCzIhWFw.js +7 -0
- package/es/chunks/layout.1y3OJ-ea.js +230 -0
- package/es/chunks/layout.2Mabaug0.js +121 -0
- package/es/chunks/layout.6MxjcpGc.js +584 -0
- package/es/chunks/layout.BJE8rMzK.js +230 -0
- package/es/chunks/layout.BKJPyxR8.js +39 -0
- package/es/chunks/layout.C0UEMbnF.js +98 -0
- package/es/chunks/layout.CTQtuC78.js +584 -0
- package/es/chunks/layout.CUOtHOHG.js +66 -0
- package/es/chunks/layout.CiNI5oQK.js +149 -0
- package/es/chunks/layout.CnANFnM1.js +584 -0
- package/es/chunks/layout.CtWHo87D.js +121 -0
- package/es/chunks/layout.Day1LJyl.js +234 -0
- package/es/chunks/layout.DeAFov0o.js +234 -0
- package/es/chunks/layout.Dvw3u-s5.js +234 -0
- package/es/chunks/layout.LCKaV7EX.js +230 -0
- package/es/chunks/layout.ZxPdKhRp.js +149 -0
- package/es/chunks/layout._A_rHZM7.js +149 -0
- package/es/chunks/layout.f58eO4Hr.js +98 -0
- package/es/chunks/layout.t3qD0LTW.js +121 -0
- package/es/chunks/layout.ypvwQzq5.js +98 -0
- package/es/index.mjs +81 -0
- package/lib/BatchImport.js +1 -0
- package/lib/BuildComponents.js +1 -0
- package/lib/CustomDialog.js +1 -0
- package/lib/CustomDropdown.js +1 -0
- package/lib/CustomPagination.js +1 -0
- package/lib/CustomSelect.js +1 -0
- package/lib/CustomTab.js +1 -0
- package/lib/CustomTitle.js +1 -0
- package/lib/FileList.js +1 -0
- package/lib/GradientButton.js +1 -0
- package/lib/IconEmpty.js +1 -0
- package/lib/IconRenderer.js +1 -0
- package/lib/IconSelect.js +1 -0
- package/lib/PaginationTable.js +1 -0
- package/lib/SearchBar.js +1 -0
- package/lib/TreeSelect.js +1 -0
- package/lib/TreeShowSelect.js +1 -0
- package/lib/UpdatePasswordDialog.js +1 -0
- package/lib/UploadFile.js +1 -0
- package/lib/assets/BuildComponents.css +1 -0
- package/lib/assets/CustomDropdown.css +1 -0
- package/lib/assets/CustomTab.css +1 -0
- package/lib/assets/GradientButton.css +1 -0
- package/lib/assets/IconSelect.css +1 -0
- package/lib/assets/PaginationTable.css +1 -0
- package/lib/assets/TreeSelect.css +1 -0
- package/lib/assets/TreeShowSelect.css +1 -0
- package/lib/assets/UpdatePasswordDialog.css +1 -0
- package/lib/assets/layout.css +0 -0
- package/lib/assets/layout2.css +1 -0
- package/lib/assets/layout3.css +1 -0
- package/lib/assets/layout4.css +1 -0
- package/lib/assets/layout5.css +1 -0
- package/lib/assets/layout6.css +1 -0
- package/lib/chunks/_plugin-vue_export-helper.BHFhmbuH.js +1 -0
- package/lib/chunks/global.Cv8u--Cy.js +1 -0
- package/lib/chunks/index.Bixsw9fA.js +23 -0
- package/lib/chunks/index.CkihWzK6.js +1 -0
- package/lib/chunks/index.CrvqvcN9.js +23 -0
- package/lib/chunks/index.DJKAT9lI.js +1 -0
- package/lib/chunks/layout.-yZzrp74.js +1 -0
- package/lib/chunks/layout.2PAIPzYY.js +1 -0
- package/lib/chunks/layout.5iOiFlVu.js +1 -0
- package/lib/chunks/layout.B-T_NE6r.js +1 -0
- package/lib/chunks/layout.BBNd1hLQ.js +1 -0
- package/lib/chunks/layout.BNJsxQ2g.js +1 -0
- package/lib/chunks/layout.BSF3ruxz.js +1 -0
- package/lib/chunks/layout.BXdjRFbn.js +1 -0
- package/lib/chunks/layout.BhL14Rqh.js +1 -0
- package/lib/chunks/layout.BmQYiD_b.js +1 -0
- package/lib/chunks/layout.CDg3sCTi.js +1 -0
- package/lib/chunks/layout.CeVldGUL.js +1 -0
- package/lib/chunks/layout.CjJiAY0w.js +1 -0
- package/lib/chunks/layout.CoSBrO12.js +1 -0
- package/lib/chunks/layout.CwA4IJ1g.js +1 -0
- package/lib/chunks/layout.DDTIwGYp.js +1 -0
- package/lib/chunks/layout.DOS2ezSW.js +1 -0
- package/lib/chunks/layout.D_TxPvRy.js +1 -0
- package/lib/chunks/layout.DfiLurg1.js +1 -0
- package/lib/chunks/layout.gqpUcAHO.js +1 -0
- package/lib/index.js +1 -0
- package/package.json +205 -0
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import { w as v } from "./chunks/index.bCzIhWFw.js";
|
|
2
|
+
import { createBlock as m, openBlock as r, unref as d, mergeProps as C, withCtx as a, renderSlot as h, createElementVNode as c, createVNode as s, toDisplayString as f, createElementBlock as V, createCommentVNode as D, Fragment as E, renderList as N } from "vue";
|
|
3
|
+
import { ElDropdown as S, ElIcon as B, ElDropdownMenu as I, ElDropdownItem as x } from "element-plus";
|
|
4
|
+
import { b as i } from "./chunks/index.D4Kbv-m1.js";
|
|
5
|
+
import { a as O } from "./chunks/index.DfOANPhX.js";
|
|
6
|
+
import { _ as T } from "./chunks/_plugin-vue_export-helper.CHgC5LLL.js";
|
|
7
|
+
import './assets/CustomDropdown.css';const M = { class: "custom-dropdown-trigger" }, $ = /* @__PURE__ */ Object.assign({
|
|
8
|
+
name: "CustomDropdown"
|
|
9
|
+
}, {
|
|
10
|
+
__name: "layout",
|
|
11
|
+
props: {
|
|
12
|
+
// 触发方式
|
|
13
|
+
trigger: {
|
|
14
|
+
type: String,
|
|
15
|
+
default: "click",
|
|
16
|
+
validator: (e) => ["hover", "click", "contextmenu"].includes(e)
|
|
17
|
+
},
|
|
18
|
+
// 下拉菜单出现的位置
|
|
19
|
+
placement: {
|
|
20
|
+
type: String,
|
|
21
|
+
default: "bottom-start",
|
|
22
|
+
validator: (e) => [
|
|
23
|
+
"top",
|
|
24
|
+
"top-start",
|
|
25
|
+
"top-end",
|
|
26
|
+
"bottom",
|
|
27
|
+
"bottom-start",
|
|
28
|
+
"bottom-end",
|
|
29
|
+
"left",
|
|
30
|
+
"left-start",
|
|
31
|
+
"left-end",
|
|
32
|
+
"right",
|
|
33
|
+
"right-start",
|
|
34
|
+
"right-end"
|
|
35
|
+
].includes(e)
|
|
36
|
+
},
|
|
37
|
+
// 是否禁用
|
|
38
|
+
disabled: {
|
|
39
|
+
type: Boolean,
|
|
40
|
+
default: !1
|
|
41
|
+
},
|
|
42
|
+
// 是否在点击菜单项后隐藏菜单
|
|
43
|
+
hideOnClick: {
|
|
44
|
+
type: Boolean,
|
|
45
|
+
default: !0
|
|
46
|
+
},
|
|
47
|
+
// 延迟显示时间
|
|
48
|
+
showTimeout: {
|
|
49
|
+
type: Number,
|
|
50
|
+
default: 250
|
|
51
|
+
},
|
|
52
|
+
// 延迟隐藏时间
|
|
53
|
+
hideTimeout: {
|
|
54
|
+
type: Number,
|
|
55
|
+
default: 150
|
|
56
|
+
},
|
|
57
|
+
// 下拉项数据
|
|
58
|
+
items: {
|
|
59
|
+
type: Array,
|
|
60
|
+
default: () => []
|
|
61
|
+
},
|
|
62
|
+
// 默认触发器占位符
|
|
63
|
+
placeholder: {
|
|
64
|
+
type: String,
|
|
65
|
+
default: "请选择"
|
|
66
|
+
},
|
|
67
|
+
// 选中值
|
|
68
|
+
modelValue: {
|
|
69
|
+
type: [String, Number, Object],
|
|
70
|
+
default: null
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
emits: [
|
|
74
|
+
i.change,
|
|
75
|
+
i.updateModelValue,
|
|
76
|
+
"command",
|
|
77
|
+
"visible-change",
|
|
78
|
+
"click"
|
|
79
|
+
],
|
|
80
|
+
setup(e, { expose: p, emit: g }) {
|
|
81
|
+
const b = e, l = g, u = (o) => {
|
|
82
|
+
const n = b.items.find(
|
|
83
|
+
(t) => t.command === o || t.value === o || t === o
|
|
84
|
+
);
|
|
85
|
+
l(i.change, o, n), l(i.updateModelValue, o, n), l("command", o, n);
|
|
86
|
+
}, w = (o) => {
|
|
87
|
+
l("visible-change", o);
|
|
88
|
+
}, k = () => {
|
|
89
|
+
l("click");
|
|
90
|
+
};
|
|
91
|
+
return p({
|
|
92
|
+
handleCommand: u
|
|
93
|
+
}), (o, n) => (r(), m(d(S), C({
|
|
94
|
+
trigger: e.trigger,
|
|
95
|
+
placement: e.placement,
|
|
96
|
+
disabled: e.disabled,
|
|
97
|
+
"hide-on-click": e.hideOnClick,
|
|
98
|
+
"show-timeout": e.showTimeout,
|
|
99
|
+
"hide-timeout": e.hideTimeout,
|
|
100
|
+
onCommand: u,
|
|
101
|
+
onVisibleChange: w,
|
|
102
|
+
onClick: k
|
|
103
|
+
}, o.$attrs), {
|
|
104
|
+
dropdown: a(() => [
|
|
105
|
+
s(d(I), null, {
|
|
106
|
+
default: a(() => [
|
|
107
|
+
h(o.$slots, "dropdown", {}, () => [
|
|
108
|
+
e.items && e.items.length > 0 ? (r(!0), V(E, { key: 0 }, N(e.items, (t, y) => (r(), m(d(x), {
|
|
109
|
+
key: t.key || y,
|
|
110
|
+
command: t.command || t.value || t,
|
|
111
|
+
disabled: t.disabled,
|
|
112
|
+
divided: t.divided,
|
|
113
|
+
icon: t.icon
|
|
114
|
+
}, {
|
|
115
|
+
default: a(() => [
|
|
116
|
+
c("span", null, f(t.label || t.text || t), 1)
|
|
117
|
+
]),
|
|
118
|
+
_: 2
|
|
119
|
+
}, 1032, ["command", "disabled", "divided", "icon"]))), 128)) : D("", !0)
|
|
120
|
+
], !0)
|
|
121
|
+
]),
|
|
122
|
+
_: 3
|
|
123
|
+
})
|
|
124
|
+
]),
|
|
125
|
+
default: a(() => [
|
|
126
|
+
h(o.$slots, "default", {}, () => [
|
|
127
|
+
c("div", M, [
|
|
128
|
+
c("span", null, f(e.placeholder), 1),
|
|
129
|
+
s(d(B), { class: "dropdown-icon" }, {
|
|
130
|
+
default: a(() => [
|
|
131
|
+
s(d(O))
|
|
132
|
+
]),
|
|
133
|
+
_: 1
|
|
134
|
+
})
|
|
135
|
+
])
|
|
136
|
+
], !0)
|
|
137
|
+
]),
|
|
138
|
+
_: 3
|
|
139
|
+
}, 16, ["trigger", "placement", "disabled", "hide-on-click", "show-timeout", "hide-timeout"]));
|
|
140
|
+
}
|
|
141
|
+
}), j = /* @__PURE__ */ T($, [["__scopeId", "data-v-07e365ee"]]), G = v(j);
|
|
142
|
+
export {
|
|
143
|
+
G as CustomDropdown,
|
|
144
|
+
G as default
|
|
145
|
+
};
|
package/es/CustomTab.mjs
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { w as m } from "./chunks/index.bCzIhWFw.js";
|
|
2
|
+
import { useModel as p, useAttrs as c, useSlots as i, createBlock as f, openBlock as _, unref as e, mergeProps as V, createSlots as v, renderList as y, withCtx as S, renderSlot as g, normalizeProps as w, guardReactiveProps as x } from "vue";
|
|
3
|
+
import { ElTabs as P } from "element-plus";
|
|
4
|
+
import { _ as b } from "./chunks/_plugin-vue_export-helper.CHgC5LLL.js";
|
|
5
|
+
import './assets/CustomTab.css';const k = {
|
|
6
|
+
__name: "layout",
|
|
7
|
+
props: {
|
|
8
|
+
modelValue: {
|
|
9
|
+
type: String,
|
|
10
|
+
default: ""
|
|
11
|
+
},
|
|
12
|
+
modelModifiers: {}
|
|
13
|
+
},
|
|
14
|
+
emits: ["update:modelValue"],
|
|
15
|
+
setup(a) {
|
|
16
|
+
const t = p(a, "modelValue"), l = c(), u = i();
|
|
17
|
+
return (n, o) => (_(), f(e(P), V({
|
|
18
|
+
modelValue: t.value,
|
|
19
|
+
"onUpdate:modelValue": o[0] || (o[0] = (r) => t.value = r)
|
|
20
|
+
}, e(l), { type: "card" }), v({ _: 2 }, [
|
|
21
|
+
y(e(u), (r, s) => ({
|
|
22
|
+
name: s,
|
|
23
|
+
fn: S((d) => [
|
|
24
|
+
g(n.$slots, s, w(x(d)), void 0, !0)
|
|
25
|
+
])
|
|
26
|
+
}))
|
|
27
|
+
]), 1040, ["modelValue"]));
|
|
28
|
+
}
|
|
29
|
+
}, B = /* @__PURE__ */ b(k, [["__scopeId", "data-v-4cd45c17"]]), h = m(B);
|
|
30
|
+
export {
|
|
31
|
+
h as CustomTab,
|
|
32
|
+
h as default
|
|
33
|
+
};
|
package/es/FileList.mjs
ADDED
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import { w as z } from "./chunks/index.bCzIhWFw.js";
|
|
2
|
+
import { computed as a, createElementBlock as c, openBlock as l, normalizeStyle as s, createElementVNode as m, normalizeClass as u, createBlock as g, createCommentVNode as b, unref as d, withCtx as S, resolveDynamicComponent as w, Fragment as $, renderList as B, toDisplayString as j } from "vue";
|
|
3
|
+
import { p as i } from "./chunks/index.D4Kbv-m1.js";
|
|
4
|
+
import { b as I } from "./chunks/index.DfOANPhX.js";
|
|
5
|
+
import { ElIcon as O } from "element-plus";
|
|
6
|
+
import { _ as R } from "./chunks/_plugin-vue_export-helper.CHgC5LLL.js";
|
|
7
|
+
import './assets/GradientButton.css';const E = /* @__PURE__ */ Object.assign({
|
|
8
|
+
name: "GradientButton"
|
|
9
|
+
}, {
|
|
10
|
+
__name: "layout",
|
|
11
|
+
props: {
|
|
12
|
+
// 文字配置对象
|
|
13
|
+
text: {
|
|
14
|
+
type: Object,
|
|
15
|
+
default: () => ({
|
|
16
|
+
// content: '新建对话',
|
|
17
|
+
// gradientColors: ['var(--theme-color-5)', 'var(--theme-color-4)'],
|
|
18
|
+
// fontSize: 14,
|
|
19
|
+
// color: 'var(--background-color-2)',
|
|
20
|
+
})
|
|
21
|
+
},
|
|
22
|
+
// 按钮配置对象
|
|
23
|
+
button: {
|
|
24
|
+
type: Object,
|
|
25
|
+
default: () => ({
|
|
26
|
+
// padding: '8px 12px',
|
|
27
|
+
// borderRadius: 100,
|
|
28
|
+
// gradientColors: ['var(--theme-color-5)', 'var(--theme-color-4)'],
|
|
29
|
+
// background: 'var(--background-color-2)',
|
|
30
|
+
})
|
|
31
|
+
},
|
|
32
|
+
// 文字排列方向:horizontal | vertical
|
|
33
|
+
direction: {
|
|
34
|
+
type: String,
|
|
35
|
+
default: i.horizontal
|
|
36
|
+
},
|
|
37
|
+
// 图标
|
|
38
|
+
icon: {
|
|
39
|
+
type: Object,
|
|
40
|
+
default: I
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
setup(o) {
|
|
44
|
+
const n = o, f = a(() => (n.text.content || "").split("") || []), p = a(() => {
|
|
45
|
+
const { gradientColors: t, borderRadius: e } = n.button;
|
|
46
|
+
return {
|
|
47
|
+
background: `linear-gradient(180deg, ${t?.[0]}, ${t?.[1]})`,
|
|
48
|
+
borderRadius: `${e}px`
|
|
49
|
+
};
|
|
50
|
+
}), v = a(() => {
|
|
51
|
+
const { borderRadius: t, padding: e, background: r } = n.button;
|
|
52
|
+
return {
|
|
53
|
+
borderRadius: `${t}px`,
|
|
54
|
+
padding: e,
|
|
55
|
+
background: r
|
|
56
|
+
};
|
|
57
|
+
}), x = a(() => ({
|
|
58
|
+
"flex items-center justify-center overflow-hidden": !0,
|
|
59
|
+
"flex-col": n.direction === i.vertical
|
|
60
|
+
})), y = a(() => {
|
|
61
|
+
const { gradientColors: t, color: e } = n.text;
|
|
62
|
+
return t?.[0] || e;
|
|
63
|
+
}), k = a(() => {
|
|
64
|
+
const { gradientColors: t, fontSize: e, color: r } = n.text, C = t?.length ? `linear-gradient(180deg, ${t?.[0]}, ${t?.[1]})` : "transparent", h = {
|
|
65
|
+
backgroundClip: "text",
|
|
66
|
+
WebkitBackgroundClip: "text",
|
|
67
|
+
WebkitTextFillColor: "transparent"
|
|
68
|
+
};
|
|
69
|
+
return {
|
|
70
|
+
background: C,
|
|
71
|
+
fontSize: `${e}px`,
|
|
72
|
+
color: r,
|
|
73
|
+
...t?.length ? h : {}
|
|
74
|
+
};
|
|
75
|
+
});
|
|
76
|
+
return (t, e) => (l(), c("div", {
|
|
77
|
+
class: "gradient-btn pointer overflow-hidden",
|
|
78
|
+
style: s(p.value)
|
|
79
|
+
}, [
|
|
80
|
+
m("div", {
|
|
81
|
+
class: "gradient-btn-content overflow-hidden",
|
|
82
|
+
style: s(v.value)
|
|
83
|
+
}, [
|
|
84
|
+
m("div", {
|
|
85
|
+
class: u(x.value)
|
|
86
|
+
}, [
|
|
87
|
+
o.icon ? (l(), g(d(O), {
|
|
88
|
+
key: 0,
|
|
89
|
+
size: o.text.fontSize,
|
|
90
|
+
color: y.value,
|
|
91
|
+
class: u({
|
|
92
|
+
"mg-r-4": o.direction === d(i).horizontal,
|
|
93
|
+
"mg-b-4": o.direction === d(i).vertical
|
|
94
|
+
})
|
|
95
|
+
}, {
|
|
96
|
+
default: S(() => [
|
|
97
|
+
(l(), g(w(o.icon)))
|
|
98
|
+
]),
|
|
99
|
+
_: 1
|
|
100
|
+
}, 8, ["size", "color", "class"])) : b("", !0),
|
|
101
|
+
f.value?.length ? (l(), c("div", {
|
|
102
|
+
key: 1,
|
|
103
|
+
class: u(["overflow-hidden flex", {
|
|
104
|
+
"flex-col": o.direction === d(i).vertical
|
|
105
|
+
}])
|
|
106
|
+
}, [
|
|
107
|
+
(l(!0), c($, null, B(f.value, (r) => (l(), c("div", {
|
|
108
|
+
style: s(k.value),
|
|
109
|
+
key: r
|
|
110
|
+
}, j(r), 5))), 128))
|
|
111
|
+
], 2)) : b("", !0)
|
|
112
|
+
], 2)
|
|
113
|
+
], 4)
|
|
114
|
+
], 4));
|
|
115
|
+
}
|
|
116
|
+
}), _ = /* @__PURE__ */ R(E, [["__scopeId", "data-v-5fab0460"]]), W = z(_);
|
|
117
|
+
export {
|
|
118
|
+
W as GradientButton,
|
|
119
|
+
W as default
|
|
120
|
+
};
|
package/es/IconEmpty.mjs
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { w as c } from "./chunks/index.bCzIhWFw.js";
|
|
2
|
+
import { createBlock as o, createCommentVNode as a, openBlock as t, unref as r, mergeProps as m, withCtx as i, resolveDynamicComponent as s } from "vue";
|
|
3
|
+
import { ElIcon as l } from "element-plus";
|
|
4
|
+
import { c as u } from "./chunks/global.DVwnOczb.js";
|
|
5
|
+
const f = /* @__PURE__ */ Object.assign({
|
|
6
|
+
name: "IconRenderer"
|
|
7
|
+
}, {
|
|
8
|
+
__name: "layout",
|
|
9
|
+
props: {
|
|
10
|
+
// 图标名称
|
|
11
|
+
iconName: {
|
|
12
|
+
type: String,
|
|
13
|
+
default: ""
|
|
14
|
+
},
|
|
15
|
+
// 图标大小
|
|
16
|
+
size: {
|
|
17
|
+
type: Number,
|
|
18
|
+
default: 16
|
|
19
|
+
},
|
|
20
|
+
// 图标颜色
|
|
21
|
+
color: {
|
|
22
|
+
type: String,
|
|
23
|
+
default: ""
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
setup(e) {
|
|
27
|
+
return (n, p) => e.iconName ? (t(), o(r(l), m({
|
|
28
|
+
key: 0,
|
|
29
|
+
size: e.size,
|
|
30
|
+
color: e.color
|
|
31
|
+
}, n.$attrs), {
|
|
32
|
+
default: i(() => [
|
|
33
|
+
(t(), o(s(r(u)[e.iconName])))
|
|
34
|
+
]),
|
|
35
|
+
_: 1
|
|
36
|
+
}, 16, ["size", "color"])) : a("", !0);
|
|
37
|
+
}
|
|
38
|
+
}), z = c(f);
|
|
39
|
+
export {
|
|
40
|
+
z as IconRenderer,
|
|
41
|
+
z as default
|
|
42
|
+
};
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import { w as N } from "./chunks/index.bCzIhWFw.js";
|
|
2
|
+
import { ref as p, computed as v, watch as S, createBlock as c, openBlock as o, unref as a, withCtx as i, createElementVNode as _, createVNode as s, createElementBlock as u, createCommentVNode as E, Fragment as h, renderList as L, normalizeClass as V, resolveDynamicComponent as I, createTextVNode as j } from "vue";
|
|
3
|
+
import { ElPopover as B, ElInput as O, ElIcon as x } from "element-plus";
|
|
4
|
+
import { c as T, b as U } from "./chunks/index.DfOANPhX.js";
|
|
5
|
+
import { c as g } from "./chunks/global.DVwnOczb.js";
|
|
6
|
+
import { I as D } from "./chunks/layout.CUOtHOHG.js";
|
|
7
|
+
import { _ as F } from "./chunks/_plugin-vue_export-helper.CHgC5LLL.js";
|
|
8
|
+
import './assets/IconSelect.css';const P = { class: "icon-select-content flex flex-col overflow-hidden" }, $ = { class: "icon-select-grid overflow-y-auto display-grid" }, q = ["title", "onClick"], A = {
|
|
9
|
+
key: 0,
|
|
10
|
+
class: "no-data"
|
|
11
|
+
}, G = /* @__PURE__ */ Object.assign({
|
|
12
|
+
name: "IconSelect"
|
|
13
|
+
}, {
|
|
14
|
+
__name: "layout",
|
|
15
|
+
props: {
|
|
16
|
+
modelValue: {
|
|
17
|
+
type: String,
|
|
18
|
+
default: ""
|
|
19
|
+
},
|
|
20
|
+
placeholder: {
|
|
21
|
+
type: String,
|
|
22
|
+
default: "请选择图标"
|
|
23
|
+
},
|
|
24
|
+
// 宽度
|
|
25
|
+
width: {
|
|
26
|
+
type: Number,
|
|
27
|
+
default: 520
|
|
28
|
+
},
|
|
29
|
+
// 图标大小
|
|
30
|
+
iconSize: {
|
|
31
|
+
type: Number,
|
|
32
|
+
default: 62
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
emits: ["update:modelValue"],
|
|
36
|
+
setup(d, { emit: k }) {
|
|
37
|
+
const y = d, C = k, m = p(!1), r = p(""), n = p(y.modelValue), b = v(() => Object.entries(g).filter(([e]) => e.toLowerCase().includes("menu")).map(([e, l]) => ({
|
|
38
|
+
name: e,
|
|
39
|
+
component: l
|
|
40
|
+
}))), w = v(() => r.value ? b.value.filter(
|
|
41
|
+
(e) => e.name.toLowerCase().includes(r.value.toLowerCase())
|
|
42
|
+
) : b.value), f = v(() => n.value && g[n.value] || null), z = (e) => {
|
|
43
|
+
n.value = e.name, C("update:modelValue", e.name), m.value = !1;
|
|
44
|
+
};
|
|
45
|
+
return S(
|
|
46
|
+
() => y.modelValue,
|
|
47
|
+
(e) => {
|
|
48
|
+
n.value = e;
|
|
49
|
+
}
|
|
50
|
+
), (e, l) => (o(), c(a(B), {
|
|
51
|
+
visible: m.value,
|
|
52
|
+
"onUpdate:visible": l[1] || (l[1] = (t) => m.value = t),
|
|
53
|
+
placement: "bottom-start",
|
|
54
|
+
width: d.width,
|
|
55
|
+
trigger: "click"
|
|
56
|
+
}, {
|
|
57
|
+
reference: i(() => [
|
|
58
|
+
_("div", {
|
|
59
|
+
class: V(["flex items-center pointer radius-16 justify-center w-icon-item", {
|
|
60
|
+
"select-icon-box bg-fcfdff text-202434 fz-14 flex-col": !f.value,
|
|
61
|
+
"icon-item": n.value
|
|
62
|
+
}])
|
|
63
|
+
}, [
|
|
64
|
+
f.value ? (o(), c(a(x), {
|
|
65
|
+
key: 0,
|
|
66
|
+
size: d.iconSize
|
|
67
|
+
}, {
|
|
68
|
+
default: i(() => [
|
|
69
|
+
(o(), c(I(f.value)))
|
|
70
|
+
]),
|
|
71
|
+
_: 1
|
|
72
|
+
}, 8, ["size"])) : (o(), u(h, { key: 1 }, [
|
|
73
|
+
s(a(x), { size: 16 }, {
|
|
74
|
+
default: i(() => [
|
|
75
|
+
s(a(U))
|
|
76
|
+
]),
|
|
77
|
+
_: 1
|
|
78
|
+
}),
|
|
79
|
+
l[2] || (l[2] = j(" 上传 ", -1))
|
|
80
|
+
], 64))
|
|
81
|
+
], 2)
|
|
82
|
+
]),
|
|
83
|
+
default: i(() => [
|
|
84
|
+
_("div", P, [
|
|
85
|
+
s(a(O), {
|
|
86
|
+
class: "mg-b-12",
|
|
87
|
+
modelValue: r.value,
|
|
88
|
+
"onUpdate:modelValue": l[0] || (l[0] = (t) => r.value = t),
|
|
89
|
+
placeholder: "搜索图标",
|
|
90
|
+
"prefix-icon": a(T),
|
|
91
|
+
clearable: ""
|
|
92
|
+
}, null, 8, ["modelValue", "prefix-icon"]),
|
|
93
|
+
_("div", $, [
|
|
94
|
+
(o(!0), u(h, null, L(w.value, (t) => (o(), u("div", {
|
|
95
|
+
key: t.name,
|
|
96
|
+
class: V(["icon-item radius-8 justify-center items-center pointer flex w-icon-item", { active: n.value === t.name }]),
|
|
97
|
+
title: t.name,
|
|
98
|
+
onClick: (J) => z(t)
|
|
99
|
+
}, [
|
|
100
|
+
s(a(x), { size: 50 }, {
|
|
101
|
+
default: i(() => [
|
|
102
|
+
(o(), c(I(t.component)))
|
|
103
|
+
]),
|
|
104
|
+
_: 2
|
|
105
|
+
}, 1024)
|
|
106
|
+
], 10, q))), 128))
|
|
107
|
+
]),
|
|
108
|
+
w.value.length === 0 ? (o(), u("div", A, [
|
|
109
|
+
s(D, { text: "未找到相关图标" })
|
|
110
|
+
])) : E("", !0)
|
|
111
|
+
])
|
|
112
|
+
]),
|
|
113
|
+
_: 1
|
|
114
|
+
}, 8, ["visible", "width"]));
|
|
115
|
+
}
|
|
116
|
+
}), H = /* @__PURE__ */ F(G, [["__scopeId", "data-v-b6a428ec"]]), Z = N(H);
|
|
117
|
+
export {
|
|
118
|
+
Z as IconSelect,
|
|
119
|
+
Z as default
|
|
120
|
+
};
|