@moontra/moonui-pro 2.26.25 → 2.26.27

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
@@ -74009,15 +74009,25 @@ function DataTable({
74009
74009
  className: "translate-y-[2px]"
74010
74010
  }
74011
74011
  ),
74012
- cell: ({ row }) => /* @__PURE__ */ jsx(
74013
- MoonUICheckboxPro,
74014
- {
74015
- checked: row.getIsSelected(),
74016
- onCheckedChange: (value) => row.toggleSelected(!!value),
74017
- "aria-label": "Select row",
74018
- className: "translate-y-[2px]"
74012
+ cell: ({ row }) => {
74013
+ const isSelected = row.getIsSelected();
74014
+ if (typeof window !== "undefined" && true) {
74015
+ console.log("Row selection state:", {
74016
+ rowId: row.id,
74017
+ isSelected,
74018
+ rowSelectionState: table.getState().rowSelection
74019
+ });
74019
74020
  }
74020
- ),
74021
+ return /* @__PURE__ */ jsx(
74022
+ MoonUICheckboxPro,
74023
+ {
74024
+ checked: isSelected,
74025
+ onCheckedChange: (value) => row.toggleSelected(!!value),
74026
+ "aria-label": "Select row",
74027
+ className: "translate-y-[2px]"
74028
+ }
74029
+ );
74030
+ },
74021
74031
  enableSorting: false,
74022
74032
  enableHiding: false,
74023
74033
  size: 40,
@@ -74045,7 +74055,10 @@ function DataTable({
74045
74055
  sortDescFirst: false,
74046
74056
  // First click should be ascending
74047
74057
  onColumnVisibilityChange: setColumnVisibility,
74048
- onRowSelectionChange: setRowSelection,
74058
+ onRowSelectionChange: (updater) => {
74059
+ const newSelection = typeof updater === "function" ? updater(rowSelection) : updater;
74060
+ setRowSelection(newSelection);
74061
+ },
74049
74062
  onGlobalFilterChange: setGlobalFilter,
74050
74063
  globalFilterFn: "includesString",
74051
74064
  enableRowSelection: selectable || enableRowSelection || false,
@@ -74140,14 +74153,12 @@ function DataTable({
74140
74153
  return rowData.id || rowData.orderId || rowData.orderNumber || `row-${index2}`;
74141
74154
  }
74142
74155
  });
74143
- const prevRowSelectionRef = t__default.useRef(rowSelection);
74144
74156
  t__default.useEffect(() => {
74145
- if (onRowSelect && selectable && prevRowSelectionRef.current !== rowSelection) {
74146
- prevRowSelectionRef.current = rowSelection;
74147
- const selectedRows = table.getFilteredSelectedRowModel().rows.map((row) => row.original);
74148
- onRowSelect(selectedRows);
74149
- }
74150
- }, [rowSelection, selectable]);
74157
+ if (!onRowSelect || !selectable)
74158
+ return;
74159
+ const selectedRows = table.getFilteredSelectedRowModel().rows.map((row) => row.original);
74160
+ onRowSelect(selectedRows);
74161
+ }, [rowSelection]);
74151
74162
  table.getState();
74152
74163
  const rowModel = table.getRowModel();
74153
74164
  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.25",
3
+ "version": "2.26.27",
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",