svelte-datatables-net
Advanced tools
Comparing version
@@ -27,3 +27,5 @@ import { functionCheckPageNumber } from './functionCheckPageNumber.js'; | ||
const numericRowsPerPage = rowsPerPage === 'all' ? sorted.length : parseInt(rowsPerPage); | ||
const lastPage = Math.ceil(sorted.length / numericRowsPerPage); | ||
const lastPage = numericRowsPerPage === 0 || sorted.length === 0 | ||
? 1 | ||
: Math.ceil(sorted.length / numericRowsPerPage); | ||
const objeto = { | ||
@@ -61,5 +63,8 @@ original: data, | ||
estado.paginated = estado.sorted.slice(estado.firstRow - 1, estado.lastRow); | ||
estado.lastPage = Math.ceil(estado.sorted.length / estado.rowsPerPage); | ||
estado.lastPage = | ||
estado.rowsPerPage === 0 || estado.sorted.length === 0 | ||
? 1 | ||
: Math.ceil(estado.sorted.length / estado.rowsPerPage); | ||
}); | ||
return estado; | ||
}; |
{ | ||
"name": "svelte-datatables-net", | ||
"version": "2.0.1", | ||
"version": "2.0.2", | ||
"description": "svelte-datatables-net is a svelte/sveltekit component that turns data into an interactive HTML table. Inspired by datatables.net.", | ||
@@ -5,0 +5,0 @@ "repository": { |
Sorry, the diff of this file is not supported yet
31528
0.76%276
1.85%