@facter/ds-core 1.22.0 → 1.23.0

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.mts CHANGED
@@ -304,6 +304,8 @@ interface DataTableProps<TData extends object> {
304
304
  * Quando true, a tabela não faz paginação local e depende do servidor.
305
305
  */
306
306
  manualPagination?: boolean;
307
+ /** Número inicial de items por página (default: 10) */
308
+ initialPageSize?: number;
307
309
  /**
308
310
  * Total de páginas (obrigatório se manualPagination=true).
309
311
  * Usado para calcular navegação quando dados vêm do servidor.
@@ -541,7 +543,7 @@ declare const DENSITY_CONFIG: {
541
543
  };
542
544
  };
543
545
 
544
- declare function DataTableRoot<TData extends object>({ children, data, columns, getRowId, manualPagination, pageCount, className, }: DataTableProps<TData>): react_jsx_runtime.JSX.Element;
546
+ declare function DataTableRoot<TData extends object>({ children, data, columns, getRowId, manualPagination, pageCount, initialPageSize, className, }: DataTableProps<TData>): react_jsx_runtime.JSX.Element;
545
547
  declare namespace DataTableRoot {
546
548
  var displayName: string;
547
549
  }
package/dist/index.d.ts CHANGED
@@ -304,6 +304,8 @@ interface DataTableProps<TData extends object> {
304
304
  * Quando true, a tabela não faz paginação local e depende do servidor.
305
305
  */
306
306
  manualPagination?: boolean;
307
+ /** Número inicial de items por página (default: 10) */
308
+ initialPageSize?: number;
307
309
  /**
308
310
  * Total de páginas (obrigatório se manualPagination=true).
309
311
  * Usado para calcular navegação quando dados vêm do servidor.
@@ -541,7 +543,7 @@ declare const DENSITY_CONFIG: {
541
543
  };
542
544
  };
543
545
 
544
- declare function DataTableRoot<TData extends object>({ children, data, columns, getRowId, manualPagination, pageCount, className, }: DataTableProps<TData>): react_jsx_runtime.JSX.Element;
546
+ declare function DataTableRoot<TData extends object>({ children, data, columns, getRowId, manualPagination, pageCount, initialPageSize, className, }: DataTableProps<TData>): react_jsx_runtime.JSX.Element;
545
547
  declare namespace DataTableRoot {
546
548
  var displayName: string;
547
549
  }
package/dist/index.js CHANGED
@@ -1141,7 +1141,8 @@ function useDataTableInternal({
1141
1141
  columns,
1142
1142
  getRowId,
1143
1143
  manualPagination = false,
1144
- pageCount: externalPageCount
1144
+ pageCount: externalPageCount,
1145
+ initialPageSize = 10
1145
1146
  }) {
1146
1147
  const [rowSelection, setRowSelection] = React10__namespace.useState({});
1147
1148
  const [columnVisibility, setColumnVisibility] = React10__namespace.useState({});
@@ -1151,7 +1152,7 @@ function useDataTableInternal({
1151
1152
  const [density, setDensity] = React10__namespace.useState("default");
1152
1153
  const [pagination, setPagination] = React10__namespace.useState({
1153
1154
  pageIndex: 0,
1154
- pageSize: 10
1155
+ pageSize: initialPageSize
1155
1156
  });
1156
1157
  const table = reactTable.useReactTable({
1157
1158
  data,
@@ -1374,6 +1375,7 @@ function DataTableRoot({
1374
1375
  getRowId,
1375
1376
  manualPagination,
1376
1377
  pageCount,
1378
+ initialPageSize,
1377
1379
  className
1378
1380
  }) {
1379
1381
  const { table, meta, density, setDensity, pageIndex, pageSize } = useDataTableInternal({
@@ -1381,7 +1383,8 @@ function DataTableRoot({
1381
1383
  columns,
1382
1384
  getRowId,
1383
1385
  manualPagination,
1384
- pageCount
1386
+ pageCount,
1387
+ initialPageSize
1385
1388
  });
1386
1389
  return /* @__PURE__ */ jsxRuntime.jsx(
1387
1390
  DataTableProvider,
@@ -1814,7 +1817,6 @@ var DataTablePagination = React10__namespace.memo(function DataTablePagination2(
1814
1817
  firstPage,
1815
1818
  lastPage
1816
1819
  } = paginationHook;
1817
- console.log("[DataTablePagination] render", { mode, pageIndex, pageSize, externalPageCount, internalPageCount });
1818
1820
  const pageCount = mode === "server" && externalPageCount !== void 0 ? externalPageCount : internalPageCount;
1819
1821
  const canGoPrevious = pageIndex > 0;
1820
1822
  const canGoNext = pageIndex < pageCount - 1;
@@ -1892,11 +1894,7 @@ var DataTablePagination = React10__namespace.memo(function DataTablePagination2(
1892
1894
  variant: "outline",
1893
1895
  size: "icon-sm",
1894
1896
  className: "h-8 w-8 p-0",
1895
- onClick: () => {
1896
- console.log("[DataTablePagination] nextPage clicked, current pageIndex:", pageIndex);
1897
- nextPage();
1898
- console.log("[DataTablePagination] nextPage called");
1899
- },
1897
+ onClick: nextPage,
1900
1898
  disabled: !canGoNext,
1901
1899
  "aria-label": "Pr\xF3xima p\xE1gina",
1902
1900
  children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronRight, { className: "h-4 w-4" })