@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.
@@ -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, ref as g, renderList as _, renderSlot as v, resolveComponent as y, toDisplayString as b, unref as x, useModel as S, watch as C, withCtx as w } from "vue";
5
- import * as T from "@ant-design/icons-vue";
6
- import { Empty as E } from "ant-design-vue";
7
- import { Button as ee, Empty as te, FormItemRest as ne, Input as D, InputNumber as O, 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 k = { class: "flex flex-col gap-3 w-full select-none" }, A = { class: "flex items-center gap-3" }, j = { class: "relative inline-flex items-center" }, M = ["disabled"], N = ["value", "disabled"], P = { class: "flex items-center gap-3" }, F = { class: "relative inline-flex items-center" }, I = ["disabled"], L = ["value", "disabled"], R = { class: "flex items-center gap-3" }, z = { class: "flex items-center gap-3" };
9
- var B = /* @__PURE__ */ f({
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 = g(u.from), _ = g(u.to), v = g(i(n.angle)), y = g(o(n.radius)), b = g(null), x = g(null);
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 T() {
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 C([
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: _.value
72
+ to: g.value
73
73
  }), r("update:angle", v.value), r("update:radius", y.value);
74
- }, { immediate: !0 }), C(() => n.background, (e) => {
74
+ }, { immediate: !0 }), w(() => n.background, (e) => {
75
75
  if (e == null) return;
76
76
  let t = a(e);
77
- f.value = t.from, _.value = t.to;
78
- }), C(() => n.angle, (e) => {
77
+ f.value = t.from, g.value = t.to;
78
+ }), w(() => n.angle, (e) => {
79
79
  e != null && (v.value = i(e));
80
- }), C(() => n.radius, (e) => {
80
+ }), w(() => n.radius, (e) => {
81
81
  e != null && (y.value = o(e));
82
82
  }), (e, t) => {
83
- let r = D, i = O;
84
- return h(), c("div", k, [
83
+ let r = k, i = A;
84
+ return h(), c("div", j, [
85
85
  s(" 起始色:紧凑输入(前缀色块 + 文本),隐藏原生 color 触发器 "),
86
- l("div", A, [t[6] ||= l("label", { class: "text-12px opacity-70 w-14 shrink-0" }, "起始色", -1), d(r, {
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: w(() => [l("div", j, [
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, M),
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, N)
115
+ }, null, 40, F)
116
116
  ])]),
117
117
  _: 1
118
118
  }, 8, ["value", "disabled"])]),
119
119
  s(" 结束色:紧凑输入(前缀色块 + 文本),隐藏原生 color 触发器 "),
120
- l("div", P, [t[7] ||= l("label", { class: "text-12px opacity-70 w-14 shrink-0" }, "结束色", -1), d(r, {
121
- value: _.value,
122
- "onUpdate:value": t[3] ||= (e) => _.value = 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: w(() => [l("div", F, [l("button", {
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: _.value }),
133
- onClick: T
134
- }, null, 14, I), l("input", {
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: _.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) => _.value = e.target.value
146
- }, null, 40, L)])]),
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", R, [
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", z, [
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 = B;
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" }, Pe = ["disabled"], Fe = ["value", "disabled"], Ie = { class: "w-full mt-auto" }, Le = { class: "py-4 rounded-md border-t border-t-dashed border-t-[#d0d7de] dark:border-t-[#30363d] flex flex-col items-center gap-2" }, Re = { class: "mt-4 flex justify-end gap-2" };
193
- var V = /* @__PURE__ */ f({
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 = S(e, "modelValue"), f = S(e, "boxType"), y = S(e, "angle"), O = S(e, "background"), k = S(e, "radius"), A = S(e, "iconColor"), j = g(t.value), M = g(f.value || "null"), N = g(y.value ?? 65), P = g(O.value ?? {
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 = g(k.value ?? 6), I = g(A.value ?? ""), L = g(null), R = g(!1);
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 = y.value ?? 65;
228
- let e = O.value;
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 = k.value ?? 6, I.value = A.value ?? "", R.value = !0;
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, y.value = N.value;
244
+ t.value = j.value, f.value = M.value, g.value = N.value;
239
245
  let e = P.value;
240
- O.value = typeof e == "string" ? e : e && { ...e }, k.value = F.value, A.value = I.value, R.value = !1;
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(T).filter((e) => /(?:Outlined|Filled|TwoTone)$/.test(e)).map((e) => `antd:${e}`).sort()), G = a(() => {
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 = g("all"), q = g(""), J = a(() => {
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 ze(e) {
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 = g(1), Q = a(() => Math.max(1, Math.ceil(X.value.length / 30))), Be = a(() => {
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
- C([q, K], () => {
305
+ w([q, K], () => {
300
306
  Z.value = 1;
301
- }), C(X, () => {
307
+ }), w(X, () => {
302
308
  Z.value > Q.value && (Z.value = Q.value);
303
309
  });
304
- function Ve(e) {
310
+ function We(e) {
305
311
  Z.value = e;
306
312
  }
307
- function He(e) {
313
+ function Ge(e) {
308
314
  j.value = e.name;
309
315
  }
310
- let Ue = E.PRESENTED_IMAGE_SIMPLE;
311
- function We() {
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 C(M, (e, t) => {
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 = D, g = ie, y = te, S = ae, C = oe, T = ee, E = re, O = ne;
321
- return h(), c(i, null, [v(e.$slots, "default", { open: z }, () => [d(f, {
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: w(() => [d(a, null, {
327
- title: w(() => [d(x(n), {
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: w(() => [d(x(n), {
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(O, null, {
341
- default: w(() => [d(E, {
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: w(() => [l("div", le, [
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: w(() => [d(x(n), {
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, _(G.value, (e) => (h(), c("div", {
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, b(e.label), 1), l("span", he, b(ze(e.value)), 1)], 10, pe))), 128))])]),
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, _(Be.value, (e) => (h(), o(a, {
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: w(() => [l("div", ve, [l("div", ye, b(e.name), 1), e.module ? (h(), c("div", be, " 模块: " + b(e.module), 1)) : s("v-if", !0)])]),
378
- default: w(() => [l("div", {
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) => He(e)
381
- }, [d(x(n), {
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: Ve
400
+ onChange: We
395
401
  }, null, 8, ["current", "total"])])
396
- ], 64)) : (h(), c("div", Ce, [d(y, {
397
- image: x(Ue),
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: w(() => [
410
- d(S, { value: "null" }, {
411
- default: w(() => [l("div", De, [d(x(n), {
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(S, { value: "square" }, {
418
- default: w(() => [l("div", Oe, [d(x(n), {
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(S, { value: "prism" }, {
428
- default: w(() => [l("div", ke, [d(x(n), {
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: w(() => [l("div", Ne, [l("button", {
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: We
473
- }, null, 14, Pe), l("input", {
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, Fe)])]),
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", Ie, [l("div", Le, [j.value ? (h(), c(i, { key: 0 }, [M.value === "null" ? (h(), o(x(n), {
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(x(n), {
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
- ]))], 64)) : s("v-if", !0)])])
521
+ ]))])) : s("v-if", !0)])])
516
522
  ]),
517
523
  s(" 侧栏底部操作按钮 "),
518
- l("div", Re, [d(T, { onClick: B }, {
519
- default: w(() => r[10] ||= [u(" 取消 ")]),
524
+ l("div", Ve, [d(w, { onClick: B }, {
525
+ default: T(() => r[10] ||= [u(" 取消 ")]),
520
526
  _: 1,
521
527
  __: [10]
522
- }), d(T, {
528
+ }), d(w, {
523
529
  type: "primary",
524
530
  onClick: V
525
531
  }, {
526
- default: w(() => r[11] ||= [u(" 确定 ")]),
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
- }), H = /* @__PURE__ */ e(V, [["__scopeId", "data-v-5889f8ee"]]);
539
- const U = {
540
- key: 0,
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 = S(e, "modelValue"), u = a({
556
- get() {
557
- let e = r.value.meta || (r.value.meta = {});
558
- return e.iconOptions ||= {
559
- boxType: "null",
560
- angle: 65,
561
- background: {
562
- from: "#65E54A",
563
- to: "#35C724"
564
- },
565
- radius: 6,
566
- iconColor: ""
567
- }, e.iconOptions;
568
- },
569
- set(e) {
570
- let t = r.value.meta || (r.value.meta = {});
571
- t.iconOptions = e || {
572
- boxType: "null",
573
- angle: 65,
574
- background: {
575
- from: "#65E54A",
576
- to: "#35C724"
577
- },
578
- radius: 6,
579
- iconColor: ""
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
- }), f = a(() => {
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
- }), p = a(() => !0);
593
- function m(e) {
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) => p.value && f.value.icon ? (h(), c("div", U, [d(H, {
597
- modelValue: r.value.icon,
598
- "onUpdate:modelValue": t[0] ||= (e) => r.value.icon = e,
599
- "box-type": u.value.boxType,
600
- "onUpdate:boxType": t[1] ||= (e) => u.value.boxType = e,
601
- angle: u.value.angle,
602
- "onUpdate:angle": t[2] ||= (e) => u.value.angle = e,
603
- background: u.value.background,
604
- "onUpdate:background": t[3] ||= (e) => u.value.background = e,
605
- radius: u.value.radius,
606
- "onUpdate:radius": t[4] ||= (e) => u.value.radius = e,
607
- "icon-color": u.value.iconColor,
608
- "onUpdate:iconColor": t[5] ||= (e) => u.value.iconColor = e
609
- }, {
610
- default: w(({ open: e }) => [s(" select box "), r.value.icon ? (h(), c(i, { key: 0 }, [s(" 已选择图标展示盒子 "), l("div", {
611
- class: "size-20 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]",
612
- onClick: e
613
- }, [
614
- u.value.boxType && u.value.boxType !== "null" ? (h(), o(x(n), {
615
- key: 0,
616
- name: r.value.icon,
617
- box: u.value.boxType,
618
- size: 76,
619
- radius: u.value.radius,
620
- background: u.value.background,
621
- angle: u.value.angle,
622
- color: (r.value.icon || "").startsWith("antd:") ? u.value.iconColor || "#ffffff" : void 0
623
- }, null, 8, [
624
- "name",
625
- "box",
626
- "radius",
627
- "background",
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
- "color"
630
- ])) : (h(), o(x(n), {
631
- key: 1,
632
- name: r.value.icon,
633
- size: "76px",
634
- color: (r.value.icon || "").startsWith("antd:") && u.value.iconColor || void 0
635
- }, null, 8, ["name", "color"])),
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
- }), J = q;
661
- export { J as b };
677
+ }), Y = J;
678
+ export { Y as b };