@algorithm-shift/design-system 1.2.72 → 1.2.73
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +20 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +20 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -28469,7 +28469,8 @@ function DataTable({
|
|
|
28469
28469
|
onSortChange,
|
|
28470
28470
|
onFilterChange,
|
|
28471
28471
|
onGlobalSearch,
|
|
28472
|
-
globalSearch
|
|
28472
|
+
globalSearch,
|
|
28473
|
+
onCellClick
|
|
28473
28474
|
}) {
|
|
28474
28475
|
const [columnFilters, setColumnFilters] = React7.useState([]);
|
|
28475
28476
|
const [columnVisibility, setColumnVisibility] = React7.useState({});
|
|
@@ -28682,7 +28683,24 @@ function DataTable({
|
|
|
28682
28683
|
] })
|
|
28683
28684
|
] }) }, header.id);
|
|
28684
28685
|
}) }, hg.id)) }),
|
|
28685
|
-
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(TableBody, { children: loading ? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(TableRow, { children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(TableCell, { colSpan: columns.length, className: "h-24 text-center", children: "Loading..." }) }) : table.getRowModel().rows.length ? table.getRowModel().rows.map((row) => /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(TableRow, { children: row.getVisibleCells().map((cell) =>
|
|
28686
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(TableBody, { children: loading ? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(TableRow, { children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(TableCell, { colSpan: columns.length, className: "h-24 text-center", children: "Loading..." }) }) : table.getRowModel().rows.length ? table.getRowModel().rows.map((row) => /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(TableRow, { children: row.getVisibleCells().map((cell) => {
|
|
28687
|
+
const meta = cell.column.columnDef.meta || {};
|
|
28688
|
+
const isClickable = meta?.isClickable;
|
|
28689
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
28690
|
+
TableCell,
|
|
28691
|
+
{
|
|
28692
|
+
className: `${meta?.cellClass ?? ""} ${isClickable ? "cursor-pointer hover:bg-gray-100 underline" : ""}`,
|
|
28693
|
+
style: meta?.cellStyle,
|
|
28694
|
+
onClick: () => {
|
|
28695
|
+
if (isClickable && onCellClick) {
|
|
28696
|
+
onCellClick(cell.row.original, cell.column.id);
|
|
28697
|
+
}
|
|
28698
|
+
},
|
|
28699
|
+
children: (0, import_react_table.flexRender)(cell.column.columnDef.cell, cell.getContext())
|
|
28700
|
+
},
|
|
28701
|
+
cell.id
|
|
28702
|
+
);
|
|
28703
|
+
}) }, row.id)) : /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(TableRow, { children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(TableCell, { colSpan: columns.length, className: "h-24 text-center", children: "No results." }) }) })
|
|
28686
28704
|
] }),
|
|
28687
28705
|
pagination && /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { className: "flex items-center justify-between py-3 px-2 text-sm w-full", children: [
|
|
28688
28706
|
/* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { children: [
|