"use strict";const e=require("vue"),v=require("./Shape-rA2az7tR.cjs"),k=require("./BaseIcon-DUokibJ1.cjs"),_=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),x={class:"vue-ui-data-table"},B={style:{display:"flex","align-items":"center","justify-content":"flex-end","padding-right":"3px",gap:"3px"}},w={key:0,height:"12",width:"12",viewBox:"0 0 20 20",style:{background:"none"}},E=["fill"],N=["data-cell"],V={dir:"auto",style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},C={key:0,height:"12",width:"12",viewBox:"0 0 20 20",style:{background:"none",overflow:"visible"}},S={__name:"DataTable",props:{colNames:{type:Array,default(){return[]}},head:Array,body:Array,title:String,config:Object},emits:["close"],setup(t,{emit:m}){const i=t;e.useCssVars(n=>({"72ac81a5":e.unref(p)}));const{backgroundColor:s,color:u,outline:f}=i.config.th,{backgroundColor:b,color:g,outline:p}=i.config.td,h=e.computed(()=>i.config.breakpoint),d=e.ref(null),y=e.ref(!1);return e.onMounted(()=>{const n=new ResizeObserver(l=>{l.forEach(o=>{y.value=o.contentRect.width<h.value})});d.value&&n.observe(d.value)}),(n,l)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"tableContainer",ref:d,style:{width:"100%","container-type":"inline-size",position:"relative","padding-top":"36px",overflow:"auto"},class:e.normalizeClass({"vue-ui-responsive":y.value})},[e.createElementVNode("div",{"data-html2canvas-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:l[0]||(l[0]=o=>m("close")),onKeypress:l[1]||(l[1]=e.withKeys(o=>m("close"),["enter"]))},[e.createVNode(k.default,{name:"close",stroke:e.unref(u),"stroke-width":2},null,8,["stroke"])],36),e.createElementVNode("table",x,[e.createElementVNode("caption",{style:e.normalizeStyle({backgroundColor:e.unref(s),color:e.unref(u),outline:e.unref(f)}),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(u)}]),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(f)}),key:`th_${r}`},[e.createElementVNode("div",B,[o.color?(e.openBlock(),e.createElementBlock("svg",w,[e.createElementVNode("circle",{cx:"10",cy:"10",r:"10",fill:o.color},null,8,E)])):e.createCommentVNode("",!0),e.renderSlot(n.$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(b),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(p)}),class:"vue-ui-data-table__tbody__td"},[e.createElementVNode("div",V,[a.color?(e.openBlock(),e.createElementBlock("svg",C,[e.createVNode(v._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(n.$slots,"td",{td:a},void 0,!0)])],12,N))),256))],6))),256))])])],2))}},z=_._export_sfc(S,[["__scopeId","data-v-5cbf64d8"]]);exports.DataTable=z;
