@moontra/moonui-pro 2.25.5 → 2.25.6
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 +65 -65
- package/dist/index.global.js.map +1 -1
- package/dist/index.mjs +26 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -73341,6 +73341,24 @@ function DataTable({
|
|
|
73341
73341
|
const expandedRows = controlledExpandedRows || internalExpandedRows;
|
|
73342
73342
|
const actualPageSize = defaultPageSize || pageSize;
|
|
73343
73343
|
const stableData = t__default.useMemo(() => data, [data]);
|
|
73344
|
+
const createSortingHandler = (columnId) => {
|
|
73345
|
+
return () => {
|
|
73346
|
+
const currentSorting = externalState?.sorting ?? sorting;
|
|
73347
|
+
const currentSort = currentSorting.find((s) => s.id === columnId);
|
|
73348
|
+
let newSorting = [];
|
|
73349
|
+
if (!currentSort) {
|
|
73350
|
+
newSorting = [{ id: columnId, desc: false }];
|
|
73351
|
+
} else if (!currentSort.desc) {
|
|
73352
|
+
newSorting = [{ id: columnId, desc: true }];
|
|
73353
|
+
} else {
|
|
73354
|
+
newSorting = [];
|
|
73355
|
+
}
|
|
73356
|
+
const sortingHandler = onSortingChange !== void 0 ? onSortingChange : setSorting;
|
|
73357
|
+
if (typeof sortingHandler === "function") {
|
|
73358
|
+
sortingHandler(newSorting);
|
|
73359
|
+
}
|
|
73360
|
+
};
|
|
73361
|
+
};
|
|
73344
73362
|
const table = useReactTable({
|
|
73345
73363
|
data: stableData,
|
|
73346
73364
|
columns,
|
|
@@ -73350,6 +73368,13 @@ function DataTable({
|
|
|
73350
73368
|
getPaginationRowModel: getPaginationRowModel(),
|
|
73351
73369
|
getSortedRowModel: getSortedRowModel(),
|
|
73352
73370
|
getFilteredRowModel: getFilteredRowModel(),
|
|
73371
|
+
// Configure sorting behavior
|
|
73372
|
+
enableSortingRemoval: true,
|
|
73373
|
+
// Allow removing sort (3rd click)
|
|
73374
|
+
enableMultiSort: false,
|
|
73375
|
+
// Disable multi-column sorting
|
|
73376
|
+
sortDescFirst: false,
|
|
73377
|
+
// First click should be ascending
|
|
73353
73378
|
onColumnVisibilityChange: setColumnVisibility,
|
|
73354
73379
|
onRowSelectionChange: setRowSelection,
|
|
73355
73380
|
onGlobalFilterChange: setGlobalFilter,
|
|
@@ -73552,7 +73577,7 @@ function DataTable({
|
|
|
73552
73577
|
"flex items-center space-x-2",
|
|
73553
73578
|
header.column.getCanSort() && "cursor-pointer select-none"
|
|
73554
73579
|
),
|
|
73555
|
-
onClick: header.column.
|
|
73580
|
+
onClick: header.column.getCanSort() ? createSortingHandler(header.column.id) : void 0,
|
|
73556
73581
|
children: [
|
|
73557
73582
|
flexRender(header.column.columnDef.header, header.getContext()),
|
|
73558
73583
|
header.column.getCanSort() && /* @__PURE__ */ jsx("div", { className: "ml-2", children: header.column.getIsSorted() === "asc" ? /* @__PURE__ */ jsx("span", { suppressHydrationWarning: true, children: /* @__PURE__ */ jsx(ArrowUp, { className: "h-4 w-4" }) }) : header.column.getIsSorted() === "desc" ? /* @__PURE__ */ jsx("span", { suppressHydrationWarning: true, children: /* @__PURE__ */ jsx(ArrowDown, { className: "h-4 w-4" }) }) : /* @__PURE__ */ jsx("span", { suppressHydrationWarning: true, children: /* @__PURE__ */ jsx(ArrowUpDown, { className: "h-4 w-4" }) }) })
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@moontra/moonui-pro",
|
|
3
|
-
"version": "2.25.
|
|
3
|
+
"version": "2.25.6",
|
|
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",
|