import{arrayType as e,booleanType as t,functionType as n,objectType as r,someType as i}from"../_util/type.mjs";import"../vc-util/warning.mjs";import a from"../_util/classNames.mjs";import o from"../_util/omit.mjs";import s from"../_util/props-util/initDefaultProps.mjs";import{filterEmpty as c}from"../_util/props-util/index.mjs";import l from"../config-provider/hooks/useConfigInject.mjs";import u from"../_util/vue-types/index.mjs";import d from"../vc-util/devWarning.mjs";import{treeProps as f}from"../vc-tree/props.mjs";import p from"../vc-tree/index.mjs";import m from"./style/index.mjs";import h from"./utils/dropIndicator.mjs";import g from"./utils/iconUtil.mjs";import{computed as _,createVNode as v,defineComponent as y,ref as b,watchEffect as x}from"vue";var S=()=>{let a=f();return{...a,showLine:i([Boolean,Object]),multiple:t(),autoExpandParent:t(),checkStrictly:t(),checkable:t(),disabled:t(),defaultExpandAll:t(),defaultExpandParent:t(),defaultExpandedKeys:e(),expandedKeys:e(),checkedKeys:i([Array,Object]),defaultCheckedKeys:e(),selectedKeys:e(),defaultSelectedKeys:e(),selectable:t(),loadedKeys:e(),draggable:t(),showIcon:t(),icon:n(),switcherIcon:u.any,prefixCls:String,replaceFields:r(),blockNode:t(),openAnimation:u.any,onDoubleclick:a.onDblclick,"onUpdate:selectedKeys":n(),"onUpdate:checkedKeys":n(),"onUpdate:expandedKeys":n()}},C=y({compatConfig:{MODE:3},name:`ATree`,inheritAttrs:!1,props:s(S(),{checkable:!1,selectable:!0,showIcon:!1,blockNode:!1}),slots:Object,setup(e,{attrs:t,expose:n,emit:r,slots:i}){e.treeData===void 0&&i.default;let{prefixCls:s,direction:u,virtual:f}=l(`tree`,e),[y,S]=m(s),C=b();n({treeRef:C,onNodeExpand:(...e)=>{C.value?.onNodeExpand(...e)},scrollTo:e=>{C.value?.scrollTo(e)},selectedKeys:_(()=>C.value?.selectedKeys),checkedKeys:_(()=>C.value?.checkedKeys),halfCheckedKeys:_(()=>C.value?.halfCheckedKeys),loadedKeys:_(()=>C.value?.loadedKeys),loadingKeys:_(()=>C.value?.loadingKeys),expandedKeys:_(()=>C.value?.expandedKeys)}),x(()=>{d(e.replaceFields===void 0,`Tree`,"`replaceFields` is deprecated, please use fieldNames instead")});let w=(e,t)=>{r(`update:checkedKeys`,e),r(`check`,e,t)},T=(e,t)=>{r(`update:expandedKeys`,e),r(`expand`,e,t)},E=(e,t)=>{r(`update:selectedKeys`,e),r(`select`,e,t)};return()=>{let{showIcon:n,showLine:r,switcherIcon:l=i.switcherIcon,icon:d=i.icon,blockNode:m,checkable:_,selectable:b,fieldNames:x=e.replaceFields,motion:D=e.openAnimation,itemHeight:O=28,onDoubleclick:k,onDblclick:A}=e,j={...t,...o(e,[`onUpdate:checkedKeys`,`onUpdate:expandedKeys`,`onUpdate:selectedKeys`,`onDoubleclick`]),showLine:!!r,dropIndicatorRender:h,fieldNames:x,icon:d,itemHeight:O},M=i.default?c(i.default()):void 0;return y(v(p,{...j,virtual:f.value,motion:D,ref:C,prefixCls:s.value,class:a({[`${s.value}-icon-hide`]:!n,[`${s.value}-block-node`]:m,[`${s.value}-unselectable`]:!b,[`${s.value}-rtl`]:u.value===`rtl`},t.class,S.value),direction:u.value,checkable:_,selectable:b,switcherIcon:e=>g(s.value,l,e,i.leafIcon,r),onCheck:w,onExpand:T,onSelect:E,onDblclick:A||k,children:M},{...i,checkable:()=>v(`span`,{class:`${s.value}-checkbox-inner`},null)}))}}});export{C as default,S as treeProps};