@moontra/moonui-pro 2.26.30 → 2.26.32

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.mjs CHANGED
@@ -74027,12 +74027,15 @@ function DataTable({
74027
74027
  },
74028
74028
  cell: ({ row }) => {
74029
74029
  const isSelected = row.getIsSelected();
74030
+ const rowId = row.id;
74031
+ console.log(`Row ${rowId}: isSelected=${isSelected}, rowSelection:`, rowSelection);
74030
74032
  return /* @__PURE__ */ jsx("div", { className: "flex items-center justify-center", children: /* @__PURE__ */ jsx(
74031
74033
  "input",
74032
74034
  {
74033
74035
  type: "checkbox",
74034
74036
  checked: isSelected,
74035
74037
  onChange: (e) => {
74038
+ console.log(`Toggling row ${rowId} to ${e.target.checked}`);
74036
74039
  row.toggleSelected(e.target.checked);
74037
74040
  },
74038
74041
  onClick: (e) => {
@@ -74052,7 +74055,7 @@ function DataTable({
74052
74055
  cols = [checkboxColumn, ...cols];
74053
74056
  }
74054
74057
  return cols;
74055
- }, [columns, selectable, enableRowSelection]);
74058
+ }, [columns, selectable, enableRowSelection, rowSelection]);
74056
74059
  const table = useReactTable({
74057
74060
  data: stableData,
74058
74061
  columns: processedColumns,
@@ -74074,6 +74077,12 @@ function DataTable({
74074
74077
  onRowSelectionChange: (updater) => {
74075
74078
  const newSelection = typeof updater === "function" ? updater(rowSelection) : updater;
74076
74079
  setRowSelection(newSelection);
74080
+ if (onRowSelect && selectable) {
74081
+ setTimeout(() => {
74082
+ const selectedRows = table.getFilteredSelectedRowModel().rows.map((row) => row.original);
74083
+ onRowSelect(selectedRows);
74084
+ }, 0);
74085
+ }
74077
74086
  },
74078
74087
  onGlobalFilterChange: setGlobalFilter,
74079
74088
  globalFilterFn: "includesString",
@@ -74169,12 +74178,6 @@ function DataTable({
74169
74178
  return rowData.id || rowData.orderId || rowData.orderNumber || `row-${index2}`;
74170
74179
  }
74171
74180
  });
74172
- t__default.useEffect(() => {
74173
- if (!onRowSelect || !selectable)
74174
- return;
74175
- const selectedRows = table.getFilteredSelectedRowModel().rows.map((row) => row.original);
74176
- onRowSelect(selectedRows);
74177
- }, [rowSelection]);
74178
74181
  table.getState();
74179
74182
  const rowModel = table.getRowModel();
74180
74183
  const rowsRef = t__default.useRef(rowModel.rows);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moontra/moonui-pro",
3
- "version": "2.26.30",
3
+ "version": "2.26.32",
4
4
  "description": "Premium React components for MoonUI - Advanced UI library with 50+ pro components including performance, interactive, and gesture components",
5
5
  "type": "module",
6
6
  "main": "dist/index.mjs",