import{d as x,u as W,r as C,dW as F,a4 as p,bY as v,dX as M,j as e,S as _,dY as S,aa as X,dZ as Y,F as $,l as n,aI as z,af as T,d6 as A,d_ as E,B as L,c as U,o as Z,w as o,W as q,p as s,i as f,X as G}from"./index-9PRMimni.js";const H={copyable:{type:Boolean,default:!1},copyConfig:{type:Object,default:()=>({showTip:!1,tooltips:["复制","复制成功"]})}};function J(a){return typeof a=="function"||Object.prototype.toString.call(a)==="[object Object]"&&!Y(a)}const l=x({name:"Paragraph",props:H,setup(a,{slots:i,emit:y,attrs:t}){const d=W(),u=C(!1),g=C(),w=F(),B=p(()=>{const r=a.copyConfig.tooltips;return v(r)&&r.length?r[0]:"复制"}),c=p(()=>{const r=a.copyConfig.tooltips;return v(r)&&r.length?r[1]:"复制成功"}),{copy:P,isSupported:V}=M({source:g}),j=p(()=>w.value.primaryColor),D=p(()=>a.copyConfig.tooltips??!0),O=p(()=>a.copyConfig.showTip??!0),k={default:()=>e("span",null,[u.value?c.value:B.value]),trigger:()=>m()};function m(){const r={color:j.value};return e(L,{text:!0,size:"small",style:"vertical-align: text-top",onClick:I},{default:u.value?T(A,r):T(E,r)})}function I(){if(u.value)return;u.value=!0;const r=S(i);g.value=r?.length?r[0].children:"",P(g.value),O.value&&d.success(c.value),V.value?y("copy-success"):y("copy-error")}function b(){return S(i)}function N(){return e(_,X({copyable:!0},t),{default:()=>[e($,null,[b(),n(D)?e(z,{trigger:"hover"},k):m()])]})}return()=>{let r;return a.copyable?N():e(_,null,J(r=b())?r:{default:()=>[r]})}}}),K={class:"mb-2"},Q={class:"mb-2"},R={class:"mb-2"},h={class:"mb-2"},et=x({__name:"basic",setup(a){function i(){console.log("不错哦！")}return(y,t)=>{const d=q,u=G;return Z(),U(u,{title:"排印组件增强",content:"可复制功能",showFooter:""},{default:o(()=>[e(d,{bordered:!1,class:"mt-3 proCard",title:"基础使用","content-style":"padding-top: 0;"},{default:o(()=>[e(n(l),{type:"info"},{default:o(()=>t[0]||(t[0]=[s(" Info ")])),_:1}),e(n(l),{type:"success"},{default:o(()=>t[1]||(t[1]=[s(" Success ")])),_:1}),e(n(l),{type:"warning"},{default:o(()=>t[2]||(t[2]=[s(" Warning ")])),_:1}),e(n(l),{type:"error"},{default:o(()=>t[3]||(t[3]=[s(" Error ")])),_:1}),t[14]||(t[14]=s()),e(n(l),{strong:""},{default:o(()=>t[4]||(t[4]=[s(" Strong ")])),_:1}),e(n(l),{italic:""},{default:o(()=>t[5]||(t[5]=[s(" Italic ")])),_:1}),t[15]||(t[15]=s()),e(n(l),{underline:""},{default:o(()=>t[6]||(t[6]=[s(" Underline ")])),_:1}),e(n(l),{delete:""},{default:o(()=>t[7]||(t[7]=[s(" Delete ")])),_:1}),t[16]||(t[16]=s()),e(n(l),{code:""},{default:o(()=>t[8]||(t[8]=[s(" Code ")])),_:1}),e(n(l),{code:"",delete:""},{default:o(()=>t[9]||(t[9]=[s(" Code ")])),_:1}),e(n(l),{depth:"1"},{default:o(()=>t[10]||(t[10]=[s(" Primary Depth ")])),_:1}),e(n(l),{depth:"2"},{default:o(()=>t[11]||(t[11]=[s(" Secondary Depth ")])),_:1}),e(n(l),{depth:"3"},{default:o(()=>t[12]||(t[12]=[s(" Tertiary Depth ")])),_:1}),e(n(l),{tag:"div"},{default:o(()=>t[13]||(t[13]=[s(" 作为 Div ")])),_:1})]),_:1}),e(d,{bordered:!1,class:"mt-3 proCard",title:"扩展复制","content-style":"padding-top: 0;"},{default:o(()=>[f("div",K,[e(n(l),{copyable:""},{default:o(()=>t[17]||(t[17]=[s(" 这是一个可以复制的文本 ")])),_:1})]),f("div",Q,[e(n(l),{class:"mb-2",copyable:"","copy-config":{showTip:!0}},{default:o(()=>t[18]||(t[18]=[s(" 显示复制成功的通知 ")])),_:1})]),f("div",R,[e(n(l),{class:"mb-2",copyable:"","copy-config":{tooltips:!1}},{default:o(()=>t[19]||(t[19]=[s("隐藏 Tooltip")])),_:1})]),f("div",h,[e(n(l),{copyable:"","copy-config":{tooltips:["复制单号","单号复制成功啦！"]},onCopySuccess:i},{default:o(()=>t[20]||(t[20]=[s(" M086611 自定义提示文字 ")])),_:1})])]),_:1})]),_:1})}}});export{et as default};
