react-router-pagination 3.1.1 → 3.1.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.
Files changed (2) hide show
  1. package/package.json +2 -2
  2. package/src/index.tsx +7 -13
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-router-pagination",
3
- "version": "3.1.1",
3
+ "version": "3.1.3",
4
4
  "description": "A React Router Pagination component",
5
5
  "main": "./src/index.mjs",
6
6
  "type": "module",
@@ -34,7 +34,7 @@
34
34
  "@babel/preset-react": "^7.22.5",
35
35
  "@babel/preset-typescript": "^7.22.5",
36
36
  "@babel/register": "^7.22.5",
37
- "@sequencemedia/hooks": "^1.0.444",
37
+ "@sequencemedia/hooks": "^1.0.445",
38
38
  "@storybook/addon-essentials": "^7.2.1",
39
39
  "@storybook/addon-links": "^7.2.1",
40
40
  "@storybook/blocks": "^7.2.1",
package/src/index.tsx CHANGED
@@ -1,9 +1,4 @@
1
- import React from 'react'
2
-
3
- import AbstractPagination, {
4
- type AbstractPaginationProps,
5
- type AbstractPaginationState
6
- } from './pagination/component.tsx'
1
+ import React, { Component } from 'react'
7
2
 
8
3
  import {
9
4
  Standard
@@ -14,18 +9,17 @@ import {
14
9
  } from './pagination/centered/index.tsx'
15
10
 
16
11
  import {
17
- toInteger
12
+ calculateTotalPages,
13
+ calculatePageNumber
18
14
  } from './pagination/common/index.mts'
19
15
 
20
- export interface PaginationProps extends AbstractPaginationProps {
16
+ export interface PaginationProps {
21
17
  format?: string
22
18
  }
23
19
 
24
- export default class Pagination extends AbstractPagination<PaginationProps, AbstractPaginationState> {
25
- state = {
26
- pageNumber: toInteger(this.props.pageNumber),
27
- totalPages: toInteger(this.props.totalPages)
28
- }
20
+ export default class Pagination extends Component<PaginationProps> {
21
+ static calculateTotalPages = calculateTotalPages
22
+ static calculatePageNumber = calculatePageNumber
29
23
 
30
24
  render (): JSX.Element {
31
25
  const { format, ...props }: PaginationProps = this.props