"use strict";const e=require("vue"),k=require("./Shape-DT8Iisqv.cjs"),_=require("./BaseIcon-CPELbcJd.cjs"),x=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),w={class:"vue-ui-data-table"},B={style:{display:"flex","align-items":"center","justify-content":"flex-end","padding-right":"3px",gap:"3px"}},E={style:{width:"12px",height:"12px"}},N={key:0,height:"12",width:"12",viewBox:"0 0 20 20",style:{background:"none"}},V=["fill"],C=["data-cell"],S={dir:"auto",style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},z={key:0,height:"12",width:"12",viewBox:"0 0 20 20",style:{background:"none",overflow:"visible"}},$={__name:"DataTable",props:{colNames:{type:Array,default(){return[]}},head:Array,body:Array,title:String,config:Object},emits:["close"],setup(t,{emit:b}){e.useCssVars(l=>({"2908e47d":e.unref(f)}));const i=t,{backgroundColor:s,color:d,outline:m}=i.config.th,{backgroundColor:h,color:g,outline:f}=i.config.td,v=e.computed(()=>i.config.breakpoint),u=e.ref(null),p=e.ref(!1);e.onMounted(()=>{const l=new ResizeObserver(n=>{n.forEach(o=>{p.value=o.contentRect.width<v.value})});u.value&&l.observe(u.value)});const y=b;return(l,n)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"tableContainer",ref:u,style:{width:"100%","container-type":"inline-size",position:"relative","padding-top":"36px",overflow:"auto"},class:e.normalizeClass({"atom-data-table":!0,"vue-ui-responsive":p.value})},[e.createElementVNode("div",{"data-dom-to-png-ignore":"",role:"button",tabindex:"0",style:e.normalizeStyle(`width:32px; position: absolute; top: 0; right:4px; padding: 0 0px; display: flex; align-items:center;justify-content:center;height: 36px; width: 32px; cursor:pointer; background:${e.unref(s)};`),onClick:n[0]||(n[0]=o=>y("close")),onKeypress:n[1]||(n[1]=e.withKeys(o=>y("close"),["enter"]))},[e.createVNode(_.default,{name:"close",stroke:e.unref(d),"stroke-width":2},null,8,["stroke"])],36),e.createElementVNode("table",w,[e.createElementVNode("caption",{style:e.normalizeStyle({backgroundColor:e.unref(s),color:e.unref(d),outline:e.unref(m)}),class:"vue-ui-data-table__caption"},e.toDisplayString(t.title),5),e.createElementVNode("thead",null,[e.createElementVNode("tr",{role:"row",style:e.normalizeStyle([{"font-variant-numeric":"tabular-nums"},{backgroundColor:e.unref(s),color:e.unref(d)}]),class:"vue-ui-data-table__thead-row"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.head,(o,r)=>(e.openBlock(),e.createElementBlock("th",{role:"cell",style:e.normalizeStyle({outline:e.unref(m)}),key:`th_${r}`},[e.createElementVNode("div",B,[e.createElementVNode("div",E,[o.color?(e.openBlock(),e.createElementBlock("svg",N,[e.createElementVNode("circle",{cx:"10",cy:"10",r:"10",fill:o.color},null,8,V)])):e.createCommentVNode("",!0)]),e.renderSlot(l.$slots,"th",{th:o},void 0,!0)])],4))),128))],4)]),e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.body,(o,r)=>(e.openBlock(),e.createElementBlock("tr",{role:"row",style:e.normalizeStyle([{"font-variant-numeric":"tabular-nums"},{backgroundColor:e.unref(h),color:e.unref(g)}]),class:e.normalizeClass({"vue-ui-data-table__tbody__row":!0,"vue-ui-data-table__tbody__row-even":r%2===0,"vue-ui-data-table__tbody__row-odd":r%2!==0})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o,(a,c)=>(e.openBlock(),e.createElementBlock("td",{role:"cell","data-cell":(t.colNames[c]&&t.colNames[c].name?t.colNames[c].name:"")||t.colNames[c]||"",style:e.normalizeStyle({outline:e.unref(f)}),class:"vue-ui-data-table__tbody__td"},[e.createElementVNode("div",S,[a.color?(e.openBlock(),e.createElementBlock("svg",z,[e.createVNode(k._sfc_main,{plot:{x:10,y:10},color:a.color,radius:9,shape:t.config.shape||a.shape||"circle"},null,8,["color","shape"])])):e.createCommentVNode("",!0),e.renderSlot(l.$slots,"td",{td:a},void 0,!0)])],12,C))),256))],6))),256))])])],2))}},q=x._export_sfc($,[["__scopeId","data-v-4afbd65f"]]);exports.DataTable=q;
