@moontra/moonui-pro 2.25.4 → 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 +92 -92
- package/dist/index.global.js.map +1 -1
- package/dist/index.mjs +32 -3
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -12,7 +12,7 @@ import { format, addMonths, subMonths, startOfMonth, endOfMonth, eachDayOfInterv
|
|
|
12
12
|
import { motion, AnimatePresence, useAnimation, useMotionValue, animate, useSpring, useTransform, Reorder, useDragControls } from 'framer-motion';
|
|
13
13
|
import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
|
|
14
14
|
import * as ReactDOM2 from 'react-dom';
|
|
15
|
-
import ReactDOM2__default from 'react-dom';
|
|
15
|
+
import ReactDOM2__default, { createPortal } from 'react-dom';
|
|
16
16
|
import { createSlot, createSlottable } from '@radix-ui/react-slot';
|
|
17
17
|
import { Command } from 'cmdk';
|
|
18
18
|
import Fuse from 'fuse.js';
|
|
@@ -73063,7 +73063,10 @@ function DataTableFilterDrawer({
|
|
|
73063
73063
|
}
|
|
73064
73064
|
onOpenChange(false);
|
|
73065
73065
|
};
|
|
73066
|
-
|
|
73066
|
+
if (typeof document === "undefined") {
|
|
73067
|
+
return null;
|
|
73068
|
+
}
|
|
73069
|
+
const content = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
73067
73070
|
/* @__PURE__ */ jsx(AnimatePresence, { children: open && /* @__PURE__ */ jsx(
|
|
73068
73071
|
motion.div,
|
|
73069
73072
|
{
|
|
@@ -73183,6 +73186,7 @@ function DataTableFilterDrawer({
|
|
|
73183
73186
|
}
|
|
73184
73187
|
) })
|
|
73185
73188
|
] });
|
|
73189
|
+
return createPortal(content, document.body);
|
|
73186
73190
|
}
|
|
73187
73191
|
function FilterConditionRow({
|
|
73188
73192
|
filter,
|
|
@@ -73337,6 +73341,24 @@ function DataTable({
|
|
|
73337
73341
|
const expandedRows = controlledExpandedRows || internalExpandedRows;
|
|
73338
73342
|
const actualPageSize = defaultPageSize || pageSize;
|
|
73339
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
|
+
};
|
|
73340
73362
|
const table = useReactTable({
|
|
73341
73363
|
data: stableData,
|
|
73342
73364
|
columns,
|
|
@@ -73346,6 +73368,13 @@ function DataTable({
|
|
|
73346
73368
|
getPaginationRowModel: getPaginationRowModel(),
|
|
73347
73369
|
getSortedRowModel: getSortedRowModel(),
|
|
73348
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
|
|
73349
73378
|
onColumnVisibilityChange: setColumnVisibility,
|
|
73350
73379
|
onRowSelectionChange: setRowSelection,
|
|
73351
73380
|
onGlobalFilterChange: setGlobalFilter,
|
|
@@ -73548,7 +73577,7 @@ function DataTable({
|
|
|
73548
73577
|
"flex items-center space-x-2",
|
|
73549
73578
|
header.column.getCanSort() && "cursor-pointer select-none"
|
|
73550
73579
|
),
|
|
73551
|
-
onClick: header.column.
|
|
73580
|
+
onClick: header.column.getCanSort() ? createSortingHandler(header.column.id) : void 0,
|
|
73552
73581
|
children: [
|
|
73553
73582
|
flexRender(header.column.columnDef.header, header.getContext()),
|
|
73554
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",
|