@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.mjs
CHANGED
|
@@ -28380,7 +28380,8 @@ function DataTable({
|
|
|
28380
28380
|
onSortChange,
|
|
28381
28381
|
onFilterChange,
|
|
28382
28382
|
onGlobalSearch,
|
|
28383
|
-
globalSearch
|
|
28383
|
+
globalSearch,
|
|
28384
|
+
onCellClick
|
|
28384
28385
|
}) {
|
|
28385
28386
|
const [columnFilters, setColumnFilters] = React7.useState([]);
|
|
28386
28387
|
const [columnVisibility, setColumnVisibility] = React7.useState({});
|
|
@@ -28593,7 +28594,24 @@ function DataTable({
|
|
|
28593
28594
|
] })
|
|
28594
28595
|
] }) }, header.id);
|
|
28595
28596
|
}) }, hg.id)) }),
|
|
28596
|
-
/* @__PURE__ */ jsx47(TableBody, { children: loading ? /* @__PURE__ */ jsx47(TableRow, { children: /* @__PURE__ */ jsx47(TableCell, { colSpan: columns.length, className: "h-24 text-center", children: "Loading..." }) }) : table.getRowModel().rows.length ? table.getRowModel().rows.map((row) => /* @__PURE__ */ jsx47(TableRow, { children: row.getVisibleCells().map((cell) =>
|
|
28597
|
+
/* @__PURE__ */ jsx47(TableBody, { children: loading ? /* @__PURE__ */ jsx47(TableRow, { children: /* @__PURE__ */ jsx47(TableCell, { colSpan: columns.length, className: "h-24 text-center", children: "Loading..." }) }) : table.getRowModel().rows.length ? table.getRowModel().rows.map((row) => /* @__PURE__ */ jsx47(TableRow, { children: row.getVisibleCells().map((cell) => {
|
|
28598
|
+
const meta = cell.column.columnDef.meta || {};
|
|
28599
|
+
const isClickable = meta?.isClickable;
|
|
28600
|
+
return /* @__PURE__ */ jsx47(
|
|
28601
|
+
TableCell,
|
|
28602
|
+
{
|
|
28603
|
+
className: `${meta?.cellClass ?? ""} ${isClickable ? "cursor-pointer hover:bg-gray-100 underline" : ""}`,
|
|
28604
|
+
style: meta?.cellStyle,
|
|
28605
|
+
onClick: () => {
|
|
28606
|
+
if (isClickable && onCellClick) {
|
|
28607
|
+
onCellClick(cell.row.original, cell.column.id);
|
|
28608
|
+
}
|
|
28609
|
+
},
|
|
28610
|
+
children: flexRender(cell.column.columnDef.cell, cell.getContext())
|
|
28611
|
+
},
|
|
28612
|
+
cell.id
|
|
28613
|
+
);
|
|
28614
|
+
}) }, row.id)) : /* @__PURE__ */ jsx47(TableRow, { children: /* @__PURE__ */ jsx47(TableCell, { colSpan: columns.length, className: "h-24 text-center", children: "No results." }) }) })
|
|
28597
28615
|
] }),
|
|
28598
28616
|
pagination && /* @__PURE__ */ jsxs26("div", { className: "flex items-center justify-between py-3 px-2 text-sm w-full", children: [
|
|
28599
28617
|
/* @__PURE__ */ jsxs26("div", { children: [
|