@pantograph/vue 0.8.1 → 0.8.3
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/Menu/index.js.js +1 -1
- package/dist/Menu/index.umd.cjs.js +1 -1
- package/dist/Menu.vue_vue_type_style_index_0_lang-C_lbO09l.js +1 -0
- package/dist/Menu.vue_vue_type_style_index_0_lang-oedL61ps.js +521 -0
- package/dist/MenuItem/index.js.js +1 -1
- package/dist/MenuItem/index.umd.cjs.js +1 -1
- package/dist/Tree/TreeNode.d.ts +19 -3
- package/dist/Tree/index.js.js +1 -1
- package/dist/Tree/index.umd.cjs.js +1 -1
- package/dist/Tree.vue_vue_type_style_index_0_lang-D2iXdFbM.js +1 -0
- package/dist/Tree.vue_vue_type_style_index_0_lang-D9EB0NE_.js +573 -0
- package/dist/index.js.js +2 -2
- package/dist/index.umd.cjs.js +1 -1
- package/dist/style/index.css +1 -1
- package/package.json +1 -1
- package/dist/Menu.vue_vue_type_style_index_0_lang-BJqJJOUC.js +0 -1
- package/dist/Menu.vue_vue_type_style_index_0_lang-CfK6q5lj.js +0 -510
- package/dist/Tree.vue_vue_type_style_index_0_lang-Ds7jrgdN.js +0 -1
- package/dist/Tree.vue_vue_type_style_index_0_lang-WOtMzGCH.js +0 -575
|
@@ -1,575 +0,0 @@
|
|
|
1
|
-
import { defineComponent as xe, computed as c, inject as _e, ref as C, watch as j, provide as ze, resolveComponent as Ie, createBlock as Q, openBlock as S, unref as d, normalizeClass as T, withCtx as M, createElementVNode as pe, withDirectives as Be, createCommentVNode as ne, createElementBlock as U, createVNode as Ee, renderSlot as O, normalizeProps as he, guardReactiveProps as me, withModifiers as ye, mergeProps as W, Fragment as ue, toDisplayString as Fe, renderList as ge, vShow as Le, normalizeStyle as $e, createSlots as Te, onMounted as Ae, onBeforeUnmount as Re } from "vue";
|
|
2
|
-
import { a as A, b as R, g as Pe, c as Me } from "./class-DziTeW9B.js";
|
|
3
|
-
import { cva as Ce } from "class-variance-authority";
|
|
4
|
-
import { c as F } from "./cloneDeep-DIRSbAoF.js";
|
|
5
|
-
import { createContext as Oe, Primitive as Ue, useId as Ge } from "radix-vue";
|
|
6
|
-
import { M as He, S as ce, e as Ve, q as qe } from "./omit-wqhC12f_.js";
|
|
7
|
-
import je from "sortablejs";
|
|
8
|
-
import { g as Ne } from "./options-JBqnVZUl.js";
|
|
9
|
-
import { _ as Ye } from "./IndentLevel.vue_vue_type_style_index_0_lang-Bs9k7yZP.js";
|
|
10
|
-
import { _ as Ze } from "./Icon.vue_vue_type_style_index_0_lang-BfPcw6PU.js";
|
|
11
|
-
import { _ as Je } from "./Checkbox.vue_vue_type_style_index_0_lang-DPxsdfde.js";
|
|
12
|
-
var Qe = "__lodash_hash_undefined__";
|
|
13
|
-
function We(a) {
|
|
14
|
-
return this.__data__.set(a, Qe), this;
|
|
15
|
-
}
|
|
16
|
-
function Xe(a) {
|
|
17
|
-
return this.__data__.has(a);
|
|
18
|
-
}
|
|
19
|
-
function ae(a) {
|
|
20
|
-
var s = -1, e = a == null ? 0 : a.length;
|
|
21
|
-
for (this.__data__ = new He(); ++s < e; )
|
|
22
|
-
this.add(a[s]);
|
|
23
|
-
}
|
|
24
|
-
ae.prototype.add = ae.prototype.push = We;
|
|
25
|
-
ae.prototype.has = Xe;
|
|
26
|
-
function De(a, s, e, u) {
|
|
27
|
-
for (var v = a.length, b = e + -1; ++b < v; )
|
|
28
|
-
if (s(a[b], b, a))
|
|
29
|
-
return b;
|
|
30
|
-
return -1;
|
|
31
|
-
}
|
|
32
|
-
function et(a) {
|
|
33
|
-
return a !== a;
|
|
34
|
-
}
|
|
35
|
-
function tt(a, s, e) {
|
|
36
|
-
for (var u = e - 1, v = a.length; ++u < v; )
|
|
37
|
-
if (a[u] === s)
|
|
38
|
-
return u;
|
|
39
|
-
return -1;
|
|
40
|
-
}
|
|
41
|
-
function nt(a, s, e) {
|
|
42
|
-
return s === s ? tt(a, s, e) : De(a, et, e);
|
|
43
|
-
}
|
|
44
|
-
function at(a, s) {
|
|
45
|
-
var e = a == null ? 0 : a.length;
|
|
46
|
-
return !!e && nt(a, s, 0) > -1;
|
|
47
|
-
}
|
|
48
|
-
function st(a, s) {
|
|
49
|
-
return a.has(s);
|
|
50
|
-
}
|
|
51
|
-
function lt() {
|
|
52
|
-
}
|
|
53
|
-
function we(a) {
|
|
54
|
-
var s = -1, e = Array(a.size);
|
|
55
|
-
return a.forEach(function(u) {
|
|
56
|
-
e[++s] = u;
|
|
57
|
-
}), e;
|
|
58
|
-
}
|
|
59
|
-
var ot = 1 / 0, rt = ce && 1 / we(new ce([, -0]))[1] == ot ? function(a) {
|
|
60
|
-
return new ce(a);
|
|
61
|
-
} : lt, it = 200;
|
|
62
|
-
function dt(a, s, e) {
|
|
63
|
-
var u = -1, v = at, b = a.length, N = !0, h = [], m = h;
|
|
64
|
-
if (b >= it) {
|
|
65
|
-
var G = rt(a);
|
|
66
|
-
if (G)
|
|
67
|
-
return we(G);
|
|
68
|
-
N = !1, v = st, m = new ae();
|
|
69
|
-
} else
|
|
70
|
-
m = h;
|
|
71
|
-
e:
|
|
72
|
-
for (; ++u < b; ) {
|
|
73
|
-
var x = a[u], y = x;
|
|
74
|
-
if (x = x !== 0 ? x : 0, N && y === y) {
|
|
75
|
-
for (var K = m.length; K--; )
|
|
76
|
-
if (m[K] === y)
|
|
77
|
-
continue e;
|
|
78
|
-
h.push(x);
|
|
79
|
-
} else v(m, y, e) || (m !== h && m.push(y), h.push(x));
|
|
80
|
-
}
|
|
81
|
-
return h;
|
|
82
|
-
}
|
|
83
|
-
function ct(a) {
|
|
84
|
-
return a && a.length ? dt(a) : [];
|
|
85
|
-
}
|
|
86
|
-
function ke(a, s, e) {
|
|
87
|
-
var u = a == null ? void 0 : Ve(a, s);
|
|
88
|
-
return u === void 0 ? e : u;
|
|
89
|
-
}
|
|
90
|
-
const ut = ["sm", "md", "lg"], be = { none: "gap-none", sm: "gap-sm", md: "gap-md", lg: "gap-lg" }, [gt, vt] = Oe("CheckboxGroup"), ft = ["tabindex"], pt = ["data-parents", "data-level"], ht = /* @__PURE__ */ xe({
|
|
91
|
-
...Ne("TreeNode"),
|
|
92
|
-
__name: "TreeNode",
|
|
93
|
-
props: {
|
|
94
|
-
item: {},
|
|
95
|
-
level: { default: 1 },
|
|
96
|
-
hovered: { type: Boolean },
|
|
97
|
-
parentKeys: {}
|
|
98
|
-
},
|
|
99
|
-
setup(a) {
|
|
100
|
-
const s = a, e = gt(), u = Ce(e.prefixes.node, {
|
|
101
|
-
variants: {
|
|
102
|
-
disabled: A("disabled", e.prefixes.node),
|
|
103
|
-
active: A("active", e.prefixes.node)
|
|
104
|
-
}
|
|
105
|
-
}), v = c(() => {
|
|
106
|
-
switch (e.size.value) {
|
|
107
|
-
case "sm":
|
|
108
|
-
return "2xsm";
|
|
109
|
-
case "md":
|
|
110
|
-
case "lg":
|
|
111
|
-
return "xsm";
|
|
112
|
-
}
|
|
113
|
-
}), b = c(() => {
|
|
114
|
-
switch (e.size.value) {
|
|
115
|
-
case "sm":
|
|
116
|
-
return "2xsm";
|
|
117
|
-
default:
|
|
118
|
-
return "xsm";
|
|
119
|
-
}
|
|
120
|
-
}), N = (l) => e.getNodeField(l, "children"), h = (l) => e.getNodeField(l, "key"), m = c(() => N(s.item)), G = c(() => e.getNodeField(s.item, "leaf")), x = c(() => e.draggable.value ? e.getNodeField(s.item, "draggable") ?? !0 : !1), y = c(() => h(s.item)), K = c(() => e.getNodeField(s.item, "disabled")), L = c(
|
|
121
|
-
() => {
|
|
122
|
-
var l;
|
|
123
|
-
return !!((l = m.value) != null && l.some((n) => e.expandedKeys.value.includes(h(n))));
|
|
124
|
-
}
|
|
125
|
-
), p = _e("tree-node-context", {
|
|
126
|
-
hovered: C(s.hovered ?? !1),
|
|
127
|
-
expanded: C(!1),
|
|
128
|
-
childExpanded: L
|
|
129
|
-
}), B = c(
|
|
130
|
-
() => !(s.item.dragging ?? !1) && e.expandedKeys.value.includes(y.value)
|
|
131
|
-
), _ = C(!1), $ = (l) => {
|
|
132
|
-
_.value = l;
|
|
133
|
-
};
|
|
134
|
-
j(_, (l) => {
|
|
135
|
-
e.showLine.value && p.hovered && (p.hovered.value = l);
|
|
136
|
-
}), ze("tree-node-context", {
|
|
137
|
-
expanded: B,
|
|
138
|
-
childExpanded: L,
|
|
139
|
-
hovered: _
|
|
140
|
-
});
|
|
141
|
-
const Y = c(() => {
|
|
142
|
-
var l, n, t;
|
|
143
|
-
if (e.dragging.value) return !1;
|
|
144
|
-
if (e.showLine.value) {
|
|
145
|
-
if (s.hovered || (l = p.hovered) != null && l.value || _.value) return "all";
|
|
146
|
-
if (B.value && !L.value) return "self";
|
|
147
|
-
if ((n = p.expanded) != null && n.value && !((t = p.childExpanded) != null && t.value)) return "last";
|
|
148
|
-
}
|
|
149
|
-
}), z = c(() => {
|
|
150
|
-
var l;
|
|
151
|
-
return !((l = m.value) != null && l.length);
|
|
152
|
-
}), se = () => {
|
|
153
|
-
K.value || e.onSelect(s.item);
|
|
154
|
-
}, Z = c(() => e.model.value.includes(y.value)), I = c(() => {
|
|
155
|
-
const l = (r = s.item) => {
|
|
156
|
-
const i = N(r);
|
|
157
|
-
return (i == null ? void 0 : i.length) && i.every((g) => e.checked.value.includes(h(g)));
|
|
158
|
-
}, n = (r = s.item) => {
|
|
159
|
-
const i = N(r);
|
|
160
|
-
return i != null && i.length ? !!(i != null && i.some(
|
|
161
|
-
(g) => e.checked.value.includes(h(g)) || n(g)
|
|
162
|
-
)) : !1;
|
|
163
|
-
}, t = e.checked.value.includes(y.value);
|
|
164
|
-
return l() ? (t || e.onCheck(s.item), !0) : n() ? (t && e.onCheck(s.item), "indeterminate") : !!t;
|
|
165
|
-
}), le = () => {
|
|
166
|
-
var t;
|
|
167
|
-
if (!((t = m.value) != null && t.length)) return e.onCheck(s.item);
|
|
168
|
-
const l = (o = s.item) => {
|
|
169
|
-
const r = N(o);
|
|
170
|
-
return r != null && r.length ? r.reduce((i, g) => {
|
|
171
|
-
const w = N(g), ee = h(g);
|
|
172
|
-
return w != null && w.length ? [...i, ee, ...l(g)] : [...i, ee];
|
|
173
|
-
}, []) : [];
|
|
174
|
-
}, n = l();
|
|
175
|
-
return e.onCheck(s.item, {
|
|
176
|
-
keys: [y.value, ...n],
|
|
177
|
-
value: !e.checked.value.includes(y.value)
|
|
178
|
-
});
|
|
179
|
-
}, X = c(() => [...s.parentKeys ?? [], y.value]), oe = () => {
|
|
180
|
-
e.onExpandKey(s.item);
|
|
181
|
-
}, H = c(() => s.item.dragging_level ?? s.level), V = c(() => H.value + 1), P = C(), D = C();
|
|
182
|
-
e.useSortable({
|
|
183
|
-
root: P,
|
|
184
|
-
instance: D,
|
|
185
|
-
node: s.item
|
|
186
|
-
});
|
|
187
|
-
const re = c(() => {
|
|
188
|
-
switch (e.size.value) {
|
|
189
|
-
case "sm":
|
|
190
|
-
return "2xsm";
|
|
191
|
-
case "md":
|
|
192
|
-
return "xsm";
|
|
193
|
-
case "lg":
|
|
194
|
-
return "sm";
|
|
195
|
-
}
|
|
196
|
-
});
|
|
197
|
-
return (l, n) => {
|
|
198
|
-
const t = Ie("TreeNode", !0);
|
|
199
|
-
return S(), Q(d(Ue), {
|
|
200
|
-
asChild: z.value,
|
|
201
|
-
key: z.value,
|
|
202
|
-
"data-parents": d(e).draggable.value ? l.parentKeys : void 0,
|
|
203
|
-
"data-key": d(e).draggable.value ? y.value : void 0,
|
|
204
|
-
"data-draggable": d(e).draggable.value ? !d(e).disabled.value && !K.value && x.value : void 0,
|
|
205
|
-
class: T([{ [d(e).prefixes.group]: !z.value }, d(e).getNodeField(l.item, "class")])
|
|
206
|
-
}, {
|
|
207
|
-
default: M(() => {
|
|
208
|
-
var o, r;
|
|
209
|
-
return [
|
|
210
|
-
pe("div", {
|
|
211
|
-
tabindex: K.value ? void 0 : 0,
|
|
212
|
-
class: T([
|
|
213
|
-
d(u)({
|
|
214
|
-
disabled: K.value,
|
|
215
|
-
active: Z.value
|
|
216
|
-
}),
|
|
217
|
-
d(e).getNodeField(l.item, "class")
|
|
218
|
-
]),
|
|
219
|
-
onMouseenter: n[1] || (n[1] = (i) => $(!0)),
|
|
220
|
-
onMouseleave: n[2] || (n[2] = (i) => $(!1)),
|
|
221
|
-
onClick: se
|
|
222
|
-
}, [
|
|
223
|
-
d(e).draggable.value ? (S(), U("span", {
|
|
224
|
-
key: 0,
|
|
225
|
-
class: T(d(e).prefixes.draggable)
|
|
226
|
-
}, [
|
|
227
|
-
!l.item.dragging && !d(e).dragging.value ? (S(), Q(Ze, {
|
|
228
|
-
key: 0,
|
|
229
|
-
icon: "tabler:grip-vertical",
|
|
230
|
-
size: b.value,
|
|
231
|
-
class: T(d(e).prefixes.draggableIcon)
|
|
232
|
-
}, {
|
|
233
|
-
default: M(() => [
|
|
234
|
-
O(l.$slots, "dragTrigger", he(me(l.item)))
|
|
235
|
-
]),
|
|
236
|
-
_: 3
|
|
237
|
-
}, 8, ["size", "class"])) : ne("", !0)
|
|
238
|
-
], 2)) : ne("", !0),
|
|
239
|
-
Ee(Ye, {
|
|
240
|
-
level: H.value,
|
|
241
|
-
children: !!((o = m.value) != null && o.length || d(e).lazyLoad.value && !G.value),
|
|
242
|
-
size: re.value,
|
|
243
|
-
expanded: B.value,
|
|
244
|
-
showLine: Y.value,
|
|
245
|
-
loading: d(e).getNodeField(l.item, "loading"),
|
|
246
|
-
"branch-icon": d(e).getNodeField(l.item, "switcherIcon") ?? d(e).switcherIcon.value,
|
|
247
|
-
"no-rotate-branch": d(e).getNodeField(l.item, "noRotateSwitcherIcon") ?? d(e).noRotateSwitcherIcon.value,
|
|
248
|
-
onToggleExpand: ye(oe, ["stop"])
|
|
249
|
-
}, {
|
|
250
|
-
default: M(() => [
|
|
251
|
-
O(l.$slots, "switcherIcon", W({ expanded: B.value }, l.item))
|
|
252
|
-
]),
|
|
253
|
-
_: 3
|
|
254
|
-
}, 8, ["level", "children", "size", "expanded", "showLine", "loading", "branch-icon", "no-rotate-branch"]),
|
|
255
|
-
!l.item.dragging || !d(e).dragging.value ? (S(), U(ue, { key: 1 }, [
|
|
256
|
-
d(e).checkbox.value ? (S(), Q(Je, {
|
|
257
|
-
key: 0,
|
|
258
|
-
size: v.value,
|
|
259
|
-
onClick: n[0] || (n[0] = ye(() => {
|
|
260
|
-
}, ["stop"])),
|
|
261
|
-
checked: I.value,
|
|
262
|
-
"onUpdate:checked": le,
|
|
263
|
-
disabled: K.value || d(e).disabled.value
|
|
264
|
-
}, null, 8, ["size", "checked", "disabled"])) : ne("", !0),
|
|
265
|
-
O(l.$slots, "title", he(me(l.item)), () => [
|
|
266
|
-
pe("div", {
|
|
267
|
-
class: T(d(R)(d(e).prefixes.node, "title"))
|
|
268
|
-
}, Fe(d(e).getNodeField(l.item, "title")), 3)
|
|
269
|
-
])
|
|
270
|
-
], 64)) : (S(), U("div", {
|
|
271
|
-
key: 2,
|
|
272
|
-
class: T(d(R)(d(e).prefixes.node, "slot"))
|
|
273
|
-
}, null, 2))
|
|
274
|
-
], 42, ft),
|
|
275
|
-
(r = m.value) != null && r.length ? Be((S(), U("div", {
|
|
276
|
-
key: 0,
|
|
277
|
-
class: T(d(e).prefixes.groupList),
|
|
278
|
-
ref_key: "root",
|
|
279
|
-
ref: P,
|
|
280
|
-
"data-parents": d(e).draggable.value ? X.value : void 0,
|
|
281
|
-
"data-level": d(e).draggable.value ? V.value : void 0
|
|
282
|
-
}, [
|
|
283
|
-
(S(!0), U(ue, null, ge(N(l.item), (i) => {
|
|
284
|
-
var g;
|
|
285
|
-
return S(), Q(t, {
|
|
286
|
-
key: d(e).getNodeField(i, "key"),
|
|
287
|
-
parentKeys: X.value,
|
|
288
|
-
item: i,
|
|
289
|
-
level: V.value,
|
|
290
|
-
hovered: s.hovered || _.value || ((g = d(p).hovered) == null ? void 0 : g.value)
|
|
291
|
-
}, {
|
|
292
|
-
title: M((w) => [
|
|
293
|
-
O(l.$slots, "title", W({ ref_for: !0 }, w))
|
|
294
|
-
]),
|
|
295
|
-
switcherIcon: M((w) => [
|
|
296
|
-
O(l.$slots, "switcherIcon", W({ ref_for: !0 }, w))
|
|
297
|
-
]),
|
|
298
|
-
dragTrigger: M((w) => [
|
|
299
|
-
O(l.$slots, "dragTrigger", W({ ref_for: !0 }, w))
|
|
300
|
-
]),
|
|
301
|
-
_: 2
|
|
302
|
-
}, 1032, ["parentKeys", "item", "level", "hovered"]);
|
|
303
|
-
}), 128))
|
|
304
|
-
], 10, pt)), [
|
|
305
|
-
[Le, B.value]
|
|
306
|
-
]) : ne("", !0)
|
|
307
|
-
];
|
|
308
|
-
}),
|
|
309
|
-
_: 3
|
|
310
|
-
}, 8, ["asChild", "data-parents", "data-key", "data-draggable", "class"]);
|
|
311
|
-
};
|
|
312
|
-
}
|
|
313
|
-
}), zt = /* @__PURE__ */ xe({
|
|
314
|
-
...Ne("Tree"),
|
|
315
|
-
__name: "Tree",
|
|
316
|
-
props: {
|
|
317
|
-
class: {},
|
|
318
|
-
size: { default: "md" },
|
|
319
|
-
gap: {},
|
|
320
|
-
data: {},
|
|
321
|
-
value: {},
|
|
322
|
-
checkedKeys: {},
|
|
323
|
-
expandedKeys: {},
|
|
324
|
-
multiple: { type: Boolean },
|
|
325
|
-
checkbox: { type: Boolean },
|
|
326
|
-
defaultExpandAll: { type: Boolean },
|
|
327
|
-
selectable: { type: Boolean },
|
|
328
|
-
showLine: { type: Boolean },
|
|
329
|
-
inlineNode: { type: Boolean },
|
|
330
|
-
lazyLoad: { type: Boolean },
|
|
331
|
-
fieldNames: {},
|
|
332
|
-
groupName: {},
|
|
333
|
-
switcherIcon: {},
|
|
334
|
-
noRotateSwitcherIcon: { type: Boolean },
|
|
335
|
-
draggable: { type: Boolean },
|
|
336
|
-
disabled: { type: Boolean }
|
|
337
|
-
},
|
|
338
|
-
emits: ["update:value", "update:expandedKeys", "update:checkedKeys", "expand", "select", "check", "dragStart", "dragEnd"],
|
|
339
|
-
setup(a, { emit: s }) {
|
|
340
|
-
const e = a, u = s, v = Pe("tree"), b = R(v, "node"), N = R(b, "group"), h = R(b, "draggable"), m = R(h, "icon"), G = R(N, "list"), x = {
|
|
341
|
-
node: b,
|
|
342
|
-
group: N,
|
|
343
|
-
draggable: h,
|
|
344
|
-
draggableIcon: m,
|
|
345
|
-
groupList: G
|
|
346
|
-
}, y = Ce(v, {
|
|
347
|
-
variants: {
|
|
348
|
-
size: A(ut, v),
|
|
349
|
-
gap: A(be, v),
|
|
350
|
-
selectable: A("selectable", v),
|
|
351
|
-
disabled: A("disabled", v),
|
|
352
|
-
inlineNode: A("inline-node", v),
|
|
353
|
-
dragging: A("dragging", v)
|
|
354
|
-
}
|
|
355
|
-
}), K = c(() => F(e.data)), L = C(K.value), p = (n, t) => {
|
|
356
|
-
var r;
|
|
357
|
-
const o = ke(n, t);
|
|
358
|
-
return (r = e.fieldNames) != null && r[t] ? ke(n, e.fieldNames[t], o) : o;
|
|
359
|
-
}, B = () => {
|
|
360
|
-
if (!e.lazyLoad) {
|
|
361
|
-
const n = [], t = (o) => {
|
|
362
|
-
for (const r of o) {
|
|
363
|
-
const i = p(r, "children");
|
|
364
|
-
i != null && i.length && (n.push(p(r, "key")), t(i));
|
|
365
|
-
}
|
|
366
|
-
};
|
|
367
|
-
return t(L.value), n;
|
|
368
|
-
}
|
|
369
|
-
return [];
|
|
370
|
-
}, _ = C(
|
|
371
|
-
e.expandedKeys ?? (e.defaultExpandAll ? B() : [])
|
|
372
|
-
);
|
|
373
|
-
j(
|
|
374
|
-
() => [e.defaultExpandAll, e.expandedKeys],
|
|
375
|
-
([n, t], [o, r]) => {
|
|
376
|
-
t !== r ? _.value = e.expandedKeys ?? [] : n && !o && (_.value = B());
|
|
377
|
-
}
|
|
378
|
-
);
|
|
379
|
-
const $ = c({
|
|
380
|
-
get() {
|
|
381
|
-
return e.expandedKeys ? e.expandedKeys : _.value;
|
|
382
|
-
},
|
|
383
|
-
set(n) {
|
|
384
|
-
e.expandedKeys || (_.value = n), u("update:expandedKeys", n);
|
|
385
|
-
}
|
|
386
|
-
});
|
|
387
|
-
j(
|
|
388
|
-
K,
|
|
389
|
-
(n) => {
|
|
390
|
-
L.value = n;
|
|
391
|
-
const t = B();
|
|
392
|
-
$.value = $.value.filter((o) => t.includes(o)), V.value++;
|
|
393
|
-
},
|
|
394
|
-
{ deep: !0 }
|
|
395
|
-
);
|
|
396
|
-
const Y = C(e.value ?? []);
|
|
397
|
-
j(
|
|
398
|
-
() => e.value,
|
|
399
|
-
() => {
|
|
400
|
-
Y.value = e.value ?? [];
|
|
401
|
-
}
|
|
402
|
-
);
|
|
403
|
-
const z = c({
|
|
404
|
-
get() {
|
|
405
|
-
return e.value ? e.value : Y.value;
|
|
406
|
-
},
|
|
407
|
-
set(n) {
|
|
408
|
-
e.value || (Y.value = n), u("update:value", n);
|
|
409
|
-
}
|
|
410
|
-
}), se = (n) => {
|
|
411
|
-
if (e.selectable && !e.disabled) {
|
|
412
|
-
let t = F(z.value);
|
|
413
|
-
const o = p(n, "key");
|
|
414
|
-
e.multiple ? z.value.includes(o) ? t = F(z.value.filter((r) => r !== o)) : t = F([...z.value, o]) : t.includes(o) ? t = [] : t = [o], z.value = t, u("select", n, t.includes(o));
|
|
415
|
-
}
|
|
416
|
-
}, Z = C(e.checkedKeys ?? []);
|
|
417
|
-
j(
|
|
418
|
-
() => e.checkedKeys,
|
|
419
|
-
() => {
|
|
420
|
-
Z.value = e.checkedKeys ?? [];
|
|
421
|
-
}
|
|
422
|
-
);
|
|
423
|
-
const I = c({
|
|
424
|
-
get() {
|
|
425
|
-
return e.checkedKeys ? e.checkedKeys : Z.value;
|
|
426
|
-
},
|
|
427
|
-
set(n) {
|
|
428
|
-
e.checkedKeys || (Z.value = n), u("update:checkedKeys", n);
|
|
429
|
-
}
|
|
430
|
-
}), le = (n, t) => {
|
|
431
|
-
if (e.checkbox && !e.disabled) {
|
|
432
|
-
let o = F(I.value);
|
|
433
|
-
const r = p(n, "key");
|
|
434
|
-
t != null && t.keys.length ? t.value ? o = ct([...t.keys, ...o]) : o = F(I.value.filter((g) => !t.keys.includes(g))) : I.value.includes(r) ? o = F(I.value.filter((g) => g !== r)) : o = F([...I.value, r]), I.value = o;
|
|
435
|
-
const i = (t == null ? void 0 : t.value) ?? I.value.includes(r);
|
|
436
|
-
u("check", n, i, (t == null ? void 0 : t.keys) ?? r);
|
|
437
|
-
}
|
|
438
|
-
}, X = (n) => {
|
|
439
|
-
let t = !0;
|
|
440
|
-
const o = p(n, "key");
|
|
441
|
-
let r = F($.value);
|
|
442
|
-
r.includes(o) ? (r = r.filter((i) => i !== o), t = !1) : r = [...r, o], $.value = r, u("expand", n, t);
|
|
443
|
-
}, oe = c(() => {
|
|
444
|
-
if (e.gap) {
|
|
445
|
-
if (typeof e.gap == "number") return `${e.gap}px`;
|
|
446
|
-
if (!Object.keys(be).includes(e.gap)) return e.gap;
|
|
447
|
-
}
|
|
448
|
-
}), H = e.groupName ?? Ge(void 0, v), V = C(1), P = C(!1), D = C(), re = C(), l = (n) => {
|
|
449
|
-
const { root: t, instance: o, node: r } = n, i = (E) => {
|
|
450
|
-
var f;
|
|
451
|
-
return (f = E.getAttribute("data-parents")) == null ? void 0 : f.split(",");
|
|
452
|
-
}, g = (E) => {
|
|
453
|
-
const f = (J, Se = L.value) => {
|
|
454
|
-
const { parents: ie, self: Ke } = J;
|
|
455
|
-
for (let de of Se) {
|
|
456
|
-
const fe = p(de, "key").toString();
|
|
457
|
-
if (fe === Ke) return de;
|
|
458
|
-
const te = p(de, "children");
|
|
459
|
-
if (ie != null && ie.includes(fe) && (te != null && te.length)) return f(J, te);
|
|
460
|
-
}
|
|
461
|
-
}, k = i(E), q = E.getAttribute("data-key") ?? "";
|
|
462
|
-
return f({ parents: k, self: q });
|
|
463
|
-
}, w = Me(R(v, "dragging_item"), e.size), ee = (E = t.value) => new je(E, {
|
|
464
|
-
group: qe(H) ? H(r) : H,
|
|
465
|
-
animation: 150,
|
|
466
|
-
forceFallback: !0,
|
|
467
|
-
fallbackOnBody: !0,
|
|
468
|
-
filter: "[data-draggable=false]",
|
|
469
|
-
handle: `.${x.node} .${x.draggable} .${x.draggableIcon}`,
|
|
470
|
-
// swapThreshold: 0.65,
|
|
471
|
-
dataIdAttr: "data-key",
|
|
472
|
-
dragClass: w,
|
|
473
|
-
onChoose(f) {
|
|
474
|
-
const k = g(f.item);
|
|
475
|
-
k && (k.dragging = !0);
|
|
476
|
-
},
|
|
477
|
-
onStart(f) {
|
|
478
|
-
var J;
|
|
479
|
-
const k = document.querySelector(`.${w}`), q = (J = getComputedStyle(t.value)) == null ? void 0 : J.direction;
|
|
480
|
-
k != null && k.style && (k.style.direction = q), P.value = !0, u("dragStart", f);
|
|
481
|
-
},
|
|
482
|
-
onUnchoose(f) {
|
|
483
|
-
const k = g(f.item);
|
|
484
|
-
k && (k.dragging = !1);
|
|
485
|
-
},
|
|
486
|
-
onEnd(f) {
|
|
487
|
-
P.value = !1, u("dragEnd", {
|
|
488
|
-
...f,
|
|
489
|
-
node: g(f.item),
|
|
490
|
-
oldParents: i(f.item),
|
|
491
|
-
newParents: i(f.to)
|
|
492
|
-
});
|
|
493
|
-
},
|
|
494
|
-
onMove(f) {
|
|
495
|
-
const k = Number(f.to.getAttribute("data-level") ?? "1"), q = g(f.dragged);
|
|
496
|
-
q && (q.dragging_level = k);
|
|
497
|
-
}
|
|
498
|
-
}), ve = () => {
|
|
499
|
-
var E;
|
|
500
|
-
(E = o.value) == null || E.destroy(), o.value = void 0;
|
|
501
|
-
};
|
|
502
|
-
Ae(() => {
|
|
503
|
-
j(
|
|
504
|
-
() => [t.value, e.draggable, V.value],
|
|
505
|
-
() => {
|
|
506
|
-
o.value ? ve() : t.value && e.draggable && (o.value = ee());
|
|
507
|
-
},
|
|
508
|
-
{ immediate: !0 }
|
|
509
|
-
);
|
|
510
|
-
}), Re(() => {
|
|
511
|
-
o.value && ve();
|
|
512
|
-
});
|
|
513
|
-
};
|
|
514
|
-
return l({
|
|
515
|
-
root: D,
|
|
516
|
-
instance: re
|
|
517
|
-
}), vt({
|
|
518
|
-
size: c(() => e.size),
|
|
519
|
-
draggable: c(() => e.draggable),
|
|
520
|
-
lazyLoad: c(() => e.lazyLoad),
|
|
521
|
-
checkbox: c(() => e.checkbox),
|
|
522
|
-
showLine: c(() => e.showLine),
|
|
523
|
-
disabled: c(() => e.disabled),
|
|
524
|
-
switcherIcon: c(() => e.switcherIcon),
|
|
525
|
-
noRotateSwitcherIcon: c(() => e.noRotateSwitcherIcon),
|
|
526
|
-
expandedKeys: $,
|
|
527
|
-
model: z,
|
|
528
|
-
checked: I,
|
|
529
|
-
onExpandKey: X,
|
|
530
|
-
onSelect: se,
|
|
531
|
-
onCheck: le,
|
|
532
|
-
getNodeField: p,
|
|
533
|
-
useSortable: l,
|
|
534
|
-
dragging: P,
|
|
535
|
-
prefixes: x
|
|
536
|
-
}), (n, t) => (S(), U("div", {
|
|
537
|
-
key: V.value,
|
|
538
|
-
class: T([
|
|
539
|
-
d(y)({
|
|
540
|
-
size: e.size,
|
|
541
|
-
gap: e.gap ?? e.size,
|
|
542
|
-
selectable: e.selectable,
|
|
543
|
-
disabled: e.disabled,
|
|
544
|
-
inlineNode: e.inlineNode,
|
|
545
|
-
dragging: P.value
|
|
546
|
-
}),
|
|
547
|
-
e.class
|
|
548
|
-
]),
|
|
549
|
-
style: $e({
|
|
550
|
-
"--ptc-tree-gap": oe.value
|
|
551
|
-
}),
|
|
552
|
-
ref_key: "root",
|
|
553
|
-
ref: D
|
|
554
|
-
}, [
|
|
555
|
-
(S(!0), U(ue, null, ge(L.value, (o) => (S(), Q(ht, {
|
|
556
|
-
key: p(o, "key"),
|
|
557
|
-
item: o
|
|
558
|
-
}, Te({ _: 2 }, [
|
|
559
|
-
ge(Object.keys(n.$slots), (r) => ({
|
|
560
|
-
name: r,
|
|
561
|
-
fn: M((i) => [
|
|
562
|
-
O(n.$slots, r, W({ ref_for: !0 }, i))
|
|
563
|
-
])
|
|
564
|
-
}))
|
|
565
|
-
]), 1032, ["item"]))), 128))
|
|
566
|
-
], 6));
|
|
567
|
-
}
|
|
568
|
-
});
|
|
569
|
-
export {
|
|
570
|
-
ut as T,
|
|
571
|
-
zt as _,
|
|
572
|
-
be as a,
|
|
573
|
-
gt as i,
|
|
574
|
-
vt as p
|
|
575
|
-
};
|