import{es as A,a4 as h,l as n,d as j,r as P,ay as I,c as y,o as f,W as E,c4 as z,cp as D,c6 as W,a9 as F,w as t,j as s,ab as x,aa as K,i as w,D as C,A as O,ca as L,c3 as Q,c2 as R,N as X,E as B,h as T,aI as q,p as o,cd as G,v as H,cf as J,ae as M,S as Y,B as Z,X as ee}from"./index-9PRMimni.js";import{c as U,_ as te}from"./CollapseTransition-CyIVGqSL.js";import{_ as V}from"./Flex-CTSf12gq.js";const N={showDivider:{type:Boolean,default:!1},tooltip:{type:[String,Array]},triggers:{type:Array,default:()=>["main","arrow"]},showCollapse:{type:Boolean,default:!0},spreadText:{type:String,default:"展开"},foldText:{type:String,default:"收起"}},se={...A,...N,...U};function oe(d){return Object.keys(d)}function ae(d,a=[],p){const r={};return Object.getOwnPropertyNames(d).forEach(l=>{a.includes(l)||(r[l]=d[l])}),Object.assign(r,p)}function S(d,a){const p=oe(a);return h(()=>{const r=n(d);return ae(r,p)})}const ne={class:"flex items-center handle-collapse"},le={class:"handle-collapse-text"},re=j({__name:"BasicCard",props:{...se},setup(d){const a=d,p=S(a,{...N,...U,title:a.title}),r=S(a,{...N}),i=P(!1);I(()=>a.show,e=>{i.value=e??!0},{immediate:!0});function l(e){const{triggers:c=[]}=a;c.includes(e)&&(i.value=!i.value)}return(e,c)=>{const m=X,k=q,g=V,$=te;return f(),y(n(E),z(D(n(p))),W({header:t(()=>[w("div",{class:B(["flex items-center",{"cursor-pointer":e.triggers.includes("main")}]),onClick:c[0]||(c[0]=u=>l("main"))},[e.title?(f(),T("span",{key:0,class:B(["mr-1 card-title",{"card-title-divider":e.showDivider}])},O(e.title),3)):C("",!0),e.tooltip?(f(),y(k,{key:1,trigger:"hover"},{trigger:t(()=>[s(m,{size:"18",class:"text-gray-400 cursor-pointer"},{default:t(()=>[s(n(G))]),_:1})]),default:t(()=>[o(" "+O(e.tooltip),1)]),_:1})):C("",!0)],2)]),"header-extra":t(()=>[w("div",{class:B({"cursor-pointer":e.triggers.includes("arrow")}),onClick:c[1]||(c[1]=u=>l("arrow"))},[e.$slots.collapse?x(e.$slots,"collapse",{key:0,expanded:i.value},void 0,!0):C("",!0),e.showCollapse&&!e.$slots.collapse?(f(),y(g,{key:1},{default:t(()=>[w("div",ne,[w("span",le,O(i.value?e.foldText:e.spreadText),1),s(m,{size:15},{default:t(()=>[(f(),y(L(i.value?n(Q):n(R))))]),_:1})])]),_:1})):C("",!0)],2)]),default:t(()=>[s($,K(n(r),{show:i.value}),{default:t(()=>[x(e.$slots,"default",{},void 0,!0)]),_:3},16,["show"])]),_:2},[F(Object.keys(e.$slots).filter(u=>u!=="default"),u=>({name:u,fn:t(b=>[x(e.$slots,u,z(D(b||{})),void 0,!0)])}))]),1040)}}}),v=H(re,[["__scopeId","data-v-646b62e9"]]),ie={class:"mb-3"},ue={key:0,class:"text-yellow-400"},de={key:1,class:"text-green-400"},me=j({__name:"collapseCard",setup(d){const a=P(!1),p=P(!0),r=P(!0),i=h(()=>{const l=[];return p.value&&l.push("main"),r.value&&l.push("arrow"),l});return(l,e)=>{const c=J,m=E,k=M,g=V,$=Y,u=Z,b=ee;return f(),y(b,{title:"卡片",content:"BasicCard 基于 Card 和 Collapse 组件扩展",showFooter:""},{default:t(()=>[s(n(v),{title:"基本使用",appear:!0,tooltip:"这是一段提示内容"},{default:t(()=>e[3]||(e[3]=[o(" 我是卡片内容 ")])),_:1}),s(m,{title:"手动控制展开/收起",class:"mt-3"},{default:t(()=>[s(c,{value:a.value,"onUpdate:value":e[0]||(e[0]=_=>a.value=_),class:"mb-3"},{checked:t(()=>e[4]||(e[4]=[o(" 收起 ")])),unchecked:t(()=>e[5]||(e[5]=[o(" 展开 ")])),_:1},8,["value"]),s(n(v),{title:"卡片",show:a.value},{default:t(()=>e[6]||(e[6]=[o(" 手动控制展开/收起-卡片内容 ")])),_:1},8,["show"])]),_:1}),s(m,{title:"触发展开区域",class:"mt-3"},{default:t(()=>[s(g,{vertical:"",class:"mb-3"},{default:t(()=>[s(g,null,{default:t(()=>[s(k,{checked:p.value,"onUpdate:checked":e[1]||(e[1]=_=>p.value=_),checkable:""},{default:t(()=>e[7]||(e[7]=[o(" main ")])),_:1},8,["checked"]),s(k,{checked:r.value,"onUpdate:checked":e[2]||(e[2]=_=>r.value=_),checkable:""},{default:t(()=>e[8]||(e[8]=[o(" arrow ")])),_:1},8,["checked"])]),_:1})]),_:1}),s(n(v),{title:"卡片",triggers:i.value},{default:t(()=>e[9]||(e[9]=[o(" 触发展开区域-卡片内容 ")])),_:1},8,["triggers"])]),_:1}),s(m,{title:"自定义展开",class:"mt-3"},{default:t(()=>[w("div",ie,[s($,{depth:"3"},{default:t(()=>e[10]||(e[10]=[o(" 如果只是想修改文案，可以通过 属性：spreadText 和 foldText 配置即可 ")])),_:1})]),s(n(v),{title:"卡片",spreadText:"显示内容",foldText:"隐藏内容"},{collapse:t(({expanded:_})=>[_?(f(),T("div",ue," 折叠 ")):(f(),T("div",de," 打开 "))]),default:t(()=>[e[11]||(e[11]=o(" 自定义展开文案-卡片内容 "))]),_:1})]),_:1}),s(m,{title:"自定义插槽",class:"mt-3"},{default:t(()=>[s(n(v),{title:"卡片"},{action:t(()=>[s(g,null,{default:t(()=>[s(u,{size:"small",type:"tertiary"},{default:t(()=>e[12]||(e[12]=[o("复制")])),_:1}),s(u,{size:"small",type:"tertiary"},{default:t(()=>e[13]||(e[13]=[o("编辑")])),_:1}),s(u,{size:"small",type:"tertiary"},{default:t(()=>e[14]||(e[14]=[o("查看")])),_:1})]),_:1})]),default:t(()=>[e[15]||(e[15]=o(" 自定义插槽-卡片内容 "))]),_:1})]),_:1}),s(n(v),{title:"显示分割条",tooltip:"这是一段提示内容",showDivider:"",showCollapse:!1,class:"mt-3",segmented:{content:!0,footer:"soft"}},{default:t(()=>e[16]||(e[16]=[o(" 我是卡片内容 ")])),_:1})]),_:1})}}});export{me as default};
