"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("vue"),y=require("../../_util/vnode.js"),X=require("../context.js"),H=require("../hooks/useSearchOptions.js"),_=require("../utils/commonUtil.js"),U=require("./Checkbox.js"),$="__cascader_fix_label__";function s({prefixCls:i,multiple:h,options:P,activeValue:N,prevValuePath:V,onToggleOpen:L,onSelect:M,onActive:O,checkedSet:q,halfCheckedSet:A,loadingKeys:E,isSelectable:K}){const R=`${i}-menu`,n=`${i}-menu-item`,{fieldNames:o,changeOnSelect:T,expandTrigger:j,expandIcon:w,loadingIcon:B,dropdownMenuColumnStyle:D,customSlots:g}=X.useInjectCascader(),m=w.value??g.value.expandIcon?.(),p=B.value??g.value.loadingIcon?.(),k=j.value==="hover";return t.createVNode("ul",{class:R,role:"menu"},[P.map(e=>{const{disabled:r}=e,x=e[H.SEARCH_MARK],u=e[$]??e[o.value.label],b=e[o.value.value],l=_.isLeaf(e,o.value),d=x?x.map(c=>c[o.value.value]):[...V,b],a=_.toPathKey(d),f=E.includes(a),C=q.has(a),F=A.has(a),I=()=>{!r&&(!k||!l)&&O(d)},S=()=>{K(e)&&M(d,l)};let v;return typeof e.title=="string"?v=e.title:typeof u=="string"&&(v=u),t.createVNode("li",{key:a,class:[n,{[`${n}-expand`]:!l,[`${n}-active`]:N===b,[`${n}-disabled`]:r,[`${n}-loading`]:f}],style:D.value,role:"menuitemcheckbox",title:v,"aria-checked":C,"data-path-key":a,onClick:()=>{I(),(!h||l)&&S()},onDblclick:()=>{T.value&&L(!1)},onMouseenter:()=>{k&&I()},onMousedown:c=>{c.preventDefault()}},[h&&t.createVNode(U.default,{prefixCls:`${i}-checkbox`,checked:C,halfChecked:F,disabled:r,onClick:c=>{c.stopPropagation(),S()}},null),t.createVNode("div",{class:`${n}-content`},[u]),!f&&m&&!l&&t.createVNode("div",{class:`${n}-expand-icon`},[y.cloneElement(m)]),f&&p&&t.createVNode("div",{class:`${n}-loading-icon`},[y.cloneElement(p)])])})])}s.props=["prefixCls","multiple","options","activeValue","prevValuePath","onToggleOpen","onSelect","onActive","checkedSet","halfCheckedSet","loadingKeys","isSelectable"];s.displayName="Column";s.inheritAttrs=!1;exports.FIX_LABEL=$;exports.default=s;
