@pubinfo/module-rbac 2.0.0-rc.5 → 2.0.1
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/dist/{IconSelect-Ct5FkeHI.js → IconSelect-BEetYi8i.js} +1 -1
- package/dist/{IconSelect-HAhfS6hd.js → IconSelect-D50456Yh.js} +210 -193
- package/dist/IconSelect.css +1 -1
- package/dist/{ResourceEdit-DF-2_zoi.js → ResourceEdit-BVdRFGOK.js} +14 -13
- package/dist/{ResourceEdit-oAPLPUf0.js → ResourceEdit-JPc5dCoU.js} +2 -2
- package/dist/index.css +1 -1
- package/dist/index.js +8 -8
- package/dist/{resource-CyI9ZpmF.js → resource-Bzx2Tx8m.js} +2 -2
- package/package.json +3 -3
- package/src/components/ResourceIcones/Select.vue +53 -48
- package/src/views/resource/components/IconSelect.vue +77 -31
- package/src/views/resource/components/ResourceEdit.vue +29 -31
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { b as e } from "./_plugin-vue_export-helper-DziIhCOI.js";
|
|
2
2
|
import { d as t } from "./enum-BMY6bmPA.js";
|
|
3
3
|
import { PubinfoIcon as n, getAllIconModules as r } from "pubinfo";
|
|
4
|
-
import { Fragment as i, computed as a, createBlock as o, createCommentVNode as s, createElementBlock as c, createElementVNode as l, createTextVNode as u, createVNode as d, defineComponent as f, normalizeClass as p, normalizeStyle as m, openBlock as h,
|
|
5
|
-
import * as
|
|
6
|
-
import { Empty as
|
|
7
|
-
import { Button as ee, Empty as te, FormItemRest as ne, Input as
|
|
8
|
-
import './IconSelect.css';const
|
|
9
|
-
var
|
|
4
|
+
import { Fragment as i, computed as a, createBlock as o, createCommentVNode as s, createElementBlock as c, createElementVNode as l, createTextVNode as u, createVNode as d, defineComponent as f, normalizeClass as p, normalizeStyle as m, openBlock as h, reactive as g, ref as _, renderList as v, renderSlot as y, resolveComponent as b, toDisplayString as x, unref as S, useModel as C, watch as w, withCtx as T } from "vue";
|
|
5
|
+
import * as E from "@ant-design/icons-vue";
|
|
6
|
+
import { Empty as D } from "ant-design-vue";
|
|
7
|
+
import { Button as ee, Empty as te, FormItem as O, FormItemRest as ne, Input as k, InputNumber as A, Modal as re, Pagination as ie, RadioButton as ae, RadioGroup as oe, Tooltip as se } from "ant-design-vue/es";
|
|
8
|
+
import './IconSelect.css';const j = { class: "flex flex-col gap-3 w-full select-none" }, M = { class: "flex items-center gap-3" }, N = { class: "relative inline-flex items-center" }, P = ["disabled"], F = ["value", "disabled"], I = { class: "flex items-center gap-3" }, L = { class: "relative inline-flex items-center" }, R = ["disabled"], z = ["value", "disabled"], B = { class: "flex items-center gap-3" }, V = { class: "flex items-center gap-3" };
|
|
9
|
+
var H = /* @__PURE__ */ f({
|
|
10
10
|
name: "ResourceIconesBoxColorPicker",
|
|
11
11
|
__name: "BoxColorPicker",
|
|
12
12
|
props: {
|
|
@@ -50,40 +50,40 @@ var B = /* @__PURE__ */ f({
|
|
|
50
50
|
}
|
|
51
51
|
return 6;
|
|
52
52
|
}
|
|
53
|
-
let u = a(n.background), f =
|
|
53
|
+
let u = a(n.background), f = _(u.from), g = _(u.to), v = _(i(n.angle)), y = _(o(n.radius)), b = _(null), x = _(null);
|
|
54
54
|
function S() {
|
|
55
55
|
if (n.disabled) return;
|
|
56
56
|
let e = b.value;
|
|
57
57
|
e && (e.style.width = "16px", e.style.height = "16px", e.click());
|
|
58
58
|
}
|
|
59
|
-
function
|
|
59
|
+
function C() {
|
|
60
60
|
if (n.disabled) return;
|
|
61
61
|
let e = x.value;
|
|
62
62
|
e && (e.style.width = "16px", e.style.height = "16px", e.click());
|
|
63
63
|
}
|
|
64
|
-
return
|
|
64
|
+
return w([
|
|
65
65
|
f,
|
|
66
|
-
|
|
66
|
+
g,
|
|
67
67
|
v,
|
|
68
68
|
y
|
|
69
69
|
], () => {
|
|
70
70
|
r("update:background", {
|
|
71
71
|
from: f.value,
|
|
72
|
-
to:
|
|
72
|
+
to: g.value
|
|
73
73
|
}), r("update:angle", v.value), r("update:radius", y.value);
|
|
74
|
-
}, { immediate: !0 }),
|
|
74
|
+
}, { immediate: !0 }), w(() => n.background, (e) => {
|
|
75
75
|
if (e == null) return;
|
|
76
76
|
let t = a(e);
|
|
77
|
-
f.value = t.from,
|
|
78
|
-
}),
|
|
77
|
+
f.value = t.from, g.value = t.to;
|
|
78
|
+
}), w(() => n.angle, (e) => {
|
|
79
79
|
e != null && (v.value = i(e));
|
|
80
|
-
}),
|
|
80
|
+
}), w(() => n.radius, (e) => {
|
|
81
81
|
e != null && (y.value = o(e));
|
|
82
82
|
}), (e, t) => {
|
|
83
|
-
let r =
|
|
84
|
-
return h(), c("div",
|
|
83
|
+
let r = k, i = A;
|
|
84
|
+
return h(), c("div", j, [
|
|
85
85
|
s(" 起始色:紧凑输入(前缀色块 + 文本),隐藏原生 color 触发器 "),
|
|
86
|
-
l("div",
|
|
86
|
+
l("div", M, [t[6] ||= l("label", { class: "text-12px opacity-70 w-14 shrink-0" }, "起始色", -1), d(r, {
|
|
87
87
|
value: f.value,
|
|
88
88
|
"onUpdate:value": t[1] ||= (e) => f.value = e,
|
|
89
89
|
disabled: n.disabled,
|
|
@@ -91,14 +91,14 @@ var B = /* @__PURE__ */ f({
|
|
|
91
91
|
size: "small",
|
|
92
92
|
class: "flex-1 min-w-0"
|
|
93
93
|
}, {
|
|
94
|
-
prefix:
|
|
94
|
+
prefix: T(() => [l("div", N, [
|
|
95
95
|
l("button", {
|
|
96
96
|
type: "button",
|
|
97
97
|
disabled: n.disabled,
|
|
98
98
|
class: p(["w-4 h-4 rounded border border-gray-300 dark:border-gray-700", n.disabled ? "opacity-50 cursor-not-allowed" : ""]),
|
|
99
99
|
style: m({ background: f.value }),
|
|
100
100
|
onClick: S
|
|
101
|
-
}, null, 14,
|
|
101
|
+
}, null, 14, P),
|
|
102
102
|
s(" 透明绝对定位的原生 input,用于正确锚定系统取色器位置 "),
|
|
103
103
|
l("input", {
|
|
104
104
|
ref_key: "fromColorPickerRef",
|
|
@@ -112,42 +112,42 @@ var B = /* @__PURE__ */ f({
|
|
|
112
112
|
height: "16px"
|
|
113
113
|
},
|
|
114
114
|
onInput: t[0] ||= (e) => f.value = e.target.value
|
|
115
|
-
}, null, 40,
|
|
115
|
+
}, null, 40, F)
|
|
116
116
|
])]),
|
|
117
117
|
_: 1
|
|
118
118
|
}, 8, ["value", "disabled"])]),
|
|
119
119
|
s(" 结束色:紧凑输入(前缀色块 + 文本),隐藏原生 color 触发器 "),
|
|
120
|
-
l("div",
|
|
121
|
-
value:
|
|
122
|
-
"onUpdate:value": t[3] ||= (e) =>
|
|
120
|
+
l("div", I, [t[7] ||= l("label", { class: "text-12px opacity-70 w-14 shrink-0" }, "结束色", -1), d(r, {
|
|
121
|
+
value: g.value,
|
|
122
|
+
"onUpdate:value": t[3] ||= (e) => g.value = e,
|
|
123
123
|
disabled: n.disabled,
|
|
124
124
|
placeholder: "#35C724",
|
|
125
125
|
size: "small",
|
|
126
126
|
class: "flex-1 min-w-0"
|
|
127
127
|
}, {
|
|
128
|
-
prefix:
|
|
128
|
+
prefix: T(() => [l("div", L, [l("button", {
|
|
129
129
|
type: "button",
|
|
130
130
|
disabled: n.disabled,
|
|
131
131
|
class: p(["w-4 h-4 rounded border border-gray-300 dark:border-gray-700", n.disabled ? "opacity-50 cursor-not-allowed" : ""]),
|
|
132
|
-
style: m({ background:
|
|
133
|
-
onClick:
|
|
134
|
-
}, null, 14,
|
|
132
|
+
style: m({ background: g.value }),
|
|
133
|
+
onClick: C
|
|
134
|
+
}, null, 14, R), l("input", {
|
|
135
135
|
ref_key: "toColorPickerRef",
|
|
136
136
|
ref: x,
|
|
137
137
|
type: "color",
|
|
138
|
-
value:
|
|
138
|
+
value: g.value,
|
|
139
139
|
disabled: n.disabled,
|
|
140
140
|
class: "absolute left-0 top-0 opacity-0 pointer-events-none",
|
|
141
141
|
style: {
|
|
142
142
|
width: "16px",
|
|
143
143
|
height: "16px"
|
|
144
144
|
},
|
|
145
|
-
onInput: t[2] ||= (e) =>
|
|
146
|
-
}, null, 40,
|
|
145
|
+
onInput: t[2] ||= (e) => g.value = e.target.value
|
|
146
|
+
}, null, 40, z)])]),
|
|
147
147
|
_: 1
|
|
148
148
|
}, 8, ["value", "disabled"])]),
|
|
149
149
|
s(" 角度:仅使用数字输入,节省横向空间 "),
|
|
150
|
-
l("div",
|
|
150
|
+
l("div", B, [
|
|
151
151
|
t[8] ||= l("label", { class: "text-12px opacity-70 w-14 shrink-0" }, "角度", -1),
|
|
152
152
|
d(i, {
|
|
153
153
|
value: v.value,
|
|
@@ -162,7 +162,7 @@ var B = /* @__PURE__ */ f({
|
|
|
162
162
|
t[9] ||= l("span", { class: "text-12px opacity-70" }, "deg", -1)
|
|
163
163
|
]),
|
|
164
164
|
s(" 圆角:仅使用数字输入,节省横向空间 "),
|
|
165
|
-
l("div",
|
|
165
|
+
l("div", V, [
|
|
166
166
|
t[10] ||= l("label", { class: "text-12px opacity-70 w-14 shrink-0" }, "圆角", -1),
|
|
167
167
|
d(i, {
|
|
168
168
|
value: y.value,
|
|
@@ -179,7 +179,7 @@ var B = /* @__PURE__ */ f({
|
|
|
179
179
|
]);
|
|
180
180
|
};
|
|
181
181
|
}
|
|
182
|
-
}), ce =
|
|
182
|
+
}), ce = H;
|
|
183
183
|
const le = { class: "flex gap-4 min-h-[600px]" }, ue = { class: "w-58 flex flex-col border-r border-[#e5e7eb] dark:border-[#30363d] pr-3" }, de = { class: "mb-3" }, fe = { class: "flex-1 overflow-auto space-y-1 pr-1" }, pe = ["onClick"], me = { class: "truncate max-w-[120px]" }, he = { class: "ml-2 inline-block min-w-6 text-center text-11px rounded bg-[#eef1f5] dark:bg-[#2d3339] px-1 text-[#5d6671] dark:text-[#9aa3ad]" }, ge = { class: "flex-1 flex flex-col min-w-0" }, _e = { class: "grid grid-cols-6 gap-3 auto-rows-[96px] overflow-auto flex-1 p-1" }, ve = { class: "text-12px leading-tight space-y-1" }, ye = { class: "font-medium" }, be = {
|
|
184
184
|
key: 0,
|
|
185
185
|
class: "opacity-70"
|
|
@@ -189,8 +189,14 @@ const le = { class: "flex gap-4 min-h-[600px]" }, ue = { class: "w-58 flex flex-
|
|
|
189
189
|
}, we = {
|
|
190
190
|
key: 0,
|
|
191
191
|
class: "relative w-60 flex flex-col border-l border-[#e5e7eb] dark:border-[#30363d] pl-4 min-h-0"
|
|
192
|
-
}, Te = { class: "flex flex-col flex-1 w-full rounded-md border border-dashed border-[#d0d7de] dark:border-[#30363d] text-12px text-[#6b7280] dark:text-[#94a3b8] p-3 overflow-hidden" }, Ee = { class: "shrink-0 flex justify-center items-center pb-4 border-b border-b-dashed border-b-[#d0d7de] dark:border-b-[#30363d]" }, De = { class: "w-8 h-8 flex justify-center items-center" }, Oe = { class: "w-8 h-8 flex justify-center items-center" }, ke = { class: "w-8 h-8 flex justify-center items-center" }, Ae = { class: "flex-1 w-full mt-3 px-2 overflow-auto space-y-3" }, je = { class: "flex flex-col justify-start w-full opacity-100" }, Me = { class: "flex items-center gap-3 w-full" }, Ne = { class: "relative inline-flex items-center" },
|
|
193
|
-
|
|
192
|
+
}, Te = { class: "flex flex-col flex-1 w-full rounded-md border border-dashed border-[#d0d7de] dark:border-[#30363d] text-12px text-[#6b7280] dark:text-[#94a3b8] p-3 overflow-hidden" }, Ee = { class: "shrink-0 flex justify-center items-center pb-4 border-b border-b-dashed border-b-[#d0d7de] dark:border-b-[#30363d]" }, De = { class: "w-8 h-8 flex justify-center items-center" }, Oe = { class: "w-8 h-8 flex justify-center items-center" }, ke = { class: "w-8 h-8 flex justify-center items-center" }, Ae = { class: "flex-1 w-full mt-3 px-2 overflow-auto space-y-3" }, je = { class: "flex flex-col justify-start w-full opacity-100" }, Me = { class: "flex items-center gap-3 w-full" }, Ne = { class: "flex flex-col" }, Pe = { class: "relative inline-flex items-center" }, Fe = ["disabled"], Ie = ["value", "disabled"], Le = {
|
|
193
|
+
key: 0,
|
|
194
|
+
class: "text-8px opacity-70"
|
|
195
|
+
}, Re = { class: "w-full mt-auto flex aspect-square" }, ze = { class: "flex-1 w-full h-full py-4 rounded-md border-t border-t-dashed border-t-[#d0d7de] dark:border-t-[#30363d] flex flex-col items-center gap-2" }, Be = {
|
|
196
|
+
key: 0,
|
|
197
|
+
class: "w-full h-full flex items-center justify-center"
|
|
198
|
+
}, Ve = { class: "mt-4 flex justify-end gap-2" };
|
|
199
|
+
var U = /* @__PURE__ */ f({
|
|
194
200
|
name: "ResourceIconesSelect",
|
|
195
201
|
__name: "Select",
|
|
196
202
|
props: {
|
|
@@ -219,25 +225,25 @@ var V = /* @__PURE__ */ f({
|
|
|
219
225
|
"update:iconColor"
|
|
220
226
|
],
|
|
221
227
|
setup(e) {
|
|
222
|
-
let t =
|
|
228
|
+
let t = C(e, "modelValue"), f = C(e, "boxType"), g = C(e, "angle"), b = C(e, "background"), O = C(e, "radius"), A = C(e, "iconColor"), j = _(t.value), M = _(f.value || "null"), N = _(g.value ?? 65), P = _(b.value ?? {
|
|
223
229
|
from: "#65E54A",
|
|
224
230
|
to: "#35C724"
|
|
225
|
-
}), F =
|
|
231
|
+
}), F = _(O.value ?? 6), I = _(A.value ?? ""), L = _(null), R = _(!1);
|
|
226
232
|
function z() {
|
|
227
|
-
j.value = t.value, M.value = f.value || "null", N.value =
|
|
228
|
-
let e =
|
|
233
|
+
j.value = t.value, M.value = f.value || "null", N.value = g.value ?? 65;
|
|
234
|
+
let e = b.value;
|
|
229
235
|
P.value = typeof e == "string" ? e : e ? { ...e } : {
|
|
230
236
|
from: "#65E54A",
|
|
231
237
|
to: "#35C724"
|
|
232
|
-
}, F.value =
|
|
238
|
+
}, F.value = O.value ?? 6, I.value = A.value ?? "", R.value = !0;
|
|
233
239
|
}
|
|
234
240
|
function B() {
|
|
235
241
|
R.value = !1;
|
|
236
242
|
}
|
|
237
243
|
function V() {
|
|
238
|
-
t.value = j.value, f.value = M.value,
|
|
244
|
+
t.value = j.value, f.value = M.value, g.value = N.value;
|
|
239
245
|
let e = P.value;
|
|
240
|
-
|
|
246
|
+
b.value = typeof e == "string" ? e : e && { ...e }, O.value = F.value, A.value = I.value, R.value = !1;
|
|
241
247
|
}
|
|
242
248
|
function H(e) {
|
|
243
249
|
let t = e.split(/[\\/]/).pop() || e;
|
|
@@ -250,7 +256,7 @@ var V = /* @__PURE__ */ f({
|
|
|
250
256
|
e.set(n, t);
|
|
251
257
|
}
|
|
252
258
|
return e;
|
|
253
|
-
}), W = a(() => Object.keys(
|
|
259
|
+
}), W = a(() => Object.keys(E).filter((e) => /(?:Outlined|Filled|TwoTone)$/.test(e)).map((e) => `antd:${e}`).sort()), G = a(() => {
|
|
254
260
|
let e = Array.from(U.value.keys()), t = e.includes("local"), n = e.filter((e) => e !== "local").sort();
|
|
255
261
|
return [
|
|
256
262
|
{
|
|
@@ -270,7 +276,7 @@ var V = /* @__PURE__ */ f({
|
|
|
270
276
|
value: "antd"
|
|
271
277
|
}
|
|
272
278
|
];
|
|
273
|
-
}), K =
|
|
279
|
+
}), K = _("all"), q = _(""), J = a(() => {
|
|
274
280
|
let e = [];
|
|
275
281
|
for (let [t, n] of U.value.entries()) n.forEach((n) => {
|
|
276
282
|
t === "local" ? e.push({
|
|
@@ -289,47 +295,47 @@ var V = /* @__PURE__ */ f({
|
|
|
289
295
|
let e = q.value.trim().toLowerCase();
|
|
290
296
|
return e ? Y.value.filter((t) => t.name.toLowerCase().includes(e)) : Y.value;
|
|
291
297
|
});
|
|
292
|
-
function
|
|
298
|
+
function He(e) {
|
|
293
299
|
return e === "all" ? J.value.length : e === "antd" ? J.value.filter((e) => e.module === "antd").length : J.value.filter((t) => t.module === e).length;
|
|
294
300
|
}
|
|
295
|
-
let Z =
|
|
301
|
+
let Z = _(1), Q = a(() => Math.max(1, Math.ceil(X.value.length / 30))), Ue = a(() => {
|
|
296
302
|
let e = (Z.value - 1) * 30;
|
|
297
303
|
return X.value.slice(e, e + 30);
|
|
298
304
|
});
|
|
299
|
-
|
|
305
|
+
w([q, K], () => {
|
|
300
306
|
Z.value = 1;
|
|
301
|
-
}),
|
|
307
|
+
}), w(X, () => {
|
|
302
308
|
Z.value > Q.value && (Z.value = Q.value);
|
|
303
309
|
});
|
|
304
|
-
function
|
|
310
|
+
function We(e) {
|
|
305
311
|
Z.value = e;
|
|
306
312
|
}
|
|
307
|
-
function
|
|
313
|
+
function Ge(e) {
|
|
308
314
|
j.value = e.name;
|
|
309
315
|
}
|
|
310
|
-
let
|
|
311
|
-
function
|
|
316
|
+
let Ke = D.PRESENTED_IMAGE_SIMPLE;
|
|
317
|
+
function qe() {
|
|
312
318
|
if (!(j.value || "").startsWith("antd:")) return;
|
|
313
319
|
let e = L.value;
|
|
314
320
|
e && (e.style.width = "16px", e.style.height = "16px", e.click());
|
|
315
321
|
}
|
|
316
322
|
let $ = a(() => (j.value || "").startsWith("antd:"));
|
|
317
|
-
return
|
|
323
|
+
return w(M, (e, t) => {
|
|
318
324
|
t === "null" && e !== "null" && !I.value && (I.value = "#ffffff");
|
|
319
325
|
}), (e, r) => {
|
|
320
|
-
let a = se, f =
|
|
321
|
-
return h(), c(i, null, [
|
|
326
|
+
let a = se, f = k, g = ie, _ = te, b = ae, C = oe, w = ee, E = re, D = ne;
|
|
327
|
+
return h(), c(i, null, [y(e.$slots, "default", { open: z }, () => [d(f, {
|
|
322
328
|
value: t.value,
|
|
323
329
|
readonly: "",
|
|
324
330
|
onClick: z
|
|
325
331
|
}, {
|
|
326
|
-
addonAfter:
|
|
327
|
-
title:
|
|
332
|
+
addonAfter: T(() => [d(a, null, {
|
|
333
|
+
title: T(() => [d(S(n), {
|
|
328
334
|
name: t.value || "",
|
|
329
335
|
size: "40px",
|
|
330
336
|
class: "cursor-default"
|
|
331
337
|
}, null, 8, ["name"])]),
|
|
332
|
-
default:
|
|
338
|
+
default: T(() => [d(S(n), {
|
|
333
339
|
name: t.value || "",
|
|
334
340
|
size: "20px",
|
|
335
341
|
class: "cursor-default"
|
|
@@ -337,8 +343,8 @@ var V = /* @__PURE__ */ f({
|
|
|
337
343
|
_: 1
|
|
338
344
|
})]),
|
|
339
345
|
_: 1
|
|
340
|
-
}, 8, ["value"])], !0), d(
|
|
341
|
-
default:
|
|
346
|
+
}, 8, ["value"])], !0), d(D, null, {
|
|
347
|
+
default: T(() => [d(E, {
|
|
342
348
|
open: R.value,
|
|
343
349
|
"onUpdate:open": r[7] ||= (e) => R.value = e,
|
|
344
350
|
title: "选择图标",
|
|
@@ -347,7 +353,7 @@ var V = /* @__PURE__ */ f({
|
|
|
347
353
|
"destroy-on-close": "",
|
|
348
354
|
onCancel: B
|
|
349
355
|
}, {
|
|
350
|
-
default:
|
|
356
|
+
default: T(() => [l("div", le, [
|
|
351
357
|
s(" 左侧模块列表 "),
|
|
352
358
|
l("div", ue, [l("div", de, [d(f, {
|
|
353
359
|
value: q.value,
|
|
@@ -357,28 +363,28 @@ var V = /* @__PURE__ */ f({
|
|
|
357
363
|
placeholder: "搜索图标",
|
|
358
364
|
class: "h-9 text-13px"
|
|
359
365
|
}, {
|
|
360
|
-
prefix:
|
|
366
|
+
prefix: T(() => [d(S(n), {
|
|
361
367
|
name: "i-carbon-search",
|
|
362
368
|
size: "16",
|
|
363
369
|
class: "text-[#7a869a]"
|
|
364
370
|
})]),
|
|
365
371
|
_: 1
|
|
366
|
-
}, 8, ["value"])]), l("div", fe, [(h(!0), c(i, null,
|
|
372
|
+
}, 8, ["value"])]), l("div", fe, [(h(!0), c(i, null, v(G.value, (e) => (h(), c("div", {
|
|
367
373
|
key: e.value,
|
|
368
374
|
class: p(["flex items-center justify-between px-3 py-2 rounded-md cursor-pointer text-13px border border-transparent hover:bg-[#f3f6fa] dark:hover:bg-[#262c33] transition", K.value === e.value ? "bg-[#eef5ff] dark:bg-[#1e2a33] border-[#1677ff] text-[#1677ff] font-medium" : "text-[#4b5563]"]),
|
|
369
375
|
onClick: (t) => K.value = e.value
|
|
370
|
-
}, [l("span", me,
|
|
376
|
+
}, [l("span", me, x(e.label), 1), l("span", he, x(He(e.value)), 1)], 10, pe))), 128))])]),
|
|
371
377
|
s(" 主体 "),
|
|
372
378
|
l("div", ge, [X.value.length ? (h(), c(i, { key: 0 }, [
|
|
373
|
-
l("div", _e, [(h(!0), c(i, null,
|
|
379
|
+
l("div", _e, [(h(!0), c(i, null, v(Ue.value, (e) => (h(), o(a, {
|
|
374
380
|
key: `${e.module || ""}:${e.name}`,
|
|
375
381
|
"mouse-enter-delay": .35
|
|
376
382
|
}, {
|
|
377
|
-
title:
|
|
378
|
-
default:
|
|
383
|
+
title: T(() => [l("div", ve, [l("div", ye, x(e.name), 1), e.module ? (h(), c("div", be, " 模块: " + x(e.module), 1)) : s("v-if", !0)])]),
|
|
384
|
+
default: T(() => [l("div", {
|
|
379
385
|
class: p(["group relative flex flex-col items-center justify-center cursor-pointer rounded-md border", j.value === e.name ? "border-solid border-[#1677ff]" : "border-dashed border-[#e5e7eb] dark:border-[#30363d]"]),
|
|
380
|
-
onClick: (t) =>
|
|
381
|
-
}, [d(
|
|
386
|
+
onClick: (t) => Ge(e)
|
|
387
|
+
}, [d(S(n), {
|
|
382
388
|
name: e.name,
|
|
383
389
|
size: "30px"
|
|
384
390
|
}, null, 8, ["name"])], 10, xe)]),
|
|
@@ -391,10 +397,10 @@ var V = /* @__PURE__ */ f({
|
|
|
391
397
|
total: X.value.length,
|
|
392
398
|
"show-size-changer": !1,
|
|
393
399
|
"show-quick-jumper": "",
|
|
394
|
-
onChange:
|
|
400
|
+
onChange: We
|
|
395
401
|
}, null, 8, ["current", "total"])])
|
|
396
|
-
], 64)) : (h(), c("div", Ce, [d(
|
|
397
|
-
image:
|
|
402
|
+
], 64)) : (h(), c("div", Ce, [d(_, {
|
|
403
|
+
image: S(Ke),
|
|
398
404
|
description: "没有匹配的图标"
|
|
399
405
|
}, null, 8, ["image"])]))]),
|
|
400
406
|
s(" 右侧预留区域 "),
|
|
@@ -406,16 +412,16 @@ var V = /* @__PURE__ */ f({
|
|
|
406
412
|
"onUpdate:value": r[1] ||= (e) => M.value = e,
|
|
407
413
|
class: "flex justify-center items-center"
|
|
408
414
|
}, {
|
|
409
|
-
default:
|
|
410
|
-
d(
|
|
411
|
-
default:
|
|
415
|
+
default: T(() => [
|
|
416
|
+
d(b, { value: "null" }, {
|
|
417
|
+
default: T(() => [l("div", De, [d(S(n), {
|
|
412
418
|
name: j.value,
|
|
413
419
|
size: 16
|
|
414
420
|
}, null, 8, ["name", "size"])])]),
|
|
415
421
|
_: 1
|
|
416
422
|
}),
|
|
417
|
-
d(
|
|
418
|
-
default:
|
|
423
|
+
d(b, { value: "square" }, {
|
|
424
|
+
default: T(() => [l("div", Oe, [d(S(n), {
|
|
419
425
|
name: j.value,
|
|
420
426
|
box: "square",
|
|
421
427
|
size: 24,
|
|
@@ -424,8 +430,8 @@ var V = /* @__PURE__ */ f({
|
|
|
424
430
|
}, null, 8, ["name"])])]),
|
|
425
431
|
_: 1
|
|
426
432
|
}),
|
|
427
|
-
d(
|
|
428
|
-
default:
|
|
433
|
+
d(b, { value: "prism" }, {
|
|
434
|
+
default: T(() => [l("div", ke, [d(S(n), {
|
|
429
435
|
name: j.value,
|
|
430
436
|
box: "prism",
|
|
431
437
|
size: 24,
|
|
@@ -455,7 +461,7 @@ var V = /* @__PURE__ */ f({
|
|
|
455
461
|
"disabled"
|
|
456
462
|
])]),
|
|
457
463
|
s(" 图标颜色设置:始终显示;非 AntD 图标时禁用 "),
|
|
458
|
-
l("div", Me, [r[9] ||= l("label", { class: "text-12px opacity-70 w-14 shrink-0" }, "图标色", -1), d(f, {
|
|
464
|
+
l("div", Me, [r[9] ||= l("label", { class: "text-12px opacity-70 w-14 shrink-0" }, "图标色", -1), l("div", Ne, [d(f, {
|
|
459
465
|
value: I.value,
|
|
460
466
|
"onUpdate:value": r[6] ||= (e) => I.value = e,
|
|
461
467
|
"allow-clear": "",
|
|
@@ -464,13 +470,13 @@ var V = /* @__PURE__ */ f({
|
|
|
464
470
|
class: "flex-1 min-w-0",
|
|
465
471
|
disabled: !$.value
|
|
466
472
|
}, {
|
|
467
|
-
prefix:
|
|
473
|
+
prefix: T(() => [l("div", Pe, [l("button", {
|
|
468
474
|
type: "button",
|
|
469
475
|
disabled: !$.value,
|
|
470
476
|
class: p(["w-4 h-4 rounded border border-gray-300 dark:border-gray-700", $.value ? "" : "opacity-50 cursor-not-allowed"]),
|
|
471
477
|
style: m({ background: I.value || "#ffffff" }),
|
|
472
|
-
onClick:
|
|
473
|
-
}, null, 14,
|
|
478
|
+
onClick: qe
|
|
479
|
+
}, null, 14, Fe), l("input", {
|
|
474
480
|
ref_key: "iconColorPickerRef",
|
|
475
481
|
ref: L,
|
|
476
482
|
type: "color",
|
|
@@ -482,21 +488,21 @@ var V = /* @__PURE__ */ f({
|
|
|
482
488
|
height: "16px"
|
|
483
489
|
},
|
|
484
490
|
onInput: r[5] ||= (e) => I.value = e.target.value
|
|
485
|
-
}, null, 40,
|
|
491
|
+
}, null, 40, Ie)])]),
|
|
486
492
|
_: 1
|
|
487
493
|
}, 8, [
|
|
488
494
|
"value",
|
|
489
495
|
"placeholder",
|
|
490
496
|
"disabled"
|
|
491
|
-
])])
|
|
497
|
+
]), $.value ? s("v-if", !0) : (h(), c("span", Le, "仅 Ant Design 图标有效"))])])
|
|
492
498
|
]),
|
|
493
499
|
s(" 预览:固定底部 "),
|
|
494
|
-
l("div",
|
|
500
|
+
l("div", Re, [l("div", ze, [j.value ? (h(), c("div", Be, [M.value === "null" ? (h(), o(S(n), {
|
|
495
501
|
key: 0,
|
|
496
502
|
name: j.value,
|
|
497
503
|
size: 80,
|
|
498
504
|
color: $.value && I.value ? I.value : void 0
|
|
499
|
-
}, null, 8, ["name", "color"])) : (h(), o(
|
|
505
|
+
}, null, 8, ["name", "color"])) : (h(), o(S(n), {
|
|
500
506
|
key: 1,
|
|
501
507
|
name: j.value,
|
|
502
508
|
box: M.value,
|
|
@@ -512,18 +518,18 @@ var V = /* @__PURE__ */ f({
|
|
|
512
518
|
"background",
|
|
513
519
|
"radius",
|
|
514
520
|
"color"
|
|
515
|
-
]))]
|
|
521
|
+
]))])) : s("v-if", !0)])])
|
|
516
522
|
]),
|
|
517
523
|
s(" 侧栏底部操作按钮 "),
|
|
518
|
-
l("div",
|
|
519
|
-
default:
|
|
524
|
+
l("div", Ve, [d(w, { onClick: B }, {
|
|
525
|
+
default: T(() => r[10] ||= [u(" 取消 ")]),
|
|
520
526
|
_: 1,
|
|
521
527
|
__: [10]
|
|
522
|
-
}), d(
|
|
528
|
+
}), d(w, {
|
|
523
529
|
type: "primary",
|
|
524
530
|
onClick: V
|
|
525
531
|
}, {
|
|
526
|
-
default:
|
|
532
|
+
default: T(() => r[11] ||= [u(" 确定 ")]),
|
|
527
533
|
_: 1,
|
|
528
534
|
__: [11]
|
|
529
535
|
})])
|
|
@@ -535,12 +541,9 @@ var V = /* @__PURE__ */ f({
|
|
|
535
541
|
})], 64);
|
|
536
542
|
};
|
|
537
543
|
}
|
|
538
|
-
}),
|
|
539
|
-
const
|
|
540
|
-
|
|
541
|
-
class: "w-full h-full flex justify-center mb-4"
|
|
542
|
-
}, W = ["onClick"], G = ["onClick"], K = { class: "flex flex-col items-center justify-center" };
|
|
543
|
-
var q = /* @__PURE__ */ f({
|
|
544
|
+
}), W = /* @__PURE__ */ e(U, [["__scopeId", "data-v-cfee029b"]]);
|
|
545
|
+
const G = ["onClick"], K = ["onClick"], q = { class: "flex flex-col items-center justify-center" };
|
|
546
|
+
var J = /* @__PURE__ */ f({
|
|
544
547
|
name: "ResourceIconSelect",
|
|
545
548
|
__name: "IconSelect",
|
|
546
549
|
props: {
|
|
@@ -552,34 +555,39 @@ var q = /* @__PURE__ */ f({
|
|
|
552
555
|
},
|
|
553
556
|
emits: ["update:modelValue"],
|
|
554
557
|
setup(e) {
|
|
555
|
-
let r =
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
558
|
+
let r = C(e, "modelValue");
|
|
559
|
+
function u() {
|
|
560
|
+
return {
|
|
561
|
+
boxType: "null",
|
|
562
|
+
angle: 65,
|
|
563
|
+
background: {
|
|
564
|
+
from: "#65E54A",
|
|
565
|
+
to: "#35C724"
|
|
566
|
+
},
|
|
567
|
+
radius: 6,
|
|
568
|
+
iconColor: ""
|
|
569
|
+
};
|
|
570
|
+
}
|
|
571
|
+
let f = a(() => r.value.meta || (r.value.meta = {})), p = g(u());
|
|
572
|
+
w(() => f.value.iconOptions, (e) => {
|
|
573
|
+
e ? Object.assign(p, u(), e) : Object.assign(p, u());
|
|
574
|
+
}, { immediate: !0 }), w(p, (e) => {
|
|
575
|
+
if (!r.value.icon) {
|
|
576
|
+
f.value.iconOptions && Reflect.deleteProperty(f.value, "iconOptions");
|
|
577
|
+
return;
|
|
578
|
+
}
|
|
579
|
+
let t = f.value.iconOptions, n = !1;
|
|
580
|
+
if (!t) n = !0;
|
|
581
|
+
else {
|
|
582
|
+
let r = new Set([...Object.keys(t), ...Object.keys(e)]);
|
|
583
|
+
for (let i of r) if (t[i] !== e[i]) {
|
|
584
|
+
n = !0;
|
|
585
|
+
break;
|
|
586
|
+
}
|
|
581
587
|
}
|
|
582
|
-
|
|
588
|
+
n && (f.value.iconOptions = { ...e });
|
|
589
|
+
}, { deep: !0 });
|
|
590
|
+
let m = a(() => {
|
|
583
591
|
let e = r.value.type;
|
|
584
592
|
return { icon: [
|
|
585
593
|
t.DYNAMIC_APP,
|
|
@@ -589,73 +597,82 @@ var q = /* @__PURE__ */ f({
|
|
|
589
597
|
t.IFRAME,
|
|
590
598
|
t.LINK
|
|
591
599
|
].includes(e) };
|
|
592
|
-
}),
|
|
593
|
-
function
|
|
594
|
-
e.stopPropagation(), r.value.icon && (r.value.icon = void 0);
|
|
600
|
+
}), _ = a(() => !0);
|
|
601
|
+
function v(e) {
|
|
602
|
+
e.stopPropagation(), r.value.icon && (r.value.icon = void 0, Reflect.deleteProperty(f.value, "iconOptions"));
|
|
595
603
|
}
|
|
596
|
-
return (e, t) =>
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
604
|
+
return (e, t) => {
|
|
605
|
+
let a = O;
|
|
606
|
+
return _.value && m.value.icon ? (h(), o(a, {
|
|
607
|
+
key: 0,
|
|
608
|
+
label: "资源图标"
|
|
609
|
+
}, {
|
|
610
|
+
default: T(() => [d(W, {
|
|
611
|
+
modelValue: r.value.icon,
|
|
612
|
+
"onUpdate:modelValue": t[0] ||= (e) => r.value.icon = e,
|
|
613
|
+
"box-type": p.boxType,
|
|
614
|
+
"onUpdate:boxType": t[1] ||= (e) => p.boxType = e,
|
|
615
|
+
angle: p.angle,
|
|
616
|
+
"onUpdate:angle": t[2] ||= (e) => p.angle = e,
|
|
617
|
+
background: p.background,
|
|
618
|
+
"onUpdate:background": t[3] ||= (e) => p.background = e,
|
|
619
|
+
radius: p.radius,
|
|
620
|
+
"onUpdate:radius": t[4] ||= (e) => p.radius = e,
|
|
621
|
+
"icon-color": p.iconColor,
|
|
622
|
+
"onUpdate:iconColor": t[5] ||= (e) => p.iconColor = e
|
|
623
|
+
}, {
|
|
624
|
+
default: T(({ open: e }) => [s(" select box "), r.value.icon ? (h(), c(i, { key: 0 }, [s(" 已选择图标展示盒子 "), l("div", {
|
|
625
|
+
class: "size-64px flex justify-center items-center cursor-pointer rounded-md border-px border-dashed relative group border-[#d9d9d9] dark:border-[#424242] hover:border-[#5794f7] dark:hover:border-[#5187e1] p-8px",
|
|
626
|
+
onClick: e
|
|
627
|
+
}, [
|
|
628
|
+
p.boxType && p.boxType !== "null" ? (h(), o(S(n), {
|
|
629
|
+
key: 0,
|
|
630
|
+
name: r.value.icon,
|
|
631
|
+
box: p.boxType,
|
|
632
|
+
size: "48px",
|
|
633
|
+
radius: p.radius,
|
|
634
|
+
background: p.background,
|
|
635
|
+
angle: p.angle,
|
|
636
|
+
color: (r.value.icon || "").startsWith("antd:") ? p.iconColor || "#ffffff" : void 0
|
|
637
|
+
}, null, 8, [
|
|
638
|
+
"name",
|
|
639
|
+
"box",
|
|
640
|
+
"radius",
|
|
641
|
+
"background",
|
|
642
|
+
"angle",
|
|
643
|
+
"color"
|
|
644
|
+
])) : (h(), o(S(n), {
|
|
645
|
+
key: 1,
|
|
646
|
+
name: r.value.icon,
|
|
647
|
+
size: "48px",
|
|
648
|
+
color: (r.value.icon || "").startsWith("antd:") && p.iconColor || void 0
|
|
649
|
+
}, null, 8, ["name", "color"])),
|
|
650
|
+
s(" 清除按钮 "),
|
|
651
|
+
r.value.icon ? (h(), c("button", {
|
|
652
|
+
key: 2,
|
|
653
|
+
class: "absolute -top-1.5 -right-1.5 size-5 flex items-center justify-center rounded-full cursor-pointer border-none op-65 dark:op-55 hover:op-100",
|
|
654
|
+
type: "button",
|
|
655
|
+
onClick: v
|
|
656
|
+
}, [d(S(n), {
|
|
657
|
+
name: "antd:CloseOutlined",
|
|
658
|
+
size: "10px"
|
|
659
|
+
})])) : s("v-if", !0)
|
|
660
|
+
], 8, G)], 64)) : (h(), c(i, { key: 1 }, [s(" null icon select box "), l("div", {
|
|
661
|
+
class: "size-64px flex justify-center items-center rounded-md border-px border-dashed cursor-pointer border-[#d9d9d9] dark:border-[#424242] hover:border-[#5794f7] dark:hover:border-[#5187e1] text-[#d9d9d9] dark:text-[#424242] hover:text-[#5794f7] dark:hover:text-[#5187e1] transition",
|
|
662
|
+
onClick: e
|
|
663
|
+
}, [l("div", q, [d(S(n), { name: "antd:PlusOutlined" }), t[6] ||= l("span", { class: "text-10px mt-1" }, "选择图标", -1)])], 8, K)], 64))]),
|
|
664
|
+
_: 1
|
|
665
|
+
}, 8, [
|
|
666
|
+
"modelValue",
|
|
667
|
+
"box-type",
|
|
628
668
|
"angle",
|
|
629
|
-
"
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
s(" 清除按钮 "),
|
|
637
|
-
r.value.icon ? (h(), c("button", {
|
|
638
|
-
key: 2,
|
|
639
|
-
class: "absolute -top-1.5 -right-1.5 size-5 flex items-center justify-center rounded-full cursor-pointer border-none op-65 dark:op-55 hover:op-100",
|
|
640
|
-
type: "button",
|
|
641
|
-
onClick: m
|
|
642
|
-
}, [d(x(n), {
|
|
643
|
-
name: "antd:CloseOutlined",
|
|
644
|
-
size: "10px"
|
|
645
|
-
})])) : s("v-if", !0)
|
|
646
|
-
], 8, W)], 64)) : (h(), c(i, { key: 1 }, [s(" null icon select box "), l("div", {
|
|
647
|
-
class: "size-20 flex justify-center items-center rounded-md border-px border-dashed cursor-pointer border-[#d9d9d9] dark:border-[#424242] hover:border-[#5794f7] dark:hover:border-[#5187e1] text-[#d9d9d9] dark:text-[#424242] hover:text-[#5794f7] dark:hover:text-[#5187e1] transition",
|
|
648
|
-
onClick: e
|
|
649
|
-
}, [l("div", K, [d(x(n), { name: "antd:PlusOutlined" }), t[6] ||= l("span", { class: "text-10px mt-1" }, "选择图标", -1)])], 8, G)], 64))]),
|
|
650
|
-
_: 1
|
|
651
|
-
}, 8, [
|
|
652
|
-
"modelValue",
|
|
653
|
-
"box-type",
|
|
654
|
-
"angle",
|
|
655
|
-
"background",
|
|
656
|
-
"radius",
|
|
657
|
-
"icon-color"
|
|
658
|
-
])])) : s("v-if", !0);
|
|
669
|
+
"background",
|
|
670
|
+
"radius",
|
|
671
|
+
"icon-color"
|
|
672
|
+
])]),
|
|
673
|
+
_: 1
|
|
674
|
+
})) : s("v-if", !0);
|
|
675
|
+
};
|
|
659
676
|
}
|
|
660
|
-
}),
|
|
661
|
-
export {
|
|
677
|
+
}), Y = J;
|
|
678
|
+
export { Y as b };
|