"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),c=require("@aplus-frontend/antdv"),f=require("lodash-unified");function s(l){return typeof l=="function"||Object.prototype.toString.call(l)==="[object Object]"&&!e.isVNode(l)}const g=e.defineComponent({name:"ApFieldTreeSelectRead",__name:"read",props:{mode:{default:"edit"},class:{},style:{},emptyText:{default:"--"},customReadMode:{},suffixIcon:{},size:{},bordered:{type:Boolean},treeLine:{},replaceFields:{},placement:{},status:{},popupClassName:{},dropdownClassName:{},"onUpdate:value":{},"onUpdate:treeExpandedKeys":{},"onUpdate:searchValue":{},variant:{},switcherLoadingIcon:{},value:{},children:{},listHeight:{},onMouseenter:{},onMouseleave:{},tabindex:{},onClick:{},onFocus:{},onBlur:{},onChange:{},onKeydown:{},onKeyup:{},onMousedown:{},onSelect:{},open:{type:Boolean},animation:{},direction:{},multiple:{type:Boolean},disabled:{type:Boolean},prefixCls:{},id:{},autofocus:{type:Boolean},getPopupContainer:{},virtual:{type:Boolean},dropdownMatchSelectWidth:{},placeholder:{},loading:{type:Boolean},defaultValue:{},prefix:{},clearIcon:{},allowClear:{type:Boolean},getRawInputElement:{},fieldNames:{},inputValue:{},searchValue:{},onSearch:{},autoClearSearchValue:{type:Boolean},onDeselect:{},listItemHeight:{},labelInValue:{type:Boolean},maxCount:{},showSearch:{type:Boolean},tagRender:{},optionLabelRender:{},notFoundContent:{},onClear:{},choiceTransitionName:{},defaultOpen:{type:Boolean},onDropdownVisibleChange:{},maxTagTextLength:{},maxTagCount:{},maxTagPlaceholder:{},tokenSeparators:{},removeIcon:{},transitionName:{},dropdownStyle:{},dropdownRender:{},dropdownAlign:{},showAction:{},onPopupScroll:{},onInputKeyDown:{},showArrow:{type:Boolean},showCheckedStrategy:{},filterTreeNode:{},treeNodeFilterProp:{},treeNodeLabelProp:{},treeCheckable:{type:Boolean},treeCheckStrictly:{type:Boolean},treeData:{},treeDataSimpleMode:{},treeLoadedKeys:{},onTreeLoad:{},treeDefaultExpandAll:{type:Boolean},treeExpandedKeys:{},treeDefaultExpandedKeys:{},onTreeExpand:{},treeIcon:{},switcherIcon:{},treeExpandAction:{},dropdownPopupAlign:{},request:{},lazy:{type:Boolean},params:{},loadData:{type:Boolean}},setup(l){const o=l,u=e.computed(()=>{let r;const d=o.value,i=f.isArray(d)?d:[d].filter(Boolean);if(!i.length)return e.createVNode(e.Fragment,null,[o.emptyText]);const t=[],y=o.fieldNames?.label||"label",m=o.fieldNames?.value||"value";function p(a){for(const n of a){if(i.find(h=>h===n[m])&&t.push(n[y]),t.length===i.length)return;n.children?.length&&p(n.children)}}return p(o.treeData),t.length?t.length===1?e.createVNode("span",null,[t[0]]):e.createVNode(c.Space,{size:4},s(r=t.map((a,n)=>e.createVNode(c.Tag,{style:"margin-right: 0px",key:`${a}-${n}`},s(a)?a:{default:()=>[a]})))?r:{default:()=>[r]}):e.createVNode(e.Fragment,null,[o.emptyText])});return(r,d)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(u.value)))}});exports.default=g;
