2 lines
20 KiB
JavaScript
2 lines
20 KiB
JavaScript
import{ap as Re,r as N,O as r,n as K,j as Me,a8 as Ee,m as Ie,G as ue,q as Fe,a as X,o as w,s as B,b as be,w as P,y as $,_ as xe,x as Y,c as H,F as qe,W as we,C as Ve,e as se,v as J,A as U,aa as S,u as ze,ab as Ge,t as Ue,T as We,aq as V}from"./vendor-adef9cb4.js";var Ye=Object.defineProperty,Oe=Object.getOwnPropertySymbols,Ke=Object.prototype.hasOwnProperty,He=Object.prototype.propertyIsEnumerable,Te=(e,t,n)=>t in e?Ye(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,I=(e,t)=>{for(var n in t||(t={}))Ke.call(t,n)&&Te(e,n,t[n]);if(Oe)for(var n of Oe(t))He.call(t,n)&&Te(e,n,t[n]);return e},ae=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Je(e){return e==null}var g=Je,Se=1/0,Xe=17976931348623157e292,Ne=0/0,Qe="[object Symbol]",Ze=/^\s+|\s+$/g,_e=/^[-+]0x[0-9a-f]+$/i,et=/^0b[01]+$/i,tt=/^0o[0-7]+$/i,nt=parseInt,rt=Object.prototype,ot=rt.toString;function je(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function at(e){return!!e&&typeof e=="object"}function st(e){return typeof e=="symbol"||at(e)&&ot.call(e)==Qe}function lt(e){if(!e)return e===0?e:0;if(e=dt(e),e===Se||e===-Se){var t=e<0?-1:1;return t*Xe}return e===e?e:0}function ut(e){var t=lt(e),n=t%1;return t===t?n?t-n:t:0}function dt(e){if(typeof e=="number")return e;if(st(e))return Ne;if(je(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=je(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=e.replace(Ze,"");var n=et.test(e);return n||tt.test(e)?nt(e.slice(2),n?2:8):_e.test(e)?Ne:+e}var it=ut;const de=8,ct="disabled",vt="focused",ft="draggable",pt="droppable",gt="node-over",ht="node-in",bt="node-under",yt="0 0 123.958 123.959",kt="M117.979,28.017h-112c-5.3,0-8,6.4-4.2,10.2l56,56c2.3,2.3,6.1,2.3,8.401,0l56-56C125.979,34.417,123.279,28.017,117.979,28.017z",mt="M38.217,1.779c-3.8-3.8-10.2-1.1-10.2,4.2v112c0,5.3,6.4,8,10.2,4.2l56-56c2.3-2.301,2.3-6.101,0-8.401L38.217,1.779z",De="black";function ye(e){return{type:"shape",width:de,height:de,viewBox:yt,stroke:De,fill:De,draw:e,name:null,src:null,alt:null,style:null,class:null}}const Q={roots:[],padding:16,editable:!1,editing:null,checkboxes:!1,dragAndDrop:!1,keyboardNavigation:!1,openedIcon:ye(kt),closedIcon:ye(mt)};function Ct(e){const t=ue("state"),n=t.config,o=t.nodes,u=N(e.depth),s=N(e.parentId),c=r(()=>{const v=[];if(g(s.value)&&n.value.roots&&u.value===0){for(const p of n.value.roots)l(p,v);return v}if(!g(s.value)){const p=o.value[s.value];if(p&&p.children&&p.children.length>0)for(const k of p.children)l(k,v);return v}return[]}),l=(v,p)=>{o.value[v]&&(o.value[v].id=v,o.value[v].parent=s.value,p.push(o.value[v]))},a=r(()=>new Date().valueOf()),b=r(()=>{if(u.value===0)return 0;if(g(n.value.padding))return Q.padding;const v=it(n.value.padding);return v>=0?v:0}),y=r(()=>({"padding-left":`${b.value}px`,"list-style":"none"}));return{id:a,level:c,padding:b,style:y}}var Z=(e,t)=>{for(const[n,o]of t)e[n]=o;return e};const It={components:{TreeNode:Re(()=>Promise.resolve().then(function(){return bn}))},props:{depth:{required:!0,type:Number,default:null},parentId:{type:String,default:null}},setup(e){return I({},Ct(e))}},wt=["id"];function Ot(e,t,n,o,u,s){const c=X("TreeNode");return w(),B("ul",{class:"tree-level",id:e.id,style:Y(e.style)},[(w(!0),B(qe,null,Ve(e.level,(l,a)=>(w(),H(c,{key:l.id,node:l,depth:n.depth,index:a,"parent-id":n.parentId},{"loading-slot":P(b=>[$(e.$slots,"loading-slot",{node:b.node})]),"before-input":P(b=>[$(e.$slots,"before-input",{node:b.node})]),"after-input":P(b=>[$(e.$slots,"after-input",{node:b.node})]),_:2},1032,["node","depth","index","parent-id"]))),128))],12,wt)}var Ae=Z(It,[["render",Ot]]),Tt=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module",default:Ae}),St=1/0,Nt="[object Symbol]",jt=typeof ae=="object"&&ae&&ae.Object===Object&&ae,Dt=typeof self=="object"&&self&&self.Object===Object&&self,Lt=jt||Dt||Function("return this")(),$t=Object.prototype,Bt=0,Pt=$t.toString,Le=Lt.Symbol,$e=Le?Le.prototype:void 0,Be=$e?$e.toString:void 0;function Rt(e){if(typeof e=="string")return e;if(Ft(e))return Be?Be.call(e):"";var t=e+"";return t=="0"&&1/e==-St?"-0":t}function Et(e){return!!e&&typeof e=="object"}function Ft(e){return typeof e=="symbol"||Et(e)&&Pt.call(e)==Nt}function qt(e){return e==null?"":Rt(e)}function At(e){var t=++Bt;return qt(e)+t}var Mt=At;const ke=new Map;function xt(e){const{nodes:t,config:n}=Ie(e),o={id:Mt(),nodes:r(()=>t.value),config:r(()=>n.value),focusable:N(null),focusFunc:new Map,dragged:N({node:null,element:null,wrapper:null,parentId:null})};return ke.set(o.id,o),o.id}function Vt(e,t){const n=N(null),o=xt(e),u=ke.get(o);we("emitter",t),we("state",u);const s=r(()=>({display:"flex","align-items":"center"}));return Ee(()=>{ke.delete(o)}),{element:n,style:s}}const zt={components:{TreeLevel:Ae},props:{nodes:{required:!0,type:Object,default:()=>{}},config:{required:!0,type:Object,default:()=>{}}},setup(e,{emit:t}){return I({},Vt(e,t))},methods:{setElementRef(e){this.element=e}}};function Gt(e,t,n,o,u,s){const c=X("TreeLevel");return w(),B("div",{class:"tree",ref:s.setElementRef,style:Y(e.style)},[be(c,xe({depth:0,"parent-id":null},e.$attrs),{"loading-slot":P(l=>[$(e.$slots,"loading-slot",{node:l.node})]),"before-input":P(l=>[$(e.$slots,"before-input",{node:l.node})]),"after-input":P(l=>[$(e.$slots,"after-input",{node:l.node})]),_:3},16)],4)}var kn=Z(zt,[["render",Gt]]);function Ut(e,t){return e===t||e!==e&&t!==t}var me=Ut;const G={opened:"nodeOpened",closed:"nodeClosed",focus:"nodeFocus",toggle:"nodeToggle",blur:"nodeBlur",edit:"nodeEdit"},Ce={checked:"nodeChecked",unchecked:"nodeUnchecked"},z={start:"nodeDragstart",end:"nodeDragend",enter:"nodeDragenter",leave:"nodeDragleave",over:"nodeOver",drop:"nodeDrop"};function Wt(e){const t=e.node,n=e.config,o=e.wrapper,u=e.editable,s=e.editing,c=N(null),l=r({get:()=>t.value.text,set:p=>t.value.text=p}),a=r(()=>e.editable.value?n.value.editableClass?n.value.editableClass:"editable":null);K(s,(p,k)=>{!me(p,k)&&p&&Fe(()=>{c.value.focus()})});const b=()=>{u.value&&!e.disabled.value&&(n.value.editing=t.value.id,e.root.emit(G.edit,t.value))};return{text:l,input:c,editing:s,editable:u,editableClass:a,focusInput:b,esc:p=>{u.value&&n.value.keyboardNavigation&&(e.blur(p),o.value.focus())},enter:()=>{u.value&&!e.disabled.value&&n.value.keyboardNavigation&&b()}}}function Yt(e){const{isLeaf:t}=Ie(e),o=ue("state").config,u=r(()=>o.value.openedIcon||Q.openedIcon),s=r(()=>o.value.closedIcon||Q.closedIcon),c=r(()=>!g(s.value)&&!g(u.value)),l=r(()=>!t.value&&c.value),a=r(()=>({width:`${de}px`,height:`${de}px`}));return{hasIcons:c,openedIcon:u,closedIcon:s,useIcons:l,fakeNodeStyle:a}}const Kt={props:{icon:{required:!0,type:Object}}},Ht=["width","height","viewBox"],Jt=["d","fill","stroke","stroke-width"],Xt=["src","alt","width","height"];function Qt(e,t,n,o,u,s){return n.icon.type==="shape"?(w(),B("svg",{key:0,xmlns:"http://www.w3.org/2000/svg",width:n.icon.width,height:n.icon.height,class:J(n.icon.class),style:Y(n.icon.style),viewBox:n.icon.viewBox},[se("path",{d:n.icon.draw,fill:n.icon.fill,stroke:n.icon.stroke,"stroke-width":n.icon.strokeWidth},null,8,Jt)],14,Ht)):n.icon.type==="class"?(w(),B("i",{key:1,class:J(n.icon.class),style:Y(n.icon.style)},null,6)):n.icon.type==="img"?(w(),B("img",{key:2,src:n.icon.src,alt:n.icon.alt,width:n.icon.width,height:n.icon.height,class:J(n.icon.class),style:Y(n.icon.style)},null,14,Xt)):U("",!0)}var Zt=Z(Kt,[["render",Qt]]);const _t={components:{Icon:Zt},props:{isLeaf:{type:Boolean},opened:{type:Boolean}},setup(e){return Yt(e)},computed:{fakeIcon(){return ye(null)}}};function en(e,t,n,o,u,s){const c=X("Icon");return e.useIcons?(w(),B(qe,{key:0},[n.opened?(w(),H(c,{key:0,icon:e.openedIcon},null,8,["icon"])):(w(),H(c,{key:1,icon:e.closedIcon},null,8,["icon"]))],64)):(w(),H(c,{key:1,icon:s.fakeIcon},null,8,["icon"]))}var tn=Z(_t,[["render",en]]);function nn(e,t){const n=e.state,o=e.node,u=e.config,s=e.wrapper,c=e.editing,l=N(null),a=N(t.depth),b=N(t.index);o.value.children||(o.value.children=N([]).value);const y=r(()=>v.value&&o.value.id),v=r(()=>!g(o)),p=r(()=>v.value&&!g(o.value.state)),k=r(()=>u.value.roots||[]),O=r(()=>g(o.value.children)?[]:o.value.children),L=r(()=>O.value.length),T=r(()=>L.value>0),m=r(()=>p.value&&o.value.state.opened||!1),h=r(()=>p.value&&o.value.state.isLoading||!1),F=r(()=>h.value&&!T.value&&m.value),D=r(()=>!h.value&&T.value&&m.value),q=r(()=>({display:"flex"})),ie=r(()=>e.disabled.value?u.value.disabledClass?u.value.disabledClass:ct:null),_=r(()=>{for(const f of k.value){const i=n.nodes.value[f];if(i.children&&i.children.length>0)return!1}return!0}),ee=r(()=>{if(u.value.leaves instanceof Array){const i=u.value.leaves.indexOf(y.value);return Number.isFinite(i)&&i>=0}return!T.value}),ce=r(()=>n.focusable.value===o.value.id),te=r(()=>a.value===0&&b.value===0&&g(n.focusable.value)||ce.value?0:-1),ve=r(()=>e.focused.value?u.value.focusClass?u.value.focusClass:vt:null);K(m,f=>{f?e.root.emit(G.opened,o.value):e.root.emit(G.closed,o.value)});const R=()=>{n.focusable.value=o.value.id,Fe(()=>{s.value.focus(),e.focused.value=!0,e.root.emit(G.focus,o.value)})},fe=()=>{o.value.state.opened=!o.value.state.opened,e.root.emit(G.toggle,o.value)},pe=()=>{!c.value&&u.value.keyboardNavigation&&(o.value.state.opened=!0)},ge=()=>{!c.value&&u.value.keyboardNavigation&&(o.value.state.opened=!1)},ne=f=>{const i=f(o.value.id);if(!g(i)&&u.value.keyboardNavigation){const C=n.focusFunc.get(i);C&&C()}},he=()=>ne(oe),re=f=>{const i=n.nodes.value[f];if(i.children&&i.children.length>0){const C=i.children.indexOf(o.value.id),x=i.children[C-1];if(!g(x))return d(x)}return i.id},oe=f=>{const i=n.nodes.value[f],C=n.nodes.value[i.parent];if(!C){const x=k.value.indexOf(f);return d(k.value[x-1])||null}return re(C.id)},d=f=>{const i=n.nodes.value[f];if(!i)return null;if(i.children&&i.children.length>0&&i.state.opened){const C=i.children[i.children.length-1];if(!g(C))return d(C)}return i.id},j=()=>ne(E),A=f=>{const i=k.value.indexOf(f);return k.value[i+1]||null},M=(f,i)=>{const C=f.children.indexOf(i);return f.children[C+1]?f.children[C+1]:f.parent?M(n.nodes.value[f.parent],f.id):A(f.id)},E=f=>{const i=n.nodes.value[f];if(i.children&&i.children.length>0&&i.state.opened)return i.children[0];const C=n.nodes.value[i.parent];return C?M(C,f):A(f)};return Me(()=>{n.focusFunc.set(o.value.id,R)}),Ee(()=>{n.focusFunc.delete(o.value.id)}),{id:y,level:l,style:q,opened:m,hasNode:v,hideIcons:_,hasChildren:T,tabIndex:te,focusClass:ve,disabledClass:ie,isLeaf:ee,isLoading:h,displayLoading:F,displayLevel:D,right:pe,left:ge,up:he,down:j,toggle:fe,focus:R,prevVisible:oe,nextVisible:E}}function le(e){g(e.state)&&(e.state={},e.state.checked=!1)}function rn(e,t){const n=h=>{e.value.state.checked=h},o=h=>{e.value.state.indeterminate=h},u=()=>{le(e.value),(e.value.state.checked||!c.value)&&o(!1)},s=r(()=>e.value.children),c=r(()=>!g(s.value)&&s.value.length>0||!1),l=r(()=>{if(!c.value)return[];const h=[];for(const F of s.value){const D=t.value[F];g(D)||(le(D),h.push(D.state))}return h}),a=r(()=>e.value.state.checked),b=r(()=>e.value.state.indeterminate),y=r(()=>l.value.every(h=>h.checked)),v=r(()=>l.value.every(h=>!h.checked)),p=r(()=>!y.value&&!v.value),k=r(()=>l.value.some(h=>h.indeterminate)),O=h=>{if(!g(h.state)&&!g(h.children))for(const F of h.children){const D=t.value[F];g(D)||(le(D),D.state.indeterminate=!1,D.state.checked=h.state.checked,O(D))}},L=()=>{if(c.value){if(v.value&&!k.value){o(!1),n(!1);return}if(y.value){o(!1),n(!0);return}o(!0),n(!1)}};return{checked:a,indeterminate:b,noneChecked:v,someChecked:p,allChecked:y,someIndeterminate:k,click:()=>{o(!1),n(!e.value.state.checked)},rebuild:()=>{u(),O(e.value),L()},updateState:L,recurseDown:O}}function on(e){const t=r(()=>e.value.state.checked),n=r(()=>e.value.state.indeterminate||!1),o=r(()=>!1),u=r(()=>!1),s=r(()=>!1),c=r(()=>!1);return{checked:t,indeterminate:n,noneChecked:o,someChecked:u,allChecked:s,someIndeterminate:c,click:()=>{e.value.state.checked=!e.value.state.checked},rebuild:()=>{},updateState:()=>{},recurseDown:()=>{}}}var W;(function(e){e[e.auto=0]="auto",e[e.manual=1]="manual"})(W||(W={}));function an(e){const t=e.node,n=e.config,o=e.state.nodes,u=r(()=>n.value.checkMode===W.auto?W.auto:W.manual),s=r(()=>u.value===W.auto?rn(t,o):on(t));K(u,(T,m)=>{me(T,m)||s.value.rebuild()});const c=r(()=>s.value.checked.value),l=r(()=>s.value.indeterminate.value),a=r(()=>n.value.checkboxes||Q.checkboxes),b=r(()=>[s.value.checked.value?n.value.checkedClass?n.value.checkedClass:"checked":null,s.value.indeterminate.value?n.value.indeterminateClass?n.value.indeterminateClass:"indeterminate":null]),y=r(()=>s.value.allChecked.value),v=r(()=>s.value.noneChecked.value),p=r(()=>s.value.someChecked.value),k=r(()=>s.value.someIndeterminate.value);K([y,v,p],([T,m,h])=>{(T||m||h)&&s.value.updateState()},{deep:!0}),K(k,(T,m)=>{me(T,m)||s.value.updateState()},{deep:!0});const O=()=>{e.disabled.value||(s.value.click(),s.value.recurseDown(t.value),e.root.emit(c.value?Ce.checked:Ce.unchecked,t.value))};return{checked:c,hasCheckbox:a,indeterminate:l,checkedClass:b,space:()=>{!e.editing.value&&n.value.checkboxes&&n.value.keyboardNavigation&&O()},clickCheckbox:O}}var Pe;(function(e){e[e.over=0]="over",e[e.in=1]="in",e[e.under=2]="under"})(Pe||(Pe={}));function sn(e,t){const n=e.node,o=e.state,u=N(t.parentId),s=e.config,c=o.nodes,l=N(o.dragged),a=e.wrapper,b=N(null),y=N(null),v=r(()=>!e.disabled.value&&s.value.dragAndDrop&&n.value.state.draggable!==!1),p=r(()=>s.value.dragAndDrop&&n.value.state.droppable!==!1),k=r(()=>!g(l.value)&&!g(l.value.node)),O=r(()=>k.value&&l.value.node.id===n.value.id),L=r(()=>h.value===T.value),T=r(()=>!k.value||!l.value.parentId?null:_(l.value.parentId)),m=r(()=>ee(T.value)),h=r(()=>g(u.value)?null:_(u.value)),F=r(()=>ee(h.value)),D=r(()=>!k.value||!l.value.wrapper?!1:l.value.element.contains(b.value)),q=r(()=>({dragged:l.value,target:{node:n.value.id,element:b.value,wrapper:a.value,parentId:u.value}})),ie=r(()=>[v.value?ft:null,p.value?pt:null,y.value===0?gt:null,y.value===1?ht:null,y.value===2?bt:null]),_=d=>g(d)?null:c.value[d],ee=d=>g(d)?s.value.roots:d.children,ce=d=>{if(!d||!d.dataTransfer)return null;const j=d.dataTransfer.getData("application/json");return j?JSON.parse(j):d.dataTransfer.getData("text/plain")},te=d=>{var j,A;return((A=(j=d==null?void 0:d.dataTransfer)==null?void 0:j.items)==null?void 0:A.length)>0},ve=d=>{v.value&&(l.value={node:n.value,element:b.value,wrapper:a.value,parentId:u.value},e.root.emit(z.start,I(I({},q.value),R(d))))},R=d=>({evt:d,external:te(d),dataTransfer:ce(d)}),fe=d=>{e.root.emit(z.end,I(I({},q.value),R(d))),l.value=null},pe=d=>{e.root.emit(z.enter,I(I({},q.value),R(d)))},ge=d=>{e.root.emit(z.leave,I(I({},q.value),R(d))),y.value=null},ne=d=>{if(!O.value&&!D.value){const j=te(d);if(!k.value&&!j)return;if(e.root.emit(z.over,I(I({},q.value),R(d))),!j&&a.value){const M=d.pageY,E=a.value.getBoundingClientRect(),f=E.top+E.height/2,i=[f-E.height*.3,f+E.height*.3],C=m.value.indexOf(n.value.id),x=m.value.indexOf(l.value.node.id);M<i[0]&&(!L.value||L.value&&C!==x+1)?y.value=0:M>i[1]&&(!L.value||L.value&&C!==x-1)?y.value=2:y.value=1}}},he=d=>{if(!O.value&&!D.value)switch(y.value){case 0:{re(0);break}case 2:{re(1);break}case 1:oe()}e.root.emit(z.drop,I(I({},q.value),R(d))),y.value=null},re=d=>{if(k.value){const j=l.value.node.id,A=m.value.indexOf(j);m.value.splice(A,1);const M=n.value.id,E=F.value.indexOf(M);F.value.splice(E+d,0,j)}},oe=()=>{if(k.value&&p.value){const d=l.value.node.id;if(m.value){const j=m.value.indexOf(d);m.value.splice(j,1)}n.value.children.unshift(d)}};return{pos:y,element:b,dragClass:ie,draggable:v,droppable:p,dragstart:ve,dragend:fe,dragenter:pe,dragleave:ge,dragover:ne,drop:he}}function ln(e){const{node:t}=Ie(e),n=ue("state"),o=n.config,u=N(null),s=N(!1),c={emit:ue("emitter")};le(t.value);const l=r(()=>!g(t)),a=r(()=>!g(o.value)),b=r(()=>l.value&&!g(t.value.state)),y=r(()=>o.value.disabled||t.value.state.disabled),v=r(()=>o.value.editable&&(g(t.value.state.editable)?!0:t.value.state.editable)||Q.editable),p=r(()=>v.value&&o.value.editing===t.value.id);return{state:n,node:t,config:o,hasNode:l,hasState:b,hasConfig:a,disabled:y,wrapper:u,editable:v,editing:p,focused:s,blur:O=>{if(O.type==="blur"){const L=O.currentTarget,T=O.relatedTarget;L.contains(T)||(o.value.editing=null,s.value=!1,c.emit(G.blur,O,t.value))}},root:c}}const un={components:{TreeLevel:Re(()=>Promise.resolve().then(function(){return Tt})),TreeIcons:tn},emits:[...Object.values(G),...Object.values(Ce),...Object.values(z)],props:{depth:{required:!0,type:Number},index:{required:!0,type:Number},node:{required:!0,type:Object},parentId:{default:null,type:String}},setup(e){const t=ln(e);return I(I(I(I(I({},t),Wt(t)),an(t)),nn(t,e)),sn(t,e))},computed:{nodeClass(){return[this.focusClass,this.disabledClass,this.checkedClass,this.editableClass,this.dragClass]}},methods:{setWrapperRef(e){this.wrapper=e},setLevelRef(e){this.level=e},setElementRef(e){this.element=e},setInputRef(e){this.input=e}}},dn=["aria-expanded"],cn=["draggable","tabindex"],vn=["checked","disabled",".indeterminate"],fn={class:"input-wrapper"},pn=["disabled"];function gn(e,t,n,o,u,s){const c=X("TreeIcons"),l=X("TreeLevel");return e.hasNode?(w(),B("li",{key:0,class:"tree-node",ref:s.setElementRef,"aria-expanded":e.opened,onKeydown:[t[13]||(t[13]=V(S((...a)=>e.enter&&e.enter(...a),["stop"]),["enter"])),t[14]||(t[14]=V(S((...a)=>e.esc&&e.esc(...a),["stop"]),["esc"])),t[15]||(t[15]=V(S((...a)=>e.space&&e.space(...a),["stop"]),["space"])),t[16]||(t[16]=V(S((...a)=>e.left&&e.left(...a),["stop"]),["left"])),t[17]||(t[17]=V(S((...a)=>e.right&&e.right(...a),["stop"]),["right"])),t[18]||(t[18]=V(S((...a)=>e.up&&e.up(...a),["stop"]),["up"])),t[19]||(t[19]=V(S((...a)=>e.down&&e.down(...a),["stop"]),["down"]))]},[se("div",{class:J(["node-wrapper",s.nodeClass]),style:Y(e.style),ref:s.setWrapperRef,draggable:e.draggable,tabindex:e.tabIndex,onBlur:t[5]||(t[5]=(...a)=>e.blur&&e.blur(...a)),onClick:t[6]||(t[6]=S((...a)=>e.focus&&e.focus(...a),["stop"])),onDragstart:t[7]||(t[7]=S((...a)=>e.dragstart&&e.dragstart(...a),["stop"])),onDragend:t[8]||(t[8]=S((...a)=>e.dragend&&e.dragend(...a),["stop"])),onDragenter:t[9]||(t[9]=S((...a)=>e.dragenter&&e.dragenter(...a),["prevent","stop"])),onDragleave:t[10]||(t[10]=S((...a)=>e.dragleave&&e.dragleave(...a),["prevent","stop"])),onDragover:t[11]||(t[11]=S((...a)=>e.dragover&&e.dragover(...a),["prevent","stop"])),onDrop:t[12]||(t[12]=S((...a)=>e.drop&&e.drop(...a),["prevent","stop"]))},[e.hideIcons?U("",!0):(w(),B("div",{key:0,class:"icon-wrapper",onClick:t[0]||(t[0]=S((...a)=>e.toggle&&e.toggle(...a),["stop"]))},[be(c,{"is-leaf":e.isLeaf,opened:e.opened},null,8,["is-leaf","opened"])])),e.hasCheckbox?(w(),B("div",{key:1,class:J(["checkbox-wrapper",e.checkedClass]),onClick:t[1]||(t[1]=S((...a)=>e.clickCheckbox&&e.clickCheckbox(...a),["stop"]))},[se("input",{type:"checkbox",tabindex:"-1",class:"node-checkbox",checked:e.checked,disabled:e.disabled,".indeterminate":e.indeterminate},null,40,vn)],2)):U("",!0),$(e.$slots,"before-input",{node:n.node}),se("div",fn,[e.editing?ze((w(),B("input",{key:0,type:"text",tabindex:"0",class:"node-input","onUpdate:modelValue":t[2]||(t[2]=a=>e.text=a),ref:s.setInputRef,disabled:e.disabled,onBlur:t[3]||(t[3]=(...a)=>e.blur&&e.blur(...a))},null,40,pn)),[[Ge,e.text]]):(w(),B("span",{key:1,class:"node-text",onDblclick:t[4]||(t[4]=(...a)=>e.focusInput&&e.focusInput(...a))},Ue(e.text),33))]),$(e.$slots,"after-input",{node:n.node})],46,cn),e.displayLoading?$(e.$slots,"loading-slot",{key:0,node:n.node}):U("",!0),be(We,{name:"level"},{default:P(()=>[e.displayLevel?(w(),H(l,{key:0,"parent-id":e.id,depth:n.depth+1,ref:s.setLevelRef},{"loading-slot":P(a=>[$(e.$slots,"loading-slot",{node:a.node})]),"before-input":P(a=>[$(e.$slots,"before-input",{node:a.node})]),"after-input":P(a=>[$(e.$slots,"after-input",{node:a.node})]),_:3},8,["parent-id","depth"])):U("",!0)]),_:3})],40,dn)):U("",!0)}var hn=Z(un,[["render",gn]]),bn=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module",default:hn});export{kn as T};
|