@moontra/moonui-pro 2.26.22 → 2.26.24

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
@@ -74001,26 +74001,27 @@ function DataTable({
74001
74001
  const checkboxColumn = {
74002
74002
  id: "select",
74003
74003
  header: ({ table: table2 }) => /* @__PURE__ */ jsx(
74004
- "input",
74004
+ MoonUICheckboxPro,
74005
74005
  {
74006
- type: "checkbox",
74007
- checked: table2.getIsAllPageRowsSelected(),
74008
- onChange: (e) => table2.toggleAllPageRowsSelected(e.target.checked),
74009
- className: "h-4 w-4 rounded border-gray-300 text-primary focus:ring-primary"
74006
+ checked: table2.getIsAllPageRowsSelected() || table2.getIsSomePageRowsSelected() && "indeterminate",
74007
+ onCheckedChange: (value) => table2.toggleAllPageRowsSelected(!!value),
74008
+ "aria-label": "Select all",
74009
+ className: "translate-y-[2px]"
74010
74010
  }
74011
74011
  ),
74012
74012
  cell: ({ row }) => /* @__PURE__ */ jsx(
74013
- "input",
74013
+ MoonUICheckboxPro,
74014
74014
  {
74015
- type: "checkbox",
74016
74015
  checked: row.getIsSelected(),
74017
- onChange: (e) => row.toggleSelected(e.target.checked),
74018
- className: "h-4 w-4 rounded border-gray-300 text-primary focus:ring-primary"
74016
+ onCheckedChange: (value) => row.toggleSelected(!!value),
74017
+ "aria-label": "Select row",
74018
+ className: "translate-y-[2px]"
74019
74019
  }
74020
74020
  ),
74021
74021
  enableSorting: false,
74022
74022
  enableHiding: false,
74023
- size: 32
74023
+ size: 40,
74024
+ maxSize: 40
74024
74025
  };
74025
74026
  cols = [checkboxColumn, ...cols];
74026
74027
  }
@@ -74135,12 +74136,14 @@ function DataTable({
74135
74136
  autoResetExpanded: false,
74136
74137
  getRowId: (row) => row.id || row.orderId || Math.random().toString()
74137
74138
  });
74139
+ const prevRowSelectionRef = t__default.useRef(rowSelection);
74138
74140
  t__default.useEffect(() => {
74139
- if (onRowSelect && selectable) {
74141
+ if (onRowSelect && selectable && prevRowSelectionRef.current !== rowSelection) {
74142
+ prevRowSelectionRef.current = rowSelection;
74140
74143
  const selectedRows = table.getFilteredSelectedRowModel().rows.map((row) => row.original);
74141
74144
  onRowSelect(selectedRows);
74142
74145
  }
74143
- }, [rowSelection, onRowSelect, selectable, table]);
74146
+ }, [rowSelection, selectable]);
74144
74147
  table.getState();
74145
74148
  const rowModel = table.getRowModel();
74146
74149
  const rowsRef = t__default.useRef(rowModel.rows);
@@ -74195,8 +74198,8 @@ function DataTable({
74195
74198
  table.resetRowSelection();
74196
74199
  };
74197
74200
  return /* @__PURE__ */ jsxs("div", { className: cn("moonui-pro-datatable-container flex flex-col gap-4", className), children: [
74198
- /* @__PURE__ */ jsxs("div", { className: "moonui-pro-datatable-toolbar flex items-center justify-between", children: [
74199
- /* @__PURE__ */ jsxs("div", { className: "flex items-center space-x-2", children: [
74201
+ /* @__PURE__ */ jsxs("div", { className: "moonui-pro-datatable-toolbar flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between", children: [
74202
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center gap-2", children: [
74200
74203
  searchable && /* @__PURE__ */ jsxs("div", { className: "relative", children: [
74201
74204
  /* @__PURE__ */ jsx("span", { suppressHydrationWarning: true, children: /* @__PURE__ */ jsx(Search, { className: "absolute left-2 top-2.5 h-4 w-4 text-muted-foreground" }) }),
74202
74205
  /* @__PURE__ */ jsx(
@@ -74205,7 +74208,7 @@ function DataTable({
74205
74208
  placeholder: filterPlaceholder,
74206
74209
  value: globalFilter,
74207
74210
  onChange: (e) => setGlobalFilter(e.target.value),
74208
- className: "pl-8 w-64"
74211
+ className: "pl-8 w-full sm:w-64"
74209
74212
  }
74210
74213
  )
74211
74214
  ] }),
@@ -74254,7 +74257,7 @@ function DataTable({
74254
74257
  }
74255
74258
  )
74256
74259
  ] }),
74257
- /* @__PURE__ */ jsxs("div", { className: "flex items-center space-x-2", children: [
74260
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center gap-2", children: [
74258
74261
  exportable && exportFormats.length > 0 && /* @__PURE__ */ jsxs(MoonUIDropdownMenuPro, { children: [
74259
74262
  /* @__PURE__ */ jsx(MoonUIDropdownMenuTriggerPro, { asChild: true, children: /* @__PURE__ */ jsxs(MoonUIButtonPro, { variant: "outline", size: "sm", children: [
74260
74263
  /* @__PURE__ */ jsx("span", { suppressHydrationWarning: true, children: /* @__PURE__ */ jsx(Download, { className: "mr-2 h-4 w-4" }) }),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moontra/moonui-pro",
3
- "version": "2.26.22",
3
+ "version": "2.26.24",
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",