n-design-readonly-plugin 1.0.2 → 1.0.4

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/index.es.js CHANGED
@@ -1,243 +1,1114 @@
1
- import { defineComponent as E, inject as B, ref as T, computed as w, provide as U, useAttrs as z, h as j } from "vue";
2
- import { Form as K, Checkbox as O, Radio as N, Select as M, Switch as q, TimePicker as J, DatePicker as Q, Cascader as W, TreeSelect as X, Textarea as Y, InputNumber as Z, Input as _ } from "n-designv3";
3
- function A(e) {
1
+ import { nextTick as He, h as k, createVNode as te, defineComponent as Be, inject as fe, ref as H, computed as M, provide as ce, useAttrs as ze } from "vue";
2
+ import { message as Ue, Form as ue, Checkbox as se, Radio as de, Select as pe, Switch as We, TimePicker as Ge, DatePicker as qe, Cascader as Ke, TreeSelect as Ve, Textarea as Ye, InputNumber as Je, Input as Ze } from "n-designv3";
3
+ function C(e, t) {
4
+ Qe(e) && (e = "100%");
5
+ var r = Xe(e);
6
+ return e = t === 360 ? e : Math.min(t, Math.max(0, parseFloat(e))), r && (e = parseInt(String(e * t), 10) / 100), Math.abs(e - t) < 1e-6 ? 1 : (t === 360 ? e = (e < 0 ? e % t + t : e % t) / parseFloat(String(t)) : e = e % t / parseFloat(String(t)), e);
7
+ }
8
+ function Qe(e) {
9
+ return typeof e == "string" && e.indexOf(".") !== -1 && parseFloat(e) === 1;
10
+ }
11
+ function Xe(e) {
12
+ return typeof e == "string" && e.indexOf("%") !== -1;
13
+ }
14
+ function er(e) {
15
+ return e = parseFloat(e), (isNaN(e) || e < 0 || e > 1) && (e = 1), e;
16
+ }
17
+ function B(e) {
18
+ return e <= 1 ? "".concat(Number(e) * 100, "%") : e;
19
+ }
20
+ function Y(e) {
21
+ return e.length === 1 ? "0" + e : String(e);
22
+ }
23
+ function rr(e, t, r) {
24
+ return {
25
+ r: C(e, 255) * 255,
26
+ g: C(t, 255) * 255,
27
+ b: C(r, 255) * 255
28
+ };
29
+ }
30
+ function J(e, t, r) {
31
+ return r < 0 && (r += 1), r > 1 && (r -= 1), r < 1 / 6 ? e + (t - e) * (6 * r) : r < 1 / 2 ? t : r < 2 / 3 ? e + (t - e) * (2 / 3 - r) * 6 : e;
32
+ }
33
+ function tr(e, t, r) {
34
+ var n, a, o;
35
+ if (e = C(e, 360), t = C(t, 100), r = C(r, 100), t === 0)
36
+ a = r, o = r, n = r;
37
+ else {
38
+ var i = r < 0.5 ? r * (1 + t) : r + t - r * t, l = 2 * r - i;
39
+ n = J(l, i, e + 1 / 3), a = J(l, i, e), o = J(l, i, e - 1 / 3);
40
+ }
41
+ return { r: n * 255, g: a * 255, b: o * 255 };
42
+ }
43
+ function nr(e, t, r) {
44
+ e = C(e, 255), t = C(t, 255), r = C(r, 255);
45
+ var n = Math.max(e, t, r), a = Math.min(e, t, r), o = 0, i = n, l = n - a, f = n === 0 ? 0 : l / n;
46
+ if (n === a)
47
+ o = 0;
48
+ else {
49
+ switch (n) {
50
+ case e:
51
+ o = (t - r) / l + (t < r ? 6 : 0);
52
+ break;
53
+ case t:
54
+ o = (r - e) / l + 2;
55
+ break;
56
+ case r:
57
+ o = (e - t) / l + 4;
58
+ break;
59
+ }
60
+ o /= 6;
61
+ }
62
+ return { h: o, s: f, v: i };
63
+ }
64
+ function ar(e, t, r) {
65
+ e = C(e, 360) * 6, t = C(t, 100), r = C(r, 100);
66
+ var n = Math.floor(e), a = e - n, o = r * (1 - t), i = r * (1 - a * t), l = r * (1 - (1 - a) * t), f = n % 6, c = [r, i, o, o, l, r][f], s = [l, r, r, i, o, o][f], S = [o, o, l, r, r, i][f];
67
+ return { r: c * 255, g: s * 255, b: S * 255 };
68
+ }
69
+ function or(e, t, r, n) {
70
+ var a = [
71
+ Y(Math.round(e).toString(16)),
72
+ Y(Math.round(t).toString(16)),
73
+ Y(Math.round(r).toString(16))
74
+ ];
75
+ return a.join("");
76
+ }
77
+ function be(e) {
78
+ return h(e) / 255;
79
+ }
80
+ function h(e) {
81
+ return parseInt(e, 16);
82
+ }
83
+ var ye = {
84
+ aliceblue: "#f0f8ff",
85
+ antiquewhite: "#faebd7",
86
+ aqua: "#00ffff",
87
+ aquamarine: "#7fffd4",
88
+ azure: "#f0ffff",
89
+ beige: "#f5f5dc",
90
+ bisque: "#ffe4c4",
91
+ black: "#000000",
92
+ blanchedalmond: "#ffebcd",
93
+ blue: "#0000ff",
94
+ blueviolet: "#8a2be2",
95
+ brown: "#a52a2a",
96
+ burlywood: "#deb887",
97
+ cadetblue: "#5f9ea0",
98
+ chartreuse: "#7fff00",
99
+ chocolate: "#d2691e",
100
+ coral: "#ff7f50",
101
+ cornflowerblue: "#6495ed",
102
+ cornsilk: "#fff8dc",
103
+ crimson: "#dc143c",
104
+ cyan: "#00ffff",
105
+ darkblue: "#00008b",
106
+ darkcyan: "#008b8b",
107
+ darkgoldenrod: "#b8860b",
108
+ darkgray: "#a9a9a9",
109
+ darkgreen: "#006400",
110
+ darkgrey: "#a9a9a9",
111
+ darkkhaki: "#bdb76b",
112
+ darkmagenta: "#8b008b",
113
+ darkolivegreen: "#556b2f",
114
+ darkorange: "#ff8c00",
115
+ darkorchid: "#9932cc",
116
+ darkred: "#8b0000",
117
+ darksalmon: "#e9967a",
118
+ darkseagreen: "#8fbc8f",
119
+ darkslateblue: "#483d8b",
120
+ darkslategray: "#2f4f4f",
121
+ darkslategrey: "#2f4f4f",
122
+ darkturquoise: "#00ced1",
123
+ darkviolet: "#9400d3",
124
+ deeppink: "#ff1493",
125
+ deepskyblue: "#00bfff",
126
+ dimgray: "#696969",
127
+ dimgrey: "#696969",
128
+ dodgerblue: "#1e90ff",
129
+ firebrick: "#b22222",
130
+ floralwhite: "#fffaf0",
131
+ forestgreen: "#228b22",
132
+ fuchsia: "#ff00ff",
133
+ gainsboro: "#dcdcdc",
134
+ ghostwhite: "#f8f8ff",
135
+ goldenrod: "#daa520",
136
+ gold: "#ffd700",
137
+ gray: "#808080",
138
+ green: "#008000",
139
+ greenyellow: "#adff2f",
140
+ grey: "#808080",
141
+ honeydew: "#f0fff0",
142
+ hotpink: "#ff69b4",
143
+ indianred: "#cd5c5c",
144
+ indigo: "#4b0082",
145
+ ivory: "#fffff0",
146
+ khaki: "#f0e68c",
147
+ lavenderblush: "#fff0f5",
148
+ lavender: "#e6e6fa",
149
+ lawngreen: "#7cfc00",
150
+ lemonchiffon: "#fffacd",
151
+ lightblue: "#add8e6",
152
+ lightcoral: "#f08080",
153
+ lightcyan: "#e0ffff",
154
+ lightgoldenrodyellow: "#fafad2",
155
+ lightgray: "#d3d3d3",
156
+ lightgreen: "#90ee90",
157
+ lightgrey: "#d3d3d3",
158
+ lightpink: "#ffb6c1",
159
+ lightsalmon: "#ffa07a",
160
+ lightseagreen: "#20b2aa",
161
+ lightskyblue: "#87cefa",
162
+ lightslategray: "#778899",
163
+ lightslategrey: "#778899",
164
+ lightsteelblue: "#b0c4de",
165
+ lightyellow: "#ffffe0",
166
+ lime: "#00ff00",
167
+ limegreen: "#32cd32",
168
+ linen: "#faf0e6",
169
+ magenta: "#ff00ff",
170
+ maroon: "#800000",
171
+ mediumaquamarine: "#66cdaa",
172
+ mediumblue: "#0000cd",
173
+ mediumorchid: "#ba55d3",
174
+ mediumpurple: "#9370db",
175
+ mediumseagreen: "#3cb371",
176
+ mediumslateblue: "#7b68ee",
177
+ mediumspringgreen: "#00fa9a",
178
+ mediumturquoise: "#48d1cc",
179
+ mediumvioletred: "#c71585",
180
+ midnightblue: "#191970",
181
+ mintcream: "#f5fffa",
182
+ mistyrose: "#ffe4e1",
183
+ moccasin: "#ffe4b5",
184
+ navajowhite: "#ffdead",
185
+ navy: "#000080",
186
+ oldlace: "#fdf5e6",
187
+ olive: "#808000",
188
+ olivedrab: "#6b8e23",
189
+ orange: "#ffa500",
190
+ orangered: "#ff4500",
191
+ orchid: "#da70d6",
192
+ palegoldenrod: "#eee8aa",
193
+ palegreen: "#98fb98",
194
+ paleturquoise: "#afeeee",
195
+ palevioletred: "#db7093",
196
+ papayawhip: "#ffefd5",
197
+ peachpuff: "#ffdab9",
198
+ peru: "#cd853f",
199
+ pink: "#ffc0cb",
200
+ plum: "#dda0dd",
201
+ powderblue: "#b0e0e6",
202
+ purple: "#800080",
203
+ rebeccapurple: "#663399",
204
+ red: "#ff0000",
205
+ rosybrown: "#bc8f8f",
206
+ royalblue: "#4169e1",
207
+ saddlebrown: "#8b4513",
208
+ salmon: "#fa8072",
209
+ sandybrown: "#f4a460",
210
+ seagreen: "#2e8b57",
211
+ seashell: "#fff5ee",
212
+ sienna: "#a0522d",
213
+ silver: "#c0c0c0",
214
+ skyblue: "#87ceeb",
215
+ slateblue: "#6a5acd",
216
+ slategray: "#708090",
217
+ slategrey: "#708090",
218
+ snow: "#fffafa",
219
+ springgreen: "#00ff7f",
220
+ steelblue: "#4682b4",
221
+ tan: "#d2b48c",
222
+ teal: "#008080",
223
+ thistle: "#d8bfd8",
224
+ tomato: "#ff6347",
225
+ turquoise: "#40e0d0",
226
+ violet: "#ee82ee",
227
+ wheat: "#f5deb3",
228
+ white: "#ffffff",
229
+ whitesmoke: "#f5f5f5",
230
+ yellow: "#ffff00",
231
+ yellowgreen: "#9acd32"
232
+ };
233
+ function $(e) {
234
+ var t = { r: 0, g: 0, b: 0 }, r = 1, n = null, a = null, o = null, i = !1, l = !1;
235
+ return typeof e == "string" && (e = fr(e)), typeof e == "object" && (O(e.r) && O(e.g) && O(e.b) ? (t = rr(e.r, e.g, e.b), i = !0, l = String(e.r).substr(-1) === "%" ? "prgb" : "rgb") : O(e.h) && O(e.s) && O(e.v) ? (n = B(e.s), a = B(e.v), t = ar(e.h, n, a), i = !0, l = "hsv") : O(e.h) && O(e.s) && O(e.l) && (n = B(e.s), o = B(e.l), t = tr(e.h, n, o), i = !0, l = "hsl"), Object.prototype.hasOwnProperty.call(e, "a") && (r = e.a)), r = er(r), {
236
+ ok: i,
237
+ format: e.format || l,
238
+ r: Math.min(255, Math.max(t.r, 0)),
239
+ g: Math.min(255, Math.max(t.g, 0)),
240
+ b: Math.min(255, Math.max(t.b, 0)),
241
+ a: r
242
+ };
243
+ }
244
+ var ir = "[-\\+]?\\d+%?", lr = "[-\\+]?\\d*\\.\\d+%?", P = "(?:".concat(lr, ")|(?:").concat(ir, ")"), Z = "[\\s|\\(]+(".concat(P, ")[,|\\s]+(").concat(P, ")[,|\\s]+(").concat(P, ")\\s*\\)?"), Q = "[\\s|\\(]+(".concat(P, ")[,|\\s]+(").concat(P, ")[,|\\s]+(").concat(P, ")[,|\\s]+(").concat(P, ")\\s*\\)?"), x = {
245
+ CSS_UNIT: new RegExp(P),
246
+ rgb: new RegExp("rgb" + Z),
247
+ rgba: new RegExp("rgba" + Q),
248
+ hsl: new RegExp("hsl" + Z),
249
+ hsla: new RegExp("hsla" + Q),
250
+ hsv: new RegExp("hsv" + Z),
251
+ hsva: new RegExp("hsva" + Q),
252
+ hex3: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
253
+ hex6: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,
254
+ hex4: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
255
+ hex8: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/
256
+ };
257
+ function fr(e) {
258
+ if (e = e.trim().toLowerCase(), e.length === 0)
259
+ return !1;
260
+ var t = !1;
261
+ if (ye[e])
262
+ e = ye[e], t = !0;
263
+ else if (e === "transparent")
264
+ return { r: 0, g: 0, b: 0, a: 0, format: "name" };
265
+ var r = x.rgb.exec(e);
266
+ return r ? { r: r[1], g: r[2], b: r[3] } : (r = x.rgba.exec(e), r ? { r: r[1], g: r[2], b: r[3], a: r[4] } : (r = x.hsl.exec(e), r ? { h: r[1], s: r[2], l: r[3] } : (r = x.hsla.exec(e), r ? { h: r[1], s: r[2], l: r[3], a: r[4] } : (r = x.hsv.exec(e), r ? { h: r[1], s: r[2], v: r[3] } : (r = x.hsva.exec(e), r ? { h: r[1], s: r[2], v: r[3], a: r[4] } : (r = x.hex8.exec(e), r ? {
267
+ r: h(r[1]),
268
+ g: h(r[2]),
269
+ b: h(r[3]),
270
+ a: be(r[4]),
271
+ format: t ? "name" : "hex8"
272
+ } : (r = x.hex6.exec(e), r ? {
273
+ r: h(r[1]),
274
+ g: h(r[2]),
275
+ b: h(r[3]),
276
+ format: t ? "name" : "hex"
277
+ } : (r = x.hex4.exec(e), r ? {
278
+ r: h(r[1] + r[1]),
279
+ g: h(r[2] + r[2]),
280
+ b: h(r[3] + r[3]),
281
+ a: be(r[4] + r[4]),
282
+ format: t ? "name" : "hex8"
283
+ } : (r = x.hex3.exec(e), r ? {
284
+ r: h(r[1] + r[1]),
285
+ g: h(r[2] + r[2]),
286
+ b: h(r[3] + r[3]),
287
+ format: t ? "name" : "hex"
288
+ } : !1)))))))));
289
+ }
290
+ function O(e) {
291
+ return !!x.CSS_UNIT.exec(String(e));
292
+ }
293
+ var z = 2, ge = 0.16, cr = 0.05, ur = 0.05, sr = 0.15, Pe = 5, Ee = 4, dr = [{
294
+ index: 7,
295
+ opacity: 0.15
296
+ }, {
297
+ index: 6,
298
+ opacity: 0.25
299
+ }, {
300
+ index: 5,
301
+ opacity: 0.3
302
+ }, {
303
+ index: 5,
304
+ opacity: 0.45
305
+ }, {
306
+ index: 5,
307
+ opacity: 0.65
308
+ }, {
309
+ index: 5,
310
+ opacity: 0.85
311
+ }, {
312
+ index: 4,
313
+ opacity: 0.9
314
+ }, {
315
+ index: 3,
316
+ opacity: 0.95
317
+ }, {
318
+ index: 2,
319
+ opacity: 0.97
320
+ }, {
321
+ index: 1,
322
+ opacity: 0.98
323
+ }];
324
+ function me(e) {
325
+ var t = e.r, r = e.g, n = e.b, a = nr(t, r, n);
326
+ return {
327
+ h: a.h * 360,
328
+ s: a.s,
329
+ v: a.v
330
+ };
331
+ }
332
+ function U(e) {
333
+ var t = e.r, r = e.g, n = e.b;
334
+ return "#".concat(or(t, r, n));
335
+ }
336
+ function pr(e, t, r) {
337
+ var n = r / 100, a = {
338
+ r: (t.r - e.r) * n + e.r,
339
+ g: (t.g - e.g) * n + e.g,
340
+ b: (t.b - e.b) * n + e.b
341
+ };
342
+ return a;
343
+ }
344
+ function ve(e, t, r) {
345
+ var n;
346
+ return Math.round(e.h) >= 60 && Math.round(e.h) <= 240 ? n = r ? Math.round(e.h) - z * t : Math.round(e.h) + z * t : n = r ? Math.round(e.h) + z * t : Math.round(e.h) - z * t, n < 0 ? n += 360 : n >= 360 && (n -= 360), n;
347
+ }
348
+ function he(e, t, r) {
349
+ if (e.h === 0 && e.s === 0)
350
+ return e.s;
351
+ var n;
352
+ return r ? n = e.s - ge * t : t === Ee ? n = e.s + ge : n = e.s + cr * t, n > 1 && (n = 1), r && t === Pe && n > 0.1 && (n = 0.1), n < 0.06 && (n = 0.06), Number(n.toFixed(2));
353
+ }
354
+ function we(e, t, r) {
355
+ var n;
356
+ return r ? n = e.v + ur * t : n = e.v - sr * t, n > 1 && (n = 1), Number(n.toFixed(2));
357
+ }
358
+ function ne(e) {
359
+ for (var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, r = [], n = $(e), a = Pe; a > 0; a -= 1) {
360
+ var o = me(n), i = U($({
361
+ h: ve(o, a, !0),
362
+ s: he(o, a, !0),
363
+ v: we(o, a, !0)
364
+ }));
365
+ r.push(i);
366
+ }
367
+ r.push(U(n));
368
+ for (var l = 1; l <= Ee; l += 1) {
369
+ var f = me(n), c = U($({
370
+ h: ve(f, l),
371
+ s: he(f, l),
372
+ v: we(f, l)
373
+ }));
374
+ r.push(c);
375
+ }
376
+ return t.theme === "dark" ? dr.map(function(s) {
377
+ var S = s.index, g = s.opacity, T = U(pr($(t.backgroundColor || "#141414"), $(r[S]), g * 100));
378
+ return T;
379
+ }) : r;
380
+ }
381
+ var X = {
382
+ red: "#F5222D",
383
+ volcano: "#FA541C",
384
+ orange: "#FA8C16",
385
+ gold: "#FAAD14",
386
+ yellow: "#FADB14",
387
+ lime: "#A0D911",
388
+ green: "#52C41A",
389
+ cyan: "#13C2C2",
390
+ blue: "#1890FF",
391
+ geekblue: "#2F54EB",
392
+ purple: "#722ED1",
393
+ magenta: "#EB2F96",
394
+ grey: "#666666"
395
+ }, ee = {}, re = {};
396
+ Object.keys(X).forEach(function(e) {
397
+ ee[e] = ne(X[e]), ee[e].primary = ee[e][5], re[e] = ne(X[e], {
398
+ theme: "dark",
399
+ backgroundColor: "#141414"
400
+ }), re[e].primary = re[e][5];
401
+ });
402
+ var Ce = [], R = [], br = "insert-css: You need to provide a CSS string. Usage: insertCss(cssString[, options]).";
403
+ function yr() {
404
+ var e = document.createElement("style");
405
+ return e.setAttribute("type", "text/css"), e;
406
+ }
407
+ function gr(e, t) {
408
+ if (t = t || {}, e === void 0)
409
+ throw new Error(br);
410
+ var r = t.prepend === !0 ? "prepend" : "append", n = t.container !== void 0 ? t.container : document.querySelector("head"), a = Ce.indexOf(n);
411
+ a === -1 && (a = Ce.push(n) - 1, R[a] = {});
412
+ var o;
413
+ return R[a] !== void 0 && R[a][r] !== void 0 ? o = R[a][r] : (o = R[a][r] = yr(), r === "prepend" ? n.insertBefore(o, n.childNodes[0]) : n.appendChild(o)), e.charCodeAt(0) === 65279 && (e = e.substr(1, e.length)), o.styleSheet ? o.styleSheet.cssText += e : o.textContent += e, o;
414
+ }
415
+ function Se(e) {
416
+ for (var t = 1; t < arguments.length; t++) {
417
+ var r = arguments[t] != null ? Object(arguments[t]) : {}, n = Object.keys(r);
418
+ typeof Object.getOwnPropertySymbols == "function" && n.push.apply(n, Object.getOwnPropertySymbols(r).filter(function(a) {
419
+ return Object.getOwnPropertyDescriptor(r, a).enumerable;
420
+ })), n.forEach(function(a) {
421
+ mr(e, a, r[a]);
422
+ });
423
+ }
424
+ return e;
425
+ }
426
+ function mr(e, t, r) {
427
+ return t = vr(t), t in e ? Object.defineProperty(e, t, { value: r, enumerable: !0, configurable: !0, writable: !0 }) : e[t] = r, e;
428
+ }
429
+ function vr(e) {
430
+ var t = hr(e, "string");
431
+ return typeof t == "symbol" ? t : String(t);
432
+ }
433
+ function hr(e, t) {
434
+ if (typeof e != "object" || e === null) return e;
435
+ var r = e[Symbol.toPrimitive];
436
+ if (r !== void 0) {
437
+ var n = r.call(e, t);
438
+ if (typeof n != "object") return n;
439
+ throw new TypeError("@@toPrimitive must return a primitive value.");
440
+ }
441
+ return (t === "string" ? String : Number)(e);
442
+ }
443
+ function wr(e, t) {
444
+ process.env.NODE_ENV !== "production" && !e && console !== void 0 && console.error("Warning: ".concat(t));
445
+ }
446
+ function Cr(e, t) {
447
+ wr(e, "[@nancal-icon/icons-vue] ".concat(t));
448
+ }
449
+ function xe(e) {
450
+ return typeof e == "object" && typeof e.name == "string" && typeof e.theme == "string" && (typeof e.icon == "object" || typeof e.icon == "function");
451
+ }
452
+ function ae(e, t, r) {
453
+ return r ? k(e.tag, Se({
454
+ key: t
455
+ }, r, e.attrs), (e.children || []).map(function(n, a) {
456
+ return ae(n, "".concat(t, "-").concat(e.tag, "-").concat(a));
457
+ })) : k(e.tag, Se({
458
+ key: t
459
+ }, e.attrs), (e.children || []).map(function(n, a) {
460
+ return ae(n, "".concat(t, "-").concat(e.tag, "-").concat(a));
461
+ }));
462
+ }
463
+ function Fe(e) {
464
+ return ne(e)[0];
465
+ }
466
+ function Ie(e) {
467
+ return e ? Array.isArray(e) ? e : [e] : [];
468
+ }
469
+ var Sr = `
470
+ .anticon {
471
+ display: inline-block;
472
+ color: #8091B7;
473
+ font-style: normal;
474
+ line-height: 0;
475
+ text-align: center;
476
+ text-transform: none;
477
+ vertical-align: -0.125em;
478
+ text-rendering: optimizeLegibility;
479
+ -webkit-font-smoothing: antialiased;
480
+ -moz-osx-font-smoothing: grayscale;
481
+ }
482
+
483
+ .anticon > * {
484
+ line-height: 1;
485
+ }
486
+
487
+ .anticon svg {
488
+ display: inline-block;
489
+ }
490
+
491
+ .anticon::before {
492
+ display: none;
493
+ }
494
+
495
+ .anticon .anticon-icon {
496
+ display: block;
497
+ }
498
+
499
+ .anticon[tabindex] {
500
+ cursor: pointer;
501
+ }
502
+
503
+ .anticon-spin::before,
504
+ .anticon-spin {
505
+ display: inline-block;
506
+ -webkit-animation: loadingCircle 1s infinite linear;
507
+ animation: loadingCircle 1s infinite linear;
508
+ }
509
+
510
+ @-webkit-keyframes loadingCircle {
511
+ 100% {
512
+ -webkit-transform: rotate(360deg);
513
+ transform: rotate(360deg);
514
+ }
515
+ }
516
+
517
+ @keyframes loadingCircle {
518
+ 100% {
519
+ -webkit-transform: rotate(360deg);
520
+ transform: rotate(360deg);
521
+ }
522
+ }
523
+ `, Oe = !1, xr = function() {
524
+ var t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : Sr;
525
+ He(function() {
526
+ Oe || (typeof window < "u" && window.document && window.document.documentElement && gr(t, {
527
+ prepend: !0
528
+ }), Oe = !0);
529
+ });
530
+ }, Or = ["icon", "primaryColor", "secondaryColor"];
531
+ function kr(e, t) {
532
+ if (e == null) return {};
533
+ var r = Tr(e, t), n, a;
534
+ if (Object.getOwnPropertySymbols) {
535
+ var o = Object.getOwnPropertySymbols(e);
536
+ for (a = 0; a < o.length; a++)
537
+ n = o[a], !(t.indexOf(n) >= 0) && Object.prototype.propertyIsEnumerable.call(e, n) && (r[n] = e[n]);
538
+ }
539
+ return r;
540
+ }
541
+ function Tr(e, t) {
542
+ if (e == null) return {};
543
+ var r = {}, n = Object.keys(e), a, o;
544
+ for (o = 0; o < n.length; o++)
545
+ a = n[o], !(t.indexOf(a) >= 0) && (r[a] = e[a]);
546
+ return r;
547
+ }
548
+ function W(e) {
549
+ for (var t = 1; t < arguments.length; t++) {
550
+ var r = arguments[t] != null ? Object(arguments[t]) : {}, n = Object.keys(r);
551
+ typeof Object.getOwnPropertySymbols == "function" && n.push.apply(n, Object.getOwnPropertySymbols(r).filter(function(a) {
552
+ return Object.getOwnPropertyDescriptor(r, a).enumerable;
553
+ })), n.forEach(function(a) {
554
+ Ar(e, a, r[a]);
555
+ });
556
+ }
557
+ return e;
558
+ }
559
+ function Ar(e, t, r) {
560
+ return t = jr(t), t in e ? Object.defineProperty(e, t, { value: r, enumerable: !0, configurable: !0, writable: !0 }) : e[t] = r, e;
561
+ }
562
+ function jr(e) {
563
+ var t = Pr(e, "string");
564
+ return typeof t == "symbol" ? t : String(t);
565
+ }
566
+ function Pr(e, t) {
567
+ if (typeof e != "object" || e === null) return e;
568
+ var r = e[Symbol.toPrimitive];
569
+ if (r !== void 0) {
570
+ var n = r.call(e, t);
571
+ if (typeof n != "object") return n;
572
+ throw new TypeError("@@toPrimitive must return a primitive value.");
573
+ }
574
+ return (t === "string" ? String : Number)(e);
575
+ }
576
+ var N = {
577
+ primaryColor: "#333",
578
+ secondaryColor: "#E6E6E6",
579
+ calculated: !1
580
+ };
581
+ function Er(e) {
582
+ var t = e.primaryColor, r = e.secondaryColor;
583
+ N.primaryColor = t, N.secondaryColor = r || Fe(t), N.calculated = !!r;
584
+ }
585
+ function Fr() {
586
+ return W({}, N);
587
+ }
588
+ var E = function(t, r) {
589
+ var n = W({}, t, r.attrs), a = n.icon, o = n.primaryColor, i = n.secondaryColor, l = kr(n, Or), f = N;
590
+ if (o && (f = {
591
+ primaryColor: o,
592
+ secondaryColor: i || Fe(o)
593
+ }), xr(), Cr(xe(a), "icon should be icon definiton, but got ".concat(a)), !xe(a))
594
+ return null;
595
+ var c = a;
596
+ return c && typeof c.icon == "function" && (c = W({}, c, {
597
+ icon: c.icon(f.primaryColor, f.secondaryColor)
598
+ })), ae(c.icon, "svg-".concat(c.name), W({}, l, {
599
+ "data-icon": c.name,
600
+ width: "1em",
601
+ height: "1em",
602
+ fill: "currentColor",
603
+ "aria-hidden": "true"
604
+ }));
605
+ };
606
+ E.props = {
607
+ icon: Object,
608
+ primaryColor: String,
609
+ secondaryColor: String,
610
+ focusable: String
611
+ };
612
+ E.inheritAttrs = !1;
613
+ E.displayName = "IconBase";
614
+ E.getTwoToneColors = Fr;
615
+ E.setTwoToneColors = Er;
616
+ function Ir(e, t) {
617
+ return Nr(e) || Rr(e, t) || $r(e, t) || Mr();
618
+ }
619
+ function Mr() {
620
+ throw new TypeError(`Invalid attempt to destructure non-iterable instance.
621
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
622
+ }
623
+ function $r(e, t) {
624
+ if (e) {
625
+ if (typeof e == "string") return ke(e, t);
626
+ var r = Object.prototype.toString.call(e).slice(8, -1);
627
+ if (r === "Object" && e.constructor && (r = e.constructor.name), r === "Map" || r === "Set") return Array.from(e);
628
+ if (r === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)) return ke(e, t);
629
+ }
630
+ }
631
+ function ke(e, t) {
632
+ (t == null || t > e.length) && (t = e.length);
633
+ for (var r = 0, n = new Array(t); r < t; r++) n[r] = e[r];
634
+ return n;
635
+ }
636
+ function Rr(e, t) {
637
+ var r = e == null ? null : typeof Symbol < "u" && e[Symbol.iterator] || e["@@iterator"];
638
+ if (r != null) {
639
+ var n, a, o, i, l = [], f = !0, c = !1;
640
+ try {
641
+ if (o = (r = r.call(e)).next, t !== 0) for (; !(f = (n = o.call(r)).done) && (l.push(n.value), l.length !== t); f = !0) ;
642
+ } catch (s) {
643
+ c = !0, a = s;
644
+ } finally {
645
+ try {
646
+ if (!f && r.return != null && (i = r.return(), Object(i) !== i)) return;
647
+ } finally {
648
+ if (c) throw a;
649
+ }
650
+ }
651
+ return l;
652
+ }
653
+ }
654
+ function Nr(e) {
655
+ if (Array.isArray(e)) return e;
656
+ }
657
+ function Me(e) {
658
+ var t = Ie(e), r = Ir(t, 2), n = r[0], a = r[1];
659
+ return E.setTwoToneColors({
660
+ primaryColor: n,
661
+ secondaryColor: a
662
+ });
663
+ }
664
+ function _r() {
665
+ var e = E.getTwoToneColors();
666
+ return e.calculated ? [e.primaryColor, e.secondaryColor] : e.primaryColor;
667
+ }
668
+ var Lr = ["class", "icon", "spin", "rotate", "tabindex", "twoToneColor", "onClick"];
669
+ function Dr(e, t) {
670
+ return Ur(e) || zr(e, t) || Br(e, t) || Hr();
671
+ }
672
+ function Hr() {
673
+ throw new TypeError(`Invalid attempt to destructure non-iterable instance.
674
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
675
+ }
676
+ function Br(e, t) {
677
+ if (e) {
678
+ if (typeof e == "string") return Te(e, t);
679
+ var r = Object.prototype.toString.call(e).slice(8, -1);
680
+ if (r === "Object" && e.constructor && (r = e.constructor.name), r === "Map" || r === "Set") return Array.from(e);
681
+ if (r === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)) return Te(e, t);
682
+ }
683
+ }
684
+ function Te(e, t) {
685
+ (t == null || t > e.length) && (t = e.length);
686
+ for (var r = 0, n = new Array(t); r < t; r++) n[r] = e[r];
687
+ return n;
688
+ }
689
+ function zr(e, t) {
690
+ var r = e == null ? null : typeof Symbol < "u" && e[Symbol.iterator] || e["@@iterator"];
691
+ if (r != null) {
692
+ var n, a, o, i, l = [], f = !0, c = !1;
693
+ try {
694
+ if (o = (r = r.call(e)).next, t !== 0) for (; !(f = (n = o.call(r)).done) && (l.push(n.value), l.length !== t); f = !0) ;
695
+ } catch (s) {
696
+ c = !0, a = s;
697
+ } finally {
698
+ try {
699
+ if (!f && r.return != null && (i = r.return(), Object(i) !== i)) return;
700
+ } finally {
701
+ if (c) throw a;
702
+ }
703
+ }
704
+ return l;
705
+ }
706
+ }
707
+ function Ur(e) {
708
+ if (Array.isArray(e)) return e;
709
+ }
710
+ function Ae(e) {
711
+ for (var t = 1; t < arguments.length; t++) {
712
+ var r = arguments[t] != null ? Object(arguments[t]) : {}, n = Object.keys(r);
713
+ typeof Object.getOwnPropertySymbols == "function" && n.push.apply(n, Object.getOwnPropertySymbols(r).filter(function(a) {
714
+ return Object.getOwnPropertyDescriptor(r, a).enumerable;
715
+ })), n.forEach(function(a) {
716
+ oe(e, a, r[a]);
717
+ });
718
+ }
719
+ return e;
720
+ }
721
+ function oe(e, t, r) {
722
+ return t = Wr(t), t in e ? Object.defineProperty(e, t, { value: r, enumerable: !0, configurable: !0, writable: !0 }) : e[t] = r, e;
723
+ }
724
+ function Wr(e) {
725
+ var t = Gr(e, "string");
726
+ return typeof t == "symbol" ? t : String(t);
727
+ }
728
+ function Gr(e, t) {
729
+ if (typeof e != "object" || e === null) return e;
730
+ var r = e[Symbol.toPrimitive];
731
+ if (r !== void 0) {
732
+ var n = r.call(e, t);
733
+ if (typeof n != "object") return n;
734
+ throw new TypeError("@@toPrimitive must return a primitive value.");
735
+ }
736
+ return (t === "string" ? String : Number)(e);
737
+ }
738
+ function qr(e, t) {
739
+ if (e == null) return {};
740
+ var r = Kr(e, t), n, a;
741
+ if (Object.getOwnPropertySymbols) {
742
+ var o = Object.getOwnPropertySymbols(e);
743
+ for (a = 0; a < o.length; a++)
744
+ n = o[a], !(t.indexOf(n) >= 0) && Object.prototype.propertyIsEnumerable.call(e, n) && (r[n] = e[n]);
745
+ }
746
+ return r;
747
+ }
748
+ function Kr(e, t) {
749
+ if (e == null) return {};
750
+ var r = {}, n = Object.keys(e), a, o;
751
+ for (o = 0; o < n.length; o++)
752
+ a = n[o], !(t.indexOf(a) >= 0) && (r[a] = e[a]);
753
+ return r;
754
+ }
755
+ Me("#1890ff");
756
+ var I = function(t, r) {
757
+ var n, a = Ae({}, t, r.attrs), o = a.class, i = a.icon, l = a.spin, f = a.rotate, c = a.tabindex, s = a.twoToneColor, S = a.onClick, g = qr(a, Lr), T = (n = {
758
+ anticon: !0
759
+ }, oe(n, "anticon-".concat(i.name), !!i.name), oe(n, o, o), n), d = l === "" || l || i.name === "loading" ? "anticon-spin" : "", p = c;
760
+ p === void 0 && S && (p = -1, g.tabindex = p);
761
+ var u = f ? {
762
+ msTransform: "rotate(".concat(f, "deg)"),
763
+ transform: "rotate(".concat(f, "deg)")
764
+ } : void 0, b = Ie(s), m = Dr(b, 2), v = m[0], A = m[1];
765
+ return te("span", Ae({
766
+ role: "img",
767
+ "aria-label": i.name
768
+ }, g, {
769
+ onClick: S,
770
+ class: T
771
+ }), [te(E, {
772
+ class: d,
773
+ icon: i,
774
+ primaryColor: v,
775
+ secondaryColor: A,
776
+ style: u
777
+ }, null)]);
778
+ };
779
+ I.props = {
780
+ spin: Boolean,
781
+ rotate: Number,
782
+ icon: Object,
783
+ twoToneColor: String
784
+ };
785
+ I.displayName = "AntdIcon";
786
+ I.inheritAttrs = !1;
787
+ I.getTwoToneColor = _r;
788
+ I.setTwoToneColor = Me;
789
+ var Vr = { icon: { tag: "svg", attrs: { viewBox: "32 32 960 960", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M384 32a96 96 0 00-96 96v96a32 32 0 0064 0v-96a32 32 0 0132-32h512a32 32 0 0132 32v512a32 32 0 01-32 32h-96a32 32 0 000 64h96a96 96 0 0096-96V128a96 96 0 00-96-96H384z" } }, { tag: "path", attrs: { d: "M128 288a96 96 0 00-96 96v512a96 96 0 0096 96h512a96 96 0 0096-96V384a96 96 0 00-96-96H128zm-32 96a32 32 0 0132-32h512a32 32 0 0132 32v512a32 32 0 01-32 32H128a32 32 0 01-32-32V384z" } }] }, name: "copy", theme: "outlined" };
790
+ function je(e) {
791
+ for (var t = 1; t < arguments.length; t++) {
792
+ var r = arguments[t] != null ? Object(arguments[t]) : {}, n = Object.keys(r);
793
+ typeof Object.getOwnPropertySymbols == "function" && n.push.apply(n, Object.getOwnPropertySymbols(r).filter(function(a) {
794
+ return Object.getOwnPropertyDescriptor(r, a).enumerable;
795
+ })), n.forEach(function(a) {
796
+ Yr(e, a, r[a]);
797
+ });
798
+ }
799
+ return e;
800
+ }
801
+ function Yr(e, t, r) {
802
+ return t = Jr(t), t in e ? Object.defineProperty(e, t, { value: r, enumerable: !0, configurable: !0, writable: !0 }) : e[t] = r, e;
803
+ }
804
+ function Jr(e) {
805
+ var t = Zr(e, "string");
806
+ return typeof t == "symbol" ? t : String(t);
807
+ }
808
+ function Zr(e, t) {
809
+ if (typeof e != "object" || e === null) return e;
810
+ var r = e[Symbol.toPrimitive];
811
+ if (r !== void 0) {
812
+ var n = r.call(e, t);
813
+ if (typeof n != "object") return n;
814
+ throw new TypeError("@@toPrimitive must return a primitive value.");
815
+ }
816
+ return (t === "string" ? String : Number)(e);
817
+ }
818
+ var ie = function(t, r) {
819
+ var n = je({}, t, r.attrs);
820
+ return te(I, je({}, n, {
821
+ icon: Vr
822
+ }), null);
823
+ };
824
+ ie.displayName = "CopyOutlined";
825
+ ie.inheritAttrs = !1;
826
+ function _(e) {
4
827
  if (e == null) return "";
5
828
  if (typeof e == "string") return e;
6
- if (Array.isArray(e)) return e.map(A).join("");
829
+ if (Array.isArray(e)) return e.map(_).join("");
7
830
  if (typeof e == "object") {
8
831
  if (typeof e.children == "string")
9
832
  return e.children;
10
833
  if (e?.default && typeof e.default == "function") {
11
- const n = e.default();
12
- if (Array.isArray(n))
13
- return A(n);
834
+ const t = e.default();
835
+ if (Array.isArray(t))
836
+ return _(t);
14
837
  }
15
- e.children && A(e.children);
838
+ e.children && _(e.children);
16
839
  }
17
840
  return "";
18
841
  }
19
- function P(e, n = {}) {
20
- const t = /* @__PURE__ */ new Map(), { value: l = "value", label: c = "label" } = n;
21
- if (!e) return t;
22
- const s = Array.isArray(e) ? e : [e];
23
- for (const r of s)
24
- if (!(!r || typeof r != "object")) {
25
- if (r.type && (typeof r.type == "object" || typeof r.type == "function")) {
26
- let u = r.type.name?.toLowerCase() || "";
27
- if (typeof r.type == "function" ? u = r.type.displayName?.toLowerCase() || "" : typeof r.type == "string" && (u = r.type?.toLowerCase() || ""), /option|radio|checkbox/i.test(u)) {
28
- const o = r.props || {}, a = o[l] ?? o.value, f = o[c] ?? o.label;
29
- if (a != null) {
30
- const x = A(r.children) || f || String(a);
31
- t.set(a, x);
842
+ function $e(e, t = {}) {
843
+ const r = /* @__PURE__ */ new Map(), { value: n = "value", label: a = "label" } = t;
844
+ if (!e) return r;
845
+ const o = Array.isArray(e) ? e : [e];
846
+ for (const i of o)
847
+ if (!(!i || typeof i != "object")) {
848
+ if (i.type && (typeof i.type == "object" || typeof i.type == "function")) {
849
+ let l = i.type.name?.toLowerCase() || "";
850
+ if (typeof i.type == "function" ? l = i.type.displayName?.toLowerCase() || "" : typeof i.type == "string" && (l = i.type?.toLowerCase() || ""), /option|radio|checkbox/i.test(l)) {
851
+ const f = i.props || {}, c = f[n] ?? f.value, s = f[a] ?? f.label;
852
+ if (c != null) {
853
+ const S = _(i.children) || s || String(c);
854
+ r.set(c, S);
32
855
  }
33
856
  }
34
857
  }
35
- r.children && P(r.children, n).forEach((o, a) => {
36
- t.has(a) || t.set(a, o);
858
+ i.children && $e(i.children, t).forEach((f, c) => {
859
+ r.has(c) || r.set(c, f);
37
860
  });
38
861
  }
39
- return t;
40
- }
41
- function V(e, n, t) {
42
- const { value: l = "value", label: c = "label", children: s = "children" } = t, r = [];
43
- let u = e;
44
- for (const o of n) {
45
- const a = u.find((f) => f[l] === o);
46
- if (a)
47
- r.push(a[c] || a[l] || String(o)), u = a[s] || [];
862
+ return r;
863
+ }
864
+ function Qr(e, t, r) {
865
+ const { value: n = "value", label: a = "label", children: o = "children" } = r, i = [];
866
+ let l = e;
867
+ for (const f of t) {
868
+ const c = l.find((s) => s[n] === f);
869
+ if (c)
870
+ i.push(c[a] || c[n] || String(f)), l = c[o] || [];
48
871
  else {
49
- r.push(String(o));
872
+ i.push(String(f));
50
873
  break;
51
874
  }
52
875
  }
53
- return r;
876
+ return i;
54
877
  }
55
- function ee(e, n, t) {
56
- const { value: l = "value", label: c = "title", children: s = "children" } = t, r = [], u = new Set(Array.isArray(n) ? n : [n]);
57
- function o(a) {
58
- for (const f of a)
59
- u.has(f[l]) && r.push(f[c] || f[l]), f[s] && o(f[s]);
878
+ function Xr(e, t, r) {
879
+ const { value: n = "value", label: a = "title", children: o = "children" } = r, i = [], l = new Set(Array.isArray(t) ? t : [t]);
880
+ function f(c) {
881
+ for (const s of c)
882
+ l.has(s[n]) && i.push(s[a] || s[n]), s[o] && f(s[o]);
60
883
  }
61
- return o(e), r;
884
+ return f(e), i;
62
885
  }
63
- function te({
886
+ function et({
64
887
  modelValue: e,
65
- options: n,
66
- treeData: t,
67
- valueToLabel: l,
68
- fieldNames: c,
69
- slots: s,
70
- isSelect: r,
71
- isRadioGroup: u,
72
- isCheckboxGroup: o,
73
- isCheckbox: a,
74
- isRadio: f,
75
- isCascader: x,
76
- isTreeSelect: m,
77
- isSwitch: R,
888
+ options: t,
889
+ treeData: r,
890
+ valueToLabel: n,
891
+ fieldNames: a,
892
+ slots: o,
893
+ isSelect: i,
894
+ isRadioGroup: l,
895
+ isCheckboxGroup: f,
896
+ isCheckbox: c,
897
+ isRadio: s,
898
+ isCascader: S,
899
+ isTreeSelect: g,
900
+ isSwitch: T,
78
901
  attrs: d,
79
- emptyText: b
902
+ emptyText: p
80
903
  }) {
81
- if (l)
904
+ if (n)
82
905
  try {
83
- return l(e) || b;
84
- } catch (i) {
85
- console.warn("[ReadonlyHOC] valueToLabel error", i);
906
+ return n(e) || p;
907
+ } catch (u) {
908
+ console.warn("[ReadonlyHOC] valueToLabel error", u);
86
909
  }
87
- if (R) {
88
- const i = d.checkedValue ?? d["checked-value"] ?? !0, y = d.uncheckedValue ?? d["un-checked-value"] ?? !1;
89
- return e === i ? d.checkedChildren ?? d["checked-children"] ?? "开启" : e === y ? d.uncheckedChildren ?? d["un-checked-children"] ?? "关闭" : String(e || b);
90
- }
91
- if (x && Array.isArray(e) && n?.length)
92
- return V(n, e, c).join(" / ") || b;
93
- if (m && t?.length)
94
- return ee(t, e, c).join(", ") || b;
95
- if (n?.length) {
96
- const i = c.value || "value", y = c.label || "label", g = (v) => {
97
- const C = n.find((k) => k[i] === v);
98
- return C ? C[y] || C[i] : v == null ? "" : String(v);
910
+ if (T) {
911
+ const u = d.checkedValue ?? d["checked-value"] ?? !0, b = d.uncheckedValue ?? d["un-checked-value"] ?? !1;
912
+ return e === u ? d.checkedChildren ?? d["checked-children"] ?? "开启" : e === b ? d.uncheckedChildren ?? d["un-checked-children"] ?? "关闭" : String(e || p);
913
+ }
914
+ if (S && Array.isArray(e) && t?.length)
915
+ return Qr(t, e, a).join(" / ") || p;
916
+ if (g && r?.length)
917
+ return Xr(r, e, a).join(", ") || p;
918
+ if (t?.length) {
919
+ const u = a.value || "value", b = a.label || "label", m = (v) => {
920
+ const A = t.find((G) => G[u] === v);
921
+ return A ? A[b] || A[u] : v == null ? "" : String(v);
99
922
  };
100
- return Array.isArray(e) ? e.map(g).join(", ") || b : g(e) || b;
101
- } else if ((r || u || o) && s?.default)
923
+ return Array.isArray(e) ? e.map(m).join(", ") || p : m(e) || p;
924
+ } else if ((i || l || f) && o?.default)
102
925
  try {
103
- const i = s.default(), y = P(i, c);
104
- if (y.size > 0) {
105
- const g = (v) => v == null ? "" : y.get(v) || String(v);
106
- return Array.isArray(e) ? e.map(g).join(", ") || b : g(e) || b;
926
+ const u = o.default(), b = $e(u, a);
927
+ if (b.size > 0) {
928
+ const m = (v) => v == null ? "" : b.get(v) || String(v);
929
+ return Array.isArray(e) ? e.map(m).join(", ") || p : m(e) || p;
107
930
  }
108
- } catch (i) {
109
- console.warn("[ReadonlyHOC] Failed to parse slot options", i);
931
+ } catch (u) {
932
+ console.warn("[ReadonlyHOC] Failed to parse slot options", u);
110
933
  }
111
- else if (s?.default && (a || f) && typeof e == "boolean")
934
+ else if (o?.default && (c || s) && typeof e == "boolean")
112
935
  try {
113
- const i = s.default(), y = A(i);
114
- if (y) return y;
936
+ const u = o.default(), b = _(u);
937
+ if (b) return b;
115
938
  } catch {
116
939
  }
117
- return e == null || e === "" ? b : Array.isArray(e) ? e.join(", ") : String(e);
940
+ return e == null || e === "" ? p : Array.isArray(e) ? e.join(", ") : String(e);
118
941
  }
119
- function re(e) {
120
- const n = e.name || "", t = n.toLowerCase(), l = /select/i.test(t) && !/tree|cascader/i.test(t), c = /radio/i.test(t) && !/group/i.test(t), s = /radio.*group/i.test(t), r = /checkbox/i.test(t) && !/group/i.test(t), u = /checkbox.*group/i.test(t), o = /switch/i.test(t), a = /cascader/i.test(t), f = /tree.*select/i.test(t), m = r || o || c ? "checked" : "value", R = `update:${m}`, d = /form$/i.test(t), b = /form.*item/i.test(t);
121
- return E({
122
- name: n,
942
+ function rt(e) {
943
+ if (typeof e == "function")
944
+ return e;
945
+ const t = e.name || "", r = t.toLowerCase(), n = /select/i.test(r) && !/tree|cascader/i.test(r), a = /radio/i.test(r) && !/group/i.test(r), o = /radio.*group/i.test(r), i = /checkbox/i.test(r) && !/group/i.test(r), l = /checkbox.*group/i.test(r), f = /switch/i.test(r), c = /cascader/i.test(r), s = /tree.*select/i.test(r), g = i || f || a ? "checked" : "value", T = `update:${g}`, d = /form$/i.test(r), p = /form.*item/i.test(r);
946
+ return Be({
947
+ name: t,
123
948
  inheritAttrs: !1,
124
949
  props: {
125
950
  modelValue: { type: [String, Number, Boolean, Array, Object], default: void 0 },
126
- [m]: { type: [String, Number, Boolean, Array, Object], default: void 0 },
951
+ [g]: { type: [String, Number, Boolean, Array, Object], default: void 0 },
127
952
  readonly: { type: Boolean, default: void 0 },
128
953
  emptyText: { type: String, default: "--" },
129
- valueToLabel: { type: Function, default: null }
954
+ valueToLabel: { type: Function, default: null },
955
+ copyable: { type: Boolean, default: void 0 }
130
956
  },
131
- emits: ["update:modelValue", R],
132
- setup(i, { emit: y, slots: g, expose: v }) {
133
- const C = B("nkReadonly", T(!1)), k = w(() => i.readonly ?? C.value), F = w(() => i.readonly ?? C.value);
134
- d && U("nkReadonly", F);
135
- const L = w(() => i[m] !== void 0 ? i[m] : i.modelValue), G = (h) => {
136
- y("update:modelValue", h), y(R, h);
137
- }, p = z(), I = w(() => {
138
- if (!k.value) return "";
139
- const h = p.fieldNames ?? p["field-names"] ?? {}, $ = p.options, D = p.treeData ?? p["tree-data"];
140
- return te({
141
- modelValue: L.value,
142
- options: $,
143
- treeData: D,
144
- valueToLabel: i.valueToLabel,
145
- fieldNames: h,
146
- slots: g,
147
- isSelect: l,
148
- isRadioGroup: s,
149
- isCheckboxGroup: u,
150
- isCheckbox: r,
151
- isRadio: c,
152
- isCascader: a,
153
- isTreeSelect: f,
154
- isSwitch: o,
155
- attrs: p,
156
- emptyText: i.emptyText
957
+ emits: ["update:modelValue", T],
958
+ setup(u, { emit: b, slots: m, expose: v }) {
959
+ const A = fe("nkReadonly", H(!1)), G = fe("copyable", H(!0)), j = M(() => u.readonly ?? A.value), q = M(() => u.readonly ?? A.value), K = M(() => u.copyable ?? G.value ?? !0), L = H(!1);
960
+ d && (ce("nkReadonly", q), ce("copyable", K));
961
+ const le = M(() => u[g] !== void 0 ? u[g] : u.modelValue), Re = (y) => {
962
+ b("update:modelValue", y), b(T, y);
963
+ }, w = ze(), D = M(() => {
964
+ if (!j.value) return "";
965
+ const y = w.fieldNames ?? w["field-names"] ?? {}, V = w.options, De = w.treeData ?? w["tree-data"];
966
+ return et({
967
+ modelValue: le.value,
968
+ options: V,
969
+ treeData: De,
970
+ valueToLabel: u.valueToLabel,
971
+ fieldNames: y,
972
+ slots: m,
973
+ isSelect: n,
974
+ isRadioGroup: o,
975
+ isCheckboxGroup: l,
976
+ isCheckbox: i,
977
+ isRadio: a,
978
+ isCascader: c,
979
+ isTreeSelect: s,
980
+ isSwitch: f,
981
+ attrs: w,
982
+ emptyText: u.emptyText
157
983
  });
158
- }), H = {
984
+ }), Ne = {
159
985
  lineHeight: "32px",
160
986
  padding: "0 6px",
161
987
  display: "inline-block",
162
988
  minHeight: "32px",
163
- border: "none",
164
- backgroundColor: "none",
165
- cursor: "default",
989
+ cursor: "text",
166
990
  wordBreak: "break-all",
167
- color: "rgba(0, 0, 0, 0.65)"
168
- }, S = T();
169
- return d && v({
170
- validate: () => k.value ? Promise.resolve({}) : S.value?.validate?.(),
171
- validateFields: (h) => k.value ? Promise.resolve({}) : S.value?.validateFields?.(h),
172
- resetFields: (h) => !k.value && S.value?.resetFields?.(h),
173
- clearValidate: (h) => !k.value && S.value?.clearValidate?.(h),
174
- scrollToField: (h) => !k.value && S.value?.scrollToField?.(h)
175
- }), () => b ? j(
991
+ color: "rgba(0, 0, 0, 0.85)",
992
+ position: "relative",
993
+ borderRadius: "4px",
994
+ border: "none",
995
+ backgroundColor: "none"
996
+ }, F = H();
997
+ d && v({
998
+ validate: () => j.value ? Promise.resolve({}) : F.value?.validate?.(),
999
+ validateFields: (y) => j.value ? Promise.resolve({}) : F.value?.validateFields?.(y),
1000
+ resetFields: (y) => !j.value && F.value?.resetFields?.(y),
1001
+ clearValidate: (y) => !j.value && F.value?.clearValidate?.(y),
1002
+ scrollToField: (y) => !j.value && F.value?.scrollToField?.(y)
1003
+ });
1004
+ const _e = () => {
1005
+ L.value = !0;
1006
+ }, Le = () => {
1007
+ L.value = !1;
1008
+ };
1009
+ return () => p ? k(
176
1010
  e,
177
1011
  {
178
- ...p,
179
- style: { ...p.style || {}, marginBottom: k.value ? "10px" : void 0 }
1012
+ ...w,
1013
+ style: { ...w.style || {}, marginBottom: j.value ? "10px" : void 0 }
180
1014
  },
181
- g
182
- ) : d ? j(
1015
+ m
1016
+ ) : d ? k(
183
1017
  e,
184
1018
  {
185
- ...p,
186
- rules: F.value ? null : p.rules,
187
- disabled: F.value ? !0 : p.disabled,
188
- ref: S
1019
+ ...w,
1020
+ rules: q.value ? null : w.rules,
1021
+ disabled: q.value ? !0 : w.disabled,
1022
+ ref: F
189
1023
  },
190
- g
191
- ) : k.value ? j(
1024
+ m
1025
+ ) : j.value ? k(
192
1026
  "span",
193
1027
  {
1028
+ onMouseenter: _e,
1029
+ onMouseleave: Le,
194
1030
  class: "nk-readonly-wrapper",
195
- style: H,
196
- role: "text",
197
- tabindex: 0,
198
- "aria-readonly": "true"
1031
+ style: {
1032
+ ...Ne,
1033
+ color: K.value && L.value ? "#6e9eff" : "rgba(0, 0, 0, 0.65)"
1034
+ }
199
1035
  },
200
- I.value
201
- ) : j(
1036
+ [
1037
+ k("span", { style: { marginRight: "8px" } }, D.value),
1038
+ K.value && D.value !== u.emptyText ? k(
1039
+ "span",
1040
+ {
1041
+ class: "copy-icon",
1042
+ style: {
1043
+ visibility: L.value ? "visible" : "hidden",
1044
+ marginLeft: "8px"
1045
+ }
1046
+ },
1047
+ [
1048
+ k(
1049
+ ie,
1050
+ {
1051
+ onClick: async () => {
1052
+ if (window.__POWERED_BY_WUJIE__)
1053
+ await window.gvUtil?.clipboard(null, D.value);
1054
+ else {
1055
+ const y = new Blob([D.value], { type: "text/plain" }), V = new ClipboardItem({ "text/plain": y });
1056
+ await navigator.clipboard.write([V]), Ue.success("复制成功");
1057
+ }
1058
+ },
1059
+ style: {
1060
+ cursor: "pointer",
1061
+ color: "#447dfd",
1062
+ fontSize: "12px",
1063
+ position: "absolute",
1064
+ top: "5px",
1065
+ right: "6px"
1066
+ }
1067
+ }
1068
+ )
1069
+ ]
1070
+ ) : null
1071
+ ]
1072
+ ) : k(
202
1073
  e,
203
1074
  {
204
- ...p,
205
- [m]: L.value,
206
- [`onUpdate:${m}`]: G,
207
- ref: d ? S : void 0
1075
+ ...w,
1076
+ [g]: le.value,
1077
+ [`onUpdate:${g}`]: Re,
1078
+ ref: d ? F : void 0
208
1079
  },
209
- g
1080
+ m
210
1081
  );
211
1082
  }
212
1083
  });
213
1084
  }
214
- const ne = {
215
- Input: _,
216
- InputNumber: Z,
217
- Textarea: Y,
218
- Select: M,
219
- SelectOption: M.Option,
220
- TreeSelect: X,
221
- Cascader: W,
222
- DatePicker: Q,
223
- TimePicker: J,
224
- Radio: N,
225
- Checkbox: O,
226
- RadioGroup: N.Group,
227
- CheckboxGroup: O.Group,
228
- Switch: q,
229
- Form: K,
230
- FormItem: K.Item
231
- }, ae = {
1085
+ const tt = {
1086
+ Input: Ze,
1087
+ InputNumber: Je,
1088
+ Textarea: Ye,
1089
+ Select: pe,
1090
+ SelectOption: pe.Option,
1091
+ TreeSelect: Ve,
1092
+ Cascader: Ke,
1093
+ DatePicker: qe,
1094
+ TimePicker: Ge,
1095
+ Radio: de,
1096
+ Checkbox: se,
1097
+ RadioGroup: de.Group,
1098
+ CheckboxGroup: se.Group,
1099
+ Switch: We,
1100
+ Form: ue,
1101
+ FormItem: ue.Item
1102
+ }, ot = {
232
1103
  install(e) {
233
- for (const [n, t] of Object.entries(ne))
234
- if (t) {
235
- const l = re(t);
236
- e.component(`Nk${n}`, l);
1104
+ for (const [t, r] of Object.entries(tt))
1105
+ if (r) {
1106
+ const n = rt(r);
1107
+ e.component(`Nk${t}`, n);
237
1108
  }
238
1109
  }
239
1110
  };
240
1111
  export {
241
- ae as NkReadonlyPlugin,
242
- re as withReadonly
1112
+ ot as default,
1113
+ rt as withReadonly
243
1114
  };