You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
2 lines
8.6 KiB
2 lines
8.6 KiB
import{eT as F,eZ as G,Q as P,dw as R,e_ as z,e$ as W,dg as X,r as Y,b9 as Q,G as U}from"./index-f4658ae7.js";globalThis&&globalThis.__rest;function te(e,r){if(!e)return[];var t=e.slice(),n=t.indexOf(r);return n>=0&&t.splice(n,1),t}function ie(e,r){var t=(e||[]).slice();return t.indexOf(r)===-1&&t.push(r),t}function B(e){return e.split("-")}function D(e,r){return"".concat(e,"-").concat(r)}function V(e){return e&&e.type&&e.type.isTreeNode}function de(e,r){var t=[],n=r[e];function a(){var d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];d.forEach(function(i){var h=i.key,s=i.children;t.push(h),a(s)})}return a(n.children),t}function Z(e){if(e.parent){var r=B(e.pos);return Number(r[r.length-1])===e.parent.children.length-1}return!1}function q(e){var r=B(e.pos);return Number(r[r.length-1])===0}function oe(e,r,t,n,a,d,i,h,s,c){var g,l=e.clientX,o=e.clientY,u=e.target.getBoundingClientRect(),f=u.top,p=u.height,v=(c==="rtl"?-1:1)*(((a==null?void 0:a.x)||0)-l),k=(v-12)/n,y=h[t.eventKey];if(o<f+p/2){var m=i.findIndex(function(A){return A.key===y.key}),O=m<=0?0:m-1,K=i[O].key;y=h[K]}var C=y.key,N=y,E=y.key,b=0,S=0;if(!s.includes(C))for(var _=0;_<k&&Z(y);_+=1)y=y.parent,S+=1;var x=r.eventData,w=y.node,T=!0;return q(y)&&y.level===0&&o<f+p/2&&d({dragNode:x,dropNode:w,dropPosition:-1})&&y.key===t.eventKey?b=-1:(N.children||[]).length&&s.includes(E)?d({dragNode:x,dropNode:w,dropPosition:0})?b=0:T=!1:S===0?k>-1.5?d({dragNode:x,dropNode:w,dropPosition:1})?b=1:T=!1:d({dragNode:x,dropNode:w,dropPosition:0})?b=0:d({dragNode:x,dropNode:w,dropPosition:1})?b=1:T=!1:d({dragNode:x,dropNode:w,dropPosition:1})?b=1:T=!1,{dropPosition:b,dropLevelOffset:S,dropTargetKey:y.key,dropTargetPos:y.pos,dragOverNodeKey:E,dropContainerKey:b===0?null:((g=y.parent)===null||g===void 0?void 0:g.key)||null,dropAllowed:T}}function le(e,r){if(e){var t=r.multiple;return t?e.slice():e.length?[e[0]]:e}}function ce(e){if(!e)return null;var r;if(Array.isArray(e))r={checkedKeys:e,halfCheckedKeys:void 0};else if(F(e)==="object")r={checkedKeys:e.checked||void 0,halfCheckedKeys:e.halfChecked||void 0};else return null;return r}function fe(e,r){var t=new Set;function n(a){if(!t.has(a)){var d=r[a];if(d){t.add(a);var i=d.parent,h=d.node;h.disabled||i&&n(i.key)}}}return(e||[]).forEach(function(a){n(a)}),G(t)}var H=globalThis&&globalThis.__rest||function(e,r){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&r.indexOf(n)<0&&(t[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,n=Object.getOwnPropertySymbols(e);a<n.length;a++)r.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(t[n[a]]=e[n[a]]);return t};function j(e,r){return e!=null?e:r}function $(e){var r=e||{},t=r.title,n=r._title,a=r.key,d=r.children,i=t||"title";return{title:i,_title:n||[i],key:a||"key",children:d||"children"}}function se(e){function r(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],n=R(t);return n.map(function(a){var d,i,h,s;if(!V(a))return null;for(var c=a.children||{},g=a.key,l={},o=0,u=Object.entries(a.props);o<u.length;o++){var f=z(u[o],2),p=f[0],v=f[1];l[W(p)]=v}var k=l.isLeaf,y=l.checkable,m=l.selectable,O=l.disabled,K=l.disableCheckbox,C={isLeaf:k||k===""||void 0,checkable:y||y===""||void 0,selectable:m||m===""||void 0,disabled:O||O===""||void 0,disableCheckbox:K||K===""||void 0},N=P(P({},l),C),E=l.title,b=E===void 0?(d=c.title)===null||d===void 0?void 0:d.call(c,N):E,S=l.icon,_=S===void 0?(i=c.icon)===null||i===void 0?void 0:i.call(c,N):S,x=l.switcherIcon,w=x===void 0?(h=c.switcherIcon)===null||h===void 0?void 0:h.call(c,N):x,T=H(l,["title","icon","switcherIcon"]),A=(s=c.default)===null||s===void 0?void 0:s.call(c),L=P(P(P({},T),{title:b,icon:_,switcherIcon:w,key:g,isLeaf:k}),C),I=r(A);return I.length&&(L.children=I),L})}return r(e)}function ue(e,r,t){var n=$(t),a=n._title,d=n.key,i=n.children,h=new Set(r===!0?[]:r),s=[];function c(g){var l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return g.map(function(o,u){for(var f=D(l?l.pos:"0",u),p=j(o[d],f),v,k=0;k<a.length;k+=1){var y=a[k];if(o[y]!==void 0){v=o[y];break}}var m=P(P({},X(o,[].concat(G(a),[d,i]))),{title:v,key:p,parent:l,pos:f,children:null,data:o,isStart:[].concat(G(l?l.isStart:[]),[u===0]),isEnd:[].concat(G(l?l.isEnd:[]),[u===g.length-1])});return s.push(m),r===!0||h.has(p)?m.children=c(o[i]||[],m):m.children=[],m})}return c(e),s}function J(e,r,t){var n={};F(t)==="object"?n=t:n={externalGetKey:t},n=n||{};var a=n,d=a.childrenPropName,i=a.externalGetKey,h=a.fieldNames,s=$(h),c=s.key,g=s.children,l=d||g,o;i?typeof i=="string"?o=function(p){return p[i]}:typeof i=="function"&&(o=function(p){return i(p)}):o=function(p,v){return j(p[c],v)};function u(f,p,v,k){var y=f?f[l]:e,m=f?D(v.pos,p):"0",O=f?[].concat(G(k),[f]):[];if(f){var K=o(f,m),C={node:f,index:p,pos:m,key:K,parentPos:v.node?v.pos:null,level:v.level+1,nodes:O};r(C)}y&&y.forEach(function(N,E){u(N,E,{node:f,pos:m,level:v?v.level+1:-1},O)})}u(null)}function ve(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=r.initWrapper,n=r.processEntity,a=r.onProcessFinished,d=r.externalGetKey,i=r.childrenPropName,h=r.fieldNames,s=arguments.length>2?arguments[2]:void 0,c=d||s,g={},l={},o={posEntities:g,keyEntities:l};return t&&(o=t(o)||o),J(e,function(u){var f=u.node,p=u.index,v=u.pos,k=u.key,y=u.parentPos,m=u.level,O=u.nodes,K={node:f,nodes:O,index:p,key:k,pos:v,level:m},C=j(k,v);g[v]=K,l[C]=K,K.parent=g[y],K.parent&&(K.parent.children=K.parent.children||[],K.parent.children.push(K)),n&&n(K,o)},{externalGetKey:c,childrenPropName:i,fieldNames:h}),a&&a(o),o}function he(e,r){var t=r.expandedKeys,n=r.selectedKeys,a=r.loadedKeys,d=r.loadingKeys,i=r.checkedKeys,h=r.halfCheckedKeys,s=r.dragOverNodeKey,c=r.dropPosition,g=r.keyEntities,l=g[e],o={eventKey:e,expanded:t.indexOf(e)!==-1,selected:n.indexOf(e)!==-1,loaded:a.indexOf(e)!==-1,loading:d.indexOf(e)!==-1,checked:i.indexOf(e)!==-1,halfChecked:h.indexOf(e)!==-1,pos:String(l?l.pos:""),parent:l.parent,dragOver:s===e&&c===0,dragOverGapTop:s===e&&c===-1,dragOverGapBottom:s===e&&c===1};return o}function pe(e){var r=e.data,t=e.expanded,n=e.selected,a=e.checked,d=e.loaded,i=e.loading,h=e.halfChecked,s=e.dragOver,c=e.dragOverGapTop,g=e.dragOverGapBottom,l=e.pos,o=e.active,u=e.eventKey,f=P(P({dataRef:r},r),{expanded:t,selected:n,checked:a,loaded:d,loading:i,halfChecked:h,dragOver:s,dragOverGapTop:c,dragOverGapBottom:g,pos:l,active:o,eventKey:u,key:u});return"props"in f||Object.defineProperty(f,"props",{get:function(){return e}}),f}function M(e,r){var t=new Set;return e.forEach(function(n){r.has(n)||t.add(n)}),t}function ee(e){var r=e||{},t=r.disabled,n=r.disableCheckbox,a=r.checkable;return!!(t||n)||a===!1}function re(e,r,t,n){for(var a=new Set(e),d=new Set,i=0;i<=t;i+=1){var h=r.get(i)||new Set;h.forEach(function(l){var o=l.key,u=l.node,f=l.children,p=f===void 0?[]:f;a.has(o)&&!n(u)&&p.filter(function(v){return!n(v.node)}).forEach(function(v){a.add(v.key)})})}for(var s=new Set,c=t;c>=0;c-=1){var g=r.get(c)||new Set;g.forEach(function(l){var o=l.parent,u=l.node;if(!(n(u)||!l.parent||s.has(l.parent.key))){if(n(l.parent.node)){s.add(o.key);return}var f=!0,p=!1;(o.children||[]).filter(function(v){return!n(v.node)}).forEach(function(v){var k=v.key,y=a.has(k);f&&!y&&(f=!1),!p&&(y||d.has(k))&&(p=!0)}),f&&a.add(o.key),p&&d.add(o.key),s.add(o.key)}})}return{checkedKeys:Array.from(a),halfCheckedKeys:Array.from(M(d,a))}}function ne(e,r,t,n,a){for(var d=new Set(e),i=new Set(r),h=0;h<=n;h+=1){var s=t.get(h)||new Set;s.forEach(function(o){var u=o.key,f=o.node,p=o.children,v=p===void 0?[]:p;!d.has(u)&&!i.has(u)&&!a(f)&&v.filter(function(k){return!a(k.node)}).forEach(function(k){d.delete(k.key)})})}i=new Set;for(var c=new Set,g=n;g>=0;g-=1){var l=t.get(g)||new Set;l.forEach(function(o){var u=o.parent,f=o.node;if(!(a(f)||!o.parent||c.has(o.parent.key))){if(a(o.parent.node)){c.add(u.key);return}var p=!0,v=!1;(u.children||[]).filter(function(k){return!a(k.node)}).forEach(function(k){var y=k.key,m=d.has(y);p&&!m&&(p=!1),!v&&(m||i.has(y))&&(v=!0)}),p||d.delete(u.key),v&&i.add(u.key),c.add(u.key)}})}return{checkedKeys:Array.from(d),halfCheckedKeys:Array.from(M(i,d))}}function ye(e,r,t,n,a,d){var i;d?i=d:i=ee;var h=new Set(e.filter(function(c){var g=!!t[c];return g})),s;return r===!0?s=re(h,a,n,i):s=ne(h,r.halfCheckedKeys,a,n,i),s}function ge(e){var r=Y(0),t=Q();return U(function(){var n=new Map,a=0,d=e.value||{};for(var i in d)if(Object.prototype.hasOwnProperty.call(d,i)){var h=d[i],s=h.level,c=n.get(s);c||(c=new Set,n.set(s,c)),c.add(h),a=Math.max(a,s)}r.value=a,t.value=n}),{maxLevel:r,levelEntities:t}}export{ve as a,fe as b,se as c,ye as d,pe as e,$ as f,he as g,j as h,ue as i,le as j,te as k,de as l,oe as m,ie as n,B as o,ce as p,ge as u};
|