import{a as e,c as t,i as n}from"./preload-helper-B45gAKPr.js";import{pn as r,t as i}from"./iframe-CMLjY6eW.js";import{n as a,t as o}from"./TreeSelect-Dp9cZxwB.js";import{n as s,t as c}from"./treeStoryFixtures-Cd984L7t.js";var l=e({Basic:()=>m,Empty:()=>g,SelectParent:()=>h,__namedExportsOrder:()=>_,default:()=>p});function u({initialValue:e,label:t=`TreeSelect`,description:n}){let[r,i]=(0,d.useState)(e);return(0,f.jsxs)(`div`,{style:{display:`grid`,gap:12,maxWidth:520},children:[(0,f.jsx)(o,{label:t,description:n,nodes:c,value:r,onChange:i}),(0,f.jsxs)(`div`,{style:{fontSize:`var(--font-size-sm)`,color:`var(--content-1)`},children:[`Текущее значение: `,r?`${r.codeKey}=${r.value}`:`пусто`]})]})}var d,f,p,m,h,g,_,v=n((()=>{d=t(r(),1),a(),s(),f=i(),p={title:`Shared/UI/TreeSelect`,component:o,parameters:{atomicCanvas:!0,layout:`padded`},args:{label:`Выбор узла`,description:`Single-select поверх дерева. Можно выбрать любой узел.`,nodes:c,value:void 0,onChange:()=>{}},argTypes:{nodes:{control:!1},value:{control:!1},onChange:{control:!1}}},m={render:()=>(0,f.jsx)(u,{initialValue:{codeKey:`BRANCH`,value:`B0101`}})},h={render:()=>(0,f.jsx)(u,{label:`Выбор родителя`,description:`Проверка single-select сценария, когда выбирается не leaf, а промежуточный узел.`,initialValue:{codeKey:`REGION`,value:`R01`}})},g={args:{nodes:[],description:`Состояние без доступных узлов.`}},m.parameters={...m.parameters,docs:{...m.parameters?.docs,source:{originalSource:`{
  render: () => <StatefulTreeSelect initialValue={{
    codeKey: "BRANCH",
    value: "B0101"
  }} />
}`,...m.parameters?.docs?.source}}},h.parameters={...h.parameters,docs:{...h.parameters?.docs,source:{originalSource:`{
  render: () => <StatefulTreeSelect label="Выбор родителя" description="Проверка single-select сценария, когда выбирается не leaf, а промежуточный узел." initialValue={{
    codeKey: "REGION",
    value: "R01"
  }} />
}`,...h.parameters?.docs?.source}}},g.parameters={...g.parameters,docs:{...g.parameters?.docs,source:{originalSource:`{
  args: {
    nodes: [],
    description: "Состояние без доступных узлов."
  }
}`,...g.parameters?.docs?.source}}},_=[`Basic`,`SelectParent`,`Empty`]}));v();export{m as Basic,g as Empty,h as SelectParent,_ as __namedExportsOrder,p as default,v as n,l as t};