Files
qhmes/web-dist/js/useMaxLevel-DE205ncc.js

2 lines
8.0 KiB
Java
Raw Normal View History

2026-06-16 18:19:57 +08:00
import{a as w,fb as D,fc as F,c8 as G}from"./index-X7Y8jykP.js";import{w as M,s as z,r as B}from"./vue-vendor-DNhG1Cve.js";function Q(e,t){if(!e)return[];const o=e.slice(),n=o.indexOf(t);return n>=0&&o.splice(n,1),o}function Z(e,t){const o=(e||[]).slice();return o.indexOf(t)===-1&&o.push(t),o}function T(e){return e.split("-")}function _(e,t){return`${e}-${t}`}function R(e){return e&&e.type&&e.type.isTreeNode}function ee(e,t){const o=[],n=t[e];function r(){(arguments.length>0&&arguments[0]!==void 0?arguments[0]:[]).forEach(d=>{let{key:f,children:u}=d;o.push(f),r(u)})}return r(n.children),o}function $(e){if(e.parent){const t=T(e.pos);return Number(t[t.length-1])===e.parent.children.length-1}return!1}function U(e){const t=T(e.pos);return Number(t[t.length-1])===0}function te(e,t,o,n,r,s,d,f,u,l){var a;const{clientX:i,clientY:c}=e,{top:p,height:h}=e.target.getBoundingClientRect(),g=((l==="rtl"?-1:1)*(((r==null?void 0:r.x)||0)-i)-12)/n;let y=f[o.eventKey];if(c<p+h/2){const C=d.findIndex(L=>L.key===y.key),E=C<=0?0:C-1,I=d[E].key;y=f[I]}const m=y.key,b=y,k=y.key;let K=0,N=0;if(!u.has(m))for(let C=0;C<g&&$(y);C+=1)y=y.parent,N+=1;const P=t.eventData,O=y.node;let S=!0;return U(y)&&y.level===0&&c<p+h/2&&s({dragNode:P,dropNode:O,dropPosition:-1})&&y.key===o.eventKey?K=-1:(b.children||[]).length&&u.has(k)?s({dragNode:P,dropNode:O,dropPosition:0})?K=0:S=!1:N===0?g>-1.5?s({dragNode:P,dropNode:O,dropPosition:1})?K=1:S=!1:s({dragNode:P,dropNode:O,dropPosition:0})?K=0:s({dragNode:P,dropNode:O,dropPosition:1})?K=1:S=!1:s({dragNode:P,dropNode:O,dropPosition:1})?K=1:S=!1,{dropPosition:K,dropLevelOffset:N,dropTargetKey:y.key,dropTargetPos:y.pos,dragOverNodeKey:k,dropContainerKey:K===0?null:((a=y.parent)===null||a===void 0?void 0:a.key)||null,dropAllowed:S}}function ne(e,t){if(!e)return;const{multiple:o}=t;return o?e.slice():e.length?[e[0]]:e}function re(e){if(!e)return null;let t;if(Array.isArray(e))t={checkedKeys:e,halfCheckedKeys:void 0};else if(typeof e=="object")t={checkedKeys:e.checked||void 0,halfCheckedKeys:e.halfChecked||void 0};else return null;return t}function oe(e,t){const o=new Set;function n(r){if(o.has(r))return;const s=t[r];if(!s)return;o.add(r);const{parent:d,node:f}=s;f.disabled||d&&n(d.key)}return(e||[]).forEach(r=>{n(r)}),[...o]}var V=function(e,t){var o={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(o[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(e);r<n.length;r++)t.indexOf(n[r])<0&&Object.prototype.propertyIsEnumerable.call(e,n[r])&&(o[n[r]]=e[n[r]]);return o};function x(e,t){return e!=null?e:t}function j(e){const{title:t,_title:o,key:n,children:r}=e||{},s=t||"title";return{title:s,_title:o||[s],key:n||"key",children:r||"children"}}function se(e){function t(){let o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return D(o).map(r=>{var s,d,f,u;if(!R(r))return null;const l=r.children||{},a=r.key,i={};for(const[C,E]of Object.entries(r.props))i[F(C)]=E;const{isLeaf:c,checkable:p,selectable:h,disabled:v,disableCheckbox:g}=i,y={isLeaf:c||c===""||void 0,checkable:p||p===""||void 0,selectable:h||h===""||void 0,disabled:v||v===""||void 0,disableCheckbox:g||g===""||void 0},m=w(w({},i),y),{title:b=(s=l.title)===null||s===void 0?void 0:s.call(l,m),icon:k=(d=l.icon)===null||d===void 0?void 0:d.call(l,m),switcherIcon:K=(f=l.switcherIcon)===null||f===void 0?void 0:f.call(l,m)}=i,N=V(i,["title","icon","switcherIcon"]),P=(u=l.default)===null||u===void 0?void 0:u.call(l),O=w(w(w({},N),{title:b,icon:k,switcherIcon:K,key:a,isLeaf:c}),y),S=t(P);return S.length&&(O.children=S),O})}return t(e)}function ie(e,t,o){const{_title:n,key:r,children:s}=j(o),d=new Set(t===!0?[]:t),f=[];function u(l){let a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return l.map((i,c)=>{const p=_(a?a.pos:"0",c),h=x(i[r],p);let v;for(let y=0;y<n.length;y+=1){const m=n[y];if(i[m]!==void 0){v=i[m];break}}const g=w(w({},G(i,[...n,r,s])),{title:v,key:h,parent:a,pos:p,children:null,data:i,isStart:[...a?a.isStart:[],c===0],isEnd:[...a?a.isEnd:[],c===l.l