@@ -133,7 +133,7 @@ class Pagination extends React.Component {
133
133
* @param {React.ReactNode | React.ComponentType<PaginationProps> } icon received icon.
134
134
* @returns {React.ReactNode }
135
135
*/
136
- getItemIcon = icon => {
136
+ getItemIcon = ( icon ) => {
137
137
const { prefixCls } = this . props ;
138
138
// eslint-disable-next-line jsx-a11y/anchor-has-content
139
139
let iconNode = icon || < a className = { `${ prefixCls } -item-link` } /> ;
@@ -161,11 +161,11 @@ class Pagination extends React.Component {
161
161
return value ;
162
162
}
163
163
164
- savePaginationNode = node => {
164
+ savePaginationNode = ( node ) => {
165
165
this . paginationNode = node ;
166
166
} ;
167
167
168
- isValid = page => isInteger ( page ) && page !== this . state . current ;
168
+ isValid = ( page ) => isInteger ( page ) && page !== this . state . current ;
169
169
170
170
shouldDisplayQuickJumper = ( ) => {
171
171
const { showQuickJumper, pageSize, total } = this . props ;
@@ -175,13 +175,13 @@ class Pagination extends React.Component {
175
175
return showQuickJumper ;
176
176
} ;
177
177
178
- handleKeyDown = e => {
178
+ handleKeyDown = ( e ) => {
179
179
if ( e . keyCode === KEYCODE . ARROW_UP || e . keyCode === KEYCODE . ARROW_DOWN ) {
180
180
e . preventDefault ( ) ;
181
181
}
182
182
} ;
183
183
184
- handleKeyUp = e => {
184
+ handleKeyUp = ( e ) => {
185
185
const value = this . getValidValue ( e ) ;
186
186
const { currentInputValue } = this . state ;
187
187
if ( value !== currentInputValue ) {
@@ -198,7 +198,7 @@ class Pagination extends React.Component {
198
198
}
199
199
} ;
200
200
201
- changePageSize = size => {
201
+ changePageSize = ( size ) => {
202
202
let { current } = this . state ;
203
203
const newCurrent = calculatePage ( size , this . state , this . props ) ;
204
204
current = current > newCurrent ? newCurrent : current ;
@@ -222,10 +222,15 @@ class Pagination extends React.Component {
222
222
} ) ;
223
223
}
224
224
}
225
+
226
+ if ( 'onChange' in this . props && this . props . onChange ) {
227
+ this . props . onChange ( current , size ) ;
228
+ }
229
+
225
230
this . props . onShowSizeChange ( current , size ) ;
226
231
} ;
227
232
228
- handleChange = p => {
233
+ handleChange = ( p ) => {
229
234
const { disabled } = this . props ;
230
235
231
236
let page = p ;
@@ -278,37 +283,37 @@ class Pagination extends React.Component {
278
283
hasNext = ( ) =>
279
284
this . state . current < calculatePage ( undefined , this . state , this . props ) ;
280
285
281
- getShowSizeChanger ( ) {
282
- const { showSizeChanger, total, totalBoundaryShowSizeChanger } = this . props ;
283
- if ( typeof showSizeChanger !== 'undefined' ) {
284
- return showSizeChanger ;
285
- }
286
- return total > totalBoundaryShowSizeChanger ;
287
- }
286
+ getShowSizeChanger ( ) {
287
+ const { showSizeChanger, total, totalBoundaryShowSizeChanger } = this . props ;
288
+ if ( typeof showSizeChanger !== 'undefined' ) {
289
+ return showSizeChanger ;
290
+ }
291
+ return total > totalBoundaryShowSizeChanger ;
292
+ }
288
293
289
294
runIfEnter = ( event , callback , ...restParams ) => {
290
295
if ( event . key === 'Enter' || event . charCode === 13 ) {
291
296
callback ( ...restParams ) ;
292
297
}
293
298
} ;
294
299
295
- runIfEnterPrev = e => {
300
+ runIfEnterPrev = ( e ) => {
296
301
this . runIfEnter ( e , this . prev ) ;
297
302
} ;
298
303
299
- runIfEnterNext = e => {
304
+ runIfEnterNext = ( e ) => {
300
305
this . runIfEnter ( e , this . next ) ;
301
306
} ;
302
307
303
- runIfEnterJumpPrev = e => {
308
+ runIfEnterJumpPrev = ( e ) => {
304
309
this . runIfEnter ( e , this . jumpPrev ) ;
305
310
} ;
306
311
307
- runIfEnterJumpNext = e => {
312
+ runIfEnterJumpNext = ( e ) => {
308
313
this . runIfEnter ( e , this . jumpNext ) ;
309
314
} ;
310
315
311
- handleGoTO = e => {
316
+ handleGoTO = ( e ) => {
312
317
if ( e . keyCode === KEYCODE . ENTER || e . type === 'click' ) {
313
318
this . handleChange ( this . state . currentInputValue ) ;
314
319
}
0 commit comments