UNPKG

@extclp/vexip-ui

Version:

A Vue 3 UI library, Highly customizability, full TypeScript, performance pretty good

974 lines (973 loc) 31 kB
import { defineComponent as Ut, useSlots as Gt, toRef as h, ref as L, reactive as ee, computed as P, nextTick as Jt, watchEffect as Te, watch as Ke, provide as qe, onMounted as Qt, createBlock as se, openBlock as G, unref as i, normalizeStyle as Ue, normalizeClass as ce, withCtx as v, withDirectives as Wt, createCommentVNode as Xt, createElementBlock as Ge, vShow as Zt, createElementVNode as Ee, renderSlot as S, createVNode as F, createTextVNode as ea, toDisplayString as ta, Fragment as aa, renderList as la, mergeProps as $, createSlots as Je, normalizeProps as te, guardReactiveProps as ae } from "vue"; import "../collapse-transition/index.mjs"; import "../renderer/index.mjs"; import "../virtual-list/index.mjs"; import "./tree-node.vue.mjs"; import { useProps as na, createIconProp as ra, useNameHelper as da, useLocale as ia, emitEvent as x } from "@vexip-ui/config"; import { useSetTimeout as oa, useMounted as sa } from "@vexip-ui/hooks"; import { debounce as ca, queryAll as fa, flatTree as Qe, getGlobalCount as ua, isNull as le, walkTree as Ie, getLast as We, transformTree as pa, isPromise as ha, removeArrayItem as ga, mapTree as ba, filterTree as va } from "@vexip-ui/utils"; import { treeProps as ya } from "./props.mjs"; import { useCascadedChecked as xa } from "./hooks.mjs"; import { defaultKeyConfig as ma, TREE_STATE as ka, TREE_NODE_STATE as Na, DropType as J } from "./symbol.mjs"; import Da from "../virtual-list/virtual-list.mjs"; import T from "../renderer/renderer.mjs"; import wa from "../collapse/collapse-transition.mjs"; import Xe from "./tree-node.vue2.mjs"; const za = /* @__PURE__ */ Ut({ name: "Tree", __name: "tree", props: ya, setup(Ze, { expose: et }) { const l = na("tree", Ze, { arrow: { default: "auto", validator: (e) => typeof e == "boolean" || e === "auto" }, data: { default: () => [], static: !0 }, noBuildTree: !1, emptyText: null, disabled: !1, readonly: !1, checkbox: !1, suffixCheckbox: !1, renderer: { default: null, isFunc: !0 }, prefixRenderer: { default: null, isFunc: !0 }, suffixRenderer: { default: null, isFunc: !0 }, multiple: !1, indent: "16px", accordion: !1, draggable: !1, appear: !1, floorSelect: !1, onAsyncLoad: { default: null, isFunc: !0 }, cacheNode: !1, rootId: null, keyConfig: () => ({}), noCascaded: !1, filter: "", ignoreCase: !1, nodeProps: null, linkLine: !1, postCreate: { default: null, isFunc: !0 }, virtual: !1, nodeMinHeight: { default: 26, validator: (e) => e > 0 }, useYBar: !1, noTransition: !1, arrowIcon: ra(), blockEffect: !1, filterLeaf: !1, keepSelected: !1, slots: () => ({}) }), K = Gt(), E = da("tree"), tt = ia("tree", h(l, "locale")), g = /* @__PURE__ */ new Map(), A = /* @__PURE__ */ new Map(), m = L([]), u = L([]), ne = L(!1), fe = L(!1), k = ee({ ...ma }), at = ee(/* @__PURE__ */ new Map()), Q = L(!1), Me = L([]), ue = L(/* @__PURE__ */ new Set()), { timer: Re } = oa(), { isMounted: lt } = sa(), re = L(), de = L(), W = L(), H = P(() => { var e; return (e = re.value) == null ? void 0 : e.wrapper; }); let I = []; const nt = { visible: !0, selected: !1, expanded: !1, disabled: !1, checked: !1, loading: !1, loaded: !1, loadFail: !1, readonly: !1, arrow: "auto", // will follow checkbox prop of tree when not set (be null) checkbox: null, selectDisabled: !1, expandDisabled: !1, checkDisabled: !1, isLeaf: "auto" }, pe = P(() => typeof l.onAsyncLoad == "function"), Be = P(() => l.linkLine === !0 ? "dashed" : l.linkLine === "none" ? !1 : l.linkLine), rt = P(() => ({ [E.cv("indent-width")]: typeof l.indent == "number" ? `${l.indent}px` : l.indent, [E.cv("link-line-type")]: Be.value || void 0 })), dt = P(() => ye(m.value)), it = P(() => Q.value ? Me.value : dt.value), _e = P(() => typeof l.nodeProps == "function" ? l.nodeProps : () => l.nodeProps); function ot(e) { const t = l.ignoreCase ? String(e).toLocaleLowerCase() : e; return (n) => { const r = n[k.label]; return l.ignoreCase ? String(r).toLocaleLowerCase().includes(t) : String(r).includes(t); }; } const z = ca(() => { H.value && (I = fa(`.${E.be("node")}`, H.value)); }, 300); let he = !1; function st() { he = !0, Jt(() => { he = !1; }); } Te(() => { const e = u.value; if (st(), l.filter) { const t = typeof l.filter == "function" ? l.filter : ot(l.filter), a = l.filterLeaf; for (let n = 0, r = e.length; n < r; ++n) { const d = e[n]; if (a && !ve(d)) { d.matched = !1, d.childMatched = !1, d.upperMatched = !1; continue; } const s = d.parent ? g.get(d.parent) : void 0; if (d.matched = t(d.data, d), d.childMatched = !1, d.upperMatched = !!s && (s.matched || s.upperMatched), d.matched) { let c = s; for (; c && !c.childMatched; ) c.childMatched = !0, c.expanded = !0, c = c.parent ? g.get(c.parent) : void 0; } } } else for (let t = 0, a = e.length; t < a; ++t) { const n = e[t]; n.matched = !0, n.childMatched = !1, n.upperMatched = !1; } V(); }), Te(() => Object.assign(k, l.keyConfig)), Te(() => { const e = ue.value, t = /* @__PURE__ */ new Set(); let a = !1; for (const n of u.value) n.expanded && (t.add(n.id), !a && !e.has(n.id) && (a = !0)); (a || t.size !== e.size) && (ue.value = t); }), Ke( [ () => l.data, () => l.data.length, () => k.id, () => k.children, () => k.parent, () => l.rootId ], He, { immediate: !0 } ), Ke( [m, () => l.rootId], () => { u.value = Qe(m.value, { keyField: "id", parentField: "parent", childField: "children", rootId: l.rootId, injectId: !1, depthFirst: !0 }); }, { immediate: !0 } ), Ke(ue, (e, t) => { var M, j, Y, q; if (l.noTransition && z(), l.noTransition || he || !H.value) return; let a, n; for (const D of e) if (!t.has(D)) { if (a != null) return; a = D; } for (const D of t) if (!e.has(D)) { if (n != null) return; n = D; } if (a == null && n == null || a && !((j = (M = g.get(a)) == null ? void 0 : M.children) != null && j.length) || n && !((q = (Y = g.get(n)) == null ? void 0 : Y.children) != null && q.length)) return; clearTimeout(Re.expand), ie.value = !1, Q.value = !0; let r; a != null && (r = t), n != null && (r ? (r = new Set(r), r.delete(n)) : r = e); const d = ye(m.value, r), s = l.virtual, c = H.value.offsetHeight, p = l.nodeMinHeight || 1, f = Math.ceil(c / p) + 1, N = [ a != null && { id: a, type: "expand" }, n != null && { id: n, type: "reduce" } ]; for (const D of N) { if (!D) continue; const { id: Z, type: U } = D, o = d.findIndex((y) => y.id === Z); if (~o) { const y = d[o].children; if (y != null && y.length) { const w = ye(y, e); d.splice(o + 1, 0, { id: Symbol("TreeNodePlaceholder"), collapse: !0, type: U, height: s ? w.length * p : void 0, nodes: s ? w.slice(0, f) : w }); } } } Me.value = d; }), qe( ka, ee({ arrow: h(l, "arrow"), checkbox: h(l, "checkbox"), suffixCheckbox: h(l, "suffixCheckbox"), noCascaded: h(l, "noCascaded"), linkLine: Be, virtual: h(l, "virtual"), labelKey: h(k, "label"), draggable: h(l, "draggable"), floorSelect: h(l, "floorSelect"), renderer: h(l, "renderer"), prefixRenderer: h(l, "prefixRenderer"), suffixRenderer: h(l, "suffixRenderer"), arrowIcon: h(l, "arrowIcon"), blockEffect: h(l, "blockEffect"), dragging: ne, boundAsyncLoad: pe, nodeStates: at, expanding: Q, keepSelected: h(l, "keepSelected"), multiple: h(l, "multiple"), getParentNode: C, updateVisibleNodeEls: z, computeCheckedState: pt, handleNodeClick: ht, handleNodeSelect: bt, handleNodeCancel: vt, handleNodeExpand: yt, handleNodeReduce: xt, handleNodeContextmenu: mt, handleAsyncLoad: kt, handleNodeDragStart: Nt, handleNodeDragOver: Dt, handleNodeDrop: Ct, handleNodeDragEnd: Lt, handleHittingChange: St, handleNodeHitting: Ft, handleLabelClick: gt }) ), qe( Na, ee({ depth: -1, disabled: h(l, "disabled"), readonly: h(l, "readonly") }) ), et({ treeNodes: m, flattedNodes: u, dragging: ne, expanding: Q, virtualList: re, trap: de, indicator: W, refreshScroll: Et, isLeafNode: ve, parseAndTransformData: He, forceUpdateData: ft, syncNodeStateIntoData: ut, getCheckedNodes: ze, getCheckedNodeData: Mt, getSelectedNodes: Oe, getSelectedNodeData: Rt, getExpandedNodes: Bt, getDisabledNodes: _t, getParentNode: C, getNodeChildren: At, getSiblingNodes: Ve, getPrevSiblingNode: Pt, getNextSiblingNode: $t, getNodeByData: X, expandNodeByData: Ht, selectNodeByData: zt, checkNodeByData: Ot, toggleNodeLoadingByData: Vt, toggleAllExpanded: jt, getTreeData: Yt, getFlattedData: qt, updateVisibleNodeEls: z }), Qt(z); const { updateCheckedUpward: ge, updateCheckedDown: be } = xa({ getNode: (e) => g.get(e), disableNode: (e) => e.disabled }); function Ae() { return `__vxp-tree-key-${ua()}`; } function ve(e) { var r; const t = e.isLeaf; let a = "auto", n = !1; return le(t) || t === "auto" ? (a = "auto", n = pe.value) : a = t, a === "auto" ? !((r = e.children) != null && r.length || n && !e.loaded) : !!a; } function ye(e, t) { const a = new Set(e); return Qe(e, { keyField: "id", parentField: "parent", childField: "children", injectId: !1, depthFirst: !0, cascaded: !0, filter: (n) => { if (a.has(n)) return n.matched || n.childMatched || n.upperMatched; const r = C(n); return n.visible && (n.matched || n.childMatched || n.upperMatched) && (!r || (t ? t.has(r.id) : r.expanded)); } }); } function ct(e) { return e.collapse; } function Pe() { Ie(m.value, (e, t) => { if (e.depth = t, e.lineIndexes = [0], e.parent && g.has(e.parent)) { const a = g.get(e.parent); e.last = We(a.children) === e, e.upstreamLast = [a.last, ...a.upstreamLast]; } else e.last = We(m.value) === e, e.upstreamLast = []; for (let a = 1; a < t; ++a) e.upstreamLast[a - 1] || e.lineIndexes.push(a); }); } function $e(e) { m.value = pa(e, { keyField: "id", parentField: "parent", childField: "children", rootId: l.rootId }), Pe(); } function He() { const e = k.id, t = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Map(); for (const r of g.values()) t.set(r.data, r), a.set(r.data[e], r); g.clear(), A.clear(); const n = []; if (l.noBuildTree) Ie( l.data, (r, d, s) => { var N; const c = t.get(r), p = (c == null ? void 0 : c.id) ?? Ae(), f = l.cacheNode ? c ?? O(r) : O(r, c); f.id = p, f.parent = s ? (N = A.get(s)) == null ? void 0 : N.id : void 0, g.set(f.id, f), n.push(f), A.set(r, f); }, { childField: k.children, depthFirst: !0 } ); else { const r = l.data; for (let d = 0, s = r.length; d < s; ++d) { const c = r[d], p = t.get(c) ?? a.get(c[e]), f = l.cacheNode ? p ?? O(c) : O(c, p); g.set(f.id, f), n.push(f), A.set(c, f); } } if ($e(n), !l.noCascaded) { const r = u.value.filter((d) => d.checked); for (let d = 0, s = r.length; d < s; ++d) { const c = r[d], p = c.parent; be(c.id), p && g.has(p) && (g.get(p).checked || ge(c.id)); } } V(); } function ft() { const e = [], { id: t, visible: a, selected: n, expanded: r, disabled: d, checked: s, loading: c, loaded: p, loadFail: f, readonly: N, arrow: M, checkbox: j, selectDisabled: Y, expandDisabled: q, checkDisabled: D, isLeaf: Z } = k, U = (o, y) => { const { [a]: w = o.visible, [n]: b = o.selected, [r]: R = o.expanded, [d]: B = o.disabled, [s]: xe = o.checked, [c]: me = o.loading, [p]: ke = o.loaded, [f]: Ne = o.loadFail, [N]: De = o.readonly, [M]: we = o.arrow, [j]: Ce = o.checkbox, [Y]: Le = o.selectDisabled, [q]: Se = o.expandDisabled, [D]: Fe = o.checkDisabled, [Z]: oe = o.isLeaf } = y; o.visible = w, o.selected = b, o.expanded = R, o.disabled = B, o.checked = xe, o.loading = me, o.loaded = ke, o.loadFail = Ne, o.readonly = De, o.arrow = we, o.checkbox = Ce, o.selectDisabled = Le, o.expandDisabled = Se, o.checkDisabled = Fe, o.isLeaf = oe; }; if (l.noBuildTree) Ie( l.data, (o, y, w) => { var R; let b = A.get(o); b ? U(b, o) : (b = O(o), b.id = Ae(), b.parent = w ? (R = A.get(w)) == null ? void 0 : R.id : void 0, g.set(b.id, b), A.set(o, b)), e.push(b); }, { childField: k.children, depthFirst: !0 } ); else { const o = l.data; for (let y = 0, w = o.length; y < w; ++y) { const b = o[y], R = b[t]; let B = g.get(R); B ? U(B, b) : (B = O(b), g.set(R, B)), e.push(B); } } $e(e), V(); } function ut() { u.value.forEach((e) => { if (!e.data) return; const { data: t, visible: a, selected: n, expanded: r, disabled: d, checked: s, loading: c, readonly: p } = e; t.visible = a, t.selected = n, t.expanded = r, t.disabled = d, t.checked = s, t.loading = c, t.readonly = p; }), V(); } function O(e, t = nt) { const { id: a, parent: n, visible: r, selected: d, expanded: s, disabled: c, checked: p, loading: f, loaded: N, loadFail: M, readonly: j, arrow: Y, checkbox: q, selectDisabled: D, expandDisabled: Z, checkDisabled: U, isLeaf: o } = k, { [r]: y = t.visible, [d]: w = t.selected, [s]: b = t.expanded, [c]: R = t.disabled, [p]: B = t.checked, [f]: xe = t.loading, [N]: me = t.loaded, [M]: ke = t.loadFail, [j]: Ne = t.readonly, [Y]: De = t.arrow, [q]: we = t.checkbox, [D]: Ce = t.selectDisabled, [Z]: Le = t.expandDisabled, [U]: Se = t.checkDisabled, [o]: Fe = t.isLeaf } = e, oe = l.noBuildTree ? null : e[a], je = l.noBuildTree ? null : e[n], Ye = { id: oe, parent: je, data: e, visible: y, selected: w, expanded: b, disabled: R, checked: B, loading: xe, loaded: me, loadFail: ke, readonly: Ne, arrow: De, checkbox: we, selectDisabled: Ce, expandDisabled: Le, checkDisabled: Se, isLeaf: Fe }; return typeof l.postCreate == "function" && l.postCreate(Ye), ee({ ...Ye, id: oe, parent: je, children: [], partial: !1, matched: !1, childMatched: !1, upperMatched: !1, depth: -1, last: !1, // inLastCount: 0, upstreamLast: [], lineIndexes: [] }); } function pt(e, t) { if (!l.noCascaded) { const a = [e].concat( // 需要包含被禁用且被勾选的节点 u.value.filter((n) => (n.disabled || n.checkDisabled) && n.checked) ); for (let n = 0, r = a.length; n < r; ++n) { const d = a[n]; ge(d.id), be(d.id); } } x(l.onNodeChange, e.data, e, t); } function ht(e) { x(l.onNodeClick, e.data, e); } function gt(e) { x(l.onLabelClick, e.data, e); } function bt(e) { const t = u.value.filter((a) => a.selected); if (l.multiple) x( l.onNodeSelect, t.map((a) => a.data), t ); else { const a = e.id; for (let n = 0, r = t.length; n < r; ++n) { const d = t[n]; d.selected = d.id === a; } x(l.onNodeSelect, e.data, e); } } function vt(e) { x(l.onNodeCancel, e.data, e); } function yt(e) { if (l.accordion) { const t = Ve(e); for (let a = 0, n = t.length; a < n; ++a) t[a].expanded = !1; } x(l.onNodeExpand, e.data, e); } function xt(e) { x(l.onNodeReduce, e.data, e); } function mt(e, t) { x(l.onNodeContextmenu, e, t.data, t); } async function kt(e) { if (!pe.value) return !1; let t = l.onAsyncLoad(e.data, e); return ha(t) && (t = await t), t !== !1; } let _ = null; function Nt(e) { H.value && (_ = { draggingNode: e.node, treeRect: H.value.getBoundingClientRect(), willDropNode: null, dropType: J.BEFORE }, ne.value = !0, x(l.onDragStart, e.node.data, e.node)); } function Dt(e, t) { if (!_ || !e.el || !e.arrow) return; const a = e.el.getBoundingClientRect(), n = _.treeRect, r = e.arrow.getBoundingClientRect(), d = 0.25, s = 0.75, c = t.clientY - a.top, p = r.height; let f, N = -9999, M = !0; c < p * d ? (f = J.BEFORE, N = r.top - n.top) : c > p * s ? (f = J.AFTER, N = r.bottom - n.top) : (f = J.INNER, M = !1), W.value && (W.value.style.top = `${N}px`, W.value.style.insetInlineStart = `${r.right - n.left}px`), _.willDropNode = e.node, _.dropType = f, fe.value = M, x(l.onDragOver, e.node.data, e.node); } function wt(e, t) { if (!e || !t) return !0; for (; e; ) { if (e === t || e.id === t.id) return !0; e = C(e); } return !1; } function Ct(e) { if (!_) return; const { draggingNode: t, willDropNode: a, dropType: n } = _; if (!a || wt(a, t)) return; let r, d; if (t && (d = C(t), d || (d = { children: m.value }), r = t.id, ga(d.children, (s) => s.id === r)), n === J.INNER) { Array.isArray(a.children) || (a.children = []); const s = Array.from(a.children); s.push(t), a.children = s, t.parent = a.id; } else { d = C(a), d || (d = { parent: void 0, children: m.value }), r = a.id; const s = d.children.findIndex((c) => c.id === r); ~s && (d.children.splice(+(n === J.AFTER) + s, 0, t), t.parent = d.id); } Pe(), x(l.onDrop, e.node.data, e.node, n); } function Lt(e) { ne.value = !0, fe.value = !1, _ = null, x(l.onDragEnd, e.node.data, e.node); } function St(e) { var n; const t = document.activeElement; if (!I.length || !t) return; const a = I.findIndex((r) => r === t); ~a && ((n = I[(a + (e === "up" ? -1 : 1) + I.length) % I.length]) == null || n.focus()); } function Ft(e) { !e || !I.length || I.includes(e) && e.focus(); } function Tt() { z(); } function Kt(e) { const t = e.target; !I.length || !t || !de.value || t === de.value && I[0].focus(); } function Et() { var e; (e = re.value) == null || e.refresh(); } function V() { Q.value = !1, lt.value && z(); } function It() { if (l.virtual) { V(); return; } ie.value = !0, requestAnimationFrame(() => { V(), Re.expand = setTimeout(() => { ie.value = !1; }, 300); }); } function ze(e = !1) { return u.value.filter((t) => t.checked || e && t.partial); } function Mt(e = !1) { return ze(e).map((t) => t.data); } function Oe() { return u.value.filter((e) => e.selected); } function Rt() { return Oe().map((e) => e.data); } function Bt() { return u.value.filter((e) => e.expanded); } function _t() { return u.value.filter((e) => e.disabled); } function C(e) { return e.parent ? g.get(e.parent) ?? null : null; } function At(e) { return e.children; } function Ve(e, t = !1) { const a = C(e), n = e.id, r = a ? a.id : null; return u.value.filter((d) => { const s = r === null ? !d.parent : d.parent === r; return s && !t ? d.id !== n : s; }); } function Pt(e) { const t = C(e); if (!t) return null; const a = e.id, n = t.id, r = u.value.filter((d) => d.parent === n); if (r && r.length) { const d = r.findIndex((s) => s.id === a); if (d > 0) return r[d - 1]; } return null; } function $t(e) { const t = C(e); if (!t) return null; const a = e.id, n = t.id, r = u.value.filter((d) => d.parent === n); if (r && r.length) { const d = r.findIndex((s) => s.id === a); if (!~d && d < r.length - 1) return r[d + 1]; } return null; } function X(e) { if (l.noBuildTree) return u.value.find((a) => a.data === e) ?? null; const t = k.id; return u.value.find( (a) => a.data === e || a.data[t] === e[t] ) ?? null; } function Ht(e, t, a = !1) { const n = X(e); if (n && (n.expanded = le(t) ? !n.expanded : !!t, a)) { let r = C(n); for (; r; ) r.expanded = n.expanded, r = C(r); } } function zt(e, t) { const a = X(e); a && (a.selected = le(t) ? !a.selected : !!t); } function Ot(e, t) { const a = X(e); if (a && (a.checked = le(t) ? !a.checked : !!t, !l.noCascaded)) { const n = [a].concat( u.value.filter((r) => r.disabled && r.checked) ); for (let r = 0, d = n.length; r < d; ++r) { const s = n[r]; ge(s.id), be(s.id); } } } function Vt(e, t) { const a = X(e); a && (a.checked = le(t) ? !a.loading : !!t); } function jt(e) { var t; for (const a of u.value) !a.disabled && !a.expandDisabled && !a.loading && ((t = a.children) != null && t.length) && (a.expanded = e); } function Yt(e = !1) { return ba( e ? va(m.value, (t) => t.matched, { childField: "children", leafOnly: l.filterLeaf, isLeaf: ve }) : m.value, (t) => ({ ...t.data }) ); } function qt(e = !1) { return (e ? u.value.filter((t) => t.matched || t.childMatched || t.upperMatched) : u.value).map((t) => ({ ...t.data })); } const ie = L(!1); return (e, t) => (G(), se(i(Da), { ref_key: "virtualList", ref: re, class: ce([i(E).b(), i(E).bs("vars"), i(l).inherit && i(E).bm("inherit")]), inherit: i(l).inherit, items: it.value, "item-size": i(l).nodeMinHeight, "items-tag": "ul", "items-attrs": { class: i(E).be("list") }, "hide-bar": !i(l).useYBar, "ignore-resize": ie.value, disabled: !i(l).virtual, role: "tree", tabindex: "-1", "aria-disabled": i(l).disabled, "aria-readonly": i(l).readonly, style: Ue(rt.value), onScroll: Tt }, { "prefix-trap": v(() => [ Ee("div", { ref_key: "trap", ref: de, tabindex: "0", role: "none", style: { width: "0", height: "0", overflow: "hidden", outline: "none" }, onFocus: Kt }, null, 544) ]), default: v(({ item: a }) => [ ct(a) ? (G(), se(i(wa), { key: 0, appear: "", reverse: a.type === "reduce", onAfterEnter: It }, { default: v(() => [ Ee("div", { class: ce(i(E).be("collapse")), style: Ue({ height: `${a.height}px` }) }, [ (G(!0), Ge(aa, null, la(a.nodes, (n, r) => (G(), se(Xe, $({ key: n.id ?? r }, { ref_for: !0 }, _e.value(n.data, n), { node: n }), Je({ _: 2 }, [ K.node || i(l).slots.node ? { name: "default", fn: v((d) => [ S(e.$slots, "node", $({ ref_for: !0 }, d), () => [ F(i(T), { renderer: i(l).slots.node, data: d }, null, 8, ["renderer", "data"]) ]) ]), key: "0" } : void 0, K.arrow || i(l).slots.arrow ? { name: "arrow", fn: v((d) => [ S(e.$slots, "arrow", $({ ref_for: !0 }, d), () => [ F(i(T), { renderer: i(l).slots.arrow, data: d }, null, 8, ["renderer", "data"]) ]) ]), key: "1" } : void 0, K.label || i(l).slots.label ? { name: "label", fn: v((d) => [ S(e.$slots, "label", $({ ref_for: !0 }, d), () => [ F(i(T), { renderer: i(l).slots.label, data: d }, null, 8, ["renderer", "data"]) ]) ]), key: "2" } : void 0, K.prefix || i(l).slots.prefix ? { name: "prefix", fn: v((d) => [ S(e.$slots, "prefix", $({ ref_for: !0 }, d), () => [ F(i(T), { renderer: i(l).slots.prefix, data: d }, null, 8, ["renderer", "data"]) ]) ]), key: "3" } : void 0, K.suffix || i(l).slots.suffix ? { name: "suffix", fn: v((d) => [ S(e.$slots, "suffix", $({ ref_for: !0 }, d), () => [ F(i(T), { renderer: i(l).slots.suffix, data: d }, null, 8, ["renderer", "data"]) ]) ]), key: "4" } : void 0 ]), 1040, ["node"]))), 128)) ], 6) ]), _: 2 }, 1032, ["reverse"])) : (G(), se(Xe, $({ key: 1 }, _e.value(a.data, a), { node: a }), Je({ _: 2 }, [ K.node || i(l).slots.node ? { name: "default", fn: v((n) => [ S(e.$slots, "node", te(ae(n)), () => [ F(i(T), { renderer: i(l).slots.node, data: n }, null, 8, ["renderer", "data"]) ]) ]), key: "0" } : void 0, K.arrow || i(l).slots.arrow ? { name: "arrow", fn: v((n) => [ S(e.$slots, "arrow", te(ae(n)), () => [ F(i(T), { renderer: i(l).slots.arrow, data: n }, null, 8, ["renderer", "data"]) ]) ]), key: "1" } : void 0, K.label || i(l).slots.label ? { name: "label", fn: v((n) => [ S(e.$slots, "label", te(ae(n)), () => [ F(i(T), { renderer: i(l).slots.label, data: n }, null, 8, ["renderer", "data"]) ]) ]), key: "2" } : void 0, K.prefix || i(l).slots.prefix ? { name: "prefix", fn: v((n) => [ S(e.$slots, "prefix", te(ae(n)), () => [ F(i(T), { renderer: i(l).slots.prefix, data: n }, null, 8, ["renderer", "data"]) ]) ]), key: "3" } : void 0, K.suffix || i(l).slots.suffix ? { name: "suffix", fn: v((n) => [ S(e.$slots, "suffix", te(ae(n)), () => [ F(i(T), { renderer: i(l).slots.suffix, data: n }, null, 8, ["renderer", "data"]) ]) ]), key: "4" } : void 0 ]), 1040, ["node"])) ]), empty: v(() => [ Ee("div", { class: ce(i(E).be("empty-tip")) }, [ S(e.$slots, "empty", {}, () => [ F(i(T), { renderer: i(l).slots.empty }, { default: v(() => [ ea(ta(i(l).emptyText ?? i(tt).empty), 1) ]), _: 1 }, 8, ["renderer"]) ]) ], 2) ]), "suffix-trap": v(() => [ i(l).draggable ? Wt((G(), Ge("div", { key: 0, ref_key: "indicator", ref: W, class: ce(i(E).be("indicator")) }, null, 2)), [ [Zt, fe.value] ]) : Xt("", !0) ]), _: 3 }, 8, ["class", "inherit", "items", "item-size", "items-attrs", "hide-bar", "ignore-resize", "disabled", "aria-disabled", "aria-readonly", "style"])); } }); export { za as default }; //# sourceMappingURL=tree.vue2.mjs.map