@moontra/moonui-pro 2.26.29 → 2.26.31

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
@@ -74000,31 +74000,50 @@ function DataTable({
74000
74000
  if (selectable || enableRowSelection) {
74001
74001
  const checkboxColumn = {
74002
74002
  id: "select",
74003
- header: ({ table: table2 }) => /* @__PURE__ */ jsx("div", { className: "flex items-center justify-center", children: /* @__PURE__ */ jsx(
74004
- "input",
74005
- {
74006
- type: "checkbox",
74007
- checked: table2.getIsAllPageRowsSelected(),
74008
- ref: (el) => {
74009
- if (el) {
74010
- el.indeterminate = !table2.getIsAllPageRowsSelected() && table2.getIsSomePageRowsSelected();
74011
- }
74012
- },
74013
- onChange: (e) => table2.toggleAllPageRowsSelected(e.target.checked),
74014
- "aria-label": "Select all",
74015
- className: "h-4 w-4 rounded border-input bg-background text-primary focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50"
74016
- }
74017
- ) }),
74018
- cell: ({ row }) => /* @__PURE__ */ jsx("div", { className: "flex items-center justify-center", children: /* @__PURE__ */ jsx(
74019
- "input",
74020
- {
74021
- type: "checkbox",
74022
- checked: row.getIsSelected(),
74023
- onChange: (e) => row.toggleSelected(e.target.checked),
74024
- "aria-label": "Select row",
74025
- className: "h-4 w-4 rounded border-input bg-background text-primary focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50"
74026
- }
74027
- ) }),
74003
+ header: ({ table: table2 }) => {
74004
+ const isAllSelected = table2.getIsAllPageRowsSelected();
74005
+ const isSomeSelected = table2.getIsSomePageRowsSelected();
74006
+ return /* @__PURE__ */ jsx("div", { className: "flex items-center justify-center", children: /* @__PURE__ */ jsx(
74007
+ "input",
74008
+ {
74009
+ type: "checkbox",
74010
+ checked: isAllSelected,
74011
+ ref: (el) => {
74012
+ if (el) {
74013
+ el.indeterminate = !isAllSelected && isSomeSelected;
74014
+ }
74015
+ },
74016
+ onChange: (e) => {
74017
+ table2.toggleAllPageRowsSelected(e.target.checked);
74018
+ },
74019
+ onClick: (e) => {
74020
+ e.stopPropagation();
74021
+ },
74022
+ "aria-label": "Select all",
74023
+ className: "h-4 w-4 rounded border-input bg-background text-primary focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 accent-primary",
74024
+ style: { accentColor: "hsl(var(--primary))" }
74025
+ }
74026
+ ) });
74027
+ },
74028
+ cell: ({ row }) => {
74029
+ const isSelected = row.getIsSelected();
74030
+ return /* @__PURE__ */ jsx("div", { className: "flex items-center justify-center", children: /* @__PURE__ */ jsx(
74031
+ "input",
74032
+ {
74033
+ type: "checkbox",
74034
+ checked: isSelected,
74035
+ onChange: (e) => {
74036
+ row.toggleSelected(e.target.checked);
74037
+ },
74038
+ onClick: (e) => {
74039
+ e.stopPropagation();
74040
+ },
74041
+ "aria-label": "Select row",
74042
+ className: "h-4 w-4 rounded border-input bg-background text-primary focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 accent-primary",
74043
+ style: { accentColor: "hsl(var(--primary))" }
74044
+ }
74045
+ ) });
74046
+ },
74028
74047
  enableSorting: false,
74029
74048
  enableHiding: false,
74030
74049
  size: 40,
@@ -74055,6 +74074,12 @@ function DataTable({
74055
74074
  onRowSelectionChange: (updater) => {
74056
74075
  const newSelection = typeof updater === "function" ? updater(rowSelection) : updater;
74057
74076
  setRowSelection(newSelection);
74077
+ if (onRowSelect && selectable) {
74078
+ setTimeout(() => {
74079
+ const selectedRows = table.getFilteredSelectedRowModel().rows.map((row) => row.original);
74080
+ onRowSelect(selectedRows);
74081
+ }, 0);
74082
+ }
74058
74083
  },
74059
74084
  onGlobalFilterChange: setGlobalFilter,
74060
74085
  globalFilterFn: "includesString",
@@ -74150,12 +74175,6 @@ function DataTable({
74150
74175
  return rowData.id || rowData.orderId || rowData.orderNumber || `row-${index2}`;
74151
74176
  }
74152
74177
  });
74153
- t__default.useEffect(() => {
74154
- if (!onRowSelect || !selectable)
74155
- return;
74156
- const selectedRows = table.getFilteredSelectedRowModel().rows.map((row) => row.original);
74157
- onRowSelect(selectedRows);
74158
- }, [rowSelection]);
74159
74178
  table.getState();
74160
74179
  const rowModel = table.getRowModel();
74161
74180
  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.29",
3
+ "version": "2.26.31",
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",