@moontra/moonui-pro 2.26.39 → 2.26.41
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 +34 -34
- package/dist/index.global.js.map +1 -1
- package/dist/index.mjs +14 -11
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -73972,6 +73972,14 @@ 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
|
+
setTimeout(() => {
|
|
73979
|
+
onRowSelect(selectedRows);
|
|
73980
|
+
}, 0);
|
|
73981
|
+
}
|
|
73982
|
+
}, [rowSelection, stableData, onRowSelect]);
|
|
73975
73983
|
const createSortingHandler = (columnId) => {
|
|
73976
73984
|
return () => {
|
|
73977
73985
|
const currentSorting = externalState?.sorting ?? sorting;
|
|
@@ -74001,15 +74009,11 @@ function DataTable({
|
|
|
74001
74009
|
const checkboxColumn = {
|
|
74002
74010
|
id: "select",
|
|
74003
74011
|
header: ({ table: table2 }) => {
|
|
74004
|
-
const isAllSelected = table2.getIsAllPageRowsSelected();
|
|
74005
|
-
const isSomeSelected = table2.getIsSomePageRowsSelected();
|
|
74006
74012
|
return /* @__PURE__ */ jsx("div", { className: "flex items-center justify-center", children: /* @__PURE__ */ jsx(
|
|
74007
74013
|
MoonUICheckboxPro,
|
|
74008
74014
|
{
|
|
74009
|
-
checked:
|
|
74010
|
-
onCheckedChange: (value) =>
|
|
74011
|
-
table2.toggleAllPageRowsSelected(!!value);
|
|
74012
|
-
},
|
|
74015
|
+
checked: table2.getIsAllPageRowsSelected() || table2.getIsSomePageRowsSelected() && "indeterminate",
|
|
74016
|
+
onCheckedChange: (value) => table2.toggleAllPageRowsSelected(!!value),
|
|
74013
74017
|
"aria-label": "Select all",
|
|
74014
74018
|
className: "h-4 w-4"
|
|
74015
74019
|
}
|
|
@@ -74020,9 +74024,7 @@ function DataTable({
|
|
|
74020
74024
|
MoonUICheckboxPro,
|
|
74021
74025
|
{
|
|
74022
74026
|
checked: row.getIsSelected(),
|
|
74023
|
-
onCheckedChange: (value) =>
|
|
74024
|
-
row.toggleSelected(!!value);
|
|
74025
|
-
},
|
|
74027
|
+
onCheckedChange: (value) => row.toggleSelected(!!value),
|
|
74026
74028
|
disabled: !row.getCanSelect(),
|
|
74027
74029
|
"aria-label": "Select row",
|
|
74028
74030
|
className: "h-4 w-4"
|
|
@@ -74154,10 +74156,11 @@ function DataTable({
|
|
|
74154
74156
|
});
|
|
74155
74157
|
t__default.useEffect(() => {
|
|
74156
74158
|
if (onRowSelect && selectable) {
|
|
74157
|
-
const
|
|
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);
|
|
74158
74161
|
onRowSelect(selectedRows);
|
|
74159
74162
|
}
|
|
74160
|
-
}, [rowSelection]);
|
|
74163
|
+
}, [rowSelection, onRowSelect, selectable]);
|
|
74161
74164
|
table.getState();
|
|
74162
74165
|
const rowModel = table.getRowModel();
|
|
74163
74166
|
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.41",
|
|
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",
|