@yqg/permission 1.3.14-beta.1 → 1.3.14
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/{apply-modal-CbdSpFHD.js → apply-modal-BHiQP1sQ.js} +127 -126
- package/dist/{category-selector-CeFM3lr8.js → category-selector-9HVsPsVR.js} +354 -352
- package/dist/{index-D-ZB-Fhd.js → index-BWIdbsw2.js} +3 -3
- package/dist/{index-D_ujkA5Y.js → index-CfdXHF81.js} +1 -1
- package/dist/index.js +2 -2
- package/dist/{permission-item-DaZXxED4.js → permission-item-CluLTqzU.js} +5 -5
- package/dist/{yqg-permission-C8hIbxln.js → yqg-permission-Btr34HIx.js} +2 -2
- package/dist/yqg-permission.umd.js +11 -11
- package/package.json +1 -1
- package/src/components/apply-modal.vue +2 -1
- package/src/components/category-selector.vue +4 -3
- package/src/components/permission-item.vue +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { a as ht, p as pt, d as Ie, r as pe, c as
|
|
2
|
-
import { a as X, _ as
|
|
3
|
-
import { u as Ot, a as Ht, b as Mt, c as Rt, d as jt, t as lt, B as Bt, e as $t, f as Wt, g as Ut } from "./index-
|
|
4
|
-
import { K as ve, T as zt, c as Xt, a as Ye, u as Yt, g as qt, b as Gt, d as Qt, F as Jt, e as Zt, f as ea, r as ta, h as aa, i as la } from "./apply-modal-
|
|
1
|
+
import { a as ht, p as pt, d as Ie, r as pe, c as C, w as we, q as gt, s as j, E as ae, e as U, b as Qe, y as re, a0 as mt, G as yt, K as et, R as je, L as oe, M as Be, P as $e, N as Ce, S as de, u as H, F as bt, Y as Ct, j as St, z as wt } from "./index-CfdXHF81.js";
|
|
2
|
+
import { a as X, _ as S, W as xt, X as Vt, ae as it, aX as tt, Y as Ne, P as he, N as It, Q as ut, V as Nt, aN as We, a0 as kt, ar as Tt, as as Lt, aY as _t, c as at, b as Et, ai as Ue, ak as ze, am as Dt, $ as Pt, aj as At, aV as Kt, aP as Se, aS as Ft } from "./yqg-permission-Btr34HIx.js";
|
|
3
|
+
import { u as Ot, a as Ht, b as Mt, c as Rt, d as jt, t as lt, B as Bt, e as $t, f as Wt, g as Ut } from "./index-BWIdbsw2.js";
|
|
4
|
+
import { K as ve, T as zt, c as Xt, a as Ye, u as Yt, g as qt, b as Gt, d as Qt, F as Jt, e as Zt, f as ea, r as ta, h as aa, i as la } from "./apply-modal-BHiQP1sQ.js";
|
|
5
5
|
function na(e) {
|
|
6
6
|
return Array.isArray(e) ? e : e !== void 0 ? [e] : [];
|
|
7
7
|
}
|
|
@@ -24,9 +24,9 @@ function qe(e) {
|
|
|
24
24
|
function oa(e, i) {
|
|
25
25
|
const c = [];
|
|
26
26
|
function a(t) {
|
|
27
|
-
t.forEach((
|
|
28
|
-
c.push(
|
|
29
|
-
const n =
|
|
27
|
+
t.forEach((r) => {
|
|
28
|
+
c.push(r[i.value]);
|
|
29
|
+
const n = r[i.children];
|
|
30
30
|
n && a(n);
|
|
31
31
|
});
|
|
32
32
|
}
|
|
@@ -62,83 +62,83 @@ const ia = {
|
|
|
62
62
|
slots: c,
|
|
63
63
|
expose: a
|
|
64
64
|
} = i;
|
|
65
|
-
const t = Ot(),
|
|
65
|
+
const t = Ot(), r = Ht(), n = ca(), l = pe(), u = Mt(() => n.treeData, [() => t.open, () => n.treeData], (h) => h[0]), s = C(() => {
|
|
66
66
|
const {
|
|
67
|
-
checkable:
|
|
68
|
-
halfCheckedKeys:
|
|
69
|
-
checkedKeys:
|
|
70
|
-
} =
|
|
71
|
-
return
|
|
72
|
-
checked:
|
|
73
|
-
halfChecked:
|
|
67
|
+
checkable: h,
|
|
68
|
+
halfCheckedKeys: V,
|
|
69
|
+
checkedKeys: D
|
|
70
|
+
} = r;
|
|
71
|
+
return h ? {
|
|
72
|
+
checked: D,
|
|
73
|
+
halfChecked: V
|
|
74
74
|
} : null;
|
|
75
75
|
});
|
|
76
76
|
we(() => t.open, () => {
|
|
77
77
|
gt(() => {
|
|
78
|
-
var
|
|
79
|
-
t.open && !t.multiple &&
|
|
80
|
-
key:
|
|
78
|
+
var h;
|
|
79
|
+
t.open && !t.multiple && r.checkedKeys.length && ((h = l.value) === null || h === void 0 || h.scrollTo({
|
|
80
|
+
key: r.checkedKeys[0]
|
|
81
81
|
}));
|
|
82
82
|
});
|
|
83
83
|
}, {
|
|
84
84
|
immediate: !0,
|
|
85
85
|
flush: "post"
|
|
86
86
|
});
|
|
87
|
-
const o =
|
|
87
|
+
const o = C(() => String(t.searchValue).toLowerCase()), f = (h) => o.value ? String(h[r.treeNodeFilterProp]).toLowerCase().includes(o.value) : !1, v = j(r.treeDefaultExpandedKeys), p = j(null);
|
|
88
88
|
we(() => t.searchValue, () => {
|
|
89
|
-
t.searchValue && (
|
|
89
|
+
t.searchValue && (p.value = oa(ae(n.treeData), ae(n.fieldNames)));
|
|
90
90
|
}, {
|
|
91
91
|
immediate: !0
|
|
92
92
|
});
|
|
93
|
-
const
|
|
94
|
-
var
|
|
95
|
-
v.value =
|
|
96
|
-
},
|
|
97
|
-
|
|
98
|
-
},
|
|
93
|
+
const y = C(() => r.treeExpandedKeys ? r.treeExpandedKeys.slice() : t.searchValue ? p.value : v.value), g = (h) => {
|
|
94
|
+
var V;
|
|
95
|
+
v.value = h, p.value = h, (V = r.onTreeExpand) === null || V === void 0 || V.call(r, h);
|
|
96
|
+
}, N = (h) => {
|
|
97
|
+
h.preventDefault();
|
|
98
|
+
}, K = (h, V) => {
|
|
99
99
|
let {
|
|
100
|
-
node:
|
|
101
|
-
} =
|
|
102
|
-
var
|
|
100
|
+
node: D
|
|
101
|
+
} = V;
|
|
102
|
+
var F, L;
|
|
103
103
|
const {
|
|
104
104
|
checkable: z,
|
|
105
105
|
checkedKeys: Y
|
|
106
|
-
} =
|
|
107
|
-
z && qe(
|
|
108
|
-
selected: !Y.includes(
|
|
106
|
+
} = r;
|
|
107
|
+
z && qe(D) || ((F = n.onSelect) === null || F === void 0 || F.call(n, D.key, {
|
|
108
|
+
selected: !Y.includes(D.key)
|
|
109
109
|
}), t.multiple || (L = t.toggleOpen) === null || L === void 0 || L.call(t, !1));
|
|
110
|
-
},
|
|
111
|
-
|
|
110
|
+
}, E = pe(null), x = C(() => r.keyEntities[E.value]), O = (h) => {
|
|
111
|
+
E.value = h;
|
|
112
112
|
};
|
|
113
113
|
return a({
|
|
114
114
|
scrollTo: function() {
|
|
115
|
-
for (var
|
|
116
|
-
|
|
117
|
-
return (
|
|
115
|
+
for (var h, V, D = arguments.length, F = new Array(D), L = 0; L < D; L++)
|
|
116
|
+
F[L] = arguments[L];
|
|
117
|
+
return (V = (h = l.value) === null || h === void 0 ? void 0 : h.scrollTo) === null || V === void 0 ? void 0 : V.call(h, ...F);
|
|
118
118
|
},
|
|
119
|
-
onKeydown: (
|
|
120
|
-
var
|
|
119
|
+
onKeydown: (h) => {
|
|
120
|
+
var V;
|
|
121
121
|
const {
|
|
122
|
-
which:
|
|
123
|
-
} =
|
|
124
|
-
switch (
|
|
122
|
+
which: D
|
|
123
|
+
} = h;
|
|
124
|
+
switch (D) {
|
|
125
125
|
case ve.UP:
|
|
126
126
|
case ve.DOWN:
|
|
127
127
|
case ve.LEFT:
|
|
128
128
|
case ve.RIGHT:
|
|
129
|
-
(
|
|
129
|
+
(V = l.value) === null || V === void 0 || V.onKeydown(h);
|
|
130
130
|
break;
|
|
131
131
|
case ve.ENTER: {
|
|
132
|
-
if (
|
|
132
|
+
if (x.value) {
|
|
133
133
|
const {
|
|
134
|
-
selectable:
|
|
134
|
+
selectable: F,
|
|
135
135
|
value: L
|
|
136
|
-
} =
|
|
137
|
-
|
|
136
|
+
} = x.value.node || {};
|
|
137
|
+
F !== !1 && K(null, {
|
|
138
138
|
node: {
|
|
139
|
-
key:
|
|
139
|
+
key: E.value
|
|
140
140
|
},
|
|
141
|
-
selected: !
|
|
141
|
+
selected: !r.checkedKeys.includes(L)
|
|
142
142
|
});
|
|
143
143
|
}
|
|
144
144
|
break;
|
|
@@ -150,13 +150,13 @@ const ia = {
|
|
|
150
150
|
onKeyup: () => {
|
|
151
151
|
}
|
|
152
152
|
}), () => {
|
|
153
|
-
var
|
|
153
|
+
var h;
|
|
154
154
|
const {
|
|
155
|
-
prefixCls:
|
|
156
|
-
multiple:
|
|
157
|
-
searchValue:
|
|
155
|
+
prefixCls: V,
|
|
156
|
+
multiple: D,
|
|
157
|
+
searchValue: F,
|
|
158
158
|
open: L,
|
|
159
|
-
notFoundContent: z = (
|
|
159
|
+
notFoundContent: z = (h = c.notFoundContent) === null || h === void 0 ? void 0 : h.call(c)
|
|
160
160
|
} = t, {
|
|
161
161
|
listHeight: Y,
|
|
162
162
|
listItemHeight: B,
|
|
@@ -172,40 +172,40 @@ const ia = {
|
|
|
172
172
|
treeLine: ye,
|
|
173
173
|
loadData: be,
|
|
174
174
|
treeLoadedKeys: ue,
|
|
175
|
-
treeMotion:
|
|
176
|
-
onTreeLoad:
|
|
175
|
+
treeMotion: w,
|
|
176
|
+
onTreeLoad: P,
|
|
177
177
|
checkedKeys: M
|
|
178
|
-
} =
|
|
178
|
+
} = r;
|
|
179
179
|
if (u.value.length === 0)
|
|
180
180
|
return U("div", {
|
|
181
181
|
role: "listbox",
|
|
182
|
-
class: `${
|
|
183
|
-
onMousedown:
|
|
182
|
+
class: `${V}-empty`,
|
|
183
|
+
onMousedown: N
|
|
184
184
|
}, [z]);
|
|
185
185
|
const Q = {
|
|
186
186
|
fieldNames: n.fieldNames
|
|
187
187
|
};
|
|
188
|
-
return ue && (Q.loadedKeys = ue),
|
|
189
|
-
onMousedown:
|
|
190
|
-
}, [
|
|
188
|
+
return ue && (Q.loadedKeys = ue), y.value && (Q.expandedKeys = y.value), U("div", {
|
|
189
|
+
onMousedown: N
|
|
190
|
+
}, [x.value && L && U("span", {
|
|
191
191
|
style: ia,
|
|
192
192
|
"aria-live": "assertive"
|
|
193
|
-
}, [
|
|
194
|
-
ref:
|
|
193
|
+
}, [x.value.node.value]), U(zt, X(X({
|
|
194
|
+
ref: l,
|
|
195
195
|
focusable: !1,
|
|
196
|
-
prefixCls: `${
|
|
196
|
+
prefixCls: `${V}-tree`,
|
|
197
197
|
treeData: u.value,
|
|
198
198
|
height: Y,
|
|
199
199
|
itemHeight: B,
|
|
200
200
|
virtual: le !== !1 && q !== !1,
|
|
201
|
-
multiple:
|
|
201
|
+
multiple: D,
|
|
202
202
|
icon: ne,
|
|
203
203
|
showIcon: G,
|
|
204
204
|
switcherIcon: me,
|
|
205
205
|
showLine: ye,
|
|
206
|
-
loadData:
|
|
207
|
-
motion:
|
|
208
|
-
activeKey:
|
|
206
|
+
loadData: F ? null : be,
|
|
207
|
+
motion: w,
|
|
208
|
+
activeKey: E.value,
|
|
209
209
|
checkable: ce,
|
|
210
210
|
checkStrictly: !0,
|
|
211
211
|
checkedKeys: s.value,
|
|
@@ -213,36 +213,36 @@ const ia = {
|
|
|
213
213
|
defaultExpandAll: ie
|
|
214
214
|
}, Q), {}, {
|
|
215
215
|
onActiveChange: O,
|
|
216
|
-
onSelect:
|
|
217
|
-
onCheck:
|
|
218
|
-
onExpand:
|
|
219
|
-
onLoad:
|
|
216
|
+
onSelect: K,
|
|
217
|
+
onCheck: K,
|
|
218
|
+
onExpand: g,
|
|
219
|
+
onLoad: P,
|
|
220
220
|
filterTreeNode: f,
|
|
221
221
|
expandAction: se
|
|
222
|
-
}),
|
|
223
|
-
checkable:
|
|
222
|
+
}), S(S({}, c), {
|
|
223
|
+
checkable: r.customSlots.treeCheckable
|
|
224
224
|
}))]);
|
|
225
225
|
};
|
|
226
226
|
}
|
|
227
227
|
}), da = "SHOW_ALL", vt = "SHOW_PARENT", Je = "SHOW_CHILD";
|
|
228
228
|
function rt(e, i, c, a) {
|
|
229
229
|
const t = new Set(e);
|
|
230
|
-
return i === Je ? e.filter((
|
|
231
|
-
const n = c[
|
|
232
|
-
return !(n && n.children && n.children.some((
|
|
230
|
+
return i === Je ? e.filter((r) => {
|
|
231
|
+
const n = c[r];
|
|
232
|
+
return !(n && n.children && n.children.some((l) => {
|
|
233
233
|
let {
|
|
234
234
|
node: u
|
|
235
|
-
} =
|
|
235
|
+
} = l;
|
|
236
236
|
return t.has(u[a.value]);
|
|
237
|
-
}) && n.children.every((
|
|
237
|
+
}) && n.children.every((l) => {
|
|
238
238
|
let {
|
|
239
239
|
node: u
|
|
240
|
-
} =
|
|
240
|
+
} = l;
|
|
241
241
|
return qe(u) || t.has(u[a.value]);
|
|
242
242
|
}));
|
|
243
|
-
}) : i === vt ? e.filter((
|
|
244
|
-
const n = c[
|
|
245
|
-
return !(
|
|
243
|
+
}) : i === vt ? e.filter((r) => {
|
|
244
|
+
const n = c[r], l = n ? n.parent : null;
|
|
245
|
+
return !(l && !qe(l.node) && t.has(l.key));
|
|
246
246
|
}) : e;
|
|
247
247
|
}
|
|
248
248
|
const ge = () => null;
|
|
@@ -263,34 +263,34 @@ function ha(e) {
|
|
|
263
263
|
function i() {
|
|
264
264
|
let c = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [];
|
|
265
265
|
return xt(c).map((a) => {
|
|
266
|
-
var t,
|
|
266
|
+
var t, r, n;
|
|
267
267
|
if (!fa(a))
|
|
268
268
|
return null;
|
|
269
|
-
const
|
|
270
|
-
for (const [
|
|
271
|
-
s[Vt(
|
|
269
|
+
const l = a.children || {}, u = a.key, s = {};
|
|
270
|
+
for (const [D, F] of Object.entries(a.props))
|
|
271
|
+
s[Vt(D)] = F;
|
|
272
272
|
const {
|
|
273
273
|
isLeaf: o,
|
|
274
274
|
checkable: f,
|
|
275
275
|
selectable: v,
|
|
276
|
-
disabled:
|
|
277
|
-
disableCheckbox:
|
|
278
|
-
} = s,
|
|
276
|
+
disabled: p,
|
|
277
|
+
disableCheckbox: y
|
|
278
|
+
} = s, g = {
|
|
279
279
|
isLeaf: o || o === "" || void 0,
|
|
280
280
|
checkable: f || f === "" || void 0,
|
|
281
281
|
selectable: v || v === "" || void 0,
|
|
282
|
-
disabled:
|
|
283
|
-
disableCheckbox:
|
|
284
|
-
},
|
|
285
|
-
title:
|
|
286
|
-
switcherIcon:
|
|
287
|
-
} = s,
|
|
288
|
-
title:
|
|
289
|
-
switcherIcon:
|
|
282
|
+
disabled: p || p === "" || void 0,
|
|
283
|
+
disableCheckbox: y || y === "" || void 0
|
|
284
|
+
}, N = S(S({}, s), g), {
|
|
285
|
+
title: K = (t = l.title) === null || t === void 0 ? void 0 : t.call(l, N),
|
|
286
|
+
switcherIcon: E = (r = l.switcherIcon) === null || r === void 0 ? void 0 : r.call(l, N)
|
|
287
|
+
} = s, x = va(s, ["title", "switcherIcon"]), O = (n = l.default) === null || n === void 0 ? void 0 : n.call(l), h = S(S(S({}, x), {
|
|
288
|
+
title: K,
|
|
289
|
+
switcherIcon: E,
|
|
290
290
|
key: u,
|
|
291
291
|
isLeaf: o
|
|
292
|
-
}),
|
|
293
|
-
return
|
|
292
|
+
}), g), V = i(O);
|
|
293
|
+
return V.length && (h.children = V), h;
|
|
294
294
|
});
|
|
295
295
|
}
|
|
296
296
|
return i(e);
|
|
@@ -298,34 +298,34 @@ function ha(e) {
|
|
|
298
298
|
function Ge(e) {
|
|
299
299
|
if (!e)
|
|
300
300
|
return e;
|
|
301
|
-
const i =
|
|
301
|
+
const i = S({}, e);
|
|
302
302
|
return "props" in i || Object.defineProperty(i, "props", {
|
|
303
303
|
get() {
|
|
304
304
|
return i;
|
|
305
305
|
}
|
|
306
306
|
}), i;
|
|
307
307
|
}
|
|
308
|
-
function pa(e, i, c, a, t,
|
|
309
|
-
let n = null,
|
|
308
|
+
function pa(e, i, c, a, t, r) {
|
|
309
|
+
let n = null, l = null;
|
|
310
310
|
function u() {
|
|
311
311
|
function s(o) {
|
|
312
312
|
let f = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "0", v = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : !1;
|
|
313
|
-
return o.map((
|
|
314
|
-
const
|
|
315
|
-
default: () => [
|
|
313
|
+
return o.map((p, y) => {
|
|
314
|
+
const g = `${f}-${y}`, N = p[r.value], K = c.includes(N), E = s(p[r.children] || [], g, K), x = U(ge, p, {
|
|
315
|
+
default: () => [E.map((O) => O.node)]
|
|
316
316
|
});
|
|
317
|
-
if (i ===
|
|
317
|
+
if (i === N && (n = x), K) {
|
|
318
318
|
const O = {
|
|
319
|
-
pos:
|
|
320
|
-
node:
|
|
321
|
-
children:
|
|
319
|
+
pos: g,
|
|
320
|
+
node: x,
|
|
321
|
+
children: E
|
|
322
322
|
};
|
|
323
|
-
return v ||
|
|
323
|
+
return v || l.push(O), O;
|
|
324
324
|
}
|
|
325
325
|
return null;
|
|
326
|
-
}).filter((
|
|
326
|
+
}).filter((p) => p);
|
|
327
327
|
}
|
|
328
|
-
|
|
328
|
+
l || (l = [], s(a), l.sort((o, f) => {
|
|
329
329
|
let {
|
|
330
330
|
node: {
|
|
331
331
|
props: {
|
|
@@ -335,12 +335,12 @@ function pa(e, i, c, a, t, l) {
|
|
|
335
335
|
} = o, {
|
|
336
336
|
node: {
|
|
337
337
|
props: {
|
|
338
|
-
value:
|
|
338
|
+
value: p
|
|
339
339
|
}
|
|
340
340
|
}
|
|
341
341
|
} = f;
|
|
342
|
-
const
|
|
343
|
-
return
|
|
342
|
+
const y = c.indexOf(v), g = c.indexOf(p);
|
|
343
|
+
return y - g;
|
|
344
344
|
}));
|
|
345
345
|
}
|
|
346
346
|
Object.defineProperty(e, "triggerNode", {
|
|
@@ -349,7 +349,7 @@ function pa(e, i, c, a, t, l) {
|
|
|
349
349
|
}
|
|
350
350
|
}), Object.defineProperty(e, "allCheckedNodes", {
|
|
351
351
|
get() {
|
|
352
|
-
return u(), t ?
|
|
352
|
+
return u(), t ? l : l.map((s) => {
|
|
353
353
|
let {
|
|
354
354
|
node: o
|
|
355
355
|
} = s;
|
|
@@ -364,12 +364,12 @@ function ga(e, i) {
|
|
|
364
364
|
pId: a,
|
|
365
365
|
rootPId: t
|
|
366
366
|
} = i;
|
|
367
|
-
const
|
|
367
|
+
const r = {}, n = [];
|
|
368
368
|
return e.map((u) => {
|
|
369
|
-
const s =
|
|
370
|
-
return
|
|
369
|
+
const s = S({}, u), o = s[c];
|
|
370
|
+
return r[o] = s, s.key = s.key || o, s;
|
|
371
371
|
}).forEach((u) => {
|
|
372
|
-
const s = u[a], o =
|
|
372
|
+
const s = u[a], o = r[s];
|
|
373
373
|
o && (o.children = o.children || [], o.children.push(u)), (s === t || !o && t === null) && n.push(u);
|
|
374
374
|
}), n;
|
|
375
375
|
}
|
|
@@ -377,7 +377,7 @@ function ma(e, i, c) {
|
|
|
377
377
|
const a = j();
|
|
378
378
|
return we([c, e, i], () => {
|
|
379
379
|
const t = c.value;
|
|
380
|
-
e.value ? a.value = c.value ? ga(ae(e.value),
|
|
380
|
+
e.value ? a.value = c.value ? ga(ae(e.value), S({
|
|
381
381
|
id: "id",
|
|
382
382
|
pId: "pId",
|
|
383
383
|
rootPId: null
|
|
@@ -395,40 +395,40 @@ const ya = (e) => {
|
|
|
395
395
|
c.value = ae(e.value);
|
|
396
396
|
}, {
|
|
397
397
|
immediate: !0
|
|
398
|
-
}), [
|
|
398
|
+
}), [C(() => {
|
|
399
399
|
const {
|
|
400
400
|
valueLabels: t
|
|
401
|
-
} = i.value,
|
|
401
|
+
} = i.value, r = /* @__PURE__ */ new Map(), n = c.value.map((l) => {
|
|
402
402
|
var u;
|
|
403
403
|
const {
|
|
404
404
|
value: s
|
|
405
|
-
} =
|
|
406
|
-
return
|
|
405
|
+
} = l, o = (u = l.label) !== null && u !== void 0 ? u : t.get(s);
|
|
406
|
+
return r.set(s, o), S(S({}, l), {
|
|
407
407
|
label: o
|
|
408
408
|
});
|
|
409
409
|
});
|
|
410
|
-
return i.value.valueLabels =
|
|
410
|
+
return i.value.valueLabels = r, n;
|
|
411
411
|
})];
|
|
412
412
|
}, ba = (e, i) => {
|
|
413
413
|
const c = j(/* @__PURE__ */ new Map()), a = j({});
|
|
414
414
|
return Qe(() => {
|
|
415
|
-
const t = i.value,
|
|
415
|
+
const t = i.value, r = Xt(e.value, {
|
|
416
416
|
fieldNames: t,
|
|
417
|
-
initWrapper: (n) =>
|
|
417
|
+
initWrapper: (n) => S(S({}, n), {
|
|
418
418
|
valueEntities: /* @__PURE__ */ new Map()
|
|
419
419
|
}),
|
|
420
|
-
processEntity: (n,
|
|
420
|
+
processEntity: (n, l) => {
|
|
421
421
|
const u = n.node[t.value];
|
|
422
|
-
|
|
422
|
+
l.valueEntities.set(u, n);
|
|
423
423
|
}
|
|
424
424
|
});
|
|
425
|
-
c.value =
|
|
425
|
+
c.value = r.valueEntities, a.value = r.keyEntities;
|
|
426
426
|
}), {
|
|
427
427
|
valueEntities: c,
|
|
428
428
|
keyEntities: a
|
|
429
429
|
};
|
|
430
|
-
}, Ca = (e, i, c, a, t,
|
|
431
|
-
const n = j([]),
|
|
430
|
+
}, Ca = (e, i, c, a, t, r) => {
|
|
431
|
+
const n = j([]), l = j([]);
|
|
432
432
|
return Qe(() => {
|
|
433
433
|
let u = e.value.map((f) => {
|
|
434
434
|
let {
|
|
@@ -445,46 +445,46 @@ const ya = (e) => {
|
|
|
445
445
|
c.value && ({
|
|
446
446
|
checkedKeys: u,
|
|
447
447
|
halfCheckedKeys: s
|
|
448
|
-
} = Ye(u, !0, a.value, t.value,
|
|
449
|
-
}), [n,
|
|
448
|
+
} = Ye(u, !0, a.value, t.value, r.value)), n.value = Array.from(/* @__PURE__ */ new Set([...o, ...u])), l.value = s;
|
|
449
|
+
}), [n, l];
|
|
450
450
|
}, Sa = (e, i, c) => {
|
|
451
451
|
let {
|
|
452
452
|
treeNodeFilterProp: a,
|
|
453
453
|
filterTreeNode: t,
|
|
454
|
-
fieldNames:
|
|
454
|
+
fieldNames: r
|
|
455
455
|
} = c;
|
|
456
|
-
return
|
|
456
|
+
return C(() => {
|
|
457
457
|
const {
|
|
458
458
|
children: n
|
|
459
|
-
} =
|
|
460
|
-
if (!
|
|
459
|
+
} = r.value, l = i.value, u = a == null ? void 0 : a.value;
|
|
460
|
+
if (!l || t.value === !1)
|
|
461
461
|
return e.value;
|
|
462
462
|
let s;
|
|
463
463
|
if (typeof t.value == "function")
|
|
464
464
|
s = t.value;
|
|
465
465
|
else {
|
|
466
|
-
const f =
|
|
467
|
-
s = (v,
|
|
468
|
-
const
|
|
469
|
-
return String(
|
|
466
|
+
const f = l.toUpperCase();
|
|
467
|
+
s = (v, p) => {
|
|
468
|
+
const y = p[u];
|
|
469
|
+
return String(y).toUpperCase().includes(f);
|
|
470
470
|
};
|
|
471
471
|
}
|
|
472
472
|
function o(f) {
|
|
473
473
|
let v = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1;
|
|
474
|
-
const
|
|
475
|
-
for (let
|
|
476
|
-
const
|
|
477
|
-
(
|
|
478
|
-
[n]:
|
|
474
|
+
const p = [];
|
|
475
|
+
for (let y = 0, g = f.length; y < g; y++) {
|
|
476
|
+
const N = f[y], K = N[n], E = v || s(l, Ge(N)), x = o(K || [], E);
|
|
477
|
+
(E || x.length) && p.push(S(S({}, N), {
|
|
478
|
+
[n]: x
|
|
479
479
|
}));
|
|
480
480
|
}
|
|
481
|
-
return
|
|
481
|
+
return p;
|
|
482
482
|
}
|
|
483
483
|
return o(e.value);
|
|
484
484
|
});
|
|
485
485
|
};
|
|
486
486
|
function ft() {
|
|
487
|
-
return
|
|
487
|
+
return S(S({}, Ne($t(), ["mode"])), {
|
|
488
488
|
prefixCls: String,
|
|
489
489
|
id: String,
|
|
490
490
|
value: {
|
|
@@ -644,138 +644,138 @@ const xa = Ie({
|
|
|
644
644
|
expose: a,
|
|
645
645
|
slots: t
|
|
646
646
|
} = i;
|
|
647
|
-
const
|
|
648
|
-
value:
|
|
647
|
+
const r = Rt(re(e, "id")), n = C(() => e.treeCheckable && !e.treeCheckStrictly), l = C(() => e.treeCheckable || e.treeCheckStrictly), u = C(() => e.treeCheckStrictly || e.labelInValue), s = C(() => l.value || e.multiple), o = C(() => ra(e.fieldNames)), [f, v] = tt("", {
|
|
648
|
+
value: C(() => e.searchValue !== void 0 ? e.searchValue : e.inputValue),
|
|
649
649
|
postState: (d) => d || ""
|
|
650
|
-
}),
|
|
651
|
-
var
|
|
652
|
-
v(d), (
|
|
653
|
-
},
|
|
654
|
-
keyEntities:
|
|
655
|
-
valueEntities:
|
|
656
|
-
} = ba(
|
|
657
|
-
const
|
|
658
|
-
return d.forEach((
|
|
659
|
-
|
|
650
|
+
}), p = (d) => {
|
|
651
|
+
var m;
|
|
652
|
+
v(d), (m = e.onSearch) === null || m === void 0 || m.call(e, d);
|
|
653
|
+
}, y = ma(re(e, "treeData"), re(e, "children"), re(e, "treeDataSimpleMode")), {
|
|
654
|
+
keyEntities: g,
|
|
655
|
+
valueEntities: N
|
|
656
|
+
} = ba(y, o), K = (d) => {
|
|
657
|
+
const m = [], b = [];
|
|
658
|
+
return d.forEach((k) => {
|
|
659
|
+
N.value.has(k) ? b.push(k) : m.push(k);
|
|
660
660
|
}), {
|
|
661
|
-
missingRawValues:
|
|
662
|
-
existRawValues:
|
|
661
|
+
missingRawValues: m,
|
|
662
|
+
existRawValues: b
|
|
663
663
|
};
|
|
664
|
-
},
|
|
664
|
+
}, E = Sa(y, f, {
|
|
665
665
|
fieldNames: o,
|
|
666
666
|
treeNodeFilterProp: re(e, "treeNodeFilterProp"),
|
|
667
667
|
filterTreeNode: re(e, "filterTreeNode")
|
|
668
|
-
}),
|
|
668
|
+
}), x = (d) => {
|
|
669
669
|
if (d) {
|
|
670
670
|
if (e.treeNodeLabelProp)
|
|
671
671
|
return d[e.treeNodeLabelProp];
|
|
672
672
|
const {
|
|
673
|
-
_title:
|
|
673
|
+
_title: m
|
|
674
674
|
} = o.value;
|
|
675
|
-
for (let
|
|
676
|
-
const
|
|
677
|
-
if (
|
|
678
|
-
return
|
|
675
|
+
for (let b = 0; b < m.length; b += 1) {
|
|
676
|
+
const k = d[m[b]];
|
|
677
|
+
if (k !== void 0)
|
|
678
|
+
return k;
|
|
679
679
|
}
|
|
680
680
|
}
|
|
681
|
-
}, O = (d) => na(d).map((
|
|
682
|
-
value:
|
|
683
|
-
} :
|
|
681
|
+
}, O = (d) => na(d).map((b) => wa(b) ? {
|
|
682
|
+
value: b
|
|
683
|
+
} : b), h = (d) => O(d).map((b) => {
|
|
684
684
|
let {
|
|
685
|
-
label:
|
|
686
|
-
} =
|
|
685
|
+
label: k
|
|
686
|
+
} = b;
|
|
687
687
|
const {
|
|
688
|
-
value:
|
|
688
|
+
value: A,
|
|
689
689
|
halfChecked: _
|
|
690
|
-
} =
|
|
690
|
+
} = b;
|
|
691
691
|
let I;
|
|
692
|
-
const T =
|
|
693
|
-
return T && (
|
|
694
|
-
label:
|
|
695
|
-
value:
|
|
692
|
+
const T = N.value.get(A);
|
|
693
|
+
return T && (k = k ?? x(T.node), I = T.node.disabled), {
|
|
694
|
+
label: k,
|
|
695
|
+
value: A,
|
|
696
696
|
halfChecked: _,
|
|
697
697
|
disabled: I
|
|
698
698
|
};
|
|
699
|
-
}), [
|
|
699
|
+
}), [V, D] = tt(e.defaultValue, {
|
|
700
700
|
value: re(e, "value")
|
|
701
|
-
}),
|
|
701
|
+
}), F = C(() => O(V.value)), L = j([]), z = j([]);
|
|
702
702
|
Qe(() => {
|
|
703
|
-
const d = [],
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
}), L.value = d, z.value =
|
|
703
|
+
const d = [], m = [];
|
|
704
|
+
F.value.forEach((b) => {
|
|
705
|
+
b.halfChecked ? m.push(b) : d.push(b);
|
|
706
|
+
}), L.value = d, z.value = m;
|
|
707
707
|
});
|
|
708
|
-
const Y =
|
|
708
|
+
const Y = C(() => L.value.map((d) => d.value)), {
|
|
709
709
|
maxLevel: B,
|
|
710
710
|
levelEntities: le
|
|
711
|
-
} = Yt(
|
|
712
|
-
const
|
|
711
|
+
} = Yt(g), [q, se] = Ca(L, z, n, g, B, le), ce = C(() => {
|
|
712
|
+
const b = rt(q.value, e.showCheckedStrategy, g.value, o.value).map((_) => {
|
|
713
713
|
var I, T, R;
|
|
714
|
-
return (R = (T = (I =
|
|
714
|
+
return (R = (T = (I = g.value[_]) === null || I === void 0 ? void 0 : I.node) === null || T === void 0 ? void 0 : T[o.value.value]) !== null && R !== void 0 ? R : _;
|
|
715
715
|
}).map((_) => {
|
|
716
716
|
const I = L.value.find((T) => T.value === _);
|
|
717
717
|
return {
|
|
718
718
|
value: _,
|
|
719
719
|
label: I == null ? void 0 : I.label
|
|
720
720
|
};
|
|
721
|
-
}),
|
|
722
|
-
return !s.value &&
|
|
721
|
+
}), k = h(b), A = k[0];
|
|
722
|
+
return !s.value && A && nt(A.value) && nt(A.label) ? [] : k.map((_) => {
|
|
723
723
|
var I;
|
|
724
|
-
return
|
|
724
|
+
return S(S({}, _), {
|
|
725
725
|
label: (I = _.label) !== null && I !== void 0 ? I : _.value
|
|
726
726
|
});
|
|
727
727
|
});
|
|
728
|
-
}), [ie] = ya(ce), ne = (d,
|
|
729
|
-
const
|
|
730
|
-
if (
|
|
731
|
-
let
|
|
732
|
-
n.value && (
|
|
733
|
-
const Ve =
|
|
728
|
+
}), [ie] = ya(ce), ne = (d, m, b) => {
|
|
729
|
+
const k = h(d);
|
|
730
|
+
if (D(k), e.autoClearSearchValue && v(""), e.onChange) {
|
|
731
|
+
let A = d;
|
|
732
|
+
n.value && (A = rt(d, e.showCheckedStrategy, g.value, o.value).map((te) => {
|
|
733
|
+
const Ve = N.value.get(te);
|
|
734
734
|
return Ve ? Ve.node[o.value.value] : te;
|
|
735
735
|
}));
|
|
736
736
|
const {
|
|
737
737
|
triggerValue: _,
|
|
738
738
|
selected: I
|
|
739
|
-
} =
|
|
739
|
+
} = m || {
|
|
740
740
|
triggerValue: void 0,
|
|
741
741
|
selected: void 0
|
|
742
742
|
};
|
|
743
|
-
let T =
|
|
743
|
+
let T = A;
|
|
744
744
|
if (e.treeCheckStrictly) {
|
|
745
|
-
const W = z.value.filter((te) => !
|
|
745
|
+
const W = z.value.filter((te) => !A.includes(te.value));
|
|
746
746
|
T = [...T, ...W];
|
|
747
747
|
}
|
|
748
|
-
const R =
|
|
748
|
+
const R = h(T), Z = {
|
|
749
749
|
// [Legacy] Always return as array contains label & value
|
|
750
750
|
preValue: L.value,
|
|
751
751
|
triggerValue: _
|
|
752
752
|
};
|
|
753
753
|
let ee = !0;
|
|
754
|
-
(e.treeCheckStrictly ||
|
|
754
|
+
(e.treeCheckStrictly || b === "selection" && !I) && (ee = !1), pa(Z, _, d, y.value, ee, o.value), l.value ? Z.checked = I : Z.selected = I;
|
|
755
755
|
const $ = u.value ? R : R.map((W) => W.value);
|
|
756
756
|
e.onChange(s.value ? $ : $[0], u.value ? null : R.map((W) => W.label), Z);
|
|
757
757
|
}
|
|
758
|
-
}, G = (d,
|
|
758
|
+
}, G = (d, m) => {
|
|
759
759
|
let {
|
|
760
|
-
selected:
|
|
761
|
-
source:
|
|
762
|
-
} =
|
|
763
|
-
var
|
|
764
|
-
const T = ae(
|
|
760
|
+
selected: b,
|
|
761
|
+
source: k
|
|
762
|
+
} = m;
|
|
763
|
+
var A, _, I;
|
|
764
|
+
const T = ae(g.value), R = ae(N.value), Z = T[d], ee = Z == null ? void 0 : Z.node, $ = (A = ee == null ? void 0 : ee[o.value.value]) !== null && A !== void 0 ? A : d;
|
|
765
765
|
if (!s.value)
|
|
766
766
|
ne([$], {
|
|
767
767
|
selected: !0,
|
|
768
768
|
triggerValue: $
|
|
769
769
|
}, "option");
|
|
770
770
|
else {
|
|
771
|
-
let W =
|
|
771
|
+
let W = b ? [...Y.value, $] : q.value.filter((te) => te !== $);
|
|
772
772
|
if (n.value) {
|
|
773
773
|
const {
|
|
774
774
|
missingRawValues: te,
|
|
775
775
|
existRawValues: Ve
|
|
776
|
-
} =
|
|
776
|
+
} = K(W), Ze = Ve.map((Re) => R.get(Re).key);
|
|
777
777
|
let Me;
|
|
778
|
-
|
|
778
|
+
b ? {
|
|
779
779
|
checkedKeys: Me
|
|
780
780
|
} = Ye(Ze, !0, T, B.value, le.value) : {
|
|
781
781
|
checkedKeys: Me
|
|
@@ -784,27 +784,27 @@ const xa = Ie({
|
|
|
784
784
|
}, T, B.value, le.value), W = [...te, ...Me.map((Re) => T[Re].node[o.value.value])];
|
|
785
785
|
}
|
|
786
786
|
ne(W, {
|
|
787
|
-
selected:
|
|
787
|
+
selected: b,
|
|
788
788
|
triggerValue: $
|
|
789
|
-
},
|
|
789
|
+
}, k || "option");
|
|
790
790
|
}
|
|
791
|
-
|
|
791
|
+
b || !s.value ? (_ = e.onSelect) === null || _ === void 0 || _.call(e, $, Ge(ee)) : (I = e.onDeselect) === null || I === void 0 || I.call(e, $, Ge(ee));
|
|
792
792
|
}, me = (d) => {
|
|
793
793
|
if (e.onDropdownVisibleChange) {
|
|
794
|
-
const
|
|
795
|
-
Object.defineProperty(
|
|
794
|
+
const m = {};
|
|
795
|
+
Object.defineProperty(m, "documentClickClose", {
|
|
796
796
|
get() {
|
|
797
797
|
return !1;
|
|
798
798
|
}
|
|
799
|
-
}), e.onDropdownVisibleChange(d,
|
|
799
|
+
}), e.onDropdownVisibleChange(d, m);
|
|
800
800
|
}
|
|
801
|
-
}, ye = (d,
|
|
802
|
-
const
|
|
803
|
-
if (
|
|
804
|
-
ne(
|
|
801
|
+
}, ye = (d, m) => {
|
|
802
|
+
const b = d.map((k) => k.value);
|
|
803
|
+
if (m.type === "clear") {
|
|
804
|
+
ne(b, {}, "selection");
|
|
805
805
|
return;
|
|
806
806
|
}
|
|
807
|
-
|
|
807
|
+
m.values.length && G(m.values[0].value, {
|
|
808
808
|
selected: !1,
|
|
809
809
|
source: "selection"
|
|
810
810
|
});
|
|
@@ -812,8 +812,8 @@ const xa = Ie({
|
|
|
812
812
|
treeNodeFilterProp: be,
|
|
813
813
|
// Data
|
|
814
814
|
loadData: ue,
|
|
815
|
-
treeLoadedKeys:
|
|
816
|
-
onTreeLoad:
|
|
815
|
+
treeLoadedKeys: w,
|
|
816
|
+
onTreeLoad: P,
|
|
817
817
|
// Expanded
|
|
818
818
|
treeDefaultExpandAll: M,
|
|
819
819
|
treeExpandedKeys: Q,
|
|
@@ -834,10 +834,10 @@ const xa = Ie({
|
|
|
834
834
|
treeExpandAction: He
|
|
835
835
|
} = mt(e);
|
|
836
836
|
jt(lt({
|
|
837
|
-
checkable:
|
|
837
|
+
checkable: l,
|
|
838
838
|
loadData: ue,
|
|
839
|
-
treeLoadedKeys:
|
|
840
|
-
onTreeLoad:
|
|
839
|
+
treeLoadedKeys: w,
|
|
840
|
+
onTreeLoad: P,
|
|
841
841
|
checkedKeys: q,
|
|
842
842
|
halfCheckedKeys: se,
|
|
843
843
|
treeDefaultExpandAll: M,
|
|
@@ -850,13 +850,13 @@ const xa = Ie({
|
|
|
850
850
|
switcherIcon: Ae,
|
|
851
851
|
treeLine: De,
|
|
852
852
|
treeNodeFilterProp: be,
|
|
853
|
-
keyEntities:
|
|
853
|
+
keyEntities: g,
|
|
854
854
|
customSlots: Fe
|
|
855
855
|
})), sa(lt({
|
|
856
856
|
virtual: Le,
|
|
857
857
|
listHeight: _e,
|
|
858
858
|
listItemHeight: Ee,
|
|
859
|
-
treeData:
|
|
859
|
+
treeData: E,
|
|
860
860
|
fieldNames: o,
|
|
861
861
|
onSelect: G,
|
|
862
862
|
dropdownMatchSelectWidth: Oe,
|
|
@@ -873,12 +873,12 @@ const xa = Ie({
|
|
|
873
873
|
(d = J.value) === null || d === void 0 || d.blur();
|
|
874
874
|
},
|
|
875
875
|
scrollTo(d) {
|
|
876
|
-
var
|
|
877
|
-
(
|
|
876
|
+
var m;
|
|
877
|
+
(m = J.value) === null || m === void 0 || m.scrollTo(d);
|
|
878
878
|
}
|
|
879
879
|
}), () => {
|
|
880
880
|
var d;
|
|
881
|
-
const
|
|
881
|
+
const m = Ne(e, [
|
|
882
882
|
"id",
|
|
883
883
|
"prefixCls",
|
|
884
884
|
"customSlots",
|
|
@@ -931,16 +931,16 @@ const xa = Ie({
|
|
|
931
931
|
]);
|
|
932
932
|
return U(Bt, X(X(X({
|
|
933
933
|
ref: J
|
|
934
|
-
}, c),
|
|
935
|
-
id:
|
|
934
|
+
}, c), m), {}, {
|
|
935
|
+
id: r,
|
|
936
936
|
prefixCls: e.prefixCls,
|
|
937
937
|
mode: s.value ? "multiple" : void 0,
|
|
938
938
|
displayValues: ie.value,
|
|
939
939
|
onDisplayValuesChange: ye,
|
|
940
940
|
searchValue: f.value,
|
|
941
|
-
onSearch:
|
|
941
|
+
onSearch: p,
|
|
942
942
|
OptionList: ua,
|
|
943
|
-
emptyOptions: !
|
|
943
|
+
emptyOptions: !y.value.length,
|
|
944
944
|
onDropdownVisibleChange: me,
|
|
945
945
|
tagRender: e.tagRender || t.tagRender,
|
|
946
946
|
dropdownMatchSelectWidth: (d = e.dropdownMatchSelectWidth) !== null && d !== void 0 ? d : !0
|
|
@@ -1006,7 +1006,7 @@ function Ia(e, i) {
|
|
|
1006
1006
|
}
|
|
1007
1007
|
const ot = (e, i, c) => c !== void 0 ? c : `${e}-${i}`;
|
|
1008
1008
|
function Na() {
|
|
1009
|
-
return
|
|
1009
|
+
return S(S({}, Ne(ft(), ["showTreeIcon", "treeMotion", "inputIcon", "getInputElement", "treeLine", "customSlots"])), {
|
|
1010
1010
|
suffixIcon: he.any,
|
|
1011
1011
|
size: ze(),
|
|
1012
1012
|
bordered: At(),
|
|
@@ -1041,53 +1041,53 @@ const Xe = Ie({
|
|
|
1041
1041
|
attrs: c,
|
|
1042
1042
|
slots: a,
|
|
1043
1043
|
expose: t,
|
|
1044
|
-
emit:
|
|
1044
|
+
emit: r
|
|
1045
1045
|
} = i;
|
|
1046
1046
|
Nt(!(e.treeData === void 0 && a.default)), We(e.multiple !== !1 || !e.treeCheckable, "TreeSelect", "`multiple` will always be `true` when `treeCheckable` is true"), We(e.replaceFields === void 0, "TreeSelect", "`replaceFields` is deprecated, please use fieldNames instead"), We(!e.dropdownClassName, "TreeSelect", "`dropdownClassName` is deprecated. Please use `popupClassName` instead.");
|
|
1047
|
-
const n = Qt(),
|
|
1047
|
+
const n = Qt(), l = Jt.useInject(), u = C(() => Zt(l.status, e.status)), {
|
|
1048
1048
|
prefixCls: s,
|
|
1049
1049
|
renderEmpty: o,
|
|
1050
1050
|
direction: f,
|
|
1051
1051
|
virtual: v,
|
|
1052
|
-
dropdownMatchSelectWidth:
|
|
1053
|
-
size:
|
|
1054
|
-
getPopupContainer:
|
|
1055
|
-
getPrefixCls:
|
|
1056
|
-
disabled:
|
|
1052
|
+
dropdownMatchSelectWidth: p,
|
|
1053
|
+
size: y,
|
|
1054
|
+
getPopupContainer: g,
|
|
1055
|
+
getPrefixCls: N,
|
|
1056
|
+
disabled: K
|
|
1057
1057
|
} = kt("select", e), {
|
|
1058
|
-
compactSize:
|
|
1059
|
-
compactItemClassnames:
|
|
1060
|
-
} = Tt(s, f), O =
|
|
1061
|
-
var
|
|
1062
|
-
return (
|
|
1063
|
-
}),
|
|
1058
|
+
compactSize: E,
|
|
1059
|
+
compactItemClassnames: x
|
|
1060
|
+
} = Tt(s, f), O = C(() => E.value || y.value), h = Lt(), V = C(() => {
|
|
1061
|
+
var w;
|
|
1062
|
+
return (w = K.value) !== null && w !== void 0 ? w : h.value;
|
|
1063
|
+
}), D = C(() => N()), F = C(() => e.placement !== void 0 ? e.placement : f.value === "rtl" ? "bottomRight" : "bottomLeft"), L = C(() => ot(D.value, _t(F.value), e.transitionName)), z = C(() => ot(D.value, "", e.choiceTransitionName)), Y = C(() => N("select-tree", e.prefixCls)), B = C(() => N("tree-select", e.prefixCls)), [le, q] = Wt(s), [se] = Ia(B, Y), ce = C(() => at(e.popupClassName || e.dropdownClassName, `${B.value}-dropdown`, {
|
|
1064
1064
|
[`${B.value}-dropdown-rtl`]: f.value === "rtl"
|
|
1065
|
-
}, q.value)), ie =
|
|
1065
|
+
}, q.value)), ie = C(() => !!(e.treeCheckable || e.multiple)), ne = C(() => e.showArrow !== void 0 ? e.showArrow : e.loading || !ie.value), G = pe();
|
|
1066
1066
|
t({
|
|
1067
1067
|
focus() {
|
|
1068
|
-
var
|
|
1069
|
-
(
|
|
1068
|
+
var w, P;
|
|
1069
|
+
(P = (w = G.value).focus) === null || P === void 0 || P.call(w);
|
|
1070
1070
|
},
|
|
1071
1071
|
blur() {
|
|
1072
|
-
var
|
|
1073
|
-
(
|
|
1072
|
+
var w, P;
|
|
1073
|
+
(P = (w = G.value).blur) === null || P === void 0 || P.call(w);
|
|
1074
1074
|
}
|
|
1075
1075
|
});
|
|
1076
1076
|
const me = function() {
|
|
1077
|
-
for (var
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
}, ye = (
|
|
1081
|
-
|
|
1082
|
-
}, be = (
|
|
1083
|
-
|
|
1084
|
-
}, ue = (
|
|
1085
|
-
|
|
1077
|
+
for (var w = arguments.length, P = new Array(w), M = 0; M < w; M++)
|
|
1078
|
+
P[M] = arguments[M];
|
|
1079
|
+
r("update:value", P[0]), r("change", ...P), n.onFieldChange();
|
|
1080
|
+
}, ye = (w) => {
|
|
1081
|
+
r("update:treeExpandedKeys", w), r("treeExpand", w);
|
|
1082
|
+
}, be = (w) => {
|
|
1083
|
+
r("update:searchValue", w), r("search", w);
|
|
1084
|
+
}, ue = (w) => {
|
|
1085
|
+
r("blur", w), n.onFieldBlur();
|
|
1086
1086
|
};
|
|
1087
1087
|
return () => {
|
|
1088
|
-
var
|
|
1088
|
+
var w, P, M;
|
|
1089
1089
|
const {
|
|
1090
|
-
notFoundContent: Q = (
|
|
1090
|
+
notFoundContent: Q = (w = a.notFoundContent) === null || w === void 0 ? void 0 : w.call(a),
|
|
1091
1091
|
prefixCls: ke,
|
|
1092
1092
|
bordered: Te,
|
|
1093
1093
|
listHeight: Le,
|
|
@@ -1096,7 +1096,7 @@ const Xe = Ie({
|
|
|
1096
1096
|
treeIcon: De,
|
|
1097
1097
|
treeLine: xe,
|
|
1098
1098
|
showArrow: Pe,
|
|
1099
|
-
switcherIcon: Ae = (
|
|
1099
|
+
switcherIcon: Ae = (P = a.switcherIcon) === null || P === void 0 ? void 0 : P.call(a),
|
|
1100
1100
|
fieldNames: Ke = e.replaceFields,
|
|
1101
1101
|
id: Fe = n.id.value,
|
|
1102
1102
|
placeholder: Oe = (M = a.placeholder) === null || M === void 0 ? void 0 : M.call(a)
|
|
@@ -1104,30 +1104,30 @@ const Xe = Ie({
|
|
|
1104
1104
|
isFormItemInput: He,
|
|
1105
1105
|
hasFeedback: J,
|
|
1106
1106
|
feedbackIcon: d
|
|
1107
|
-
} =
|
|
1108
|
-
suffixIcon:
|
|
1109
|
-
removeIcon:
|
|
1110
|
-
clearIcon:
|
|
1111
|
-
} = Ut(
|
|
1107
|
+
} = l, {
|
|
1108
|
+
suffixIcon: m,
|
|
1109
|
+
removeIcon: b,
|
|
1110
|
+
clearIcon: k
|
|
1111
|
+
} = Ut(S(S({}, e), {
|
|
1112
1112
|
multiple: ie.value,
|
|
1113
1113
|
showArrow: ne.value,
|
|
1114
1114
|
hasFeedback: J,
|
|
1115
1115
|
feedbackIcon: d,
|
|
1116
1116
|
prefixCls: s.value
|
|
1117
1117
|
}), a);
|
|
1118
|
-
let
|
|
1119
|
-
Q !== void 0 ?
|
|
1118
|
+
let A;
|
|
1119
|
+
Q !== void 0 ? A = Q : A = o("Select");
|
|
1120
1120
|
const _ = Ne(e, ["suffixIcon", "itemIcon", "removeIcon", "clearIcon", "switcherIcon", "bordered", "status", "onUpdate:value", "onUpdate:treeExpandedKeys", "onUpdate:searchValue"]), I = at(!ke && B.value, {
|
|
1121
1121
|
[`${s.value}-lg`]: O.value === "large",
|
|
1122
1122
|
[`${s.value}-sm`]: O.value === "small",
|
|
1123
1123
|
[`${s.value}-rtl`]: f.value === "rtl",
|
|
1124
1124
|
[`${s.value}-borderless`]: !Te,
|
|
1125
1125
|
[`${s.value}-in-form-item`]: He
|
|
1126
|
-
}, ea(s.value, u.value, J),
|
|
1126
|
+
}, ea(s.value, u.value, J), x.value, c.class, q.value), T = {};
|
|
1127
1127
|
return e.treeData === void 0 && a.default && (T.children = Et(a.default())), le(se(U(xa, X(X(X(X({}, c), _), {}, {
|
|
1128
|
-
disabled:
|
|
1128
|
+
disabled: V.value,
|
|
1129
1129
|
virtual: v.value,
|
|
1130
|
-
dropdownMatchSelectWidth:
|
|
1130
|
+
dropdownMatchSelectWidth: p.value,
|
|
1131
1131
|
id: Fe,
|
|
1132
1132
|
fieldNames: Ke,
|
|
1133
1133
|
ref: G,
|
|
@@ -1136,14 +1136,14 @@ const Xe = Ie({
|
|
|
1136
1136
|
listHeight: Le,
|
|
1137
1137
|
listItemHeight: _e,
|
|
1138
1138
|
treeLine: !!xe,
|
|
1139
|
-
inputIcon:
|
|
1139
|
+
inputIcon: m,
|
|
1140
1140
|
multiple: Ee,
|
|
1141
|
-
removeIcon:
|
|
1142
|
-
clearIcon:
|
|
1141
|
+
removeIcon: b,
|
|
1142
|
+
clearIcon: k,
|
|
1143
1143
|
switcherIcon: (R) => ta(Y.value, Ae, R, a.leafIcon, xe),
|
|
1144
1144
|
showTreeIcon: De,
|
|
1145
|
-
notFoundContent:
|
|
1146
|
-
getPopupContainer:
|
|
1145
|
+
notFoundContent: A,
|
|
1146
|
+
getPopupContainer: g == null ? void 0 : g.value,
|
|
1147
1147
|
treeMotion: null,
|
|
1148
1148
|
dropdownClassName: ce.value,
|
|
1149
1149
|
choiceTransitionName: z.value,
|
|
@@ -1153,23 +1153,23 @@ const Xe = Ie({
|
|
|
1153
1153
|
onTreeExpand: ye
|
|
1154
1154
|
}, T), {}, {
|
|
1155
1155
|
transitionName: L.value,
|
|
1156
|
-
customSlots:
|
|
1156
|
+
customSlots: S(S({}, a), {
|
|
1157
1157
|
treeCheckable: () => U("span", {
|
|
1158
1158
|
class: `${s.value}-tree-checkbox-inner`
|
|
1159
1159
|
}, null)
|
|
1160
1160
|
}),
|
|
1161
1161
|
maxTagPlaceholder: e.maxTagPlaceholder || a.maxTagPlaceholder,
|
|
1162
|
-
placement:
|
|
1162
|
+
placement: F.value,
|
|
1163
1163
|
showArrow: J || Pe,
|
|
1164
1164
|
placeholder: Oe
|
|
1165
|
-
}),
|
|
1165
|
+
}), S(S({}, a), {
|
|
1166
1166
|
treeCheckable: () => U("span", {
|
|
1167
1167
|
class: `${s.value}-tree-checkbox-inner`
|
|
1168
1168
|
}, null)
|
|
1169
1169
|
}))));
|
|
1170
1170
|
};
|
|
1171
1171
|
}
|
|
1172
|
-
}), st = ge, ct =
|
|
1172
|
+
}), st = ge, ct = S(Xe, {
|
|
1173
1173
|
TreeNode: ge,
|
|
1174
1174
|
SHOW_ALL: da,
|
|
1175
1175
|
SHOW_PARENT: vt,
|
|
@@ -1178,54 +1178,54 @@ const Xe = Ie({
|
|
|
1178
1178
|
}), fe = yt({});
|
|
1179
1179
|
function ka(e) {
|
|
1180
1180
|
we(() => e.categoryList, (t) => {
|
|
1181
|
-
t.forEach(async (
|
|
1182
|
-
if (!fe[
|
|
1183
|
-
const n = await Kt.getCategoryValues(
|
|
1184
|
-
fe[
|
|
1181
|
+
t.forEach(async (r) => {
|
|
1182
|
+
if (!fe[r.id]) {
|
|
1183
|
+
const n = await Kt.getCategoryValues(r.id), { flatAttributeValue: l, treeAttributeValue: u, showWay: s } = n.body;
|
|
1184
|
+
fe[r.id] = s === "TREE" ? u : l;
|
|
1185
1185
|
}
|
|
1186
1186
|
});
|
|
1187
1187
|
}, { immediate: !0, deep: !0 });
|
|
1188
|
-
const i = (t,
|
|
1189
|
-
for (let n = 0; n <
|
|
1190
|
-
const
|
|
1191
|
-
if (
|
|
1192
|
-
return
|
|
1193
|
-
if (
|
|
1194
|
-
const u = i(t,
|
|
1188
|
+
const i = (t, r) => {
|
|
1189
|
+
for (let n = 0; n < r.length; n++) {
|
|
1190
|
+
const l = r[n];
|
|
1191
|
+
if (l.id === t)
|
|
1192
|
+
return l.attributeName;
|
|
1193
|
+
if (l.children && l.children.length) {
|
|
1194
|
+
const u = i(t, l.children);
|
|
1195
1195
|
if (u)
|
|
1196
1196
|
return u;
|
|
1197
1197
|
}
|
|
1198
1198
|
}
|
|
1199
1199
|
return "";
|
|
1200
|
-
}, c = (t,
|
|
1201
|
-
const n = [],
|
|
1202
|
-
if (
|
|
1200
|
+
}, c = (t, r) => {
|
|
1201
|
+
const n = [], l = /* @__PURE__ */ new Set(), u = (o) => {
|
|
1202
|
+
if (l.has(o.id) || (l.add(o.id), n.push(o)), o.children && o.children.length)
|
|
1203
1203
|
for (let f = 0; f < o.children.length; f++)
|
|
1204
1204
|
u(o.children[f]);
|
|
1205
1205
|
}, s = (o, f) => {
|
|
1206
1206
|
for (let v = 0; v < f.length; v++) {
|
|
1207
|
-
const
|
|
1208
|
-
if (
|
|
1209
|
-
return u(
|
|
1210
|
-
if (
|
|
1207
|
+
const p = f[v];
|
|
1208
|
+
if (p.id === o)
|
|
1209
|
+
return u(p), !0;
|
|
1210
|
+
if (p.children && p.children.length && s(o, p.children))
|
|
1211
1211
|
return !0;
|
|
1212
1212
|
}
|
|
1213
1213
|
return !1;
|
|
1214
1214
|
};
|
|
1215
1215
|
for (let o = 0; o < t.length; o++)
|
|
1216
|
-
s(t[o],
|
|
1216
|
+
s(t[o], r);
|
|
1217
1217
|
return n;
|
|
1218
1218
|
};
|
|
1219
1219
|
return {
|
|
1220
1220
|
categoryValuesMap: fe,
|
|
1221
1221
|
getDeleteAttributesNames: (t) => {
|
|
1222
1222
|
var o, f;
|
|
1223
|
-
const
|
|
1224
|
-
for (let v = 0; v < l.length; v++)
|
|
1225
|
-
n.add(l[v].id);
|
|
1226
|
-
const r = c(t.defaultValueIds || [], fe[t.id] || []), u = /* @__PURE__ */ new Map();
|
|
1223
|
+
const r = c(t.attributeValueIds_view || [], fe[t.id] || []), n = /* @__PURE__ */ new Set();
|
|
1227
1224
|
for (let v = 0; v < r.length; v++)
|
|
1228
|
-
|
|
1225
|
+
n.add(r[v].id);
|
|
1226
|
+
const l = c(t.defaultValueIds || [], fe[t.id] || []), u = /* @__PURE__ */ new Map();
|
|
1227
|
+
for (let v = 0; v < l.length; v++)
|
|
1228
|
+
u.set(l[v].id, l[v].attributeName);
|
|
1229
1229
|
return (f = (o = t.defaultValueIds) == null ? void 0 : o.filter((v) => !n.has(v))) == null ? void 0 : f.map((v) => u.get(v) || i(v, fe[t.id] || [])).filter(Boolean).join("、");
|
|
1230
1230
|
}
|
|
1231
1231
|
};
|
|
@@ -1247,83 +1247,85 @@ const Ta = { class: "crane-required" }, La = { class: "crane-category-tips" }, _
|
|
|
1247
1247
|
default: () => []
|
|
1248
1248
|
}
|
|
1249
1249
|
},
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1250
|
+
emits: ["onChange"],
|
|
1251
|
+
setup(e, { expose: i, emit: c }) {
|
|
1252
|
+
const a = ct.SHOW_PARENT, t = e, r = c, n = pe(), l = pe(""), {
|
|
1253
|
+
categoryValuesMap: u,
|
|
1254
|
+
getDeleteAttributesNames: s
|
|
1255
|
+
} = ka(t), o = C(() => ({
|
|
1256
|
+
categoryList: t.categoryList
|
|
1257
|
+
})), f = C(() => Object.values(u).some((p) => p.length > 0));
|
|
1257
1258
|
return i({
|
|
1258
|
-
validate: () => new Promise((
|
|
1259
|
-
if (!
|
|
1260
|
-
|
|
1259
|
+
validate: () => new Promise((p, y) => {
|
|
1260
|
+
if (!n.value) {
|
|
1261
|
+
p(!0);
|
|
1261
1262
|
return;
|
|
1262
1263
|
}
|
|
1263
|
-
|
|
1264
|
-
|
|
1264
|
+
n.value.validate().then(() => {
|
|
1265
|
+
p(!0);
|
|
1265
1266
|
}).catch(() => {
|
|
1266
|
-
|
|
1267
|
+
y(!1);
|
|
1267
1268
|
});
|
|
1268
1269
|
})
|
|
1269
|
-
}), (
|
|
1270
|
+
}), (p, y) => f.value ? (oe(), et(H(la), {
|
|
1270
1271
|
key: 0,
|
|
1271
1272
|
class: "crane-category-wraper",
|
|
1272
|
-
model:
|
|
1273
|
+
model: o.value,
|
|
1273
1274
|
ref_key: "formRef",
|
|
1274
|
-
ref:
|
|
1275
|
+
ref: n
|
|
1275
1276
|
}, {
|
|
1276
1277
|
default: Be(() => [
|
|
1277
1278
|
$e("div", Ta, de(H(Se)("category")), 1),
|
|
1278
1279
|
$e("div", La, de(H(Se)("categotySelectTips")), 1),
|
|
1279
|
-
|
|
1280
|
-
(oe(!0), Ce(bt, null, Ct(
|
|
1281
|
-
var
|
|
1280
|
+
y[2] || (y[2] = $e("div", { class: "crane-category-line" }, null, -1)),
|
|
1281
|
+
(oe(!0), Ce(bt, null, Ct(o.value.categoryList, (g, N) => {
|
|
1282
|
+
var K;
|
|
1282
1283
|
return St((oe(), et(H(aa), {
|
|
1283
|
-
key:
|
|
1284
|
-
label:
|
|
1285
|
-
name: ["categoryList",
|
|
1284
|
+
key: g.id,
|
|
1285
|
+
label: g.categoryName,
|
|
1286
|
+
name: ["categoryList", N, "attributeValueIds_view"],
|
|
1286
1287
|
rules: [{ required: !0, message: H(Se)("pleaseChoose"), trigger: ["change", "blur"] }]
|
|
1287
1288
|
}, {
|
|
1288
1289
|
default: Be(() => {
|
|
1289
|
-
var
|
|
1290
|
+
var E;
|
|
1290
1291
|
return [
|
|
1291
1292
|
U(H(ct), {
|
|
1292
1293
|
treeCheckable: "",
|
|
1293
1294
|
treeDefaultExpandAll: "",
|
|
1294
|
-
"tree-data": H(
|
|
1295
|
+
"tree-data": H(u)[g.id],
|
|
1295
1296
|
showSearch: "",
|
|
1296
1297
|
allowClear: "",
|
|
1297
|
-
value:
|
|
1298
|
-
"onUpdate:value": (
|
|
1298
|
+
value: g.attributeValueIds_view,
|
|
1299
|
+
"onUpdate:value": (x) => g.attributeValueIds_view = x,
|
|
1299
1300
|
treeNodeFilterProp: "attributeName",
|
|
1300
1301
|
searchValue: l.value,
|
|
1301
|
-
"onUpdate:searchValue":
|
|
1302
|
+
"onUpdate:searchValue": y[0] || (y[0] = (x) => l.value = x),
|
|
1302
1303
|
fieldNames: { label: "attributeName", value: "id" },
|
|
1303
1304
|
treeNodeLabelProp: "attributeName",
|
|
1304
|
-
"show-checked-strategy": H(
|
|
1305
|
-
virtual: !0
|
|
1305
|
+
"show-checked-strategy": H(a),
|
|
1306
|
+
virtual: !0,
|
|
1307
|
+
onChange: y[1] || (y[1] = (x) => r("onChange"))
|
|
1306
1308
|
}, {
|
|
1307
|
-
title: Be(({ attributeName:
|
|
1308
|
-
l.value.toLowerCase() &&
|
|
1309
|
+
title: Be(({ attributeName: x }) => [
|
|
1310
|
+
l.value.toLowerCase() && x.includes(l.value.toLowerCase()) ? (oe(), Ce("span", _a, de(x), 1)) : (oe(), Ce("span", Ea, de(x), 1))
|
|
1309
1311
|
]),
|
|
1310
1312
|
_: 2
|
|
1311
1313
|
}, 1032, ["tree-data", "value", "onUpdate:value", "searchValue", "show-checked-strategy"]),
|
|
1312
|
-
(
|
|
1313
|
-
H(
|
|
1314
|
+
(E = g.attributeValueIds_view) != null && E.includes(-1) ? (oe(), Ce("span", Da, de(H(Se)("categoryChangeTips", { category: g.categoryName })), 1)) : je("", !0),
|
|
1315
|
+
H(s)(g) ? (oe(), Ce("span", Pa, de(H(Se)("deleteCategoryTips", { categorys: H(s)(g) })), 1)) : je("", !0)
|
|
1314
1316
|
];
|
|
1315
1317
|
}),
|
|
1316
1318
|
_: 2
|
|
1317
1319
|
}, 1032, ["label", "name", "rules"])), [
|
|
1318
|
-
[wt, (
|
|
1320
|
+
[wt, (K = H(u)[g.id]) == null ? void 0 : K.length]
|
|
1319
1321
|
]);
|
|
1320
1322
|
}), 128))
|
|
1321
1323
|
]),
|
|
1322
1324
|
_: 1,
|
|
1323
|
-
__: [
|
|
1325
|
+
__: [2]
|
|
1324
1326
|
}, 8, ["model"])) : je("", !0);
|
|
1325
1327
|
}
|
|
1326
|
-
}), Ma = /* @__PURE__ */ Ft(Aa, [["__scopeId", "data-v-
|
|
1328
|
+
}), Ma = /* @__PURE__ */ Ft(Aa, [["__scopeId", "data-v-db9afb32"]]);
|
|
1327
1329
|
export {
|
|
1328
1330
|
Ma as default
|
|
1329
1331
|
};
|