react-router-pagination 3.3.2 → 3.3.4
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/eslint.config.mjs +2 -8
- package/jest.config.mjs +6 -3
- package/jest.setup.mjs +9 -0
- package/package.json +3 -4
- package/src/index.cjs +5 -1
- package/src/pagination/centered/index.cjs +11 -1
- package/src/pagination/centered/index.mjs +6 -2
- package/src/pagination/centered/index.tsx +3 -1
- package/src/pagination/common/index.cjs +9 -1
- package/src/pagination/common/index.mjs +5 -2
- package/src/pagination/component.cjs +11 -1
- package/src/pagination/component.mjs +6 -2
- package/src/pagination/component.tsx +3 -1
- package/src/pagination/index.cjs +13 -1
- package/src/pagination/index.mjs +7 -2
- package/src/pagination/standard/index.cjs +11 -1
- package/src/pagination/standard/index.mjs +6 -2
- package/src/pagination/standard/index.tsx +3 -1
- package/src/super/pagination/component.tsx +1 -1
package/eslint.config.mjs
CHANGED
|
@@ -129,10 +129,7 @@ export default [
|
|
|
129
129
|
...reactRules
|
|
130
130
|
},
|
|
131
131
|
settings: {
|
|
132
|
-
...reactSettings
|
|
133
|
-
'import/resolver': {
|
|
134
|
-
'babel-module': {}
|
|
135
|
-
}
|
|
132
|
+
...reactSettings
|
|
136
133
|
}
|
|
137
134
|
}),
|
|
138
135
|
standard({
|
|
@@ -159,10 +156,7 @@ export default [
|
|
|
159
156
|
...reactRules
|
|
160
157
|
},
|
|
161
158
|
settings: {
|
|
162
|
-
...reactSettings
|
|
163
|
-
'import/resolver': {
|
|
164
|
-
'babel-module': {}
|
|
165
|
-
}
|
|
159
|
+
...reactSettings
|
|
166
160
|
}
|
|
167
161
|
}),
|
|
168
162
|
/**
|
package/jest.config.mjs
CHANGED
|
@@ -9,7 +9,7 @@ export default {
|
|
|
9
9
|
collectCoverage: true,
|
|
10
10
|
coverageDirectory: './coverage',
|
|
11
11
|
coverageProvider: 'v8',
|
|
12
|
-
testRegex: '(/__tests__/.*|(\\.|/))(test|spec)\\.(jsx
|
|
12
|
+
testRegex: '(/__tests__/.*|(\\.|/))(test|spec)\\.(jsx|mjs|tsx|mts)$',
|
|
13
13
|
transform: {
|
|
14
14
|
'^.+\\.jsx$': 'babel-jest',
|
|
15
15
|
'^.+\\.mjs$': 'babel-jest',
|
|
@@ -21,6 +21,9 @@ export default {
|
|
|
21
21
|
'/node_modules\\/(?!react-component-snapshot)\\/',
|
|
22
22
|
'/node_modules\\/(?!react-component-name)\\/'
|
|
23
23
|
],
|
|
24
|
-
moduleFileExtensions: ['js', 'jsx', 'mjs'],
|
|
25
|
-
testEnvironment: 'jest-
|
|
24
|
+
moduleFileExtensions: ['js', 'ts', 'jsx', 'mjs', 'tsx', 'mts'],
|
|
25
|
+
testEnvironment: 'jest-environment-jsdom',
|
|
26
|
+
setupFilesAfterEnv: [
|
|
27
|
+
'<rootDir>/jest.setup.mjs'
|
|
28
|
+
]
|
|
26
29
|
}
|
package/jest.setup.mjs
ADDED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-router-pagination",
|
|
3
|
-
"version": "3.3.
|
|
3
|
+
"version": "3.3.4",
|
|
4
4
|
"description": "A React Router Pagination component",
|
|
5
5
|
"main": "./src/index.mjs",
|
|
6
6
|
"type": "module",
|
|
@@ -57,13 +57,13 @@
|
|
|
57
57
|
"@types/react": "^19.0.12",
|
|
58
58
|
"@types/react-dom": "^19.0.4",
|
|
59
59
|
"@types/react-router": "^5.1.20",
|
|
60
|
+
"@types/testing-library__jest-dom": "^5.14.9",
|
|
61
|
+
"@types/testing-library__react": "^10.0.1",
|
|
60
62
|
"@typescript-eslint/eslint-plugin": "^8.27.0",
|
|
61
63
|
"@typescript-eslint/parser": "^8.27.0",
|
|
62
|
-
"babel-plugin-module-resolver": "^5.0.2",
|
|
63
64
|
"core-js": "^3.41.0",
|
|
64
65
|
"cross-env": "^7.0.3",
|
|
65
66
|
"eslint": "^9.22.0",
|
|
66
|
-
"eslint-import-resolver-babel-module": "^5.3.2",
|
|
67
67
|
"eslint-plugin-react": "^7.37.4",
|
|
68
68
|
"eslint-plugin-storybook": "^0.11.6",
|
|
69
69
|
"globals": "^16.0.0",
|
|
@@ -76,7 +76,6 @@
|
|
|
76
76
|
"react-component-snapshot": "^0.0.7",
|
|
77
77
|
"react-dom": "^19.0.0",
|
|
78
78
|
"react-router": "^7.4.0",
|
|
79
|
-
"react-test-renderer": "^19.0.0",
|
|
80
79
|
"storybook": "^8.6.7"
|
|
81
80
|
},
|
|
82
81
|
"imports": {
|
package/src/index.cjs
CHANGED
|
@@ -9,4 +9,14 @@ require('@babel/register')({
|
|
|
9
9
|
]
|
|
10
10
|
})
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
const {
|
|
13
|
+
toInteger,
|
|
14
|
+
calculateTotalPages,
|
|
15
|
+
calculatePageNumber,
|
|
16
|
+
Centered
|
|
17
|
+
} = require('./index.tsx')
|
|
18
|
+
|
|
19
|
+
module.exports.toInteger = toInteger
|
|
20
|
+
module.exports.calculateTotalPages = calculateTotalPages
|
|
21
|
+
module.exports.calculatePageNumber = calculatePageNumber
|
|
22
|
+
module.exports.Centered = Centered
|
|
@@ -6,7 +6,9 @@ import {
|
|
|
6
6
|
calculatePageNumber
|
|
7
7
|
} from '#pagination/pagination/common'
|
|
8
8
|
|
|
9
|
-
import
|
|
9
|
+
import {
|
|
10
|
+
AbstractPagination
|
|
11
|
+
} from '#pagination/super/pagination/component' // '../../super/pagination/component.tsx'
|
|
10
12
|
|
|
11
13
|
const error = debug('react-router-pagination/pagination/component')
|
|
12
14
|
|
|
@@ -9,4 +9,12 @@ require('@babel/register')({
|
|
|
9
9
|
]
|
|
10
10
|
})
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
const {
|
|
13
|
+
toInteger,
|
|
14
|
+
calculateTotalPages,
|
|
15
|
+
calculatePageNumber
|
|
16
|
+
} = require('./index.mts')
|
|
17
|
+
|
|
18
|
+
module.exports.toInteger = toInteger
|
|
19
|
+
module.exports.calculateTotalPages = calculateTotalPages
|
|
20
|
+
module.exports.calculatePageNumber = calculatePageNumber
|
|
@@ -9,4 +9,14 @@ require('@babel/register')({
|
|
|
9
9
|
]
|
|
10
10
|
})
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
const {
|
|
13
|
+
toInteger,
|
|
14
|
+
calculateTotalPages,
|
|
15
|
+
calculatePageNumber,
|
|
16
|
+
Pagination
|
|
17
|
+
} = require('./component.tsx')
|
|
18
|
+
|
|
19
|
+
module.exports.toInteger = toInteger
|
|
20
|
+
module.exports.calculateTotalPages = calculateTotalPages
|
|
21
|
+
module.exports.calculatePageNumber = calculatePageNumber
|
|
22
|
+
module.exports.Pagination = Pagination
|
|
@@ -7,7 +7,9 @@ import {
|
|
|
7
7
|
calculatePageNumber
|
|
8
8
|
} from '#pagination/pagination/common'
|
|
9
9
|
|
|
10
|
-
import
|
|
10
|
+
import {
|
|
11
|
+
AbstractPagination
|
|
12
|
+
} from '#pagination/super/pagination/component' // '../super/pagination/component.tsx'
|
|
11
13
|
|
|
12
14
|
export {
|
|
13
15
|
toInteger,
|
package/src/pagination/index.cjs
CHANGED
|
@@ -9,4 +9,16 @@ require('@babel/register')({
|
|
|
9
9
|
]
|
|
10
10
|
})
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
const {
|
|
13
|
+
calculateTotalPages,
|
|
14
|
+
calculatePageNumber,
|
|
15
|
+
Pagination,
|
|
16
|
+
Centered,
|
|
17
|
+
Standard
|
|
18
|
+
} = require('./index.tsx')
|
|
19
|
+
|
|
20
|
+
module.exports.calculateTotalPages = calculateTotalPages
|
|
21
|
+
module.exports.calculatePageNumber = calculatePageNumber
|
|
22
|
+
module.exports.Pagination = Pagination
|
|
23
|
+
module.exports.Centered = Centered
|
|
24
|
+
module.exports.Standard = Standard
|
package/src/pagination/index.mjs
CHANGED
|
@@ -9,4 +9,14 @@ require('@babel/register')({
|
|
|
9
9
|
]
|
|
10
10
|
})
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
const {
|
|
13
|
+
toInteger,
|
|
14
|
+
calculateTotalPages,
|
|
15
|
+
calculatePageNumber,
|
|
16
|
+
Standard
|
|
17
|
+
} = require('./index.tsx')
|
|
18
|
+
|
|
19
|
+
module.exports.toInteger = toInteger
|
|
20
|
+
module.exports.calculateTotalPages = calculateTotalPages
|
|
21
|
+
module.exports.calculatePageNumber = calculatePageNumber
|
|
22
|
+
module.exports.Standard = Standard
|
|
@@ -6,7 +6,9 @@ import {
|
|
|
6
6
|
calculatePageNumber
|
|
7
7
|
} from '#pagination/pagination/common'
|
|
8
8
|
|
|
9
|
-
import
|
|
9
|
+
import {
|
|
10
|
+
AbstractPagination
|
|
11
|
+
} from '#pagination/super/pagination/component' // '../../super/pagination/component.tsx'
|
|
10
12
|
|
|
11
13
|
const error = debug('react-router-pagination/pagination/component')
|
|
12
14
|
|
|
@@ -29,7 +29,7 @@ export type AbstractPaginationProps = ReactRouterPaginationTypes.AbstractPaginat
|
|
|
29
29
|
|
|
30
30
|
export type AbstractPaginationState = ReactRouterPaginationTypes.AbstractPaginationState
|
|
31
31
|
|
|
32
|
-
export
|
|
32
|
+
export abstract class AbstractPagination<P, S> extends Component<P & AbstractPaginationProps, S & AbstractPaginationState> { // eslint-disable-line @typescript-eslint/no-unnecessary-type-parameters -- Base
|
|
33
33
|
static defaultProps = {
|
|
34
34
|
onClick () {},
|
|
35
35
|
pageNumber: 0,
|