i18n-paginator.ts 730 B

1234567891011121314151617181920
  1. import { MatPaginatorIntl } from "@angular/material";
  2. export class MatPaginatorIntlSpa extends MatPaginatorIntl {
  3. itemsPerPageLabel = "Registros por página";
  4. nextPageLabel = "Siguiente";
  5. previousPageLabel = "Anterior";
  6. getRangeLabel = function(page, pageSize, length) {
  7. if (length === 0 || pageSize === 0) {
  8. return "0 de " + length;
  9. }
  10. length = Math.max(length, 0);
  11. const startIndex = page * pageSize;
  12. // If the start index exceeds the list length, do not try and fix the end index to the end.
  13. const endIndex =
  14. startIndex < length
  15. ? Math.min(startIndex + pageSize, length)
  16. : startIndex + pageSize;
  17. return startIndex + 1 + " - " + endIndex + " de " + length;
  18. };
  19. }