@moontra/moonui-pro 2.4.2 → 2.4.3

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
@@ -53265,27 +53265,31 @@ function DataTable({
53265
53265
  ] })
53266
53266
  ] }),
53267
53267
  /* @__PURE__ */ jsx("div", { className: "moonui-pro-datatable-wrapper rounded-md border overflow-hidden", style: { contain: "layout style" }, children: /* @__PURE__ */ jsx("div", { style: { overflowX: "auto" }, children: /* @__PURE__ */ jsxs("table", { className: "moonui-pro-datatable", style: { width: "100%", tableLayout: "auto" }, children: [
53268
- /* @__PURE__ */ jsx("thead", { className: "moonui-data-table-header", children: table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ jsx("tr", { className: "moonui-data-table-row border-b", children: headerGroup.headers.map((header) => /* @__PURE__ */ jsx(
53269
- "th",
53270
- {
53271
- className: "moonui-data-table-th h-12 px-4 text-left align-middle font-medium text-muted-foreground",
53272
- children: header.isPlaceholder ? null : /* @__PURE__ */ jsxs(
53273
- "div",
53274
- {
53275
- className: cn(
53276
- "flex items-center space-x-2",
53277
- header.column.getCanSort() && "cursor-pointer select-none"
53278
- ),
53279
- onClick: header.column.getToggleSortingHandler(),
53280
- children: [
53281
- flexRender(header.column.columnDef.header, header.getContext()),
53282
- 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" }) }) })
53283
- ]
53284
- }
53285
- )
53286
- },
53287
- header.id
53288
- )) }, headerGroup.id)) }),
53268
+ /* @__PURE__ */ jsx("thead", { className: "moonui-data-table-header", children: table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ jsx("tr", { className: "moonui-data-table-row border-b", children: headerGroup.headers.map((header) => {
53269
+ if (!header.column.getIsVisible())
53270
+ return null;
53271
+ return /* @__PURE__ */ jsx(
53272
+ "th",
53273
+ {
53274
+ className: "moonui-data-table-th h-12 px-4 text-left align-middle font-medium text-muted-foreground",
53275
+ children: header.isPlaceholder ? null : /* @__PURE__ */ jsxs(
53276
+ "div",
53277
+ {
53278
+ className: cn(
53279
+ "flex items-center space-x-2",
53280
+ header.column.getCanSort() && "cursor-pointer select-none"
53281
+ ),
53282
+ onClick: header.column.getToggleSortingHandler(),
53283
+ children: [
53284
+ flexRender(header.column.columnDef.header, header.getContext()),
53285
+ 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" }) }) })
53286
+ ]
53287
+ }
53288
+ )
53289
+ },
53290
+ header.id
53291
+ );
53292
+ }) }, headerGroup.id)) }),
53289
53293
  /* @__PURE__ */ jsx("tbody", { className: "moonui-data-table-body", children: isPaginationLoading ? /* @__PURE__ */ jsx(
53290
53294
  motion.tr,
53291
53295
  {
@@ -53293,7 +53297,7 @@ function DataTable({
53293
53297
  animate: { opacity: 1 },
53294
53298
  exit: { opacity: 0 },
53295
53299
  transition: { duration: 0.2 },
53296
- children: /* @__PURE__ */ jsx("td", { colSpan: columns.length, className: "h-24 text-center", children: /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-center space-x-2", children: [
53300
+ children: /* @__PURE__ */ jsx("td", { colSpan: table.getVisibleLeafColumns().length, className: "h-24 text-center", children: /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-center space-x-2", children: [
53297
53301
  /* @__PURE__ */ jsx("span", { suppressHydrationWarning: true, children: /* @__PURE__ */ jsx(Loader2, { className: "h-4 w-4 animate-spin" }) }),
53298
53302
  /* @__PURE__ */ jsx("span", { className: "text-sm text-muted-foreground", children: "Loading..." })
53299
53303
  ] }) })
@@ -53320,7 +53324,7 @@ function DataTable({
53320
53324
  animate: { opacity: 1 },
53321
53325
  exit: { opacity: 0 },
53322
53326
  transition: { duration: 0.2 },
53323
- children: /* @__PURE__ */ jsx("td", { colSpan: columns.length, className: "h-24 text-center", children: "No results found." })
53327
+ children: /* @__PURE__ */ jsx("td", { colSpan: table.getVisibleLeafColumns().length, className: "h-24 text-center", children: "No results found." })
53324
53328
  },
53325
53329
  "no-results"
53326
53330
  ) })
@@ -53509,10 +53513,14 @@ var TableRow2 = t__default.memo(({
53509
53513
  row.getIsSelected() && "bg-muted",
53510
53514
  isExpanded && "border-b-0"
53511
53515
  ),
53512
- children: row.getVisibleCells().map((cell) => /* @__PURE__ */ jsx("td", { className: "moonui-data-table-td p-4 align-middle", children: flexRender(cell.column.columnDef.cell, cell.getContext()) }, cell.id))
53516
+ children: row.getVisibleCells().map((cell) => {
53517
+ if (!cell.column.getIsVisible())
53518
+ return null;
53519
+ return /* @__PURE__ */ jsx("td", { className: "moonui-data-table-td p-4 align-middle", children: flexRender(cell.column.columnDef.cell, cell.getContext()) }, cell.id);
53520
+ })
53513
53521
  }
53514
53522
  ),
53515
- isExpanded && renderSubComponent && /* @__PURE__ */ jsx("tr", { className: "border-b", children: /* @__PURE__ */ jsx("td", { colSpan: row.getVisibleCells().length, className: "p-0 overflow-hidden", children: /* @__PURE__ */ jsx(
53523
+ isExpanded && renderSubComponent && /* @__PURE__ */ jsx("tr", { className: "border-b", children: /* @__PURE__ */ jsx("td", { colSpan: row.getVisibleCells().filter((cell) => cell.column.getIsVisible()).length, className: "p-0 overflow-hidden", children: /* @__PURE__ */ jsx(
53516
53524
  "div",
53517
53525
  {
53518
53526
  className: "transition-all duration-300 ease-out",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moontra/moonui-pro",
3
- "version": "2.4.2",
3
+ "version": "2.4.3",
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",
@@ -421,35 +421,40 @@ export function DataTable<TData, TValue>({
421
421
  <thead className="moonui-data-table-header">
422
422
  {table.getHeaderGroups().map((headerGroup) => (
423
423
  <tr key={headerGroup.id} className="moonui-data-table-row border-b">
424
- {headerGroup.headers.map((header) => (
425
- <th
426
- key={header.id}
427
- className="moonui-data-table-th h-12 px-4 text-left align-middle font-medium text-muted-foreground"
428
- >
429
- {header.isPlaceholder ? null : (
430
- <div
431
- className={cn(
432
- "flex items-center space-x-2",
433
- header.column.getCanSort() && "cursor-pointer select-none"
434
- )}
435
- onClick={header.column.getToggleSortingHandler()}
436
- >
437
- {flexRender(header.column.columnDef.header, header.getContext())}
438
- {header.column.getCanSort() && (
439
- <div className="ml-2">
440
- {header.column.getIsSorted() === 'asc' ? (
441
- <span suppressHydrationWarning><ArrowUp className="h-4 w-4" /></span>
442
- ) : header.column.getIsSorted() === 'desc' ? (
443
- <span suppressHydrationWarning><ArrowDown className="h-4 w-4" /></span>
444
- ) : (
445
- <span suppressHydrationWarning><ArrowUpDown className="h-4 w-4" /></span>
446
- )}
447
- </div>
448
- )}
449
- </div>
450
- )}
451
- </th>
452
- ))}
424
+ {headerGroup.headers.map((header) => {
425
+ // Column visibility kontrolü
426
+ if (!header.column.getIsVisible()) return null;
427
+
428
+ return (
429
+ <th
430
+ key={header.id}
431
+ className="moonui-data-table-th h-12 px-4 text-left align-middle font-medium text-muted-foreground"
432
+ >
433
+ {header.isPlaceholder ? null : (
434
+ <div
435
+ className={cn(
436
+ "flex items-center space-x-2",
437
+ header.column.getCanSort() && "cursor-pointer select-none"
438
+ )}
439
+ onClick={header.column.getToggleSortingHandler()}
440
+ >
441
+ {flexRender(header.column.columnDef.header, header.getContext())}
442
+ {header.column.getCanSort() && (
443
+ <div className="ml-2">
444
+ {header.column.getIsSorted() === 'asc' ? (
445
+ <span suppressHydrationWarning><ArrowUp className="h-4 w-4" /></span>
446
+ ) : header.column.getIsSorted() === 'desc' ? (
447
+ <span suppressHydrationWarning><ArrowDown className="h-4 w-4" /></span>
448
+ ) : (
449
+ <span suppressHydrationWarning><ArrowUpDown className="h-4 w-4" /></span>
450
+ )}
451
+ </div>
452
+ )}
453
+ </div>
454
+ )}
455
+ </th>
456
+ );
457
+ })}
453
458
  </tr>
454
459
  ))}
455
460
  </thead>
@@ -462,7 +467,7 @@ export function DataTable<TData, TValue>({
462
467
  exit={{ opacity: 0 }}
463
468
  transition={{ duration: 0.2 }}
464
469
  >
465
- <td colSpan={columns.length} className="h-24 text-center">
470
+ <td colSpan={table.getVisibleLeafColumns().length} className="h-24 text-center">
466
471
  <div className="flex items-center justify-center space-x-2">
467
472
  <span suppressHydrationWarning><Loader2 className="h-4 w-4 animate-spin" /></span>
468
473
  <span className="text-sm text-muted-foreground">Loading...</span>
@@ -495,7 +500,7 @@ export function DataTable<TData, TValue>({
495
500
  exit={{ opacity: 0 }}
496
501
  transition={{ duration: 0.2 }}
497
502
  >
498
- <td colSpan={columns.length} className="h-24 text-center">
503
+ <td colSpan={table.getVisibleLeafColumns().length} className="h-24 text-center">
499
504
  No results found.
500
505
  </td>
501
506
  </motion.tr>
@@ -724,16 +729,21 @@ const TableRow = React.memo(({
724
729
  isExpanded && "border-b-0"
725
730
  )}
726
731
  >
727
- {row.getVisibleCells().map((cell) => (
728
- <td key={cell.id} className="moonui-data-table-td p-4 align-middle">
729
- {flexRender(cell.column.columnDef.cell, cell.getContext())}
730
- </td>
731
- ))}
732
+ {row.getVisibleCells().map((cell) => {
733
+ // Column visibility kontrolü
734
+ if (!cell.column.getIsVisible()) return null;
735
+
736
+ return (
737
+ <td key={cell.id} className="moonui-data-table-td p-4 align-middle">
738
+ {flexRender(cell.column.columnDef.cell, cell.getContext())}
739
+ </td>
740
+ );
741
+ })}
732
742
  </tr>
733
743
 
734
744
  {isExpanded && renderSubComponent && (
735
745
  <tr className="border-b">
736
- <td colSpan={row.getVisibleCells().length} className="p-0 overflow-hidden">
746
+ <td colSpan={row.getVisibleCells().filter(cell => cell.column.getIsVisible()).length} className="p-0 overflow-hidden">
737
747
  <div
738
748
  className="transition-all duration-300 ease-out"
739
749
  style={{