@moontra/moonui-pro 2.25.8 → 2.25.10

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
@@ -73703,6 +73703,7 @@ function DataTable({
73703
73703
  selectable = false,
73704
73704
  pagination = true,
73705
73705
  pageSize = 10,
73706
+ pageSizeOptions = [5, 10, 20, 50, 100],
73706
73707
  className,
73707
73708
  onRowSelect,
73708
73709
  onExport,
@@ -73762,6 +73763,10 @@ function DataTable({
73762
73763
  const [columnVisibility, setColumnVisibility] = t__default.useState({});
73763
73764
  const [rowSelection, setRowSelection] = t__default.useState({});
73764
73765
  const [globalFilter, setGlobalFilter] = t__default.useState("");
73766
+ const [paginationState, setPaginationState] = t__default.useState({
73767
+ pageIndex: 0,
73768
+ pageSize: defaultPageSize || pageSize || 10
73769
+ });
73765
73770
  const [isPaginationLoading, setIsPaginationLoading] = t__default.useState(false);
73766
73771
  const [internalExpandedRows, setInternalExpandedRows] = t__default.useState(/* @__PURE__ */ new Set());
73767
73772
  const [filterDrawerOpen, setFilterDrawerOpen] = t__default.useState(false);
@@ -73791,6 +73796,7 @@ function DataTable({
73791
73796
  columns,
73792
73797
  onSortingChange: onSortingChange !== void 0 ? onSortingChange : setSorting,
73793
73798
  onColumnFiltersChange: onColumnFiltersChange !== void 0 ? onColumnFiltersChange : setColumnFilters,
73799
+ onPaginationChange: onPaginationChange !== void 0 ? onPaginationChange : setPaginationState,
73794
73800
  getCoreRowModel: getCoreRowModel(),
73795
73801
  getPaginationRowModel: getPaginationRowModel(),
73796
73802
  getSortedRowModel: getSortedRowModel(),
@@ -73880,6 +73886,7 @@ function DataTable({
73880
73886
  columnVisibility: externalState?.columnVisibility ?? columnVisibility,
73881
73887
  rowSelection: externalState?.rowSelection ?? rowSelection,
73882
73888
  globalFilter: externalState?.globalFilter ?? globalFilter,
73889
+ pagination: externalState?.pagination ?? paginationState,
73883
73890
  ...externalState || {}
73884
73891
  },
73885
73892
  initialState: {
@@ -74109,14 +74116,22 @@ function DataTable({
74109
74116
  {
74110
74117
  value: table.getState().pagination.pageSize,
74111
74118
  onChange: async (e) => {
74112
- setIsPaginationLoading(true);
74113
- await new Promise((resolve) => setTimeout(resolve, 300));
74114
- table.setPageSize(Number(e.target.value));
74115
- setIsPaginationLoading(false);
74119
+ const newPageSize = Number(e.target.value);
74120
+ if (onPaginationChange) {
74121
+ onPaginationChange({
74122
+ pageIndex: table.getState().pagination.pageIndex,
74123
+ pageSize: newPageSize
74124
+ });
74125
+ } else {
74126
+ setIsPaginationLoading(true);
74127
+ await new Promise((resolve) => setTimeout(resolve, 300));
74128
+ table.setPageSize(newPageSize);
74129
+ setIsPaginationLoading(false);
74130
+ }
74116
74131
  },
74117
74132
  className: "h-8 w-[70px] rounded border border-input bg-background px-3 py-1 text-sm",
74118
74133
  disabled: isPaginationLoading,
74119
- children: [10, 20, 30, 40, 50].map((pageSize2) => /* @__PURE__ */ jsx("option", { value: pageSize2, children: pageSize2 }, pageSize2))
74134
+ children: pageSizeOptions.map((size4) => /* @__PURE__ */ jsx("option", { value: size4, children: size4 }, size4))
74120
74135
  }
74121
74136
  )
74122
74137
  ] }),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moontra/moonui-pro",
3
- "version": "2.25.8",
3
+ "version": "2.25.10",
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",