import{n as e}from"./rolldown-runtime-C0FnF6B9.js";import{t}from"./react-C21x__mS.js";import{n}from"./iframe-GrlyTB2d.js";import{n as r,r as i,t as a,u as o}from"./TreePickerBase-DPVMwILr.js";function s(e){if(e)return e.code&&e.code!==e.label?`${e.label} · ${e.code}`:e.label}function c({label:e,description:t,disabled:n,placeholder:r=`Выберите значение`,size:c,nodes:d,value:f,onChange:p,query:m,defaultQuery:h,onQuery:g,isLoading:_,error:v,clearable:y=!1,defaultExpandedCodeKeys:b}){let x=(0,l.useMemo)(()=>i(d),[d]),S=o(f,x),C=S?x.nodeById.get(S):void 0;return(0,u.jsx)(a,{label:e,description:t,disabled:n,placeholder:r,size:c,nodes:d,selectedIds:S?new Set([S]):new Set,partialIds:new Set,selectionMode:`single`,defaultExpandedCodeKeys:b,triggerMode:`search`,selectedSummaryText:s(C),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 l,u;function d(){return(d=e((()=>{l=t(),r(),u=n(),c.__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}},defaultExpandedCodeKeys:{required:!1,tsType:{name:`unknown`},description:"Ключи уровней, узлы которых раскрываются до ручного действия пользователя.\nЗначения сопоставляются с `TreeSelectNode.codeKey`."}},composes:[`Omit`]}})))()}export{d as n,c as t};