@yqg/permission 1.3.0-alpha.5 → 1.3.0-alpha.6

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.
@@ -0,0 +1,1250 @@
1
+ import { c as ge, Y as Ne, a as _, a1 as Ge, b as nt, _ as P, ae as We, aX as Me, aZ as He, P as ne, $ as Be, ar as at, as as it, aE as st, aY as rt, a_ as ct, a0 as _e, ak as Ce, aj as ut, am as dt, N as vt, R as mt, a$ as ft, b0 as gt, Q as pt, b1 as ht, b2 as bt, b3 as yt, aq as St, aD as Ct, aP as G, aS as we, aQ as At } from "./yqg-permission-BZ4qZKdy.js";
2
+ import { p as Ot, a as It, d as pe, c as A, G as wt, w as Ee, E as Xe, q as je, e as N, F as Re, s as de, b as Ve, y as oe, r as Ye, K as q, P as Ae, L as Oe, M as J, S as Te, R as H, O as xt, u as R, U as ue, N as W, a0 as Vt, Y as Nt } from "./index-3gtBphGl.js";
3
+ import { L as Tt, j as Pt, p as Et, K as Z, d as Ft, F as Dt, e as Bt, f as Rt, Q as kt } from "./apply-modal-BLik7xOg.js";
4
+ import { u as $t, b as Lt, T as Mt, i as Fe, c as Ht, h as _t, j as jt, k as zt, t as Ut, B as Kt, e as Gt, f as Wt, g as Xt } from "./index-okxSyYmx.js";
5
+ function Yt() {
6
+ return /(mac\sos|macintosh)/i.test(navigator.appVersion);
7
+ }
8
+ const Qe = Symbol("SelectContextKey");
9
+ function Qt(e) {
10
+ return Ot(Qe, e);
11
+ }
12
+ function qt() {
13
+ return It(Qe, {});
14
+ }
15
+ var Jt = function(e, g) {
16
+ var i = {};
17
+ for (var o in e) Object.prototype.hasOwnProperty.call(e, o) && g.indexOf(o) < 0 && (i[o] = e[o]);
18
+ if (e != null && typeof Object.getOwnPropertySymbols == "function") for (var t = 0, o = Object.getOwnPropertySymbols(e); t < o.length; t++)
19
+ g.indexOf(o[t]) < 0 && Object.prototype.propertyIsEnumerable.call(e, o[t]) && (i[o[t]] = e[o[t]]);
20
+ return i;
21
+ };
22
+ function ze(e) {
23
+ return typeof e == "string" || typeof e == "number";
24
+ }
25
+ const Zt = pe({
26
+ compatConfig: {
27
+ MODE: 3
28
+ },
29
+ name: "OptionList",
30
+ inheritAttrs: !1,
31
+ setup(e, g) {
32
+ let {
33
+ expose: i,
34
+ slots: o
35
+ } = g;
36
+ const t = $t(), n = qt(), v = A(() => `${t.prefixCls}-item`), m = Lt(() => n.flattenOptions, [() => t.open, () => n.flattenOptions], (r) => r[0]), p = Pt(), f = (r) => {
37
+ r.preventDefault();
38
+ }, a = (r) => {
39
+ p.current && p.current.scrollTo(typeof r == "number" ? {
40
+ index: r
41
+ } : r);
42
+ }, b = function(r) {
43
+ let O = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 1;
44
+ const x = m.value.length;
45
+ for (let y = 0; y < x; y += 1) {
46
+ const F = (r + y * O + x) % x, {
47
+ group: j,
48
+ data: L
49
+ } = m.value[F];
50
+ if (!j && !L.disabled)
51
+ return F;
52
+ }
53
+ return -1;
54
+ }, V = wt({
55
+ activeIndex: b(0)
56
+ }), w = function(r) {
57
+ let O = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1;
58
+ V.activeIndex = r;
59
+ const x = {
60
+ source: O ? "keyboard" : "mouse"
61
+ }, y = m.value[r];
62
+ if (!y) {
63
+ n.onActiveValue(null, -1, x);
64
+ return;
65
+ }
66
+ n.onActiveValue(y.value, r, x);
67
+ };
68
+ Ee([() => m.value.length, () => t.searchValue], () => {
69
+ w(n.defaultActiveFirstOption !== !1 ? b(0) : -1);
70
+ }, {
71
+ immediate: !0
72
+ });
73
+ const c = (r) => n.rawValues.has(r) && t.mode !== "combobox";
74
+ Ee([() => t.open, () => t.searchValue], () => {
75
+ if (!t.multiple && t.open && n.rawValues.size === 1) {
76
+ const r = Array.from(n.rawValues)[0], O = Xe(m.value).findIndex((x) => {
77
+ let {
78
+ data: y
79
+ } = x;
80
+ return y[n.fieldNames.value] === r;
81
+ });
82
+ O !== -1 && (w(O), je(() => {
83
+ a(O);
84
+ }));
85
+ }
86
+ t.open && je(() => {
87
+ var r;
88
+ (r = p.current) === null || r === void 0 || r.scrollTo(void 0);
89
+ });
90
+ }, {
91
+ immediate: !0,
92
+ flush: "post"
93
+ });
94
+ const S = (r) => {
95
+ r !== void 0 && n.onSelect(r, {
96
+ selected: !n.rawValues.has(r)
97
+ }), t.multiple || t.toggleOpen(!1);
98
+ }, I = (r) => typeof r.label == "function" ? r.label() : r.label;
99
+ function E(r) {
100
+ const O = m.value[r];
101
+ if (!O) return null;
102
+ const x = O.data || {}, {
103
+ value: y
104
+ } = x, {
105
+ group: F
106
+ } = O, j = Et(x, !0), L = I(O);
107
+ return O ? N("div", _(_({
108
+ "aria-label": typeof L == "string" && !F ? L : null
109
+ }, j), {}, {
110
+ key: r,
111
+ role: F ? "presentation" : "option",
112
+ id: `${t.id}_list_${r}`,
113
+ "aria-selected": c(y)
114
+ }), [y]) : null;
115
+ }
116
+ return i({
117
+ onKeydown: (r) => {
118
+ const {
119
+ which: O,
120
+ ctrlKey: x
121
+ } = r;
122
+ switch (O) {
123
+ case Z.N:
124
+ case Z.P:
125
+ case Z.UP:
126
+ case Z.DOWN: {
127
+ let y = 0;
128
+ if (O === Z.UP ? y = -1 : O === Z.DOWN ? y = 1 : Yt() && x && (O === Z.N ? y = 1 : O === Z.P && (y = -1)), y !== 0) {
129
+ const F = b(V.activeIndex + y, y);
130
+ a(F), w(F, !0);
131
+ }
132
+ break;
133
+ }
134
+ case Z.ENTER: {
135
+ const y = m.value[V.activeIndex];
136
+ y && !y.data.disabled ? S(y.value) : S(void 0), t.open && r.preventDefault();
137
+ break;
138
+ }
139
+ case Z.ESC:
140
+ t.toggleOpen(!1), t.open && r.stopPropagation();
141
+ }
142
+ },
143
+ onKeyup: () => {
144
+ },
145
+ scrollTo: (r) => {
146
+ a(r);
147
+ }
148
+ }), () => {
149
+ const {
150
+ id: r,
151
+ notFoundContent: O,
152
+ onPopupScroll: x
153
+ } = t, {
154
+ menuItemSelectedIcon: y,
155
+ fieldNames: F,
156
+ virtual: j,
157
+ listHeight: L,
158
+ listItemHeight: he
159
+ } = n, Y = o.option, {
160
+ activeIndex: z
161
+ } = V, be = Object.keys(F).map((M) => F[M]);
162
+ return m.value.length === 0 ? N("div", {
163
+ role: "listbox",
164
+ id: `${r}_list`,
165
+ class: `${v.value}-empty`,
166
+ onMousedown: f
167
+ }, [O]) : N(Re, null, [N("div", {
168
+ role: "listbox",
169
+ id: `${r}_list`,
170
+ style: {
171
+ height: 0,
172
+ width: 0,
173
+ overflow: "hidden"
174
+ }
175
+ }, [E(z - 1), E(z), E(z + 1)]), N(Tt, {
176
+ itemKey: "key",
177
+ ref: p,
178
+ data: m.value,
179
+ height: L,
180
+ itemHeight: he,
181
+ fullHeight: !1,
182
+ onMousedown: f,
183
+ onScroll: x,
184
+ virtual: j
185
+ }, {
186
+ default: (M, ae) => {
187
+ var ie;
188
+ const {
189
+ group: ye,
190
+ groupOption: ve,
191
+ data: U,
192
+ value: C
193
+ } = M, {
194
+ key: k
195
+ } = U, $ = typeof M.label == "function" ? M.label() : M.label;
196
+ if (ye) {
197
+ const ce = (ie = U.title) !== null && ie !== void 0 ? ie : ze($) && $;
198
+ return N("div", {
199
+ class: ge(v.value, `${v.value}-group`),
200
+ title: ce
201
+ }, [Y ? Y(U) : $ !== void 0 ? $ : k]);
202
+ }
203
+ const {
204
+ disabled: Q,
205
+ title: se,
206
+ children: re,
207
+ style: Se,
208
+ class: l,
209
+ className: s
210
+ } = U, u = Jt(U, ["disabled", "title", "children", "style", "class", "className"]), h = Ne(u, be), d = c(C), D = `${v.value}-option`, le = ge(v.value, D, l, s, {
211
+ [`${D}-grouped`]: ve,
212
+ [`${D}-active`]: z === ae && !Q,
213
+ [`${D}-disabled`]: Q,
214
+ [`${D}-selected`]: d
215
+ }), K = I(M), me = !y || typeof y == "function" || d, T = typeof K == "number" ? K : K || C;
216
+ let Ie = ze(T) ? T.toString() : void 0;
217
+ return se !== void 0 && (Ie = se), N("div", _(_({}, h), {}, {
218
+ "aria-selected": d,
219
+ class: le,
220
+ title: Ie,
221
+ onMousemove: (ce) => {
222
+ u.onMousemove && u.onMousemove(ce), !(z === ae || Q) && w(ae);
223
+ },
224
+ onClick: (ce) => {
225
+ Q || S(C), u.onClick && u.onClick(ce);
226
+ },
227
+ style: Se
228
+ }), [N("div", {
229
+ class: `${D}-content`
230
+ }, [Y ? Y(U) : T]), Ge(y) || d, me && N(Mt, {
231
+ class: `${v.value}-option-state`,
232
+ customizeIcon: y,
233
+ customizeIconProps: {
234
+ isSelected: d
235
+ }
236
+ }, {
237
+ default: () => [d ? "✓" : null]
238
+ })]);
239
+ }
240
+ })]);
241
+ };
242
+ }
243
+ });
244
+ var el = function(e, g) {
245
+ var i = {};
246
+ for (var o in e) Object.prototype.hasOwnProperty.call(e, o) && g.indexOf(o) < 0 && (i[o] = e[o]);
247
+ if (e != null && typeof Object.getOwnPropertySymbols == "function") for (var t = 0, o = Object.getOwnPropertySymbols(e); t < o.length; t++)
248
+ g.indexOf(o[t]) < 0 && Object.prototype.propertyIsEnumerable.call(e, o[t]) && (i[o[t]] = e[o[t]]);
249
+ return i;
250
+ };
251
+ function tl(e) {
252
+ const g = e, {
253
+ key: i,
254
+ children: o
255
+ } = g, t = g.props, {
256
+ value: n,
257
+ disabled: v
258
+ } = t, m = el(t, ["value", "disabled"]), p = o == null ? void 0 : o.default;
259
+ return P({
260
+ key: i,
261
+ value: n !== void 0 ? n : i,
262
+ children: p,
263
+ disabled: v || v === ""
264
+ }, m);
265
+ }
266
+ function qe(e) {
267
+ let g = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1;
268
+ return nt(e).map((o, t) => {
269
+ var n;
270
+ if (!Ge(o) || !o.type)
271
+ return null;
272
+ const {
273
+ type: {
274
+ isSelectOptGroup: v
275
+ },
276
+ key: m,
277
+ children: p,
278
+ props: f
279
+ } = o;
280
+ if (g || !v)
281
+ return tl(o);
282
+ const a = p && p.default ? p.default() : void 0, b = (f == null ? void 0 : f.label) || ((n = p.label) === null || n === void 0 ? void 0 : n.call(p)) || m;
283
+ return P(P({
284
+ key: `__RC_SELECT_GRP__${m === null ? t : String(m)}__`
285
+ }, f), {
286
+ label: b,
287
+ options: qe(a || [])
288
+ });
289
+ }).filter((o) => o);
290
+ }
291
+ function ll(e, g, i) {
292
+ const o = de(), t = de(), n = de(), v = de([]);
293
+ return Ee([e, g], () => {
294
+ e.value ? v.value = Xe(e.value).slice() : v.value = qe(g.value);
295
+ }, {
296
+ immediate: !0,
297
+ deep: !0
298
+ }), Ve(() => {
299
+ const m = v.value, p = /* @__PURE__ */ new Map(), f = /* @__PURE__ */ new Map(), a = i.value;
300
+ function b(V) {
301
+ let w = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1;
302
+ for (let c = 0; c < V.length; c += 1) {
303
+ const S = V[c];
304
+ !S[a.options] || w ? (p.set(S[a.value], S), f.set(S[a.label], S)) : b(S[a.options], !0);
305
+ }
306
+ }
307
+ b(m), o.value = m, t.value = p, n.value = f;
308
+ }), {
309
+ options: o,
310
+ valueOptions: t,
311
+ labelOptions: n
312
+ };
313
+ }
314
+ function Je(e) {
315
+ return Array.isArray(e) ? e : e !== void 0 ? [e] : [];
316
+ }
317
+ function Pe(e, g) {
318
+ return Je(e).join("").toUpperCase().includes(g);
319
+ }
320
+ const ol = (e, g, i, o, t) => A(() => {
321
+ const n = i.value, v = t == null ? void 0 : t.value, m = o == null ? void 0 : o.value;
322
+ if (!n || m === !1)
323
+ return e.value;
324
+ const {
325
+ options: p,
326
+ label: f,
327
+ value: a
328
+ } = g.value, b = [], V = typeof m == "function", w = n.toUpperCase(), c = V ? m : (I, E) => v ? Pe(E[v], w) : E[p] ? Pe(E[f !== "children" ? f : "label"], w) : Pe(E[a], w), S = V ? (I) => Fe(I) : (I) => I;
329
+ return e.value.forEach((I) => {
330
+ if (I[p]) {
331
+ if (c(n, S(I)))
332
+ b.push(I);
333
+ else {
334
+ const X = I[p].filter((te) => c(n, S(te)));
335
+ X.length && b.push(P(P({}, I), {
336
+ [p]: X
337
+ }));
338
+ }
339
+ return;
340
+ }
341
+ c(n, S(I)) && b.push(I);
342
+ }), b;
343
+ }), nl = (e, g) => {
344
+ const i = de({
345
+ values: /* @__PURE__ */ new Map(),
346
+ options: /* @__PURE__ */ new Map()
347
+ });
348
+ return [A(() => {
349
+ const {
350
+ values: n,
351
+ options: v
352
+ } = i.value, m = e.value.map((a) => {
353
+ var b;
354
+ return a.label === void 0 ? P(P({}, a), {
355
+ label: (b = n.get(a.value)) === null || b === void 0 ? void 0 : b.label
356
+ }) : a;
357
+ }), p = /* @__PURE__ */ new Map(), f = /* @__PURE__ */ new Map();
358
+ return m.forEach((a) => {
359
+ p.set(a.value, a), f.set(a.value, g.value.get(a.value) || v.get(a.value));
360
+ }), i.value.values = p, i.value.options = f, m;
361
+ }), (n) => g.value.get(n) || i.value.options.get(n)];
362
+ }, al = ["inputValue"];
363
+ function Ze() {
364
+ return P(P({}, Gt()), {
365
+ prefixCls: String,
366
+ id: String,
367
+ backfill: {
368
+ type: Boolean,
369
+ default: void 0
370
+ },
371
+ // >>> Field Names
372
+ fieldNames: Object,
373
+ // >>> Search
374
+ /** @deprecated Use `searchValue` instead */
375
+ inputValue: String,
376
+ searchValue: String,
377
+ onSearch: Function,
378
+ autoClearSearchValue: {
379
+ type: Boolean,
380
+ default: void 0
381
+ },
382
+ // >>> Select
383
+ onSelect: Function,
384
+ onDeselect: Function,
385
+ // >>> Options
386
+ /**
387
+ * In Select, `false` means do nothing.
388
+ * In TreeSelect, `false` will highlight match item.
389
+ * It's by design.
390
+ */
391
+ filterOption: {
392
+ type: [Boolean, Function],
393
+ default: void 0
394
+ },
395
+ filterSort: Function,
396
+ optionFilterProp: String,
397
+ optionLabelProp: String,
398
+ options: Array,
399
+ defaultActiveFirstOption: {
400
+ type: Boolean,
401
+ default: void 0
402
+ },
403
+ virtual: {
404
+ type: Boolean,
405
+ default: void 0
406
+ },
407
+ listHeight: Number,
408
+ listItemHeight: Number,
409
+ // >>> Icon
410
+ menuItemSelectedIcon: ne.any,
411
+ mode: String,
412
+ labelInValue: {
413
+ type: Boolean,
414
+ default: void 0
415
+ },
416
+ value: ne.any,
417
+ defaultValue: ne.any,
418
+ onChange: Function,
419
+ children: Array
420
+ });
421
+ }
422
+ function il(e) {
423
+ return !e || typeof e != "object";
424
+ }
425
+ const sl = pe({
426
+ compatConfig: {
427
+ MODE: 3
428
+ },
429
+ name: "VcSelect",
430
+ inheritAttrs: !1,
431
+ props: We(Ze(), {
432
+ prefixCls: "vc-select",
433
+ autoClearSearchValue: !0,
434
+ listHeight: 200,
435
+ listItemHeight: 20,
436
+ dropdownMatchSelectWidth: !0
437
+ }),
438
+ setup(e, g) {
439
+ let {
440
+ expose: i,
441
+ attrs: o,
442
+ slots: t
443
+ } = g;
444
+ const n = Ht(oe(e, "id")), v = A(() => _t(e.mode)), m = A(() => !!(!e.options && e.children)), p = A(() => e.filterOption === void 0 && e.mode === "combobox" ? !1 : e.filterOption), f = A(() => jt(e.fieldNames, m.value)), [a, b] = Me("", {
445
+ value: A(() => e.searchValue !== void 0 ? e.searchValue : e.inputValue),
446
+ postState: (l) => l || ""
447
+ }), V = ll(oe(e, "options"), oe(e, "children"), f), {
448
+ valueOptions: w,
449
+ labelOptions: c,
450
+ options: S
451
+ } = V, I = (l) => Je(l).map((u) => {
452
+ var h, d;
453
+ let D, le, K, me;
454
+ il(u) ? D = u : (K = u.key, le = u.label, D = (h = u.value) !== null && h !== void 0 ? h : K);
455
+ const T = w.value.get(D);
456
+ return T && (le === void 0 && (le = T == null ? void 0 : T[e.optionLabelProp || f.value.label]), K === void 0 && (K = (d = T == null ? void 0 : T.key) !== null && d !== void 0 ? d : D), me = T == null ? void 0 : T.disabled), {
457
+ label: le,
458
+ value: D,
459
+ key: K,
460
+ disabled: me,
461
+ option: T
462
+ };
463
+ }), [E, X] = Me(e.defaultValue, {
464
+ value: oe(e, "value")
465
+ }), te = A(() => {
466
+ var l;
467
+ const s = I(E.value);
468
+ return e.mode === "combobox" && !(!((l = s[0]) === null || l === void 0) && l.value) ? [] : s;
469
+ }), [B, r] = nl(te, w), O = A(() => {
470
+ if (!e.mode && B.value.length === 1) {
471
+ const l = B.value[0];
472
+ if (l.value === null && (l.label === null || l.label === void 0))
473
+ return [];
474
+ }
475
+ return B.value.map((l) => {
476
+ var s;
477
+ return P(P({}, l), {
478
+ label: (s = typeof l.label == "function" ? l.label() : l.label) !== null && s !== void 0 ? s : l.value
479
+ });
480
+ });
481
+ }), x = A(() => new Set(B.value.map((l) => l.value)));
482
+ Ve(() => {
483
+ var l;
484
+ if (e.mode === "combobox") {
485
+ const s = (l = B.value[0]) === null || l === void 0 ? void 0 : l.value;
486
+ s != null && b(String(s));
487
+ }
488
+ }, {
489
+ flush: "post"
490
+ });
491
+ const y = (l, s) => {
492
+ const u = s ?? l;
493
+ return {
494
+ [f.value.value]: l,
495
+ [f.value.label]: u
496
+ };
497
+ }, F = de();
498
+ Ve(() => {
499
+ if (e.mode !== "tags") {
500
+ F.value = S.value;
501
+ return;
502
+ }
503
+ const l = S.value.slice(), s = (u) => w.value.has(u);
504
+ [...B.value].sort((u, h) => u.value < h.value ? -1 : 1).forEach((u) => {
505
+ const h = u.value;
506
+ s(h) || l.push(y(h, u.label));
507
+ }), F.value = l;
508
+ });
509
+ const j = ol(F, f, a, p, oe(e, "optionFilterProp")), L = A(() => e.mode !== "tags" || !a.value || j.value.some((l) => l[e.optionFilterProp || "value"] === a.value) ? j.value : [y(a.value), ...j.value]), he = A(() => e.filterSort ? [...L.value].sort((l, s) => e.filterSort(l, s)) : L.value), Y = A(() => zt(he.value, {
510
+ fieldNames: f.value,
511
+ childrenAsData: m.value
512
+ })), z = (l) => {
513
+ const s = I(l);
514
+ if (X(s), e.onChange && // Trigger event only when value changed
515
+ (s.length !== B.value.length || s.some((u, h) => {
516
+ var d;
517
+ return ((d = B.value[h]) === null || d === void 0 ? void 0 : d.value) !== (u == null ? void 0 : u.value);
518
+ }))) {
519
+ const u = e.labelInValue ? s.map((d) => P(P({}, d), {
520
+ originLabel: d.label,
521
+ label: typeof d.label == "function" ? d.label() : d.label
522
+ })) : s.map((d) => d.value), h = s.map((d) => Fe(r(d.value)));
523
+ e.onChange(
524
+ // Value
525
+ v.value ? u : u[0],
526
+ // Option
527
+ v.value ? h : h[0]
528
+ );
529
+ }
530
+ }, [be, M] = He(null), [ae, ie] = He(0), ye = A(() => e.defaultActiveFirstOption !== void 0 ? e.defaultActiveFirstOption : e.mode !== "combobox"), ve = function(l, s) {
531
+ let {
532
+ source: u = "keyboard"
533
+ } = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
534
+ ie(s), e.backfill && e.mode === "combobox" && l !== null && u === "keyboard" && M(String(l));
535
+ }, U = (l, s) => {
536
+ const u = () => {
537
+ var h;
538
+ const d = r(l), D = d == null ? void 0 : d[f.value.label];
539
+ return [e.labelInValue ? {
540
+ label: typeof D == "function" ? D() : D,
541
+ originLabel: D,
542
+ value: l,
543
+ key: (h = d == null ? void 0 : d.key) !== null && h !== void 0 ? h : l
544
+ } : l, Fe(d)];
545
+ };
546
+ if (s && e.onSelect) {
547
+ const [h, d] = u();
548
+ e.onSelect(h, d);
549
+ } else if (!s && e.onDeselect) {
550
+ const [h, d] = u();
551
+ e.onDeselect(h, d);
552
+ }
553
+ }, C = (l, s) => {
554
+ let u;
555
+ const h = v.value ? s.selected : !0;
556
+ h ? u = v.value ? [...B.value, l] : [l] : u = B.value.filter((d) => d.value !== l), z(u), U(l, h), e.mode === "combobox" ? M("") : (!v.value || e.autoClearSearchValue) && (b(""), M(""));
557
+ }, k = (l, s) => {
558
+ z(l), (s.type === "remove" || s.type === "clear") && s.values.forEach((u) => {
559
+ U(u.value, !1);
560
+ });
561
+ }, $ = (l, s) => {
562
+ var u;
563
+ if (b(l), M(null), s.source === "submit") {
564
+ const h = (l || "").trim();
565
+ if (h) {
566
+ const d = Array.from(/* @__PURE__ */ new Set([...x.value, h]));
567
+ z(d), U(h, !0), b("");
568
+ }
569
+ return;
570
+ }
571
+ s.source !== "blur" && (e.mode === "combobox" && z(l), (u = e.onSearch) === null || u === void 0 || u.call(e, l));
572
+ }, Q = (l) => {
573
+ let s = l;
574
+ e.mode !== "tags" && (s = l.map((h) => {
575
+ const d = c.value.get(h);
576
+ return d == null ? void 0 : d.value;
577
+ }).filter((h) => h !== void 0));
578
+ const u = Array.from(/* @__PURE__ */ new Set([...x.value, ...s]));
579
+ z(u), u.forEach((h) => {
580
+ U(h, !0);
581
+ });
582
+ }, se = A(() => e.virtual !== !1 && e.dropdownMatchSelectWidth !== !1);
583
+ Qt(Ut(P(P({}, V), {
584
+ flattenOptions: Y,
585
+ onActiveValue: ve,
586
+ defaultActiveFirstOption: ye,
587
+ onSelect: C,
588
+ menuItemSelectedIcon: oe(e, "menuItemSelectedIcon"),
589
+ rawValues: x,
590
+ fieldNames: f,
591
+ virtual: se,
592
+ listHeight: oe(e, "listHeight"),
593
+ listItemHeight: oe(e, "listItemHeight"),
594
+ childrenAsData: m
595
+ })));
596
+ const re = Ye();
597
+ i({
598
+ focus() {
599
+ var l;
600
+ (l = re.value) === null || l === void 0 || l.focus();
601
+ },
602
+ blur() {
603
+ var l;
604
+ (l = re.value) === null || l === void 0 || l.blur();
605
+ },
606
+ scrollTo(l) {
607
+ var s;
608
+ (s = re.value) === null || s === void 0 || s.scrollTo(l);
609
+ }
610
+ });
611
+ const Se = A(() => Ne(e, [
612
+ "id",
613
+ "mode",
614
+ "prefixCls",
615
+ "backfill",
616
+ "fieldNames",
617
+ // Search
618
+ "inputValue",
619
+ "searchValue",
620
+ "onSearch",
621
+ "autoClearSearchValue",
622
+ // Select
623
+ "onSelect",
624
+ "onDeselect",
625
+ "dropdownMatchSelectWidth",
626
+ // Options
627
+ "filterOption",
628
+ "filterSort",
629
+ "optionFilterProp",
630
+ "optionLabelProp",
631
+ "options",
632
+ "children",
633
+ "defaultActiveFirstOption",
634
+ "menuItemSelectedIcon",
635
+ "virtual",
636
+ "listHeight",
637
+ "listItemHeight",
638
+ // Value
639
+ "value",
640
+ "defaultValue",
641
+ "labelInValue",
642
+ "onChange"
643
+ ]));
644
+ return () => N(Kt, _(_(_({}, Se.value), o), {}, {
645
+ id: n,
646
+ prefixCls: e.prefixCls,
647
+ ref: re,
648
+ omitDomProps: al,
649
+ mode: e.mode,
650
+ displayValues: O.value,
651
+ onDisplayValuesChange: k,
652
+ searchValue: a.value,
653
+ onSearch: $,
654
+ onSearchSplit: Q,
655
+ dropdownMatchSelectWidth: e.dropdownMatchSelectWidth,
656
+ OptionList: Zt,
657
+ emptyOptions: !Y.value.length,
658
+ activeValue: be.value,
659
+ activeDescendantId: `${n}_list_${ae.value}`
660
+ }), t);
661
+ }
662
+ }), ke = () => null;
663
+ ke.isSelectOption = !0;
664
+ ke.displayName = "ASelectOption";
665
+ const $e = () => null;
666
+ $e.isSelectOptGroup = !0;
667
+ $e.displayName = "ASelectOptGroup";
668
+ const rl = () => P(P({}, Ne(Ze(), ["inputIcon", "mode", "getInputElement", "getRawInputElement", "backfill"])), {
669
+ value: _e([Array, Object, String, Number]),
670
+ defaultValue: _e([Array, Object, String, Number]),
671
+ notFoundContent: ne.any,
672
+ suffixIcon: ne.any,
673
+ itemIcon: ne.any,
674
+ size: Ce(),
675
+ mode: Ce(),
676
+ bordered: ut(!0),
677
+ transitionName: String,
678
+ choiceTransitionName: Ce(""),
679
+ popupClassName: String,
680
+ /** @deprecated Please use `popupClassName` instead */
681
+ dropdownClassName: String,
682
+ placement: Ce(),
683
+ status: Ce(),
684
+ "onUpdate:value": dt()
685
+ }), Ue = "SECRET_COMBOBOX_MODE_DO_NOT_USE", ee = pe({
686
+ compatConfig: {
687
+ MODE: 3
688
+ },
689
+ name: "ASelect",
690
+ Option: ke,
691
+ OptGroup: $e,
692
+ inheritAttrs: !1,
693
+ props: We(rl(), {
694
+ listHeight: 256,
695
+ listItemHeight: 24
696
+ }),
697
+ SECRET_COMBOBOX_MODE_DO_NOT_USE: Ue,
698
+ slots: Object,
699
+ setup(e, g) {
700
+ let {
701
+ attrs: i,
702
+ emit: o,
703
+ slots: t,
704
+ expose: n
705
+ } = g;
706
+ const v = Ye(), m = Ft(), p = Dt.useInject(), f = A(() => Bt(p.status, e.status)), a = () => {
707
+ var C;
708
+ (C = v.value) === null || C === void 0 || C.focus();
709
+ }, b = () => {
710
+ var C;
711
+ (C = v.value) === null || C === void 0 || C.blur();
712
+ }, V = (C) => {
713
+ var k;
714
+ (k = v.value) === null || k === void 0 || k.scrollTo(C);
715
+ }, w = A(() => {
716
+ const {
717
+ mode: C
718
+ } = e;
719
+ if (C !== "combobox")
720
+ return C === Ue ? "combobox" : C;
721
+ }), {
722
+ prefixCls: c,
723
+ direction: S,
724
+ configProvider: I,
725
+ renderEmpty: E,
726
+ size: X,
727
+ getPrefixCls: te,
728
+ getPopupContainer: B,
729
+ disabled: r,
730
+ select: O
731
+ } = Be("select", e), {
732
+ compactSize: x,
733
+ compactItemClassnames: y
734
+ } = at(c, S), F = A(() => x.value || X.value), j = it(), L = A(() => {
735
+ var C;
736
+ return (C = r.value) !== null && C !== void 0 ? C : j.value;
737
+ }), [he, Y] = Wt(c), z = A(() => te()), be = A(() => e.placement !== void 0 ? e.placement : S.value === "rtl" ? "bottomRight" : "bottomLeft"), M = A(() => st(z.value, rt(be.value), e.transitionName)), ae = A(() => ge({
738
+ [`${c.value}-lg`]: F.value === "large",
739
+ [`${c.value}-sm`]: F.value === "small",
740
+ [`${c.value}-rtl`]: S.value === "rtl",
741
+ [`${c.value}-borderless`]: !e.bordered,
742
+ [`${c.value}-in-form-item`]: p.isFormItemInput
743
+ }, Rt(c.value, f.value, p.hasFeedback), y.value, Y.value)), ie = function() {
744
+ for (var C = arguments.length, k = new Array(C), $ = 0; $ < C; $++)
745
+ k[$] = arguments[$];
746
+ o("update:value", k[0]), o("change", ...k), m.onFieldChange();
747
+ }, ye = (C) => {
748
+ o("blur", C), m.onFieldBlur();
749
+ };
750
+ n({
751
+ blur: b,
752
+ focus: a,
753
+ scrollTo: V
754
+ });
755
+ const ve = A(() => w.value === "multiple" || w.value === "tags"), U = A(() => e.showArrow !== void 0 ? e.showArrow : e.loading || !(ve.value || w.value === "combobox"));
756
+ return () => {
757
+ var C, k, $, Q;
758
+ const {
759
+ notFoundContent: se,
760
+ listHeight: re = 256,
761
+ listItemHeight: Se = 24,
762
+ popupClassName: l,
763
+ dropdownClassName: s,
764
+ virtual: u,
765
+ dropdownMatchSelectWidth: h,
766
+ id: d = m.id.value,
767
+ placeholder: D = (C = t.placeholder) === null || C === void 0 ? void 0 : C.call(t),
768
+ showArrow: le
769
+ } = e, {
770
+ hasFeedback: K,
771
+ feedbackIcon: me
772
+ } = p;
773
+ let T;
774
+ se !== void 0 ? T = se : t.notFoundContent ? T = t.notFoundContent() : w.value === "combobox" ? T = null : T = (E == null ? void 0 : E("Select")) || N(ct, {
775
+ componentName: "Select"
776
+ }, null);
777
+ const {
778
+ suffixIcon: Ie,
779
+ itemIcon: ce,
780
+ removeIcon: tt,
781
+ clearIcon: lt
782
+ } = Xt(P(P({}, e), {
783
+ multiple: ve.value,
784
+ prefixCls: c.value,
785
+ hasFeedback: K,
786
+ feedbackIcon: me,
787
+ showArrow: U.value
788
+ }), t), Le = Ne(e, ["prefixCls", "suffixIcon", "itemIcon", "removeIcon", "clearIcon", "size", "bordered", "status"]), ot = ge(l || s, {
789
+ [`${c.value}-dropdown-${S.value}`]: S.value === "rtl"
790
+ }, Y.value);
791
+ return he(N(sl, _(_(_({
792
+ ref: v,
793
+ virtual: u,
794
+ dropdownMatchSelectWidth: h
795
+ }, Le), i), {}, {
796
+ showSearch: (k = e.showSearch) !== null && k !== void 0 ? k : ($ = O == null ? void 0 : O.value) === null || $ === void 0 ? void 0 : $.showSearch,
797
+ placeholder: D,
798
+ listHeight: re,
799
+ listItemHeight: Se,
800
+ mode: w.value,
801
+ prefixCls: c.value,
802
+ direction: S.value,
803
+ inputIcon: Ie,
804
+ menuItemSelectedIcon: ce,
805
+ removeIcon: tt,
806
+ clearIcon: lt,
807
+ notFoundContent: T,
808
+ class: [ae.value, i.class],
809
+ getPopupContainer: B == null ? void 0 : B.value,
810
+ dropdownClassName: ot,
811
+ onChange: ie,
812
+ onBlur: ye,
813
+ id: d,
814
+ dropdownRender: Le.dropdownRender || t.dropdownRender,
815
+ transitionName: M.value,
816
+ children: (Q = t.default) === null || Q === void 0 ? void 0 : Q.call(t),
817
+ tagRender: e.tagRender || t.tagRender,
818
+ optionLabelRender: t.optionLabel,
819
+ maxTagPlaceholder: e.maxTagPlaceholder || t.maxTagPlaceholder,
820
+ showArrow: K || le,
821
+ disabled: L.value
822
+ }), {
823
+ option: t.option
824
+ }));
825
+ };
826
+ }
827
+ });
828
+ ee.install = function(e) {
829
+ return e.component(ee.name, ee), e.component(ee.Option.displayName, ee.Option), e.component(ee.OptGroup.displayName, ee.OptGroup), e;
830
+ };
831
+ ee.Option;
832
+ ee.OptGroup;
833
+ const xe = (e, g, i) => {
834
+ const o = ft(i);
835
+ return {
836
+ [`${e.componentCls}-${g}`]: {
837
+ color: e[`color${i}`],
838
+ background: e[`color${o}Bg`],
839
+ borderColor: e[`color${o}Border`],
840
+ [`&${e.componentCls}-borderless`]: {
841
+ borderColor: "transparent"
842
+ }
843
+ }
844
+ };
845
+ }, cl = (e) => gt(e, (g, i) => {
846
+ let {
847
+ textColor: o,
848
+ lightBorderColor: t,
849
+ lightColor: n,
850
+ darkColor: v
851
+ } = i;
852
+ return {
853
+ [`${e.componentCls}-${g}`]: {
854
+ color: o,
855
+ background: n,
856
+ borderColor: t,
857
+ // Inverse color
858
+ "&-inverse": {
859
+ color: e.colorTextLightSolid,
860
+ background: v,
861
+ borderColor: v
862
+ },
863
+ [`&${e.componentCls}-borderless`]: {
864
+ borderColor: "transparent"
865
+ }
866
+ }
867
+ };
868
+ }), ul = (e) => {
869
+ const {
870
+ paddingXXS: g,
871
+ lineWidth: i,
872
+ tagPaddingHorizontal: o,
873
+ componentCls: t
874
+ } = e, n = o - i, v = g - i;
875
+ return {
876
+ // Result
877
+ [t]: P(P({}, pt(e)), {
878
+ display: "inline-block",
879
+ height: "auto",
880
+ marginInlineEnd: e.marginXS,
881
+ paddingInline: n,
882
+ fontSize: e.tagFontSize,
883
+ lineHeight: `${e.tagLineHeight}px`,
884
+ whiteSpace: "nowrap",
885
+ background: e.tagDefaultBg,
886
+ border: `${e.lineWidth}px ${e.lineType} ${e.colorBorder}`,
887
+ borderRadius: e.borderRadiusSM,
888
+ opacity: 1,
889
+ transition: `all ${e.motionDurationMid}`,
890
+ textAlign: "start",
891
+ // RTL
892
+ [`&${t}-rtl`]: {
893
+ direction: "rtl"
894
+ },
895
+ "&, a, a:hover": {
896
+ color: e.tagDefaultColor
897
+ },
898
+ [`${t}-close-icon`]: {
899
+ marginInlineStart: v,
900
+ color: e.colorTextDescription,
901
+ fontSize: e.tagIconSize,
902
+ cursor: "pointer",
903
+ transition: `all ${e.motionDurationMid}`,
904
+ "&:hover": {
905
+ color: e.colorTextHeading
906
+ }
907
+ },
908
+ [`&${t}-has-color`]: {
909
+ borderColor: "transparent",
910
+ [`&, a, a:hover, ${e.iconCls}-close, ${e.iconCls}-close:hover`]: {
911
+ color: e.colorTextLightSolid
912
+ }
913
+ },
914
+ "&-checkable": {
915
+ backgroundColor: "transparent",
916
+ borderColor: "transparent",
917
+ cursor: "pointer",
918
+ [`&:not(${t}-checkable-checked):hover`]: {
919
+ color: e.colorPrimary,
920
+ backgroundColor: e.colorFillSecondary
921
+ },
922
+ "&:active, &-checked": {
923
+ color: e.colorTextLightSolid
924
+ },
925
+ "&-checked": {
926
+ backgroundColor: e.colorPrimary,
927
+ "&:hover": {
928
+ backgroundColor: e.colorPrimaryHover
929
+ }
930
+ },
931
+ "&:active": {
932
+ backgroundColor: e.colorPrimaryActive
933
+ }
934
+ },
935
+ "&-hidden": {
936
+ display: "none"
937
+ },
938
+ // To ensure that a space will be placed between character and `Icon`.
939
+ [`> ${e.iconCls} + span, > span + ${e.iconCls}`]: {
940
+ marginInlineStart: n
941
+ }
942
+ }),
943
+ [`${t}-borderless`]: {
944
+ borderColor: "transparent",
945
+ background: e.tagBorderlessBg
946
+ }
947
+ };
948
+ }, et = vt("Tag", (e) => {
949
+ const {
950
+ fontSize: g,
951
+ lineHeight: i,
952
+ lineWidth: o,
953
+ fontSizeIcon: t
954
+ } = e, n = Math.round(g * i), v = e.fontSizeSM, m = n - o * 2, p = e.colorFillAlter, f = e.colorText, a = mt(e, {
955
+ tagFontSize: v,
956
+ tagLineHeight: m,
957
+ tagDefaultBg: p,
958
+ tagDefaultColor: f,
959
+ tagIconSize: t - 2 * o,
960
+ tagPaddingHorizontal: 8,
961
+ tagBorderlessBg: e.colorFillTertiary
962
+ });
963
+ return [ul(a), cl(a), xe(a, "success", "Success"), xe(a, "processing", "Info"), xe(a, "error", "Error"), xe(a, "warning", "Warning")];
964
+ }), dl = () => ({
965
+ prefixCls: String,
966
+ checked: {
967
+ type: Boolean,
968
+ default: void 0
969
+ },
970
+ onChange: {
971
+ type: Function
972
+ },
973
+ onClick: {
974
+ type: Function
975
+ },
976
+ "onUpdate:checked": Function
977
+ }), De = pe({
978
+ compatConfig: {
979
+ MODE: 3
980
+ },
981
+ name: "ACheckableTag",
982
+ inheritAttrs: !1,
983
+ props: dl(),
984
+ // emits: ['update:checked', 'change', 'click'],
985
+ setup(e, g) {
986
+ let {
987
+ slots: i,
988
+ emit: o,
989
+ attrs: t
990
+ } = g;
991
+ const {
992
+ prefixCls: n
993
+ } = Be("tag", e), [v, m] = et(n), p = (a) => {
994
+ const {
995
+ checked: b
996
+ } = e;
997
+ o("update:checked", !b), o("change", !b), o("click", a);
998
+ }, f = A(() => ge(n.value, m.value, {
999
+ [`${n.value}-checkable`]: !0,
1000
+ [`${n.value}-checkable-checked`]: e.checked
1001
+ }));
1002
+ return () => {
1003
+ var a;
1004
+ return v(N("span", _(_({}, t), {}, {
1005
+ class: [f.value, t.class],
1006
+ onClick: p
1007
+ }), [(a = i.default) === null || a === void 0 ? void 0 : a.call(i)]));
1008
+ };
1009
+ }
1010
+ }), vl = () => ({
1011
+ prefixCls: String,
1012
+ color: {
1013
+ type: String
1014
+ },
1015
+ closable: {
1016
+ type: Boolean,
1017
+ default: !1
1018
+ },
1019
+ closeIcon: ne.any,
1020
+ /** @deprecated `visible` will be removed in next major version. */
1021
+ visible: {
1022
+ type: Boolean,
1023
+ default: void 0
1024
+ },
1025
+ onClose: {
1026
+ type: Function
1027
+ },
1028
+ onClick: St(),
1029
+ "onUpdate:visible": Function,
1030
+ icon: ne.any,
1031
+ bordered: {
1032
+ type: Boolean,
1033
+ default: !0
1034
+ }
1035
+ }), fe = pe({
1036
+ compatConfig: {
1037
+ MODE: 3
1038
+ },
1039
+ name: "ATag",
1040
+ inheritAttrs: !1,
1041
+ props: vl(),
1042
+ // emits: ['update:visible', 'close'],
1043
+ slots: Object,
1044
+ setup(e, g) {
1045
+ let {
1046
+ slots: i,
1047
+ emit: o,
1048
+ attrs: t
1049
+ } = g;
1050
+ const {
1051
+ prefixCls: n,
1052
+ direction: v
1053
+ } = Be("tag", e), [m, p] = et(n), f = de(!0);
1054
+ Ve(() => {
1055
+ e.visible !== void 0 && (f.value = e.visible);
1056
+ });
1057
+ const a = (c) => {
1058
+ c.stopPropagation(), o("update:visible", !1), o("close", c), !c.defaultPrevented && e.visible === void 0 && (f.value = !1);
1059
+ }, b = A(() => ht(e.color) || bt(e.color)), V = A(() => ge(n.value, p.value, {
1060
+ [`${n.value}-${e.color}`]: b.value,
1061
+ [`${n.value}-has-color`]: e.color && !b.value,
1062
+ [`${n.value}-hidden`]: !f.value,
1063
+ [`${n.value}-rtl`]: v.value === "rtl",
1064
+ [`${n.value}-borderless`]: !e.bordered
1065
+ })), w = (c) => {
1066
+ o("click", c);
1067
+ };
1068
+ return () => {
1069
+ var c, S, I;
1070
+ const {
1071
+ icon: E = (c = i.icon) === null || c === void 0 ? void 0 : c.call(i),
1072
+ color: X,
1073
+ closeIcon: te = (S = i.closeIcon) === null || S === void 0 ? void 0 : S.call(i),
1074
+ closable: B = !1
1075
+ } = e, r = () => B ? te ? N("span", {
1076
+ class: `${n.value}-close-icon`,
1077
+ onClick: a
1078
+ }, [te]) : N(Ct, {
1079
+ class: `${n.value}-close-icon`,
1080
+ onClick: a
1081
+ }, null) : null, O = {
1082
+ backgroundColor: X && !b.value ? X : void 0
1083
+ }, x = E || null, y = (I = i.default) === null || I === void 0 ? void 0 : I.call(i), F = x ? N(Re, null, [x, N("span", null, [y])]) : y, j = e.onClick !== void 0, L = N("span", _(_({}, t), {}, {
1084
+ onClick: w,
1085
+ class: [V.value, t.class],
1086
+ style: [O, t.style]
1087
+ }), [F, r()]);
1088
+ return m(j ? N(yt, null, {
1089
+ default: () => [L]
1090
+ }) : L);
1091
+ };
1092
+ }
1093
+ });
1094
+ fe.CheckableTag = De;
1095
+ fe.install = function(e) {
1096
+ return e.component(fe.name, fe), e.component(De.name, De), e;
1097
+ };
1098
+ const ml = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAYAAABWzo5XAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAGXSURBVHgBlVNLTgJBEK1qOrjtI4w34AhwAuQEZBJc4yyVBbCRxE2HrZoQT4CcAI7AEeYIbDUM5asGZYj0KJX0J1WvX9eXqUIm/qUpbNp6ZzHT+yzNY1iOGR796w2sc1w3B5Ujoc5D1ns/hzcxImb2OPJPqV3rwn0NYh/DR4mEJBGhxShLN7pEZAF1EsPbmAExr7C1kad9KGy6oF/RpR6R1FIGkzAvw4KPqqv4OC4jP3N1LpZ6R55aGiJd7JES4SF+CquK5JdHWnKE48o6YenjcCw8PtGTbMqtwGWSQ9/8X0p9ZY+M7DShLNKCOq9m2Cb7Ahy9P1N+m1eNgsrEz7AXJ7qQ7Cf/3IBLw71rxQzApIIkUUyAsgzDWyXSEhdcm2tY6N4xuqXxDTwrsCkGXT/VPtuyWSqHuaJtQ8cBuUkH2e0IgDcAmzEeteHD6SDr3eHMoHLKYT/IruuIF0PaR+UczjaIc4rLGpguRmfFTN1dUNncHAZyDEUoP0iclV0nxgLbz+joG32rxeGTJKKs6uFfXaw50XDK2C8hpcmbpfjHLAAAAABJRU5ErkJggg==", fl = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAGxSURBVHgB1VQ9TsNQDLYTKtYeIUeAjQXRboztESLoTDIGhqZLA1OSua3CEdqRidygPULYGDsipMTYLy9Sq/yIbuDqqe99tr989nMC8NcNu5xBmFiAeUIAF3zsGwBrItP1XDs7mVDICPOtEHFQKhgTD/hvj2RetpEabYRMFioyoqHn3Ksle8FEdVteKyHbSJR57iStANkLpltwMuG+w9c/mZCV7KRnQbgYVJjsBePSN215Z20OINPmXm0J8T2IlqmC9KVwmtOWZjaBfpj0TcivCOgDEYXE0guI6EWor2/Hn+nb5gvqlR3bc7x8KAh86OiTtozZ40d3Eh2CRz0M4tWUySJVFpGrllIFsR4ZsR0S2ihaEMN5uHAaCdUgE/ny5G8eXHkygrEvg2hdjgxmcvbcu1cgY6jOiFNpUYPCYlCqwZnv2oqIoFCBfDHJPFqF3FOrilZvCsFMWtODYlQjLKBQwT3IdxUmKlm1JLGPnLJcc3xQYKqzrQaFpeXQOxroJ3fis5KxEHMrhl0fBrH6HPJ7ynNXh/l3DvnNoY8g77cSGmBkIKOg5+03pmcuI31Z/8N+AJZHvSBz6IiBAAAAAElFTkSuQmCC", gl = { class: "crane-flex-center permission-item-wraper" }, pl = { style: { "flex-shrink": "0" } }, hl = { style: { "max-width": "400px" } }, bl = { class: "crane-text-overflow" }, yl = { style: { "max-width": "400px" } }, Sl = { style: { "max-width": "400px" } }, Cl = { class: "crane-flex-center crane-margin-left-4" }, Al = ["src"], Ol = { class: "crane-weak-color crane-margin-left-4" }, Il = ["src"], wl = { style: { "max-width": "400px" } }, xl = { class: "crane-weak-color crane-margin-left-4 crane-text-overflow" }, Vl = {
1099
+ key: 6,
1100
+ class: "crane-weak-color crane-margin-left-12"
1101
+ }, Ke = "OWNER", Nl = /* @__PURE__ */ pe({
1102
+ __name: "permission-item",
1103
+ props: {
1104
+ checkedKeys: {
1105
+ type: Array,
1106
+ default: () => []
1107
+ },
1108
+ validTimeOptions: {
1109
+ type: Array,
1110
+ default: () => []
1111
+ },
1112
+ item: {
1113
+ type: Object,
1114
+ default: () => {
1115
+ }
1116
+ }
1117
+ },
1118
+ emits: ["onChangeTime", "updateTime"],
1119
+ setup(e, { emit: g }) {
1120
+ const i = {
1121
+ L1: {
1122
+ color: "#1AA83B",
1123
+ text: G("levels.L1"),
1124
+ background: "#E3F9E9"
1125
+ },
1126
+ L2: {
1127
+ color: "#F37D1C",
1128
+ text: G("levels.L2"),
1129
+ background: "#FFE4BA"
1130
+ },
1131
+ L3: {
1132
+ color: "#F2494B",
1133
+ text: G("levels.L3"),
1134
+ background: "#FDCDC5"
1135
+ }
1136
+ };
1137
+ let o = g, t = e;
1138
+ const n = G("status"), v = A(() => t.validTimeOptions.filter((f) => f.value !== "FOREVER")), m = (f) => {
1139
+ var a, b;
1140
+ return `【${f.categoryName}】:${((b = (a = f.attributeValues) == null ? void 0 : a.map((V) => V.attributeName)) == null ? void 0 : b.join("、")) || G("empty")}`;
1141
+ }, p = () => {
1142
+ o("updateTime", t.item), o("onChangeTime", t.item);
1143
+ };
1144
+ return (f, a) => {
1145
+ var b, V, w;
1146
+ return q(), Ae("div", gl, [
1147
+ e.item.securityLevel ? (q(), Oe(R(fe), {
1148
+ key: 0,
1149
+ bordered: !1,
1150
+ style: xt({ color: i[e.item.securityLevel].color, background: i[e.item.securityLevel].background }),
1151
+ class: "crane-tag-position"
1152
+ }, {
1153
+ default: J(() => [
1154
+ Te(H(i[e.item.securityLevel].text), 1)
1155
+ ]),
1156
+ _: 1
1157
+ }, 8, ["style"])) : ue("", !0),
1158
+ W("div", pl, H(R(G)(`operationType.${e.item.operationType}`)) + "| ", 1),
1159
+ N(R(we), null, {
1160
+ content: J(() => [
1161
+ W("div", hl, H(e.item.name), 1)
1162
+ ]),
1163
+ default: J(() => [
1164
+ W("div", bl, H(e.item.shortName), 1)
1165
+ ]),
1166
+ _: 1
1167
+ }),
1168
+ e.item.businessApplyType ? (q(), Oe(R(fe), {
1169
+ key: 1,
1170
+ bordered: !1,
1171
+ class: Vt(["crane-tag-position crane-margin-left-4 crane-margin-right-0", ["PENDING"].includes(e.item.businessApplyType) ? "" : "crane-disabled-color"])
1172
+ }, {
1173
+ default: J(() => {
1174
+ var c, S, I, E;
1175
+ return [
1176
+ Te(H(R(n)[e.item.businessApplyType]) + " " + H(e.item.businessApplyType === "TEMP_OWNER" ? `(${((S = (c = e.item) == null ? void 0 : c.ownStatusVO) == null ? void 0 : S.dayDiff) > 0 ? R(G)("lastDays", {
1177
+ count: (E = (I = e.item) == null ? void 0 : I.ownStatusVO) == null ? void 0 : E.dayDiff
1178
+ }) : R(G)("today")})` : ""), 1)
1179
+ ];
1180
+ }),
1181
+ _: 1
1182
+ }, 8, ["class"])) : ue("", !0),
1183
+ e.item.desc ? (q(), Oe(R(we), { key: 2 }, {
1184
+ content: J(() => [
1185
+ W("div", yl, H(e.item.desc), 1)
1186
+ ]),
1187
+ default: J(() => [
1188
+ N(R(kt), { class: "crane-weak-color crane-margin-left-4" })
1189
+ ]),
1190
+ _: 1
1191
+ })) : ue("", !0),
1192
+ (b = e.item.relatedCompleteNames) != null && b.length ? (q(), Oe(R(we), { key: 3 }, {
1193
+ content: J(() => [
1194
+ W("div", Sl, H(R(G)("adaptDepartment")) + ":" + H(e.item.relatedCompleteNames.map((c) => c).join("、")), 1)
1195
+ ]),
1196
+ default: J(() => [
1197
+ W("div", Cl, [
1198
+ W("img", {
1199
+ src: R(ml),
1200
+ height: "14",
1201
+ width: "14"
1202
+ }, null, 8, Al),
1203
+ W("span", Ol, H(e.item.relatedCompleteNames.length), 1)
1204
+ ])
1205
+ ]),
1206
+ _: 1
1207
+ })) : ue("", !0),
1208
+ (V = e.item.categoryVOS) != null && V.length ? (q(), Ae("img", {
1209
+ key: 4,
1210
+ src: R(fl),
1211
+ height: "16",
1212
+ width: "16",
1213
+ class: "crane-margin-left-4"
1214
+ }, null, 8, Il)) : ue("", !0),
1215
+ (w = e.item.categoryVOS) != null && w.length ? (q(), Oe(R(we), { key: 5 }, {
1216
+ content: J(() => [
1217
+ W("div", wl, [
1218
+ W("div", null, H(R(G)("categoryTips")), 1),
1219
+ (q(!0), Ae(Re, null, Nt(e.item.categoryVOS, (c) => (q(), Ae("div", {
1220
+ key: c.id
1221
+ }, H(m(c)), 1))), 128))
1222
+ ])
1223
+ ]),
1224
+ default: J(() => {
1225
+ var c;
1226
+ return [
1227
+ W("div", xl, H((c = e.item.categoryVOS) == null ? void 0 : c.map((S) => S.categoryName).join("、")), 1)
1228
+ ];
1229
+ }),
1230
+ _: 1
1231
+ })) : ue("", !0),
1232
+ e.checkedKeys.includes(e.item.feature) ? (q(), Ae("span", Vl, [
1233
+ Te(H(R(G)("availableTime")) + ": ", 1),
1234
+ N(R(ee), {
1235
+ value: e.item.validTime,
1236
+ "onUpdate:value": a[0] || (a[0] = (c) => e.item.validTime = c),
1237
+ style: { width: "100px" },
1238
+ disabled: e.item.businessApplyType === Ke,
1239
+ options: e.item.businessApplyType === Ke ? e.validTimeOptions : v.value,
1240
+ onChange: p,
1241
+ size: "small"
1242
+ }, null, 8, ["value", "disabled", "options"])
1243
+ ])) : ue("", !0)
1244
+ ]);
1245
+ };
1246
+ }
1247
+ }), Dl = /* @__PURE__ */ At(Nl, [["__scopeId", "data-v-ee71dc45"]]);
1248
+ export {
1249
+ Dl as default
1250
+ };