synapse-react-client
Version:
[](https://badge.fury.io/js/synapse-react-client) [](https://github.com/prettier/prettie
49 lines (48 loc) • 1.86 kB
JavaScript
import { jsx as l, jsxs as x } from "react/jsx-runtime";
import { StyledTableContainer as L } from "../styled/StyledTableContainer.js";
import { SynapseCardLabel as b } from "../GenericCard/SynapseCardLabel.js";
import "../GenericCard/GenericCard.js";
import "react";
import "../Markdown/MarkdownSynapse.js";
import "@mui/material";
import "../../utils/functions/EntityTypeUtils.js";
import "../../utils/SynapseConstants.js";
import "@sage-bionetworks/synapse-types";
const D = (m) => {
const { columnAliases: c, columnLinks: p, headers: e, rowData: o, displayedColumns: r } = m, a = r ? e.filter((t) => r.includes(t.name)).map((t) => t.name) : e.map((t) => t.name), d = [];
for (let t = 0; t < a.length; t += 1) {
const s = a[t], i = e.findIndex((y) => y.name === s), n = i !== -1 ? o[i] : void 0, u = e[i], h = n === "null", f = u.columnType.endsWith("_LIST");
typeof n == "string" && !(h || f && (n === "[]" || n === "[null]")) && d.push([s, n]);
}
return /* @__PURE__ */ l(L, { sx: { width: "100%" }, children: /* @__PURE__ */ l("table", { style: { width: "100%" }, children: /* @__PURE__ */ l("tbody", { children: d?.map(([t, s]) => /* @__PURE__ */ x("tr", { children: [
/* @__PURE__ */ l("td", { style: { width: "256px" }, children: /* @__PURE__ */ l(
"span",
{
style: {
fontSize: "14px",
lineHeight: "20px",
color: "#333"
},
children: c?.[t] ?? t
}
) }),
/* @__PURE__ */ l("td", { children: /* @__PURE__ */ l(
b,
{
value: s,
columnName: t,
labelLink: p?.find(
(i) => i.matchColumnName === t
),
selectColumns: e,
columnModels: void 0,
isHeader: !1,
rowData: o
}
) })
] }, t)) }) }) });
};
export {
D as default
};
//# sourceMappingURL=RowDataTable.js.map