import{c as e,i as t}from"./preload-helper-B45gAKPr.js";import{pn as n,t as r}from"./iframe-GmIo3IOR.js";import{l as i,n as a,o,r as s,t as c}from"./TreePickerBase-DCognf3p.js";function l(e){if(e)return e.code&&e.code!==e.label?`${e.label} · ${e.code}`:e.label}function u({label:e,description:t,disabled:n,placeholder:r=`Выберите значение`,size:a,nodes:o,value:u,onChange:p,query:m,defaultQuery:h,onQuery:g,isLoading:_,error:v,clearable:y=!1}){let b=(0,d.useMemo)(()=>s(o),[o]),x=i(u,b),S=x?b.nodeById.get(x):void 0;return(0,f.jsx)(c,{label:e,description:t,disabled:n,placeholder:r,size:a,nodes:o,selectedIds:x?new Set([x]):new Set,partialIds:new Set,selectionMode:`single`,triggerMode:`search`,selectedSummaryText:l(S),query:m,defaultQuery:h,onQuery:g,onNodeActivate:e=>p({codeKey:e.codeKey,value:e.value}),onClearSelection:y?()=>p(void 0):void 0,isLoading:_,error:v})}var d,f,p=t((()=>{d=e(n(),1),o(),a(),f=r(),u.__docgenInfo={description:``,methods:[],displayName:`TreeSelect`,props:{nodes:{required:!0,tsType:{name:`unknown`},description:``},placeholder:{required:!1,tsType:{name:`string`},description:``,defaultValue:{value:`"Выберите значение"`,computed:!1}},query:{required:!1,tsType:{name:`string`},description:``},defaultQuery:{required:!1,tsType:{name:`string`},description:``},onQuery:{required:!1,tsType:{name:`signature`,type:`function`,raw:`(value: string) => void`,signature:{arguments:[{type:{name:`string`},name:`value`}],return:{name:`void`}}},description:``},isLoading:{required:!1,tsType:{name:`boolean`},description:``},error:{required:!1,tsType:{name:`string`},description:``},clearable:{required:!1,tsType:{name:`boolean`},description:``,defaultValue:{value:`false`,computed:!1}}},composes:[`Omit`]}}));export{p as n,u as t};