@facter/ds-core 1.7.2 → 1.7.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.d.mts +11 -1
- package/dist/index.d.ts +11 -1
- package/dist/index.js +11 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +11 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -299,6 +299,16 @@ interface DataTableProps<TData extends object> {
|
|
|
299
299
|
children: React$1.ReactNode;
|
|
300
300
|
/** Função para obter ID único da row */
|
|
301
301
|
getRowId?: (row: TData) => string;
|
|
302
|
+
/**
|
|
303
|
+
* Habilita server-side pagination.
|
|
304
|
+
* Quando true, a tabela não faz paginação local e depende do servidor.
|
|
305
|
+
*/
|
|
306
|
+
manualPagination?: boolean;
|
|
307
|
+
/**
|
|
308
|
+
* Total de páginas (obrigatório se manualPagination=true).
|
|
309
|
+
* Usado para calcular navegação quando dados vêm do servidor.
|
|
310
|
+
*/
|
|
311
|
+
pageCount?: number;
|
|
302
312
|
/** Custom className */
|
|
303
313
|
className?: string;
|
|
304
314
|
}
|
|
@@ -515,7 +525,7 @@ declare const DENSITY_CONFIG: {
|
|
|
515
525
|
};
|
|
516
526
|
};
|
|
517
527
|
|
|
518
|
-
declare function DataTableRoot<TData extends object>({ children, data, columns, getRowId, className, }: DataTableProps<TData>): react_jsx_runtime.JSX.Element;
|
|
528
|
+
declare function DataTableRoot<TData extends object>({ children, data, columns, getRowId, manualPagination, pageCount, className, }: DataTableProps<TData>): react_jsx_runtime.JSX.Element;
|
|
519
529
|
declare namespace DataTableRoot {
|
|
520
530
|
var displayName: string;
|
|
521
531
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -299,6 +299,16 @@ interface DataTableProps<TData extends object> {
|
|
|
299
299
|
children: React$1.ReactNode;
|
|
300
300
|
/** Função para obter ID único da row */
|
|
301
301
|
getRowId?: (row: TData) => string;
|
|
302
|
+
/**
|
|
303
|
+
* Habilita server-side pagination.
|
|
304
|
+
* Quando true, a tabela não faz paginação local e depende do servidor.
|
|
305
|
+
*/
|
|
306
|
+
manualPagination?: boolean;
|
|
307
|
+
/**
|
|
308
|
+
* Total de páginas (obrigatório se manualPagination=true).
|
|
309
|
+
* Usado para calcular navegação quando dados vêm do servidor.
|
|
310
|
+
*/
|
|
311
|
+
pageCount?: number;
|
|
302
312
|
/** Custom className */
|
|
303
313
|
className?: string;
|
|
304
314
|
}
|
|
@@ -515,7 +525,7 @@ declare const DENSITY_CONFIG: {
|
|
|
515
525
|
};
|
|
516
526
|
};
|
|
517
527
|
|
|
518
|
-
declare function DataTableRoot<TData extends object>({ children, data, columns, getRowId, className, }: DataTableProps<TData>): react_jsx_runtime.JSX.Element;
|
|
528
|
+
declare function DataTableRoot<TData extends object>({ children, data, columns, getRowId, manualPagination, pageCount, className, }: DataTableProps<TData>): react_jsx_runtime.JSX.Element;
|
|
519
529
|
declare namespace DataTableRoot {
|
|
520
530
|
var displayName: string;
|
|
521
531
|
}
|
package/dist/index.js
CHANGED
|
@@ -1137,7 +1137,9 @@ EmptyState.displayName = "EmptyState";
|
|
|
1137
1137
|
function useDataTableInternal({
|
|
1138
1138
|
data,
|
|
1139
1139
|
columns,
|
|
1140
|
-
getRowId
|
|
1140
|
+
getRowId,
|
|
1141
|
+
manualPagination = false,
|
|
1142
|
+
pageCount: externalPageCount
|
|
1141
1143
|
}) {
|
|
1142
1144
|
const [rowSelection, setRowSelection] = React49__namespace.useState({});
|
|
1143
1145
|
const [columnVisibility, setColumnVisibility] = React49__namespace.useState({});
|
|
@@ -1166,6 +1168,9 @@ function useDataTableInternal({
|
|
|
1166
1168
|
enableSorting: true,
|
|
1167
1169
|
enableFilters: true,
|
|
1168
1170
|
enableGlobalFilter: true,
|
|
1171
|
+
// Server-side pagination support
|
|
1172
|
+
manualPagination,
|
|
1173
|
+
pageCount: manualPagination ? externalPageCount : void 0,
|
|
1169
1174
|
// Handlers
|
|
1170
1175
|
onRowSelectionChange: setRowSelection,
|
|
1171
1176
|
onSortingChange: setSorting,
|
|
@@ -1315,12 +1320,16 @@ function DataTableRoot({
|
|
|
1315
1320
|
data,
|
|
1316
1321
|
columns,
|
|
1317
1322
|
getRowId,
|
|
1323
|
+
manualPagination,
|
|
1324
|
+
pageCount,
|
|
1318
1325
|
className
|
|
1319
1326
|
}) {
|
|
1320
1327
|
const { table, meta, density, setDensity } = useDataTableInternal({
|
|
1321
1328
|
data,
|
|
1322
1329
|
columns,
|
|
1323
|
-
getRowId
|
|
1330
|
+
getRowId,
|
|
1331
|
+
manualPagination,
|
|
1332
|
+
pageCount
|
|
1324
1333
|
});
|
|
1325
1334
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1326
1335
|
DataTableProvider,
|