@@ -23,7 +23,8 @@ const CPagination = props=>{
23
23
pageFrom,
24
24
pageTo,
25
25
pageMin,
26
- pageMax,
26
+ pageMax : pageMaxProp ,
27
+ pages,
27
28
activePage,
28
29
size,
29
30
firstButtonHtml,
@@ -40,6 +41,7 @@ const CPagination = props=>{
40
41
...attributes
41
42
} = props ;
42
43
44
+ let pageMax ;
43
45
44
46
const paginationClick = ( e , type , n ) => {
45
47
onClick && onClick ( e , type , n ) ;
@@ -61,6 +63,8 @@ const CPagination = props=>{
61
63
62
64
let autoChildren ;
63
65
66
+ pages ? pageMax = pageMin + pages - 1 : pageMax = pageMaxProp ;
67
+
64
68
if ( ! custom ) {
65
69
let list = [ ] ;
66
70
let pageAutoFrom = pageFrom ;
@@ -112,6 +116,7 @@ CPagination.propTypes = {
112
116
innerRef : PropTypes . oneOfType ( [ PropTypes . object , PropTypes . func , PropTypes . string ] ) ,
113
117
pageMin : PropTypes . number ,
114
118
pageMax : PropTypes . number ,
119
+ pages : PropTypes . number ,
115
120
pageFrom : PropTypes . number ,
116
121
pageTo : PropTypes . number ,
117
122
activePage : PropTypes . number ,
@@ -136,7 +141,7 @@ CPagination.defaultProps = {
136
141
listTag : 'ul' ,
137
142
'aria-label' : 'pagination' ,
138
143
pageMin : 1 ,
139
- pageMax : 5 ,
144
+ pages : 5 ,
140
145
activePage : 2 ,
141
146
hideDots : true ,
142
147
firstButtonHtml : < React . Fragment > «</ React . Fragment > ,
0 commit comments