@moontra/moonui-pro 2.26.46 → 2.26.48

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
@@ -73990,13 +73990,15 @@ function DataTable({
73990
73990
  }
73991
73991
  };
73992
73992
  };
73993
+ const tableRef = t__default.useRef(null);
73993
73994
  const handleRowSelectionChange = t__default.useCallback((newSelection) => {
73994
73995
  setRowSelection(newSelection);
73995
- if (onRowSelect) {
73996
- const selectedRows = Object.keys(newSelection).filter((key) => newSelection[key]).map((index2) => stableData[parseInt(index2)]).filter(Boolean);
73997
- setTimeout(() => onRowSelect(selectedRows), 0);
73996
+ if (onRowSelect && tableRef.current) {
73997
+ const selectedRowIds = Object.keys(newSelection).filter((key) => newSelection[key]);
73998
+ const selectedRows = tableRef.current.getRowModel().rows.filter((row) => selectedRowIds.includes(row.id)).map((row) => row.original);
73999
+ onRowSelect(selectedRows);
73998
74000
  }
73999
- }, [stableData, onRowSelect]);
74001
+ }, [onRowSelect]);
74000
74002
  const processedColumns = t__default.useMemo(() => {
74001
74003
  let cols = columns.map((col) => {
74002
74004
  if (!col.id && col.accessorKey) {
@@ -74151,16 +74153,20 @@ function DataTable({
74151
74153
  autoResetExpanded: false,
74152
74154
  getRowId: (row, index2) => {
74153
74155
  const rowData = row;
74154
- return rowData.id || rowData.orderId || rowData.orderNumber || `row-${index2}`;
74156
+ if (rowData.id)
74157
+ return String(rowData.id);
74158
+ if (rowData.orderId)
74159
+ return String(rowData.orderId);
74160
+ if (rowData.orderNumber)
74161
+ return String(rowData.orderNumber);
74162
+ if (rowData.email)
74163
+ return `email-${rowData.email}`;
74164
+ if (rowData.name)
74165
+ return `name-${rowData.name}-${index2}`;
74166
+ return String(index2);
74155
74167
  }
74156
74168
  });
74157
- t__default.useEffect(() => {
74158
- if (onRowSelect && selectable) {
74159
- const selectedRowIds = Object.keys(rowSelection).filter((id) => rowSelection[id]);
74160
- const selectedRows = table.getRowModel().rows.filter((row) => selectedRowIds.includes(row.id)).map((row) => row.original);
74161
- onRowSelect(selectedRows);
74162
- }
74163
- }, [rowSelection, onRowSelect, selectable]);
74169
+ tableRef.current = table;
74164
74170
  table.getState();
74165
74171
  const rowModel = table.getRowModel();
74166
74172
  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.46",
3
+ "version": "2.26.48",
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,7 +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
+ "@moontra/moonui-pro": "^2.26.46",
85
85
  "@radix-ui/react-accordion": "^1.2.11",
86
86
  "@radix-ui/react-avatar": "^1.1.10",
87
87
  "@radix-ui/react-checkbox": "^1.3.2",