import{c as e,i as t}from"./preload-helper-B45gAKPr.js";import{C as n,Tt as r,ht as i,n as a,pn as o,pt as s,t as c,x as l,y as u}from"./iframe-NOj5DEP4.js";import{a as d,i as f}from"./utils-C5_R17vJ.js";import{t as p}from"./Button-CqbxyL6u.js";import{t as m}from"./CheckBox-CyShYZlX.js";import{t as h}from"./button-DorJdQ5y.js";import{a as g}from"./Input-CtFBsQ8Z.js";import{t as _}from"./input-BtunpXs_.js";import{t as v}from"./Select-DbumJ08V.js";import{t as y}from"./select-C1H_K5pE.js";import{t as b}from"./check-box-DgmFIKzd.js";import{o as x,t as S}from"./misc-k4ycC2LT.js";var C,w,T,E,D,O,k,A=t((()=>{C=`sj-rIq`,w=`_3anR7j`,T=`gMRIsT`,E=`f5Pv1e`,D=`q7eZzv`,O=`maUL24`,k={expandableActionPanel:C,content:w,contentScroller:T,labeledPanel:E,label:D,labeledActionPanel:O}}));function j({children:e,className:t,contentClassName:n,toggleClassName:r,open:a,defaultOpen:o=!1,disabled:c,onOpenChange:l,expandLabel:u=`Раскрыть панель действий влево`,collapseLabel:f=`Свернуть панель действий`,panelLabel:m=`Действия панели`,itemSelector:h,scrollPadding:g,smoothScroll:_}){let[v,y]=(0,M.useState)(o),b=(0,M.useId)(),S=a!==void 0,C=S?a:v,w=(0,M.useCallback)(e=>{let t=typeof e==`function`?e(C):e;S||y(t),l?.(t)},[S,l,C]),T=()=>w(e=>!e),E=C?s:i;return(0,N.jsxs)(`div`,{className:d(k.expandableActionPanel,t),"data-ui":`expandable-action-panel`,"data-open":C?``:void 0,children:[(0,N.jsx)(p,{className:r,icon:(0,N.jsx)(E,{}),title:C?f:u,disabled:c,variant:`neutralOutline`,"aria-expanded":C,"aria-controls":b,"data-ui":`expandable-action-panel-toggle`,"data-action":C?`collapse-action-panel`:`expand-action-panel`,onClick:T}),C&&(0,N.jsx)(`div`,{id:b,role:`group`,"aria-label":m,className:d(k.content,n),children:(0,N.jsx)(x,{className:k.contentScroller,itemSelector:h,scrollPadding:g,smooth:_,children:e})})]})}var M,N,P=t((()=>{M=e(o(),1),f(),a(),h(),S(),A(),N=c(),j.__docgenInfo={description:`Горизонтальная раскрывающаяся панель действий.
Не знает о внешнем layout и может использоваться рядом с любым содержимым.`,methods:[],displayName:`ExpandableActionPanel`,props:{className:{required:!1,tsType:{name:`string`},description:``},contentClassName:{required:!1,tsType:{name:`string`},description:``},toggleClassName:{required:!1,tsType:{name:`string`},description:``},open:{required:!1,tsType:{name:`boolean`},description:``},defaultOpen:{required:!1,tsType:{name:`boolean`},description:``,defaultValue:{value:`false`,computed:!1}},disabled:{required:!1,tsType:{name:`boolean`},description:``},onOpenChange:{required:!1,tsType:{name:`signature`,type:`function`,raw:`(open: boolean) => void`,signature:{arguments:[{type:{name:`boolean`},name:`open`}],return:{name:`void`}}},description:``},expandLabel:{required:!1,tsType:{name:`string`},description:``,defaultValue:{value:`"Раскрыть панель действий влево"`,computed:!1}},collapseLabel:{required:!1,tsType:{name:`string`},description:``,defaultValue:{value:`"Свернуть панель действий"`,computed:!1}},panelLabel:{required:!1,tsType:{name:`string`},description:``,defaultValue:{value:`"Действия панели"`,computed:!1}},itemSelector:{required:!1,tsType:{name:`string`},description:``},scrollPadding:{required:!1,tsType:{name:`number`},description:``},smoothScroll:{required:!1,tsType:{name:`boolean`},description:``}},composes:[`PropsWithChildren`]}}));function F({label:e,className:t,labelClassName:n,labelStyle:r,labelMinWidth:i=`12em`,panelClassName:a,open:o,defaultOpen:s,...c}){let l={...r,minWidth:i},u=typeof e==`string`?e:void 0;return(0,I.jsxs)(`div`,{className:d(k.labeledPanel,t),"data-ui":`labeled-expandable-action-panel`,children:[(0,I.jsx)(`div`,{className:d(`flexEllipsis`,k.label,n),style:l,title:u,children:e}),(0,I.jsx)(j,{...c,open:o,defaultOpen:s,className:d(k.labeledActionPanel,a)})]})}var I,L=t((()=>{o(),f(),P(),A(),I=c(),F.__docgenInfo={description:"Раскрывающаяся панель действий с левым текстом, который сжимается через `flexEllipsis`.",methods:[],displayName:`LabeledExpandableActionPanel`,props:{label:{required:!0,tsType:{name:`ReactReactNode`,raw:`React.ReactNode`},description:``},className:{required:!1,tsType:{name:`string`},description:``},labelClassName:{required:!1,tsType:{name:`string`},description:``},labelStyle:{required:!1,tsType:{name:`ReactCSSProperties`,raw:`React.CSSProperties`},description:``},labelMinWidth:{required:!1,tsType:{name:`ReactCSSProperties["minWidth"]`,raw:`React.CSSProperties["minWidth"]`},description:``,defaultValue:{value:`"12em"`,computed:!1}},panelClassName:{required:!1,tsType:{name:`string`},description:``}},composes:[`Omit`]}}));function R(){let[e,t]=(0,z.useState)(``),[i,a]=(0,z.useState)(!1),[o,s]=(0,z.useState)(`Все`);return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`div`,{style:{width:`calc(14em + var(--width-add))`},children:(0,B.jsx)(g,{placeholder:`Поиск`,value:e,onChange:t,endAdornment:(0,B.jsx)(l,{})})}),(0,B.jsx)(`div`,{style:{width:`calc(12em + var(--width-add))`},children:(0,B.jsx)(v,{placeholder:`Статус`,options:U,value:o,onChange:s,getOptionKey:e=>e,getOptionLabel:e=>e})}),(0,B.jsx)(m,{placeholder:`Только мои`,value:i,onChange:a,noWrap:!0}),(0,B.jsx)(p,{icon:(0,B.jsx)(n,{}),title:`Обновить`}),(0,B.jsx)(p,{icon:(0,B.jsx)(u,{}),title:`Настроить`}),(0,B.jsx)(p,{icon:(0,B.jsx)(r,{}),tone:`success`,appearance:`solid`,children:`Применить`})]})}var z,B,V,H,U,W,G,K;t((()=>{z=e(o(),1),a(),h(),b(),_(),y(),P(),L(),B=c(),{fn:V}=__STORYBOOK_MODULE_TEST__,H={title:`Shared/UI/ExpandableActionPanel`,component:F,args:{label:`Длинное название строки с результатами расчёта и параметрами отбора`,labelMinWidth:`18em`,defaultOpen:!1,onOpenChange:V()},parameters:{atomicCanvas:!0,layout:`padded`},argTypes:{label:{description:`Текст или ReactNode слева от панели.`,control:`text`},labelMinWidth:{description:"Минимальная ширина `flexEllipsis`-текста.",control:`text`},defaultOpen:{description:`Начальное состояние раскрытия в uncontrolled-режиме.`,control:`boolean`},open:{description:`Контролируемое состояние раскрытия.`,control:`boolean`},onOpenChange:{description:`Вызывается при раскрытии или сворачивании панели.`,control:!1}}},U=[`Все`,`Активные`,`Архив`],W={render:e=>(0,B.jsx)(`div`,{style:{width:`min(100%, 920px)`},children:(0,B.jsx)(F,{...e,children:(0,B.jsx)(R,{})})})},G={render:()=>(0,B.jsx)(`div`,{style:{width:`min(100%, 720px)`,display:`flex`,justifyContent:`flex-end`},children:(0,B.jsx)(j,{defaultOpen:!0,children:(0,B.jsx)(R,{})})})},W.parameters={...W.parameters,docs:{...W.parameters?.docs,source:{originalSource:`{
  render: args => <div style={{
    width: "min(100%, 920px)"
  }}>
            <LabeledExpandableActionPanel {...args}>
                <DemoControls />
            </LabeledExpandableActionPanel>
        </div>
}`,...W.parameters?.docs?.source}}},G.parameters={...G.parameters,docs:{...G.parameters?.docs,source:{originalSource:`{
  render: () => <div style={{
    width: "min(100%, 720px)",
    display: "flex",
    justifyContent: "flex-end"
  }}>
            <ExpandableActionPanel defaultOpen>
                <DemoControls />
            </ExpandableActionPanel>
        </div>
}`,...G.parameters?.docs?.source}}},K=[`Labeled`,`BasePanel`]}))();export{G as BasePanel,W as Labeled,K as __namedExportsOrder,H as default};