1import{_ as A,c as n,k as v,a as h,a6 as T,F as f,j as _,n as x,o as l,ao as c,z as b,Z as p,d as w,t as k,a7 as u}from"#entry";const S={name:"DataTable",components:{},async setup(e,t){},props:{columns:{type:Array,required:!0},records:{type:Array,required:!0}},data(){return{}},methods:{headerTextAlign(e){return e.header?.textAlign?e.header.textAlign:e.textAlign?typeof e.textAlign=="function"?e.textAlign(e):e.textAlign:"left"},headerStyle(e){let t={};return e.width&&(t.width=e.width),e.minWidth&&(t.minWidth=e.minWidth),e.header?.style?t={...t,...e.header.style}:e.style&&(typeof e.style=="function"?t={...t,...e.style(e)}:t={...t,...e.style}),t},recordTextAlign(e,t){return e.textAlign?typeof e.textAlign=="function"?e.textAlign(e,t):e.textAlign:"left"},recordTextStyle(e,t){return e.textStyle?typeof e.textStyle=="function"?e.textStyle(e,t):e.textStyle:"gray"},recordStyle(e,t){let a={};return e.width&&(a.width=e.width),e.minWidth&&(a.minWidth=e.minWidth),typeof e.style=="function"?a={...a,...e.style(e,t)}:e.style&&(a={...a,...e.style}),e.emit&&(a.cursor="pointer"),a},cellValue(e,t){return e.value?e.value(e,t):e.key?t[e.key]:t[e._id]},onHeaderClick(e){e.header?.emit&&this.$emit(e.header.emit,e)},onRecordClick(e,t){t.emit&&this.$emit(t.emit,e)},onHeaderEmit(e,t){this.$emit(...arguments)},onRecordEmit(e){this.$emit(...arguments)},onCellClick(e,t){t.emit&&this.$emit(t.emit,e,t)},scrollIntoView(e,t=!1){let a=this.records.findIndex(i=>i._id===e._id);if(a<0){console.warn("DataTable: record not found",e);return}const y=this.$el.querySelector("tbody");if(!y){console.warn("DataTable: tbody not found");return}const g=y.children[a];g.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"}),t&&this.$nextTick(()=>{let i=g.querySelectorAll("button, [href], input, select, textarea");i.length>0&&(i[0].select?i[0].select():i[0].focus&&i[0].focus())})}},watch:{records:{handler(){if(!this.records||!Array.isArray(this.records)){console.warn("DataTable: records must be an array");return}this.records.length>0&&this.records.some(e=>!e._id)&&console.warn("DataTable: records should have a unique _id property")},deep:!0}}},C={class:"DataTable theme-rounded-lg ring-1 ring-slate-900/10 bg-white"},m={key:0,class:"w-full max-w-inherit"},D={class:"overflow-y-auto overflow-x-auto max-h-inherit max-w-inherit h-full"},E={class:"px-4 sm:px-6 lg:px-8"},V={class:"flow-root"},W={class:"-mx-4 -my-2 sm:-mx-6 lg:-mx-8"},q={class:"inline-block min-w-full py-2 align-middle"},N={class:"min-w-full border-separate border-spacing-0"},B=["onClick"],H=["data-row-id"],z=["onClick"];function R(e,t,a,y,g,i){return l(),n("div",C,[e.$slots.header?(l(),n("div",m,[T(e.$slots,"header",{},void 0,!0)])):v("",!0),h("div",{class:x(["w-full overflow-hidden theme-rounded-b-lg max-h-inherit max-w-inherit grow h-auto",{"theme-rounded-t-lg":!e.$slots.header}])},[h("div",D,[h("div",E,[h("div",V,[h("div",W,[h("div",q,[h("table",N,[h("thead",null,[h("tr",null,[(l(!0),n(f,null,_(a.columns,(r,d)=>(l(),n("th",{key:r._id||d,scope:"col",class:x(["sticky top-0 border-b border-gray-300 bg-white bg-opacity-75 py-3.5 pl-4 pr-3 text-sm font-semibold text-gray-900 backdrop-blur backdrop-filter",{"sm:pl-6":d==0,"lg:pl-8":d==0,"sm:pr-8":d==a.columns.length-1,"lg:pr-8":d==a.columns.length-1,"text-left":i.headerTextAlign(r)=="left","text-center":i.headerTextAlign(r)=="center","text-right":i.headerTextAlign(r)=="right"}]),style:c(i.headerStyle(r)),onClick:s=>i.onHeaderClick(r)},[r.header?.component?(l(),b(p(r.header.component),{key:`${r._id||d}-header-component`,column:r,onEmit:i.onHeaderEmit},null,40,["column","onEmit"])):(l(),n(f,{key:1},[w(k(r.text),1)],64))],14,B))),128))])]),h("tbody",null,[(l(!0),n(f,null,_(a.records,(r,d)=>(l(),n("tr",{key:r._id||d,"data-row-id":r._id||d},[(l(!0),n(f,null,_(a.columns,(s,o)=>(l(),n("td",{key:s._id||o,class:x(["whitespace-nowrap border-b border-gray-200 px-3 py-4 text-sm",{"sm:pl-6":o==0,"lg:pl-8":o==0,"sm:pr-8":o==a.columns.length-1,"lg:pr-8":o==a.columns.length-1,"text-left":i.recordTextAlign(s,r)=="left","text-center":i.recordTextAlign(s,r)=="center","text-right":i.recordTextAlign(s,r)=="right","text-gray-500":i.recordTextStyle(s,r)=="gray","text-gray-900":i.recordTextStyle(s,r)=="dark","font-medium":i.recordTextStyle(s,r)=="dark"}]),style:c(i.recordStyle(s,r)),onClick:j=>i.onCellClick(r,s)},[s.component?(l(),b(p(s.component),u({key:`${r._id||d}-${s._id||o}`,id:`${r._id||d}-${s._id||o}`,index:d,column:s,record:r},{ref_for:!0},s.additionalProps||{},{onEmit:i.onRecordEmit}
1),null,16,["id","index","column","record","onEmit"])):(l(),n(f,{key:1},[w(k(i.cellValue(s,r)),1)],64))],14,z))),128))],8,H))),128))])])])])])])])],2)])}const P=Object.assign(A(S,[["render",R],["__scopeId","data-v-82df5238"]]),{__name:"DataTable"});export{P as _};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.