Pagination.js 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721
  1. import _defineProperty from 'babel-runtime/helpers/defineProperty';
  2. import _mergeJSXProps from 'babel-helper-vue-jsx-merge-props';
  3. import _toConsumableArray from 'babel-runtime/helpers/toConsumableArray';
  4. import PropTypes from '../_util/vue-types';
  5. import BaseMixin from '../_util/BaseMixin';
  6. import { hasProp, getComponentFromProp, getOptionProps } from '../_util/props-util';
  7. import Pager from './Pager';
  8. import Options from './Options';
  9. import LOCALE from './locale/zh_CN';
  10. import KEYCODE from './KeyCode';
  11. function noop() {}
  12. // 是否是正整数
  13. function isInteger(value) {
  14. return typeof value === 'number' && isFinite(value) && Math.floor(value) === value;
  15. }
  16. function defaultItemRender(page, type, element) {
  17. return element;
  18. }
  19. function calculatePage(p, state, props) {
  20. var pageSize = p;
  21. if (typeof pageSize === 'undefined') {
  22. pageSize = state.statePageSize;
  23. }
  24. return Math.floor((props.total - 1) / pageSize) + 1;
  25. }
  26. export default {
  27. name: 'Pagination',
  28. mixins: [BaseMixin],
  29. model: {
  30. prop: 'current',
  31. event: 'change.current'
  32. },
  33. props: {
  34. disabled: PropTypes.bool,
  35. prefixCls: PropTypes.string.def('rc-pagination'),
  36. selectPrefixCls: PropTypes.string.def('rc-select'),
  37. current: PropTypes.number,
  38. defaultCurrent: PropTypes.number.def(1),
  39. total: PropTypes.number.def(0),
  40. pageSize: PropTypes.number,
  41. defaultPageSize: PropTypes.number.def(10),
  42. hideOnSinglePage: PropTypes.bool.def(false),
  43. showSizeChanger: PropTypes.bool.def(false),
  44. showLessItems: PropTypes.bool.def(false),
  45. // showSizeChange: PropTypes.func.def(noop),
  46. selectComponentClass: PropTypes.any,
  47. showPrevNextJumpers: PropTypes.bool.def(true),
  48. showQuickJumper: PropTypes.oneOfType([PropTypes.bool, PropTypes.object]).def(false),
  49. showTitle: PropTypes.bool.def(true),
  50. pageSizeOptions: PropTypes.arrayOf(PropTypes.string),
  51. buildOptionText: PropTypes.func,
  52. showTotal: PropTypes.func,
  53. simple: PropTypes.bool,
  54. locale: PropTypes.object.def(LOCALE),
  55. itemRender: PropTypes.func.def(defaultItemRender),
  56. prevIcon: PropTypes.any,
  57. nextIcon: PropTypes.any,
  58. jumpPrevIcon: PropTypes.any,
  59. jumpNextIcon: PropTypes.any
  60. },
  61. data: function data() {
  62. var props = getOptionProps(this);
  63. var hasOnChange = this.onChange !== noop;
  64. var hasCurrent = 'current' in props;
  65. if (hasCurrent && !hasOnChange) {
  66. console.warn('Warning: You provided a `current` prop to a Pagination component without an `onChange` handler. This will render a read-only component.'); // eslint-disable-line
  67. }
  68. var current = this.defaultCurrent;
  69. if ('current' in props) {
  70. current = this.current;
  71. }
  72. var pageSize = this.defaultPageSize;
  73. if ('pageSize' in props) {
  74. pageSize = this.pageSize;
  75. }
  76. current = Math.min(current, calculatePage(pageSize, undefined, props));
  77. return {
  78. stateCurrent: current,
  79. stateCurrentInputValue: current,
  80. statePageSize: pageSize
  81. };
  82. },
  83. watch: {
  84. current: function current(val) {
  85. this.setState({
  86. stateCurrent: val,
  87. stateCurrentInputValue: val
  88. });
  89. },
  90. pageSize: function pageSize(val) {
  91. var newState = {};
  92. var current = this.stateCurrent;
  93. var newCurrent = calculatePage(val, this.$data, this.$props);
  94. current = current > newCurrent ? newCurrent : current;
  95. if (!hasProp(this, 'current')) {
  96. newState.stateCurrent = current;
  97. newState.stateCurrentInputValue = current;
  98. }
  99. newState.statePageSize = val;
  100. this.setState(newState);
  101. },
  102. stateCurrent: function stateCurrent(val, oldValue) {
  103. var _this = this;
  104. // When current page change, fix focused style of prev item
  105. // A hacky solution of https://github.com/ant-design/ant-design/issues/8948
  106. this.$nextTick(function () {
  107. if (_this.$refs.paginationNode) {
  108. var lastCurrentNode = _this.$refs.paginationNode.querySelector('.' + _this.prefixCls + '-item-' + oldValue);
  109. if (lastCurrentNode && document.activeElement === lastCurrentNode) {
  110. lastCurrentNode.blur();
  111. }
  112. }
  113. });
  114. },
  115. total: function total() {
  116. var newState = {};
  117. var newCurrent = calculatePage(this.pageSize, this.$data, this.$props);
  118. if (hasProp(this, 'current')) {
  119. var current = Math.min(this.current, newCurrent);
  120. newState.stateCurrent = current;
  121. newState.stateCurrentInputValue = current;
  122. } else {
  123. var _current = this.stateCurrent;
  124. if (_current === 0 && newCurrent > 0) {
  125. _current = 1;
  126. } else {
  127. _current = Math.min(this.stateCurrent, newCurrent);
  128. }
  129. newState.stateCurrent = _current;
  130. }
  131. this.setState(newState);
  132. }
  133. },
  134. methods: {
  135. getJumpPrevPage: function getJumpPrevPage() {
  136. return Math.max(1, this.stateCurrent - (this.showLessItems ? 3 : 5));
  137. },
  138. getJumpNextPage: function getJumpNextPage() {
  139. return Math.min(calculatePage(undefined, this.$data, this.$props), this.stateCurrent + (this.showLessItems ? 3 : 5));
  140. },
  141. getItemIcon: function getItemIcon(icon) {
  142. var h = this.$createElement;
  143. var prefixCls = this.$props.prefixCls;
  144. var iconNode = getComponentFromProp(this, icon, this.$props) || h('a', { 'class': prefixCls + '-item-link' });
  145. return iconNode;
  146. },
  147. getValidValue: function getValidValue(e) {
  148. var inputValue = e.target.value;
  149. var allPages = calculatePage(undefined, this.$data, this.$props);
  150. var stateCurrentInputValue = this.$data.stateCurrentInputValue;
  151. var value = void 0;
  152. if (inputValue === '') {
  153. value = inputValue;
  154. } else if (isNaN(Number(inputValue))) {
  155. value = stateCurrentInputValue;
  156. } else if (inputValue >= allPages) {
  157. value = allPages;
  158. } else {
  159. value = Number(inputValue);
  160. }
  161. return value;
  162. },
  163. isValid: function isValid(page) {
  164. return isInteger(page) && page !== this.stateCurrent;
  165. },
  166. shouldDisplayQuickJumper: function shouldDisplayQuickJumper() {
  167. var _$props = this.$props,
  168. showQuickJumper = _$props.showQuickJumper,
  169. pageSize = _$props.pageSize,
  170. total = _$props.total;
  171. if (total <= pageSize) {
  172. return false;
  173. }
  174. return showQuickJumper;
  175. },
  176. // calculatePage (p) {
  177. // let pageSize = p
  178. // if (typeof pageSize === 'undefined') {
  179. // pageSize = this.statePageSize
  180. // }
  181. // return Math.floor((this.total - 1) / pageSize) + 1
  182. // },
  183. handleKeyDown: function handleKeyDown(event) {
  184. if (event.keyCode === KEYCODE.ARROW_UP || event.keyCode === KEYCODE.ARROW_DOWN) {
  185. event.preventDefault();
  186. }
  187. },
  188. handleKeyUp: function handleKeyUp(e) {
  189. if (e.isComposing || e.target.composing) return;
  190. var value = this.getValidValue(e);
  191. var stateCurrentInputValue = this.stateCurrentInputValue;
  192. if (value !== stateCurrentInputValue) {
  193. this.setState({
  194. stateCurrentInputValue: value
  195. });
  196. }
  197. if (e.keyCode === KEYCODE.ENTER) {
  198. this.handleChange(value);
  199. } else if (e.keyCode === KEYCODE.ARROW_UP) {
  200. this.handleChange(value - 1);
  201. } else if (e.keyCode === KEYCODE.ARROW_DOWN) {
  202. this.handleChange(value + 1);
  203. }
  204. },
  205. changePageSize: function changePageSize(size) {
  206. var current = this.stateCurrent;
  207. var preCurrent = current;
  208. var newCurrent = calculatePage(size, this.$data, this.$props);
  209. current = current > newCurrent ? newCurrent : current;
  210. // fix the issue:
  211. // Once 'total' is 0, 'current' in 'onShowSizeChange' is 0, which is not correct.
  212. if (newCurrent === 0) {
  213. current = this.stateCurrent;
  214. }
  215. if (typeof size === 'number') {
  216. if (!hasProp(this, 'pageSize')) {
  217. this.setState({
  218. statePageSize: size
  219. });
  220. }
  221. if (!hasProp(this, 'current')) {
  222. this.setState({
  223. stateCurrent: current,
  224. stateCurrentInputValue: current
  225. });
  226. }
  227. }
  228. this.$emit('update:pageSize', size);
  229. this.$emit('showSizeChange', current, size);
  230. if (current !== preCurrent) {
  231. this.$emit('change.current', current, size);
  232. }
  233. },
  234. handleChange: function handleChange(p) {
  235. var disabled = this.$props.disabled;
  236. var page = p;
  237. if (this.isValid(page) && !disabled) {
  238. var currentPage = calculatePage(undefined, this.$data, this.$props);
  239. if (page > currentPage) {
  240. page = currentPage;
  241. } else if (page < 1) {
  242. page = 1;
  243. }
  244. if (!hasProp(this, 'current')) {
  245. this.setState({
  246. stateCurrent: page,
  247. stateCurrentInputValue: page
  248. });
  249. }
  250. // this.$emit('input', page)
  251. this.$emit('change.current', page, this.statePageSize);
  252. this.$emit('change', page, this.statePageSize);
  253. return page;
  254. }
  255. return this.stateCurrent;
  256. },
  257. prev: function prev() {
  258. if (this.hasPrev()) {
  259. this.handleChange(this.stateCurrent - 1);
  260. }
  261. },
  262. next: function next() {
  263. if (this.hasNext()) {
  264. this.handleChange(this.stateCurrent + 1);
  265. }
  266. },
  267. jumpPrev: function jumpPrev() {
  268. this.handleChange(this.getJumpPrevPage());
  269. },
  270. jumpNext: function jumpNext() {
  271. this.handleChange(this.getJumpNextPage());
  272. },
  273. hasPrev: function hasPrev() {
  274. return this.stateCurrent > 1;
  275. },
  276. hasNext: function hasNext() {
  277. return this.stateCurrent < calculatePage(undefined, this.$data, this.$props);
  278. },
  279. runIfEnter: function runIfEnter(event, callback) {
  280. if (event.key === 'Enter' || event.charCode === 13) {
  281. for (var _len = arguments.length, restParams = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
  282. restParams[_key - 2] = arguments[_key];
  283. }
  284. callback.apply(undefined, _toConsumableArray(restParams));
  285. }
  286. },
  287. runIfEnterPrev: function runIfEnterPrev(event) {
  288. this.runIfEnter(event, this.prev);
  289. },
  290. runIfEnterNext: function runIfEnterNext(event) {
  291. this.runIfEnter(event, this.next);
  292. },
  293. runIfEnterJumpPrev: function runIfEnterJumpPrev(event) {
  294. this.runIfEnter(event, this.jumpPrev);
  295. },
  296. runIfEnterJumpNext: function runIfEnterJumpNext(event) {
  297. this.runIfEnter(event, this.jumpNext);
  298. },
  299. handleGoTO: function handleGoTO(event) {
  300. if (event.keyCode === KEYCODE.ENTER || event.type === 'click') {
  301. this.handleChange(this.stateCurrentInputValue);
  302. }
  303. }
  304. },
  305. render: function render() {
  306. var _ref;
  307. var h = arguments[0];
  308. var _$props2 = this.$props,
  309. prefixCls = _$props2.prefixCls,
  310. disabled = _$props2.disabled;
  311. // When hideOnSinglePage is true and there is only 1 page, hide the pager
  312. if (this.hideOnSinglePage === true && this.total <= this.statePageSize) {
  313. return null;
  314. }
  315. var props = this.$props;
  316. var locale = this.locale;
  317. var allPages = calculatePage(undefined, this.$data, this.$props);
  318. var pagerList = [];
  319. var jumpPrev = null;
  320. var jumpNext = null;
  321. var firstPager = null;
  322. var lastPager = null;
  323. var gotoButton = null;
  324. var goButton = this.showQuickJumper && this.showQuickJumper.goButton;
  325. var pageBufferSize = this.showLessItems ? 1 : 2;
  326. var stateCurrent = this.stateCurrent,
  327. statePageSize = this.statePageSize;
  328. var prevPage = stateCurrent - 1 > 0 ? stateCurrent - 1 : 0;
  329. var nextPage = stateCurrent + 1 < allPages ? stateCurrent + 1 : allPages;
  330. if (this.simple) {
  331. if (goButton) {
  332. if (typeof goButton === 'boolean') {
  333. gotoButton = h(
  334. 'button',
  335. {
  336. attrs: { type: 'button' },
  337. on: {
  338. 'click': this.handleGoTO,
  339. 'keyup': this.handleGoTO
  340. }
  341. },
  342. [locale.jump_to_confirm]
  343. );
  344. } else {
  345. gotoButton = h(
  346. 'span',
  347. {
  348. on: {
  349. 'click': this.handleGoTO,
  350. 'keyup': this.handleGoTO
  351. }
  352. },
  353. [goButton]
  354. );
  355. }
  356. gotoButton = h(
  357. 'li',
  358. {
  359. attrs: {
  360. title: this.showTitle ? '' + locale.jump_to + this.stateCurrent + '/' + allPages : null
  361. },
  362. 'class': prefixCls + '-simple-pager'
  363. },
  364. [gotoButton]
  365. );
  366. }
  367. var hasPrev = this.hasPrev();
  368. var hasNext = this.hasNext();
  369. return h(
  370. 'ul',
  371. { 'class': prefixCls + ' ' + prefixCls + '-simple' },
  372. [h(
  373. 'li',
  374. {
  375. attrs: {
  376. title: this.showTitle ? locale.prev_page : null,
  377. tabIndex: hasPrev ? 0 : null,
  378. 'aria-disabled': !this.hasPrev()
  379. },
  380. on: {
  381. 'click': this.prev,
  382. 'keypress': this.runIfEnterPrev
  383. },
  384. 'class': (hasPrev ? '' : prefixCls + '-disabled') + ' ' + prefixCls + '-prev' },
  385. [this.itemRender(prevPage, 'prev', this.getItemIcon('prevIcon'))]
  386. ), h(
  387. 'li',
  388. {
  389. attrs: {
  390. title: this.showTitle ? stateCurrent + '/' + allPages : null
  391. },
  392. 'class': prefixCls + '-simple-pager'
  393. },
  394. [h('input', _mergeJSXProps([{
  395. attrs: {
  396. type: 'text',
  397. size: '3'
  398. },
  399. domProps: {
  400. 'value': this.stateCurrentInputValue
  401. },
  402. on: {
  403. 'keydown': this.handleKeyDown,
  404. 'keyup': this.handleKeyUp,
  405. 'input': this.handleKeyUp
  406. }
  407. }, {
  408. directives: [{
  409. name: 'ant-input'
  410. }]
  411. }])), h(
  412. 'span',
  413. { 'class': prefixCls + '-slash' },
  414. ['\uFF0F']
  415. ), allPages]
  416. ), h(
  417. 'li',
  418. {
  419. attrs: {
  420. title: this.showTitle ? locale.next_page : null,
  421. tabIndex: this.hasNext ? 0 : null,
  422. 'aria-disabled': !this.hasNext()
  423. },
  424. on: {
  425. 'click': this.next,
  426. 'keypress': this.runIfEnterNext
  427. },
  428. 'class': (hasNext ? '' : prefixCls + '-disabled') + ' ' + prefixCls + '-next' },
  429. [this.itemRender(nextPage, 'next', this.getItemIcon('nextIcon'))]
  430. ), gotoButton]
  431. );
  432. }
  433. if (allPages <= 5 + pageBufferSize * 2) {
  434. var pagerProps = {
  435. props: {
  436. locale: locale,
  437. rootPrefixCls: prefixCls,
  438. showTitle: props.showTitle,
  439. itemRender: props.itemRender
  440. },
  441. on: {
  442. click: this.handleChange,
  443. keypress: this.runIfEnter
  444. }
  445. };
  446. if (!allPages) {
  447. pagerList.push(h(Pager, _mergeJSXProps([pagerProps, { key: 'noPager', attrs: { page: allPages },
  448. 'class': prefixCls + '-disabled' }])));
  449. }
  450. for (var i = 1; i <= allPages; i++) {
  451. var active = stateCurrent === i;
  452. pagerList.push(h(Pager, _mergeJSXProps([pagerProps, { key: i, attrs: { page: i, active: active }
  453. }])));
  454. }
  455. } else {
  456. var prevItemTitle = this.showLessItems ? locale.prev_3 : locale.prev_5;
  457. var nextItemTitle = this.showLessItems ? locale.next_3 : locale.next_5;
  458. if (this.showPrevNextJumpers) {
  459. var jumpPrevClassString = prefixCls + '-jump-prev';
  460. if (props.jumpPrevIcon) {
  461. jumpPrevClassString += ' ' + prefixCls + '-jump-prev-custom-icon';
  462. }
  463. jumpPrev = h(
  464. 'li',
  465. {
  466. attrs: {
  467. title: this.showTitle ? prevItemTitle : null,
  468. tabIndex: '0'
  469. },
  470. key: 'prev',
  471. on: {
  472. 'click': this.jumpPrev,
  473. 'keypress': this.runIfEnterJumpPrev
  474. },
  475. 'class': jumpPrevClassString
  476. },
  477. [this.itemRender(this.getJumpPrevPage(), 'jump-prev', this.getItemIcon('jumpPrevIcon'))]
  478. );
  479. var jumpNextClassString = prefixCls + '-jump-next';
  480. if (props.jumpNextIcon) {
  481. jumpNextClassString += ' ' + prefixCls + '-jump-next-custom-icon';
  482. }
  483. jumpNext = h(
  484. 'li',
  485. {
  486. attrs: {
  487. title: this.showTitle ? nextItemTitle : null,
  488. tabIndex: '0'
  489. },
  490. key: 'next', on: {
  491. 'click': this.jumpNext,
  492. 'keypress': this.runIfEnterJumpNext
  493. },
  494. 'class': jumpNextClassString
  495. },
  496. [this.itemRender(this.getJumpNextPage(), 'jump-next', this.getItemIcon('jumpNextIcon'))]
  497. );
  498. }
  499. lastPager = h(Pager, {
  500. attrs: {
  501. locale: locale,
  502. last: true,
  503. rootPrefixCls: prefixCls,
  504. page: allPages,
  505. active: false,
  506. showTitle: this.showTitle,
  507. itemRender: this.itemRender
  508. },
  509. on: {
  510. 'click': this.handleChange,
  511. 'keypress': this.runIfEnter
  512. },
  513. key: allPages });
  514. firstPager = h(Pager, {
  515. attrs: {
  516. locale: locale,
  517. rootPrefixCls: prefixCls,
  518. page: 1,
  519. active: false,
  520. showTitle: this.showTitle,
  521. itemRender: this.itemRender
  522. },
  523. on: {
  524. 'click': this.handleChange,
  525. 'keypress': this.runIfEnter
  526. },
  527. key: 1 });
  528. var left = Math.max(1, stateCurrent - pageBufferSize);
  529. var right = Math.min(stateCurrent + pageBufferSize, allPages);
  530. if (stateCurrent - 1 <= pageBufferSize) {
  531. right = 1 + pageBufferSize * 2;
  532. }
  533. if (allPages - stateCurrent <= pageBufferSize) {
  534. left = allPages - pageBufferSize * 2;
  535. }
  536. for (var _i = left; _i <= right; _i++) {
  537. var _active = stateCurrent === _i;
  538. pagerList.push(h(Pager, {
  539. attrs: {
  540. locale: locale,
  541. rootPrefixCls: prefixCls,
  542. page: _i,
  543. active: _active,
  544. showTitle: this.showTitle,
  545. itemRender: this.itemRender
  546. },
  547. on: {
  548. 'click': this.handleChange,
  549. 'keypress': this.runIfEnter
  550. },
  551. key: _i }));
  552. }
  553. if (stateCurrent - 1 >= pageBufferSize * 2 && stateCurrent !== 1 + 2) {
  554. pagerList[0] = h(Pager, {
  555. attrs: {
  556. locale: locale,
  557. rootPrefixCls: prefixCls,
  558. page: left,
  559. active: false,
  560. showTitle: this.showTitle,
  561. itemRender: this.itemRender
  562. },
  563. on: {
  564. 'click': this.handleChange,
  565. 'keypress': this.runIfEnter
  566. },
  567. key: left, 'class': prefixCls + '-item-after-jump-prev' });
  568. pagerList.unshift(jumpPrev);
  569. }
  570. if (allPages - stateCurrent >= pageBufferSize * 2 && stateCurrent !== allPages - 2) {
  571. pagerList[pagerList.length - 1] = h(Pager, {
  572. attrs: {
  573. locale: locale,
  574. rootPrefixCls: prefixCls,
  575. page: right,
  576. active: false,
  577. showTitle: this.showTitle,
  578. itemRender: this.itemRender
  579. },
  580. on: {
  581. 'click': this.handleChange,
  582. 'keypress': this.runIfEnter
  583. },
  584. key: right, 'class': prefixCls + '-item-before-jump-next' });
  585. pagerList.push(jumpNext);
  586. }
  587. if (left !== 1) {
  588. pagerList.unshift(firstPager);
  589. }
  590. if (right !== allPages) {
  591. pagerList.push(lastPager);
  592. }
  593. }
  594. var totalText = null;
  595. if (this.showTotal) {
  596. totalText = h(
  597. 'li',
  598. { 'class': prefixCls + '-total-text' },
  599. [this.showTotal(this.total, [this.total === 0 ? 0 : (stateCurrent - 1) * statePageSize + 1, stateCurrent * statePageSize > this.total ? this.total : stateCurrent * statePageSize])]
  600. );
  601. }
  602. var prevDisabled = !this.hasPrev() || !allPages;
  603. var nextDisabled = !this.hasNext() || !allPages;
  604. var buildOptionText = this.buildOptionText || this.$scopedSlots.buildOptionText;
  605. return h(
  606. 'ul',
  607. {
  608. 'class': (_ref = {}, _defineProperty(_ref, '' + prefixCls, true), _defineProperty(_ref, prefixCls + '-disabled', disabled), _ref),
  609. attrs: { unselectable: 'unselectable'
  610. },
  611. ref: 'paginationNode'
  612. },
  613. [totalText, h(
  614. 'li',
  615. {
  616. attrs: {
  617. title: this.showTitle ? locale.prev_page : null,
  618. tabIndex: prevDisabled ? null : 0,
  619. 'aria-disabled': prevDisabled
  620. },
  621. on: {
  622. 'click': this.prev,
  623. 'keypress': this.runIfEnterPrev
  624. },
  625. 'class': (!prevDisabled ? '' : prefixCls + '-disabled') + ' ' + prefixCls + '-prev' },
  626. [this.itemRender(prevPage, 'prev', this.getItemIcon('prevIcon'))]
  627. ), pagerList, h(
  628. 'li',
  629. {
  630. attrs: {
  631. title: this.showTitle ? locale.next_page : null,
  632. tabIndex: nextDisabled ? null : 0,
  633. 'aria-disabled': nextDisabled
  634. },
  635. on: {
  636. 'click': this.next,
  637. 'keypress': this.runIfEnterNext
  638. },
  639. 'class': (!nextDisabled ? '' : prefixCls + '-disabled') + ' ' + prefixCls + '-next' },
  640. [this.itemRender(nextPage, 'next', this.getItemIcon('nextIcon'))]
  641. ), h(Options, {
  642. attrs: {
  643. disabled: disabled,
  644. locale: locale,
  645. rootPrefixCls: prefixCls,
  646. selectComponentClass: this.selectComponentClass,
  647. selectPrefixCls: this.selectPrefixCls,
  648. changeSize: this.showSizeChanger ? this.changePageSize : null,
  649. current: stateCurrent,
  650. pageSize: statePageSize,
  651. pageSizeOptions: this.pageSizeOptions,
  652. buildOptionText: buildOptionText || null,
  653. quickGo: this.shouldDisplayQuickJumper() ? this.handleChange : null,
  654. goButton: goButton
  655. }
  656. })]
  657. );
  658. }
  659. };