@moontra/moonui-pro 2.26.47 → 2.26.49
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.global.js +69 -69
- package/dist/index.global.js.map +1 -1
- package/dist/index.mjs +9 -8
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -73990,13 +73990,16 @@ function DataTable({
|
|
|
73990
73990
|
}
|
|
73991
73991
|
};
|
|
73992
73992
|
};
|
|
73993
|
-
const
|
|
73993
|
+
const tableRef = t__default.useRef(null);
|
|
73994
|
+
const handleRowSelectionChange = t__default.useCallback((updater) => {
|
|
73995
|
+
const newSelection = typeof updater === "function" ? updater(rowSelection) : updater;
|
|
73994
73996
|
setRowSelection(newSelection);
|
|
73995
|
-
if (onRowSelect) {
|
|
73996
|
-
const
|
|
73997
|
+
if (onRowSelect && tableRef.current) {
|
|
73998
|
+
const selectedRowIds = Object.keys(newSelection).filter((key) => newSelection[key]);
|
|
73999
|
+
const selectedRows = tableRef.current.getRowModel().rows.filter((row) => selectedRowIds.includes(row.id)).map((row) => row.original);
|
|
73997
74000
|
onRowSelect(selectedRows);
|
|
73998
74001
|
}
|
|
73999
|
-
}, [
|
|
74002
|
+
}, [rowSelection, onRowSelect]);
|
|
74000
74003
|
const processedColumns = t__default.useMemo(() => {
|
|
74001
74004
|
let cols = columns.map((col) => {
|
|
74002
74005
|
if (!col.id && col.accessorKey) {
|
|
@@ -74057,10 +74060,7 @@ function DataTable({
|
|
|
74057
74060
|
sortDescFirst: false,
|
|
74058
74061
|
// First click should be ascending
|
|
74059
74062
|
onColumnVisibilityChange: setColumnVisibility,
|
|
74060
|
-
onRowSelectionChange:
|
|
74061
|
-
const newSelection = typeof updater === "function" ? updater(rowSelection) : updater;
|
|
74062
|
-
handleRowSelectionChange(newSelection);
|
|
74063
|
-
},
|
|
74063
|
+
onRowSelectionChange: handleRowSelectionChange,
|
|
74064
74064
|
onGlobalFilterChange: setGlobalFilter,
|
|
74065
74065
|
globalFilterFn: "includesString",
|
|
74066
74066
|
enableRowSelection: selectable || enableRowSelection || false,
|
|
@@ -74164,6 +74164,7 @@ function DataTable({
|
|
|
74164
74164
|
return String(index2);
|
|
74165
74165
|
}
|
|
74166
74166
|
});
|
|
74167
|
+
tableRef.current = table;
|
|
74167
74168
|
table.getState();
|
|
74168
74169
|
const rowModel = table.getRowModel();
|
|
74169
74170
|
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.
|
|
3
|
+
"version": "2.26.49",
|
|
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",
|