| 1 |
import{j as t}from"./tanstack-1.0.83-vdxW-z_W.js";import{r as c}from"./redux-1.0.83-C_HljLTP.js";import{B as u}from"./Box-1.0.83-Cqg2aQ6v.js";import"./vendor-1.0.83-CN03Eozo.js";import"./CircularProgress-1.0.83-C7us6xSc.js";import"./lib-1.0.83-DP604-fF.js";import"./utils-1.0.83-DdPZyaQg.js";import"./Typography-1.0.83-RUNWFUSq.js";const T=c.memo(({queryResults:r})=>{var p,b,i;const s=(e,o,d)=>{const n=o[d]===null?"pp-data-value-null":"";return t.jsx("td",{className:n,children:o[d]},e+d)},l=((p=r==null?void 0:r.status)==null?void 0:p.last_result)??((b=r==null?void 0:r.wpdavar)==null?void 0:b.data);let a=((i=r==null?void 0:r.columns)==null?void 0:i.map(e=>e.Field))??null;return a===null&&Array.isArray(l)&&l.length>0&&(a=Object.keys(l[0])),t.jsx(u,{className:"pp-result-table-container",sx:{borderTopLeftRadius:"4px",borderTopRightRadius:"4px",backgroundColor:"#fff","& table.pp-sql-query-builder-table":{width:"100%",marginBottom:"0 !important",border:"none",borderCollapse:"collapse",borderTopLeftRadius:"4px",borderTopRightRadius:"4px",borderBottomLeftRadius:0,borderBottomRightRadius:0},"& table.pp-sql-query-builder-table thead":{display:"block",overflowY:"scroll",backgroundColor:"#f0f0f1",borderTopLeftRadius:"4px",borderTopRightRadius:"4px",borderBottomLeftRadius:0,borderBottomRightRadius:0},"& table.pp-sql-query-builder-table thead::-webkit-scrollbar":{borderTopRightRadius:"4px"},"& table.pp-sql-query-builder-table tbody":{display:"block",overflowY:"scroll",height:"240px",borderTop:"1px solid #ccc",backgroundColor:"#fff"},"& table.pp-sql-query-builder-table tr":{width:"calc(100% - 1px)",display:"table",tableLayout:"fixed"},"& table.pp-sql-query-builder-table tbody tr:hover":{backgroundColor:"#f5f5f5"},"& table.pp-sql-query-builder-table thead tr th":{borderRight:"1px dotted #ccc",height:"17px",lineHeight:"17px"},"& table.pp-sql-query-builder-table tbody tr td":{borderRight:"1px dotted #ccc",borderBottom:"1px dotted #ccc",borderLeft:0},"& table.pp-sql-query-builder-table tbody tr:first-of-type td":{borderTop:0},"& table.pp-sql-query-builder-table thead tr th, & table.pp-sql-query-builder-table tbody tr td":{overflowWrap:"anywhere",textAlign:"left",padding:"6px"},"& table.pp-sql-query-builder-table tbody td.pp-data-value-null":{fontStyle:"italic",color:"#2271b1"},"& table.pp-sql-query-builder-table tbody td.pp-data-value-null:before":{content:'"(null)"'}},children:l&&Array.isArray(l)&&t.jsxs("table",{className:"pp-sql-query-builder-table",children:[t.jsx("thead",{children:t.jsx("tr",{children:Array.isArray(a)&&a.length>0?t.jsx(t.Fragment,{children:a.map(e=>t.jsx("th",{children:e},e))}):t.jsx("th",{})},"header")}),t.jsx("tbody",{children:l.map((e,o)=>t.jsx("tr",{children:a.map(d=>s(o,e,d))},o))})]})})});export{T as default}; |