@moontra/moonui-pro 2.25.5 → 2.25.7

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
@@ -73208,7 +73208,7 @@ function FilterConditionRow({
73208
73208
  onValueChange: (value) => onUpdate({ column: value }),
73209
73209
  children: [
73210
73210
  /* @__PURE__ */ jsx(MoonUISelectTriggerPro, { className: "flex-1", children: /* @__PURE__ */ jsx(MoonUISelectValuePro, {}) }),
73211
- /* @__PURE__ */ jsx(MoonUISelectContentPro, { children: columns.map((column) => {
73211
+ /* @__PURE__ */ jsx(MoonUISelectContentPro, { style: { zIndex: 1e4 }, children: columns.map((column) => {
73212
73212
  const header = column.columnDef.header;
73213
73213
  const label = typeof header === "function" ? column.id : header || column.id;
73214
73214
  return /* @__PURE__ */ jsx(MoonUISelectItemPro, { value: column.id, children: label }, column.id);
@@ -73234,7 +73234,7 @@ function FilterConditionRow({
73234
73234
  onValueChange: (value) => onUpdate({ operator: value }),
73235
73235
  children: [
73236
73236
  /* @__PURE__ */ jsx(MoonUISelectTriggerPro, { children: /* @__PURE__ */ jsx(MoonUISelectValuePro, {}) }),
73237
- /* @__PURE__ */ jsx(MoonUISelectContentPro, { children: availableOperators.map((operator2) => /* @__PURE__ */ jsx(MoonUISelectItemPro, { value: operator2, children: operatorLabels[operator2] }, operator2)) })
73237
+ /* @__PURE__ */ jsx(MoonUISelectContentPro, { style: { zIndex: 1e4 }, children: availableOperators.map((operator2) => /* @__PURE__ */ jsx(MoonUISelectItemPro, { value: operator2, children: operatorLabels[operator2] }, operator2)) })
73238
73238
  ]
73239
73239
  }
73240
73240
  ),
@@ -73245,7 +73245,7 @@ function FilterConditionRow({
73245
73245
  onValueChange: (value) => onUpdate({ value: value === "true" }),
73246
73246
  children: [
73247
73247
  /* @__PURE__ */ jsx(MoonUISelectTriggerPro, { children: /* @__PURE__ */ jsx(MoonUISelectValuePro, {}) }),
73248
- /* @__PURE__ */ jsxs(MoonUISelectContentPro, { children: [
73248
+ /* @__PURE__ */ jsxs(MoonUISelectContentPro, { style: { zIndex: 1e4 }, children: [
73249
73249
  /* @__PURE__ */ jsx(MoonUISelectItemPro, { value: "true", children: "True" }),
73250
73250
  /* @__PURE__ */ jsx(MoonUISelectItemPro, { value: "false", children: "False" })
73251
73251
  ] })
@@ -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.getToggleSortingHandler(),
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.5",
3
+ "version": "2.25.7",
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",