@moontra/moonui-pro 2.26.44 → 2.26.45

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
@@ -73972,12 +73972,6 @@ function DataTable({
73972
73972
  const expandedRows = controlledExpandedRows || internalExpandedRows;
73973
73973
  const actualPageSize = defaultPageSize || pageSize;
73974
73974
  const stableData = t__default.useMemo(() => data, [data]);
73975
- t__default.useEffect(() => {
73976
- if (onRowSelect) {
73977
- const selectedRows = Object.keys(rowSelection).filter((key) => rowSelection[key]).map((index2) => stableData[parseInt(index2)]).filter(Boolean);
73978
- onRowSelect(selectedRows);
73979
- }
73980
- }, [rowSelection, stableData, onRowSelect]);
73981
73975
  const createSortingHandler = (columnId) => {
73982
73976
  return () => {
73983
73977
  const currentSorting = externalState?.sorting ?? sorting;
@@ -74023,6 +74017,10 @@ function DataTable({
74023
74017
  });
74024
74018
  }
74025
74019
  setRowSelection(newSelection);
74020
+ if (onRowSelect) {
74021
+ const selectedRows = value ? allRows.map((row) => row.original) : [];
74022
+ setTimeout(() => onRowSelect(selectedRows), 0);
74023
+ }
74026
74024
  },
74027
74025
  "aria-label": "Select all",
74028
74026
  className: "h-4 w-4"
@@ -74037,10 +74035,15 @@ function DataTable({
74037
74035
  {
74038
74036
  checked: isChecked,
74039
74037
  onCheckedChange: (value) => {
74040
- setRowSelection((prev) => ({
74041
- ...prev,
74038
+ const newSelection = {
74039
+ ...rowSelection,
74042
74040
  [rowIndex]: !!value
74043
- }));
74041
+ };
74042
+ setRowSelection(newSelection);
74043
+ if (onRowSelect) {
74044
+ const selectedRows = Object.keys(newSelection).filter((key) => newSelection[key]).map((index2) => stableData[parseInt(index2)]).filter(Boolean);
74045
+ setTimeout(() => onRowSelect(selectedRows), 0);
74046
+ }
74044
74047
  },
74045
74048
  "aria-label": "Select row",
74046
74049
  className: "h-4 w-4"
@@ -74055,7 +74058,7 @@ function DataTable({
74055
74058
  cols = [checkboxColumn, ...cols];
74056
74059
  }
74057
74060
  return cols;
74058
- }, [columns, selectable, enableRowSelection, rowSelection, setRowSelection]);
74061
+ }, [columns, selectable, enableRowSelection, rowSelection, setRowSelection, stableData, onRowSelect]);
74059
74062
  const table = useReactTable({
74060
74063
  data: stableData,
74061
74064
  columns: processedColumns,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moontra/moonui-pro",
3
- "version": "2.26.44",
3
+ "version": "2.26.45",
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",
@@ -81,6 +81,7 @@
81
81
  "react-dom": ">=18.0.0 || ^19.0.0"
82
82
  },
83
83
  "dependencies": {
84
+ "@moontra/moonui-pro": "^2.26.44",
84
85
  "@radix-ui/react-accordion": "^1.2.11",
85
86
  "@radix-ui/react-avatar": "^1.1.10",
86
87
  "@radix-ui/react-checkbox": "^1.3.2",