@moontra/moonui-pro 2.4.1 → 2.4.2

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.d.ts CHANGED
@@ -1617,7 +1617,7 @@ interface DataTableProps<TData, TValue> {
1617
1617
  filterButton?: string;
1618
1618
  };
1619
1619
  }
1620
- declare function DataTable<TData, TValue>({ columns, data, searchable, filterable, exportable, selectable, pagination, pageSize, className, onRowSelect, onExport, enableExpandable, renderSubComponent, expandedRows: controlledExpandedRows, onRowExpandChange, bulkActions, features, theme, texts, enableSorting, enableFiltering, enablePagination, enableColumnVisibility, enableRowSelection, filterPlaceholder, defaultPageSize, manualPagination, pageCount, onPaginationChange, onSortingChange, onColumnFiltersChange, state: externalState, }: DataTableProps<TData, TValue>): react_jsx_runtime.JSX.Element;
1620
+ declare function DataTable<TData, TValue>({ columns: originalColumns, data, searchable, filterable, exportable, selectable, pagination, pageSize, className, onRowSelect, onExport, enableExpandable, renderSubComponent, expandedRows: controlledExpandedRows, onRowExpandChange, bulkActions, features, theme, texts, enableSorting, enableFiltering, enablePagination, enableColumnVisibility, enableRowSelection, filterPlaceholder, defaultPageSize, manualPagination, pageCount, onPaginationChange, onSortingChange, onColumnFiltersChange, state: externalState, }: DataTableProps<TData, TValue>): react_jsx_runtime.JSX.Element;
1621
1621
  /**
1622
1622
  * Helper function to create an expandable column
1623
1623
  * @param expandedRows - Set of expanded row IDs
package/dist/index.mjs CHANGED
@@ -53043,7 +53043,7 @@ function FilterConditionRow({
53043
53043
  ] });
53044
53044
  }
53045
53045
  function DataTable({
53046
- columns,
53046
+ columns: originalColumns,
53047
53047
  data,
53048
53048
  searchable = true,
53049
53049
  filterable = true,
@@ -53077,6 +53077,12 @@ function DataTable({
53077
53077
  onColumnFiltersChange,
53078
53078
  state: externalState
53079
53079
  }) {
53080
+ const columns = t__default.useMemo(() => {
53081
+ return originalColumns.map((col) => ({
53082
+ ...col,
53083
+ enableHiding: col.enableHiding !== false
53084
+ }));
53085
+ }, [originalColumns]);
53080
53086
  const { hasProAccess, isLoading } = useSubscription();
53081
53087
  if (!isLoading && !hasProAccess) {
53082
53088
  return /* @__PURE__ */ jsx(MoonUICardPro, { className: cn("w-full", className), children: /* @__PURE__ */ jsx(MoonUICardContentPro, { className: "py-12 text-center", children: /* @__PURE__ */ jsxs("div", { className: "max-w-md mx-auto space-y-4", children: [
@@ -53117,6 +53123,9 @@ function DataTable({
53117
53123
  globalFilterFn: "includesString",
53118
53124
  manualPagination,
53119
53125
  pageCount,
53126
+ enableColumnFilters: true,
53127
+ enableSorting: true,
53128
+ enableHiding: true,
53120
53129
  state: externalState || {
53121
53130
  sorting,
53122
53131
  columnFilters,
@@ -53503,7 +53512,7 @@ var TableRow2 = t__default.memo(({
53503
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))
53504
53513
  }
53505
53514
  ),
53506
- isExpanded && renderSubComponent && /* @__PURE__ */ jsx("tr", { className: "border-b", children: /* @__PURE__ */ jsx("td", { colSpan: columns.length, className: "p-0 overflow-hidden", children: /* @__PURE__ */ jsx(
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(
53507
53516
  "div",
53508
53517
  {
53509
53518
  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.1",
3
+ "version": "2.4.2",
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",
@@ -119,7 +119,7 @@ interface DataTableProps<TData, TValue> {
119
119
  }
120
120
 
121
121
  export function DataTable<TData, TValue>({
122
- columns,
122
+ columns: originalColumns,
123
123
  data,
124
124
  searchable = true,
125
125
  filterable = true,
@@ -153,6 +153,13 @@ export function DataTable<TData, TValue>({
153
153
  onColumnFiltersChange,
154
154
  state: externalState,
155
155
  }: DataTableProps<TData, TValue>) {
156
+ // Process columns to ensure they can be hidden
157
+ const columns = React.useMemo(() => {
158
+ return originalColumns.map(col => ({
159
+ ...col,
160
+ enableHiding: col.enableHiding !== false,
161
+ }))
162
+ }, [originalColumns])
156
163
  // Check if we're in docs mode or have pro access
157
164
  const { hasProAccess, isLoading } = useSubscription()
158
165
 
@@ -221,6 +228,9 @@ export function DataTable<TData, TValue>({
221
228
  globalFilterFn: 'includesString',
222
229
  manualPagination,
223
230
  pageCount,
231
+ enableColumnFilters: true,
232
+ enableSorting: true,
233
+ enableHiding: true,
224
234
  state: externalState || {
225
235
  sorting,
226
236
  columnFilters,
@@ -723,7 +733,7 @@ const TableRow = React.memo(({
723
733
 
724
734
  {isExpanded && renderSubComponent && (
725
735
  <tr className="border-b">
726
- <td colSpan={columns.length} className="p-0 overflow-hidden">
736
+ <td colSpan={row.getVisibleCells().length} className="p-0 overflow-hidden">
727
737
  <div
728
738
  className="transition-all duration-300 ease-out"
729
739
  style={{