var E=(u,a,s)=>new Promise((c,n)=>{var _=t=>{try{r(s.next(t))}catch(e){n(e)}},f=t=>{try{r(s.throw(t))}catch(e){n(e)}},r=t=>t.done?c(t.value):Promise.resolve(t.value).then(_,f);r((s=s.apply(u,a)).next())});import{M as F}from"./index-1fe6349f.js";import{_ as L,o as A}from"./index-fd8ca376.js";import{u as I,E as v}from"./chartEditStore-49f0f0f3.js";import{u as K,a as b}from"./chartLayoutStore-c5479196.js";import{j as O,d as R,v as M,a5 as N,R as H,am as V,r as D,o as h,m as g,z as l,F as $,A as j,e as o,f as d,w as m,p as S,t as B,ad as z,cj as U,c1 as G}from"./index.js";import{a as J,b as Y,l as q}from"./plugin-af210832.js";import{c as p}from"./index-aa680c47.js";import{f as w,b as k,m as P}from"./index-e222387a.js";import"./icon-772f21c3.js";import"./index-4f9ce0b7.js";import"./index-06923d46.js";import"./index-b77c596c.js";import"./tables_list-16bd57ab.js";/* empty css                                                                */import"./SettingItemBox-4077356c.js";import"./CollapseItem-16cb7bcb.js";import"./useTargetData.hook-84c6257d.js";const Q={class:"go-content-charts-item-animation-patch"},W=["onDragstart","onDblclick"],X={class:"list-header"},Z={class:"list-center go-flex-center go-transition"},tt={class:"list-bottom"},et=R({__name:"index",props:{menuOptions:{type:Array,default:()=>[]}},setup(u){const a=I(),s=K(),c=M(),n=N(()=>s.getChartType),_=(t,e)=>{p(e.chartKey,w(e)),p(e.conKey,k(e)),t.dataTransfer.setData(U.DRAG_KEY,G(A(e,["image"]))),a.setEditCanvas(v.IS_CREATE,!0)},f=()=>{a.setEditCanvas(v.IS_CREATE,!1)},r=t=>E(this,null,function*(){try{J(),p(t.chartKey,w(t)),p(t.conKey,k(t));let e=yield P(t);a.addComponentList(e,!1,!0),a.setTargetSelectChart(e.id),Y()}catch(e){q(),window.$message.warning("\u56FE\u8868\u6B63\u5728\u7814\u53D1\u4E2D, \u656C\u8BF7\u671F\u5F85...")}});return H(()=>n.value,t=>{t===b.DOUBLE&&V(()=>{c.value.classList.add("miniAnimation")})}),(t,e)=>{const C=D("n-ellipsis"),x=D("n-text");return h(),g("div",Q,[l("div",{ref_key:"contentChartsItemBoxRef",ref:c,class:z(["go-content-charts-item-box",[d(n)===d(b).DOUBLE?"double":"single"]])},[(h(!0),g($,null,j(u.menuOptions,(i,T)=>(h(),g("div",{class:"item-box",key:T,draggable:"",onDragstart:y=>_(y,i),onDragend:f,onDblclick:y=>r(i)},[l("div",X,[o(d(F),{class:"list-header-control-btn",mini:!0,disabled:!0}),o(x,{class:"list-header-text",depth:"3"},{default:m(()=>[o(C,null,{default:m(()=>[S(B(i.title),1)]),_:2},1024)]),_:2},1024)]),l("div",Z,[o(d(L),{class:"list-img",chartConfig:i},null,8,["chartConfig"])]),l("div",tt,[o(x,{class:"list-bottom-text",depth:"3"},{default:m(()=>[o(C,{style:{"max-width":"90%"}},{default:m(()=>[S(B(i.title),1)]),_:2},1024)]),_:2},1024)])],40,W))),128))],2)])}}});var yt=O(et,[["__scopeId","data-v-3bb6960e"]]);export{yt as default};
