@@ -133,7 +133,7 @@ class Pagination extends React.Component {
133133 * @param {React.ReactNode | React.ComponentType<PaginationProps> } icon received icon.
134134 * @returns {React.ReactNode }
135135 */
136- getItemIcon = icon => {
136+ getItemIcon = ( icon ) => {
137137 const { prefixCls } = this . props ;
138138 // eslint-disable-next-line jsx-a11y/anchor-has-content
139139 let iconNode = icon || < a className = { `${ prefixCls } -item-link` } /> ;
@@ -161,11 +161,11 @@ class Pagination extends React.Component {
161161 return value ;
162162 }
163163
164- savePaginationNode = node => {
164+ savePaginationNode = ( node ) => {
165165 this . paginationNode = node ;
166166 } ;
167167
168- isValid = page => isInteger ( page ) && page !== this . state . current ;
168+ isValid = ( page ) => isInteger ( page ) && page !== this . state . current ;
169169
170170 shouldDisplayQuickJumper = ( ) => {
171171 const { showQuickJumper, pageSize, total } = this . props ;
@@ -175,13 +175,13 @@ class Pagination extends React.Component {
175175 return showQuickJumper ;
176176 } ;
177177
178- handleKeyDown = e => {
178+ handleKeyDown = ( e ) => {
179179 if ( e . keyCode === KEYCODE . ARROW_UP || e . keyCode === KEYCODE . ARROW_DOWN ) {
180180 e . preventDefault ( ) ;
181181 }
182182 } ;
183183
184- handleKeyUp = e => {
184+ handleKeyUp = ( e ) => {
185185 const value = this . getValidValue ( e ) ;
186186 const { currentInputValue } = this . state ;
187187 if ( value !== currentInputValue ) {
@@ -198,7 +198,7 @@ class Pagination extends React.Component {
198198 }
199199 } ;
200200
201- changePageSize = size => {
201+ changePageSize = ( size ) => {
202202 let { current } = this . state ;
203203 const newCurrent = calculatePage ( size , this . state , this . props ) ;
204204 current = current > newCurrent ? newCurrent : current ;
@@ -222,10 +222,15 @@ class Pagination extends React.Component {
222222 } ) ;
223223 }
224224 }
225+
226+ if ( 'onChange' in this . props && this . props . onChange ) {
227+ this . props . onChange ( current , size ) ;
228+ }
229+
225230 this . props . onShowSizeChange ( current , size ) ;
226231 } ;
227232
228- handleChange = p => {
233+ handleChange = ( p ) => {
229234 const { disabled } = this . props ;
230235
231236 let page = p ;
@@ -278,37 +283,37 @@ class Pagination extends React.Component {
278283 hasNext = ( ) =>
279284 this . state . current < calculatePage ( undefined , this . state , this . props ) ;
280285
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+ }
288293
289294 runIfEnter = ( event , callback , ...restParams ) => {
290295 if ( event . key === 'Enter' || event . charCode === 13 ) {
291296 callback ( ...restParams ) ;
292297 }
293298 } ;
294299
295- runIfEnterPrev = e => {
300+ runIfEnterPrev = ( e ) => {
296301 this . runIfEnter ( e , this . prev ) ;
297302 } ;
298303
299- runIfEnterNext = e => {
304+ runIfEnterNext = ( e ) => {
300305 this . runIfEnter ( e , this . next ) ;
301306 } ;
302307
303- runIfEnterJumpPrev = e => {
308+ runIfEnterJumpPrev = ( e ) => {
304309 this . runIfEnter ( e , this . jumpPrev ) ;
305310 } ;
306311
307- runIfEnterJumpNext = e => {
312+ runIfEnterJumpNext = ( e ) => {
308313 this . runIfEnter ( e , this . jumpNext ) ;
309314 } ;
310315
311- handleGoTO = e => {
316+ handleGoTO = ( e ) => {
312317 if ( e . keyCode === KEYCODE . ENTER || e . type === 'click' ) {
313318 this . handleChange ( this . state . currentInputValue ) ;
314319 }
0 commit comments