From caabba686b08ed5fef5a21fe0c4eb95373bfeb08 Mon Sep 17 00:00:00 2001 From: wuxh Date: Sat, 4 Nov 2023 01:37:32 +0800 Subject: [PATCH 01/64] test: add example test --- jest.config.js | 5 +++++ package.json | 1 + tests/__snapshots__/demo.test.js.snap | 27 +++++++++++++++++++++++++++ tests/demo.test.js | 20 ++++++++++++++++++++ 4 files changed, 53 insertions(+) create mode 100644 tests/__snapshots__/demo.test.js.snap create mode 100644 tests/demo.test.js diff --git a/jest.config.js b/jest.config.js index 66a2c875..cdd7872b 100644 --- a/jest.config.js +++ b/jest.config.js @@ -1,3 +1,8 @@ +const pkg = require('./package.json'); module.exports = { snapshotSerializers: [require.resolve('enzyme-to-json/serializer')], + moduleNameMapper: { + [pkg.name]: '/src/index.ts', + '\\.less$': 'identity-obj-proxy', + }, }; diff --git a/package.json b/package.json index 72b9b82a..a361ab0c 100644 --- a/package.json +++ b/package.json @@ -67,6 +67,7 @@ "gh-pages": "^4.0.0", "glob": "^7.1.6", "husky": "^8.0.3", + "identity-obj-proxy": "^3.0.0", "less": "^3.10.3", "lint-staged": "^15.0.2", "np": "^7.0.0", diff --git a/tests/__snapshots__/demo.test.js.snap b/tests/__snapshots__/demo.test.js.snap new file mode 100644 index 00000000..b04aad6e --- /dev/null +++ b/tests/__snapshots__/demo.test.js.snap @@ -0,0 +1,27 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`Example basic 1`] = `""`; + +exports[`Example controlled 1`] = `""`; + +exports[`Example itemRender 1`] = `""`; + +exports[`Example jumper 1`] = `"

默认

禁用

单页默认隐藏


"`; + +exports[`Example jumperWithGoButton 1`] = `"

customize node

default node

"`; + +exports[`Example lessPages 1`] = `"
Is using icon: true
"`; + +exports[`Example locale 1`] = `""`; + +exports[`Example more 1`] = `""`; + +exports[`Example showTitle 1`] = `"
"`; + +exports[`Example showTotal 1`] = `"

"`; + +exports[`Example simple 1`] = `"

"`; + +exports[`Example sizer 1`] = `"
"`; + +exports[`Example styles 1`] = `""`; diff --git a/tests/demo.test.js b/tests/demo.test.js new file mode 100644 index 00000000..f5cf65d1 --- /dev/null +++ b/tests/demo.test.js @@ -0,0 +1,20 @@ +import { mount } from 'enzyme'; +import fs from 'fs'; +import path from 'path'; + +const exampleDir = path.resolve(__dirname, '../docs/examples'); +const files = fs + .readdirSync(exampleDir) + .filter((file) => file.endsWith('.tsx')); + +describe('Example', () => { + files.forEach((file) => { + const name = path.basename(file, '.tsx'); + it(name, () => { + const Example = require(path.join(exampleDir, file)).default; + + const wrapper = mount(); + expect(wrapper.html()).toMatchSnapshot(); + }); + }); +}); From 3e6a3886c060aa340740010f1f1885795c4e5a4a Mon Sep 17 00:00:00 2001 From: wuxh Date: Sat, 4 Nov 2023 01:41:35 +0800 Subject: [PATCH 02/64] chore: refactor type --- src/Pagination.tsx | 178 ++++++++++++++------------------------------- src/interface.ts | 66 +++++++++++++++++ 2 files changed, 119 insertions(+), 125 deletions(-) create mode 100644 src/interface.ts diff --git a/src/Pagination.tsx b/src/Pagination.tsx index 8175b2af..32587f0e 100644 --- a/src/Pagination.tsx +++ b/src/Pagination.tsx @@ -2,78 +2,12 @@ import classNames from 'classnames'; import pickAttrs from 'rc-util/lib/pickAttrs'; import React, { cloneElement, isValidElement } from 'react'; import KEYCODE from './KeyCode'; -import LOCALE from './locale/zh_CN'; import Options from './Options'; import Pager from './Pager'; +import type { PaginationProps, PaginationState } from './interface'; +import LOCALE from './locale/zh_CN'; -export interface PaginationLocale { - // Options.jsx - items_per_page?: string; - jump_to?: string; - jump_to_confirm?: string; - page?: string; - - // Pagination.jsx - prev_page?: string; - next_page?: string; - prev_5?: string; - next_5?: string; - prev_3?: string; - next_3?: string; -} - -export interface PaginationData { - className: string; - selectPrefixCls: string; - prefixCls: string; - pageSizeOptions: string[] | number[]; - - current: number; - defaultCurrent: number; - total: number; - totalBoundaryShowSizeChanger?: number; - pageSize: number; - defaultPageSize: number; - - hideOnSinglePage: boolean; - showSizeChanger: boolean; - showLessItems: boolean; - showPrevNextJumpers: boolean; - showQuickJumper: boolean | object; - showTitle: boolean; - simple: boolean; - disabled: boolean; - - locale: PaginationLocale; - - style: React.CSSProperties; - - selectComponentClass: React.ComponentType; - prevIcon: React.ComponentType | React.ReactNode; - nextIcon: React.ComponentType | React.ReactNode; - jumpPrevIcon: React.ComponentType | React.ReactNode; - jumpNextIcon: React.ComponentType | React.ReactNode; -} - -export interface PaginationProps extends Partial { - onChange?: (page: number, pageSize: number) => void; - onShowSizeChange?: (current: number, size: number) => void; - itemRender?: ( - page: number, - type: 'page' | 'prev' | 'next' | 'jump-prev' | 'jump-next', - element: React.ReactNode, - ) => React.ReactNode; - showTotal?: (total: number, range: [number, number]) => React.ReactNode; -} - -interface PaginationState { - current: number; - currentInputValue: number; - pageSize: number; -} - -function noop() { -} +function noop() {} function isInteger(v: number) { const value = Number(v); @@ -545,22 +479,20 @@ class Pagination extends React.Component { {...dataOrAriaAttributeProps} > {totalText} - { - prev ? ( -
  • - {prev} -
  • - ) : null - } + {prev ? ( +
  • + {prev} +
  • + ) : null}
  • { this.getItemIcon(jumpNextIcon, 'next page'), ); if (showPrevNextJumpers) { - jumpPrev = ( - jumpPrevContent ?
  • { })} > {jumpPrevContent} -
  • : null - ); - jumpNext = ( - jumpNextContent ?
  • + ) : null; + jumpNext = jumpNextContent ? ( +
  • { })} > {jumpNextContent} -
  • : null - ); + + ) : null; } lastPager = ( { {...dataOrAriaAttributeProps} > {totalText} - { - prev ? ( -
  • - {prev} -
  • - ) : null - } + {prev ? ( +
  • + {prev} +
  • + ) : null} {pagerList} - { - next ? ( -
  • - {next} -
  • - ) : null - } + {next ? ( +
  • + {next} +
  • + ) : null} { + onChange?: (page: number, pageSize: number) => void; + onShowSizeChange?: (current: number, size: number) => void; + itemRender?: ( + page: number, + type: 'page' | 'prev' | 'next' | 'jump-prev' | 'jump-next', + element: React.ReactNode, + ) => React.ReactNode; + showTotal?: (total: number, range: [number, number]) => React.ReactNode; +} +export interface PaginationState { + current: number; + currentInputValue: number; + pageSize: number; +} From f49d4baaa58b537a8c23b67630e6ad0c8e59de78 Mon Sep 17 00:00:00 2001 From: wuxh Date: Sat, 4 Nov 2023 01:45:14 +0800 Subject: [PATCH 03/64] chore: bump deps --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index a361ab0c..437d4cb8 100644 --- a/package.json +++ b/package.json @@ -45,8 +45,8 @@ }, "dependencies": { "@babel/runtime": "^7.10.1", - "classnames": "^2.2.1", - "rc-util": "^5.32.2" + "classnames": "^2.3.2", + "rc-util": "^5.38.0" }, "devDependencies": { "@rc-component/father-plugin": "^1.0.0", From 0834880ad1275a20898ea3c0e4a5f32101031407 Mon Sep 17 00:00:00 2001 From: wuxh Date: Sat, 4 Nov 2023 01:50:38 +0800 Subject: [PATCH 04/64] chore: replace keycode --- src/KeyCode.ts | 16 ---------------- src/Options.tsx | 2 +- src/Pagination.tsx | 9 ++++----- 3 files changed, 5 insertions(+), 22 deletions(-) delete mode 100644 src/KeyCode.ts diff --git a/src/KeyCode.ts b/src/KeyCode.ts deleted file mode 100644 index a85d600c..00000000 --- a/src/KeyCode.ts +++ /dev/null @@ -1,16 +0,0 @@ -const KeyCode = { - ZERO: 48, - NINE: 57, - - NUMPAD_ZERO: 96, - NUMPAD_NINE: 105, - - BACKSPACE: 8, - DELETE: 46, - ENTER: 13, - - ARROW_UP: 38, - ARROW_DOWN: 40, -}; - -export default KeyCode; \ No newline at end of file diff --git a/src/Options.tsx b/src/Options.tsx index a505c379..d5a215f3 100644 --- a/src/Options.tsx +++ b/src/Options.tsx @@ -1,6 +1,6 @@ /* eslint react/prop-types: 0 */ +import KEYCODE from 'rc-util/lib/KeyCode'; import React from 'react'; -import KEYCODE from './KeyCode'; interface Props { disabled: boolean; diff --git a/src/Pagination.tsx b/src/Pagination.tsx index 32587f0e..7f7128f1 100644 --- a/src/Pagination.tsx +++ b/src/Pagination.tsx @@ -1,7 +1,7 @@ import classNames from 'classnames'; +import KEYCODE from 'rc-util/lib/KeyCode'; import pickAttrs from 'rc-util/lib/pickAttrs'; import React, { cloneElement, isValidElement } from 'react'; -import KEYCODE from './KeyCode'; import Options from './Options'; import Pager from './Pager'; import type { PaginationProps, PaginationState } from './interface'; @@ -205,7 +205,7 @@ class Pagination extends React.Component { }; handleKeyDown = (e: React.KeyboardEvent) => { - if (e.keyCode === KEYCODE.ARROW_UP || e.keyCode === KEYCODE.ARROW_DOWN) { + if (e.keyCode === KEYCODE.UP || e.keyCode === KEYCODE.DOWN) { e.preventDefault(); } }; @@ -225,12 +225,11 @@ class Pagination extends React.Component { ) { this.handleChange(value); } else if ( - (e as React.KeyboardEvent).keyCode === KEYCODE.ARROW_UP + (e as React.KeyboardEvent).keyCode === KEYCODE.UP ) { this.handleChange(value - 1); } else if ( - (e as React.KeyboardEvent).keyCode === - KEYCODE.ARROW_DOWN + (e as React.KeyboardEvent).keyCode === KEYCODE.DOWN ) { this.handleChange(value + 1); } From 4cf101aab68ab2598f9f9a0d873db848a3f439e9 Mon Sep 17 00:00:00 2001 From: wuxh Date: Sat, 4 Nov 2023 01:53:04 +0800 Subject: [PATCH 05/64] chore: rename --- src/Options.tsx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/Options.tsx b/src/Options.tsx index d5a215f3..080a2eb9 100644 --- a/src/Options.tsx +++ b/src/Options.tsx @@ -1,8 +1,7 @@ -/* eslint react/prop-types: 0 */ import KEYCODE from 'rc-util/lib/KeyCode'; import React from 'react'; -interface Props { +interface OptionsProps { disabled: boolean; locale: any; rootPrefixCls: string; @@ -23,7 +22,7 @@ interface State { goInputText: string; } -class Options extends React.Component { +class Options extends React.Component { static defaultProps = { pageSizeOptions: ['10', '20', '50', '100'], }; From 23d3c429cb12d131fe5584daad6f0d9458f43dbf Mon Sep 17 00:00:00 2001 From: wuxh Date: Sat, 4 Nov 2023 01:54:15 +0800 Subject: [PATCH 06/64] chore: update --- src/Options.tsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Options.tsx b/src/Options.tsx index 080a2eb9..b57d8312 100644 --- a/src/Options.tsx +++ b/src/Options.tsx @@ -22,7 +22,10 @@ interface State { goInputText: string; } -class Options extends React.Component { +/** + * @deprecated Please use `Options` instead. + */ +class _Options extends React.Component { static defaultProps = { pageSizeOptions: ['10', '20', '50', '100'], }; @@ -194,4 +197,4 @@ class Options extends React.Component { } } -export default Options; +export default _Options; From 2f23c254bc7c47546cdec3ddd03e5f4ad1d92a44 Mon Sep 17 00:00:00 2001 From: wuxh Date: Sat, 4 Nov 2023 02:12:53 +0800 Subject: [PATCH 07/64] refactor: Options.tsx CS => FC --- src/Options.tsx | 239 ++++++++++++++++++++++-------------------------- 1 file changed, 111 insertions(+), 128 deletions(-) diff --git a/src/Options.tsx b/src/Options.tsx index b57d8312..1e827893 100644 --- a/src/Options.tsx +++ b/src/Options.tsx @@ -18,48 +18,49 @@ interface OptionsProps { }; } -interface State { - goInputText: string; -} - -/** - * @deprecated Please use `Options` instead. - */ -class _Options extends React.Component { - static defaultProps = { - pageSizeOptions: ['10', '20', '50', '100'], - }; - - state = { - goInputText: '', - }; - - getValidValue = () => { - const { goInputText } = this.state; - // eslint-disable-next-line no-restricted-globals +const defaultPageSizeOptions = ['10', '20', '50', '100']; + +function Options(props: OptionsProps) { + const { + pageSizeOptions = defaultPageSizeOptions, + locale, + changeSize, + pageSize, + goButton, + quickGo, + rootPrefixCls, + selectComponentClass: Select, + selectPrefixCls, + disabled, + buildOptionText, + } = props; + + const [goInputText, setGoInputText] = React.useState(''); + + const getValidValue = () => { return !goInputText || Number.isNaN(goInputText) ? undefined : Number(goInputText); }; - buildOptionText = (value: string) => - `${value} ${this.props.locale.items_per_page}`; + const mergeBuildOptionText = + typeof buildOptionText === 'function' + ? buildOptionText + : (value: string) => `${value} ${locale.items_per_page}`; - changeSize = (value: number) => { - this.props.changeSize(Number(value)); + const changeSizeHandle = (value: number) => { + changeSize(Number(value)); }; - handleChange = (e: React.ChangeEvent) => { - this.setState({ goInputText: e.target.value }); + const handleChange = (e: React.ChangeEvent) => { + setGoInputText(e.target.value); }; - handleBlur = (e: React.FocusEvent) => { - const { goButton, quickGo, rootPrefixCls } = this.props; - const { goInputText } = this.state; + const handleBlur = (e: React.FocusEvent) => { if (goButton || goInputText === '') { return; } - this.setState({ goInputText: '' }); + setGoInputText(''); if ( e.relatedTarget && (e.relatedTarget.className.indexOf(`${rootPrefixCls}-item-link`) >= 0 || @@ -67,22 +68,20 @@ class _Options extends React.Component { ) { return; } - quickGo(this.getValidValue()); + quickGo(getValidValue()); }; - go = (e: any) => { - const { goInputText } = this.state; + const go = (e: any) => { if (goInputText === '') { return; } if (e.keyCode === KEYCODE.ENTER || e.type === 'click') { - this.setState({ goInputText: '' }); - this.props.quickGo(this.getValidValue()); + setGoInputText(''); + quickGo(getValidValue()); } }; - getPageSizeOptions() { - const { pageSize, pageSizeOptions } = this.props; + const getPageSizeOptions = () => { if ( pageSizeOptions.some( (option) => option.toString() === pageSize.toString(), @@ -91,110 +90,94 @@ class _Options extends React.Component { return pageSizeOptions; } return pageSizeOptions.concat([pageSize.toString()]).sort((a, b) => { - // eslint-disable-next-line no-restricted-globals const numberA = Number.isNaN(Number(a)) ? 0 : Number(a); - // eslint-disable-next-line no-restricted-globals const numberB = Number.isNaN(Number(b)) ? 0 : Number(b); return numberA - numberB; }); - } - - render() { - const { - pageSize, - locale, - rootPrefixCls, - changeSize, - quickGo, - goButton, - selectComponentClass, - buildOptionText, - selectPrefixCls, - disabled, - } = this.props; - const { goInputText } = this.state; - const prefixCls = `${rootPrefixCls}-options`; - const Select = selectComponentClass; - let changeSelect = null; - let goInput = null; - let gotoButton = null; - - if (!changeSize && !quickGo) { - return null; - } + }; + // ============== cls ============== + const prefixCls = `${rootPrefixCls}-options`; - const pageSizeOptions = this.getPageSizeOptions(); + // ============== render ============== - if (changeSize && Select) { - const options = pageSizeOptions.map((opt, i) => ( - - {(buildOptionText || this.buildOptionText)(opt)} - - )); + if (!changeSize && !quickGo) { + return null; + } - changeSelect = ( - - ); - } + let changeSelect = null; + let goInput = null; + let gotoButton = null; + + if (changeSize && Select) { + const options = getPageSizeOptions().map((opt, i) => ( + + {mergeBuildOptionText(opt)} + + )); + + changeSelect = ( + + ); + } - if (quickGo) { - if (goButton) { - gotoButton = - typeof goButton === 'boolean' ? ( - - ) : ( - - {goButton} - - ); - } - goInput = ( -
    - {locale.jump_to} - - {locale.page} - {gotoButton} -
    - ); + className={`${prefixCls}-quick-jumper-button`} + > + {locale.jump_to_confirm} + + ) : ( + + {goButton} + + ); } - return ( -
  • - {changeSelect} - {goInput} -
  • + goInput = ( +
    + {locale.jump_to} + + {locale.page} + {gotoButton} +
    ); } + + return ( +
  • + {changeSelect} + {goInput} +
  • + ); } -export default _Options; +export default Options; From 840d03ca5e26b1fc5b97fe5af03584276f1f89a6 Mon Sep 17 00:00:00 2001 From: wuxh Date: Sat, 4 Nov 2023 09:24:36 +0800 Subject: [PATCH 08/64] chore: update local typo --- src/Options.tsx | 3 ++- src/interface.ts | 1 + src/locale/am.ts | 10 +++++++--- src/locale/ar_EG.ts | 10 +++++++--- src/locale/az_AZ.ts | 10 +++++++--- src/locale/bg_BG.ts | 10 +++++++--- src/locale/bn_BD.ts | 10 +++++++--- src/locale/by_BY.ts | 10 +++++++--- src/locale/ca_ES.ts | 10 +++++++--- src/locale/cs_CZ.ts | 10 +++++++--- src/locale/da_DK.ts | 10 +++++++--- src/locale/de_DE.ts | 10 +++++++--- src/locale/el_GR.ts | 10 +++++++--- src/locale/en_GB.ts | 10 +++++++--- src/locale/en_US.ts | 10 +++++++--- src/locale/es_ES.ts | 10 +++++++--- src/locale/et_EE.ts | 10 +++++++--- src/locale/eu_ES.ts | 10 +++++++--- src/locale/fa_IR.ts | 10 +++++++--- src/locale/fi_FI.ts | 10 +++++++--- src/locale/fr_BE.ts | 10 +++++++--- src/locale/fr_CA.ts | 10 +++++++--- src/locale/fr_FR.ts | 10 +++++++--- src/locale/ga_IE.ts | 10 +++++++--- src/locale/gl_ES.ts | 10 +++++++--- src/locale/he_IL.ts | 10 +++++++--- src/locale/hi_IN.ts | 10 +++++++--- src/locale/hr_HR.ts | 10 +++++++--- src/locale/hu_HU.ts | 10 +++++++--- src/locale/id_ID.ts | 10 +++++++--- src/locale/is_IS.ts | 10 +++++++--- src/locale/it_IT.ts | 10 +++++++--- src/locale/ja_JP.ts | 10 +++++++--- src/locale/ka_GE.ts | 10 +++++++--- src/locale/kk_KZ.ts | 10 +++++++--- src/locale/km_KH.ts | 10 +++++++--- src/locale/kmr_IQ.ts | 10 +++++++--- src/locale/kn_IN.ts | 10 +++++++--- src/locale/ko_KR.ts | 10 +++++++--- src/locale/lt_LT.ts | 10 +++++++--- src/locale/lv_LV.ts | 10 +++++++--- src/locale/mk_MK.ts | 10 +++++++--- src/locale/ml_IN.ts | 10 +++++++--- src/locale/mn_MN.ts | 10 +++++++--- src/locale/ms_MY.ts | 10 +++++++--- src/locale/my_MM.ts | 10 +++++++--- src/locale/nb_NO.ts | 10 +++++++--- src/locale/nl_BE.ts | 10 +++++++--- src/locale/nl_NL.ts | 10 +++++++--- src/locale/pa_IN.ts | 10 +++++++--- src/locale/pb_IN.ts | 10 +++++++--- src/locale/pl_PL.ts | 10 +++++++--- src/locale/pt_BR.ts | 10 +++++++--- src/locale/pt_PT.ts | 10 +++++++--- src/locale/ro_RO.ts | 10 +++++++--- src/locale/ru_RU.ts | 10 +++++++--- src/locale/si_LK.ts | 10 +++++++--- src/locale/sk_SK.ts | 10 +++++++--- src/locale/sl_SI.ts | 10 +++++++--- src/locale/sr_RS.ts | 10 +++++++--- src/locale/sv_SE.ts | 10 +++++++--- src/locale/ta_IN.ts | 10 +++++++--- src/locale/th_TH.ts | 10 +++++++--- src/locale/tk_TK.ts | 10 +++++++--- src/locale/tr_TR.ts | 10 +++++++--- src/locale/ug_CN.ts | 10 +++++++--- src/locale/uk_UA.ts | 10 +++++++--- src/locale/ur_PK.ts | 10 +++++++--- src/locale/uz_UZ.ts | 10 +++++++--- src/locale/vi_VN.ts | 10 +++++++--- src/locale/zh_CN.ts | 10 +++++++--- src/locale/zh_TW.ts | 10 +++++++--- 72 files changed, 493 insertions(+), 211 deletions(-) diff --git a/src/Options.tsx b/src/Options.tsx index 1e827893..86df7eb4 100644 --- a/src/Options.tsx +++ b/src/Options.tsx @@ -1,9 +1,10 @@ import KEYCODE from 'rc-util/lib/KeyCode'; import React from 'react'; +import type { PaginationLocale } from './interface'; interface OptionsProps { disabled: boolean; - locale: any; + locale: PaginationLocale; rootPrefixCls: string; selectPrefixCls: string; current: number; diff --git a/src/interface.ts b/src/interface.ts index 74dc308c..56ec86c6 100644 --- a/src/interface.ts +++ b/src/interface.ts @@ -14,6 +14,7 @@ export interface PaginationLocale { next_5?: string; prev_3?: string; next_3?: string; + page_size?: string; } export interface PaginationData { diff --git a/src/locale/am.ts b/src/locale/am.ts index 97835632..fedb6a92 100644 --- a/src/locale/am.ts +++ b/src/locale/am.ts @@ -1,11 +1,13 @@ -export default { - // Options.jsx +import type { PaginationLocale } from '../interface'; + +const locale: PaginationLocale = { + // Options items_per_page: '/ ግፅ', jump_to: 'ሂድ ወደ', jump_to_confirm: 'አረጋግጥ', page: 'ገፅ', - // Pagination.jsx + // Pagination prev_page: 'ያለፈው ገፅ', next_page: 'ቀጣይ ገፅ', prev_5: 'ያለፈው 5 ገፅ', @@ -14,3 +16,5 @@ export default { next_3: 'ቀጣይ 3 ገፅ', page_size: 'የገፅ መጠን', }; + +export default locale; diff --git a/src/locale/ar_EG.ts b/src/locale/ar_EG.ts index 7c99a914..45453008 100644 --- a/src/locale/ar_EG.ts +++ b/src/locale/ar_EG.ts @@ -1,11 +1,13 @@ -export default { - // Options.jsx +import type { PaginationLocale } from '../interface'; + +const locale: PaginationLocale = { + // Options items_per_page: '/ الصفحة', jump_to: 'الذهاب إلى', jump_to_confirm: 'تأكيد', page: 'الصفحة', - // Pagination.jsx + // Pagination prev_page: 'الصفحة السابقة', next_page: 'الصفحة التالية', prev_5: 'خمس صفحات سابقة', @@ -14,3 +16,5 @@ export default { next_3: 'ثلاث صفحات تالية', page_size: 'مقاس الصفحه', }; + +export default locale; diff --git a/src/locale/az_AZ.ts b/src/locale/az_AZ.ts index d0960c55..921d6784 100644 --- a/src/locale/az_AZ.ts +++ b/src/locale/az_AZ.ts @@ -1,11 +1,13 @@ -export default { - // Options.jsx +import type { PaginationLocale } from '../interface'; + +const locale: PaginationLocale = { + // Options items_per_page: '/ səhifə', jump_to: 'Get', jump_to_confirm: 'təsdiqlə', page: '', - // Pagination.jsx + // Pagination prev_page: 'Əvvəlki Səhifə', next_page: 'Növbəti Səhifə', prev_5: 'Əvvəlki 5 Səhifə', @@ -14,3 +16,5 @@ export default { next_3: 'Növbəti 3 Səhifə', page_size: 'Page Size', }; + +export default locale; diff --git a/src/locale/bg_BG.ts b/src/locale/bg_BG.ts index b19c1396..b35f3db1 100644 --- a/src/locale/bg_BG.ts +++ b/src/locale/bg_BG.ts @@ -1,11 +1,13 @@ -export default { - // Options.jsx +import type { PaginationLocale } from '../interface'; + +const locale: PaginationLocale = { + // Options items_per_page: '/ страница', jump_to: 'Към', jump_to_confirm: 'потвърждавам', page: '', - // Pagination.jsx + // Pagination prev_page: 'Предишна страница', next_page: 'Следваща страница', prev_5: 'Предишни 5 страници', @@ -14,3 +16,5 @@ export default { next_3: 'Следващи 3 страници', page_size: 'Page Size', }; + +export default locale; diff --git a/src/locale/bn_BD.ts b/src/locale/bn_BD.ts index f9f90948..039d9c3b 100644 --- a/src/locale/bn_BD.ts +++ b/src/locale/bn_BD.ts @@ -1,11 +1,13 @@ -export default { - // Options.jsx +import type { PaginationLocale } from '../interface'; + +const locale: PaginationLocale = { + // Options items_per_page: '/ পৃষ্ঠা', jump_to: 'যাও', jump_to_confirm: 'নিশ্চিত', page: 'পৃষ্ঠা', - // Pagination.jsx + // Pagination prev_page: 'আগের পৃষ্ঠা', next_page: 'পরের পৃষ্ঠা', prev_5: 'পূর্ববর্তী ৫ পৃষ্ঠা', @@ -14,3 +16,5 @@ export default { next_3: 'পরবর্তী ৩ পৃষ্ঠা', page_size: 'পাতার আকার', }; + +export default locale; diff --git a/src/locale/by_BY.ts b/src/locale/by_BY.ts index de64cf6b..5284b579 100644 --- a/src/locale/by_BY.ts +++ b/src/locale/by_BY.ts @@ -1,10 +1,12 @@ -export default { - // Options.jsx +import type { PaginationLocale } from '../interface'; + +const locale: PaginationLocale = { + // Options items_per_page: '/старонка', jump_to: 'Перайсці', jump_to_confirm: 'Пацвердзіць', page: '', - // Pagination.jsx + // Pagination prev_page: 'Назад', next_page: 'Наперад', prev_5: 'Папярэднія 5', @@ -13,3 +15,5 @@ export default { next_3: 'Наступныя 3', page_size: 'памер старонкі', }; + +export default locale; diff --git a/src/locale/ca_ES.ts b/src/locale/ca_ES.ts index df4f01e4..22a16c58 100644 --- a/src/locale/ca_ES.ts +++ b/src/locale/ca_ES.ts @@ -1,11 +1,13 @@ -export default { - // Options.jsx +import type { PaginationLocale } from '../interface'; + +const locale: PaginationLocale = { + // Options items_per_page: '/ pàgina', jump_to: 'Anar a', jump_to_confirm: 'Confirma', page: '', - // Pagination.jsx + // Pagination prev_page: 'Pàgina prèvia', next_page: 'Pàgina següent', prev_5: '5 pàgines prèvies', @@ -14,3 +16,5 @@ export default { next_3: '3 pàgines següents', page_size: 'mida de la pàgina', }; + +export default locale; diff --git a/src/locale/cs_CZ.ts b/src/locale/cs_CZ.ts index 730e79de..cdba815e 100644 --- a/src/locale/cs_CZ.ts +++ b/src/locale/cs_CZ.ts @@ -1,11 +1,13 @@ -export default { - // Options.jsx +import type { PaginationLocale } from '../interface'; + +const locale: PaginationLocale = { + // Options items_per_page: '/ strana', jump_to: 'Přejít', jump_to_confirm: 'potvrdit', page: '', - // Pagination.jsx + // Pagination prev_page: 'Předchozí strana', next_page: 'Následující strana', prev_5: 'Předchozích 5 stran', @@ -14,3 +16,5 @@ export default { next_3: 'Následující 3 strany', page_size: 'velikost stránky', }; + +export default locale; diff --git a/src/locale/da_DK.ts b/src/locale/da_DK.ts index f65d82e3..24dbbd11 100644 --- a/src/locale/da_DK.ts +++ b/src/locale/da_DK.ts @@ -1,11 +1,13 @@ -export default { - // Options.jsx +import type { PaginationLocale } from '../interface'; + +const locale: PaginationLocale = { + // Options items_per_page: '/ side', jump_to: 'Gå til', jump_to_confirm: 'bekræft', page: 'Side', - // Pagination.jsx + // Pagination prev_page: 'Forrige Side', next_page: 'Næste Side', prev_5: 'Forrige 5 Sider', @@ -14,3 +16,5 @@ export default { next_3: 'Næste 3 Sider', page_size: 'sidestørrelse', }; + +export default locale; diff --git a/src/locale/de_DE.ts b/src/locale/de_DE.ts index e0136afb..aa595cef 100644 --- a/src/locale/de_DE.ts +++ b/src/locale/de_DE.ts @@ -1,11 +1,13 @@ -export default { - // Options.jsx +import type { PaginationLocale } from '../interface'; + +const locale: PaginationLocale = { + // Options items_per_page: '/ Seite', jump_to: 'Gehe zu', jump_to_confirm: 'bestätigen', page: 'Seite', - // Pagination.jsx + // Pagination prev_page: 'Vorherige Seite', next_page: 'Nächste Seite', prev_5: '5 Seiten zurück', @@ -14,3 +16,5 @@ export default { next_3: '3 Seiten vor', page_size: 'Page Size', }; + +export default locale; diff --git a/src/locale/el_GR.ts b/src/locale/el_GR.ts index e61327c3..41ef95dd 100644 --- a/src/locale/el_GR.ts +++ b/src/locale/el_GR.ts @@ -1,11 +1,13 @@ -export default { - // Options.jsx +import type { PaginationLocale } from '../interface'; + +const locale: PaginationLocale = { + // Options items_per_page: '/ σελίδα', jump_to: 'Μετάβαση', jump_to_confirm: 'επιβεβαιώνω', page: '', - // Pagination.jsx + // Pagination prev_page: 'Προηγούμενη Σελίδα', next_page: 'Επόμενη Σελίδα', prev_5: 'Προηγούμενες 5 Σελίδες', @@ -14,3 +16,5 @@ export default { next_3: 'Επόμενες 3 Σελίδες', page_size: 'Μέγεθος σελίδας', }; + +export default locale; diff --git a/src/locale/en_GB.ts b/src/locale/en_GB.ts index a0c5ff5f..481ff0ef 100644 --- a/src/locale/en_GB.ts +++ b/src/locale/en_GB.ts @@ -1,11 +1,13 @@ -export default { - // Options.jsx +import type { PaginationLocale } from '../interface'; + +const locale: PaginationLocale = { + // Options items_per_page: '/ page', jump_to: 'Go to', jump_to_confirm: 'confirm', page: 'Page', - // Pagination.jsx + // Pagination prev_page: 'Previous Page', next_page: 'Next Page', prev_5: 'Previous 5 Pages', @@ -14,3 +16,5 @@ export default { next_3: 'Next 3 Pages', page_size: 'Page Size', }; + +export default locale; diff --git a/src/locale/en_US.ts b/src/locale/en_US.ts index a0c5ff5f..481ff0ef 100644 --- a/src/locale/en_US.ts +++ b/src/locale/en_US.ts @@ -1,11 +1,13 @@ -export default { - // Options.jsx +import type { PaginationLocale } from '../interface'; + +const locale: PaginationLocale = { + // Options items_per_page: '/ page', jump_to: 'Go to', jump_to_confirm: 'confirm', page: 'Page', - // Pagination.jsx + // Pagination prev_page: 'Previous Page', next_page: 'Next Page', prev_5: 'Previous 5 Pages', @@ -14,3 +16,5 @@ export default { next_3: 'Next 3 Pages', page_size: 'Page Size', }; + +export default locale; diff --git a/src/locale/es_ES.ts b/src/locale/es_ES.ts index 2a4a6dce..7139b67c 100644 --- a/src/locale/es_ES.ts +++ b/src/locale/es_ES.ts @@ -1,11 +1,13 @@ -export default { - // Options.jsx +import type { PaginationLocale } from '../interface'; + +const locale: PaginationLocale = { + // Options items_per_page: '/ página', jump_to: 'Ir a', jump_to_confirm: 'confirmar', page: 'Página', - // Pagination.jsx + // Pagination prev_page: 'Página anterior', next_page: 'Página siguiente', prev_5: '5 páginas previas', @@ -14,3 +16,5 @@ export default { next_3: '3 páginas siguientes', page_size: 'tamaño de página', }; + +export default locale; diff --git a/src/locale/et_EE.ts b/src/locale/et_EE.ts index 548b0522..5978de8e 100644 --- a/src/locale/et_EE.ts +++ b/src/locale/et_EE.ts @@ -1,11 +1,13 @@ -export default { - // Options.jsx +import type { PaginationLocale } from '../interface'; + +const locale: PaginationLocale = { + // Options items_per_page: '/ leheküljel', jump_to: 'Hüppa', jump_to_confirm: 'Kinnitage', page: '', - // Pagination.jsx + // Pagination prev_page: 'Eelmine leht', next_page: 'Järgmine leht', prev_5: 'Eelmised 5 lehekülge', @@ -14,3 +16,5 @@ export default { next_3: 'Järgmised 3 lehekülge', page_size: 'lehe suurus', }; + +export default locale; diff --git a/src/locale/eu_ES.ts b/src/locale/eu_ES.ts index 281bcb48..cf283b4f 100644 --- a/src/locale/eu_ES.ts +++ b/src/locale/eu_ES.ts @@ -1,11 +1,13 @@ -export default { - // Options.jsx +import type { PaginationLocale } from '../interface'; + +const locale: PaginationLocale = { + // Options items_per_page: '/ orrialde', jump_to: '-ra joan', jump_to_confirm: 'baieztatu', page: 'Orrialde', - // Pagination.jsx + // Pagination prev_page: 'Aurreko orrialdea', next_page: 'Hurrengo orrialdea', prev_5: 'aurreko 5 orrialde', @@ -14,3 +16,5 @@ export default { next_3: 'hurrengo 3 orrialde', page_size: 'orrien tamaina', }; + +export default locale; diff --git a/src/locale/fa_IR.ts b/src/locale/fa_IR.ts index 64de0aa5..240ae182 100644 --- a/src/locale/fa_IR.ts +++ b/src/locale/fa_IR.ts @@ -1,11 +1,13 @@ -export default { - // Options.jsx +import type { PaginationLocale } from '../interface'; + +const locale: PaginationLocale = { + // Options items_per_page: '/ صفحه', jump_to: 'برو به', jump_to_confirm: 'تایید', page: '', - // Pagination.jsx + // Pagination prev_page: 'صفحه قبلی', next_page: 'صفحه بعدی', prev_5: '۵ صفحه قبلی', @@ -14,3 +16,5 @@ export default { next_3: '۳ صفحه بعدی', page_size: 'اندازه صفحه', }; + +export default locale; diff --git a/src/locale/fi_FI.ts b/src/locale/fi_FI.ts index 19fb1a05..41e8ebde 100644 --- a/src/locale/fi_FI.ts +++ b/src/locale/fi_FI.ts @@ -1,11 +1,13 @@ -export default { - // Options.jsx +import type { PaginationLocale } from '../interface'; + +const locale: PaginationLocale = { + // Options items_per_page: '/ sivu', jump_to: 'Mene', jump_to_confirm: 'Potvrdite', page: 'Sivu', - // Pagination.jsx + // Pagination prev_page: 'Edellinen sivu', next_page: 'Seuraava sivu', prev_5: 'Edelliset 5 sivua', @@ -14,3 +16,5 @@ export default { next_3: 'Seuraavat 3 sivua', page_size: 'Page Size', }; + +export default locale; diff --git a/src/locale/fr_BE.ts b/src/locale/fr_BE.ts index d604531a..08be8534 100644 --- a/src/locale/fr_BE.ts +++ b/src/locale/fr_BE.ts @@ -1,11 +1,13 @@ -export default { - // Options.jsx +import type { PaginationLocale } from '../interface'; + +const locale: PaginationLocale = { + // Options items_per_page: '/ page', jump_to: 'Aller à', jump_to_confirm: 'confirmer', page: '', - // Pagination.jsx + // Pagination prev_page: 'Page précédente', next_page: 'Page suivante', prev_5: '5 Pages précédentes', @@ -14,3 +16,5 @@ export default { next_3: '3 Pages suivantes', page_size: 'Page Size', }; + +export default locale; diff --git a/src/locale/fr_CA.ts b/src/locale/fr_CA.ts index 914dbb87..08179c48 100644 --- a/src/locale/fr_CA.ts +++ b/src/locale/fr_CA.ts @@ -1,11 +1,13 @@ -export default { - // Options.jsx +import type { PaginationLocale } from '../interface'; + +const locale: PaginationLocale = { + // Options items_per_page: '/ page', jump_to: 'Aller à', jump_to_confirm: 'confirmer', page: 'Page', - // Pagination.jsx + // Pagination prev_page: 'Page précédente', next_page: 'Page suivante', prev_5: '5 Pages précédentes', @@ -14,3 +16,5 @@ export default { next_3: '3 Pages suivantes', page_size: 'taille de la page', }; + +export default locale; diff --git a/src/locale/fr_FR.ts b/src/locale/fr_FR.ts index 914dbb87..08179c48 100644 --- a/src/locale/fr_FR.ts +++ b/src/locale/fr_FR.ts @@ -1,11 +1,13 @@ -export default { - // Options.jsx +import type { PaginationLocale } from '../interface'; + +const locale: PaginationLocale = { + // Options items_per_page: '/ page', jump_to: 'Aller à', jump_to_confirm: 'confirmer', page: 'Page', - // Pagination.jsx + // Pagination prev_page: 'Page précédente', next_page: 'Page suivante', prev_5: '5 Pages précédentes', @@ -14,3 +16,5 @@ export default { next_3: '3 Pages suivantes', page_size: 'taille de la page', }; + +export default locale; diff --git a/src/locale/ga_IE.ts b/src/locale/ga_IE.ts index 1c19fff2..44df59ff 100644 --- a/src/locale/ga_IE.ts +++ b/src/locale/ga_IE.ts @@ -1,11 +1,13 @@ -export default { - // Options.jsx +import type { PaginationLocale } from '../interface'; + +const locale: PaginationLocale = { + // Options items_per_page: '/ leathanach', jump_to: 'Téigh', jump_to_confirm: 'dheimhnigh', page: '', - // Pagination.jsx + // Pagination prev_page: 'Leathanach Roimhe Seo', next_page: 'An chéad leathanach eile', prev_5: '5 leathanach roimhe seo', @@ -14,3 +16,5 @@ export default { next_3: 'Ar Aghaidh 3 Leathanaigh', page_size: 'Page Size', }; + +export default locale; diff --git a/src/locale/gl_ES.ts b/src/locale/gl_ES.ts index 91391389..1885bfb3 100644 --- a/src/locale/gl_ES.ts +++ b/src/locale/gl_ES.ts @@ -1,11 +1,13 @@ -export default { - // Options.jsx +import type { PaginationLocale } from '../interface'; + +const locale: PaginationLocale = { + // Options items_per_page: '/ páxina', jump_to: 'Ir a', jump_to_confirm: 'confirmar', page: '', - // Pagination.jsx + // Pagination prev_page: 'Páxina anterior', next_page: 'Páxina seguinte', prev_5: '5 páxinas previas', @@ -14,3 +16,5 @@ export default { next_3: '3 páxinas seguintes', page_size: 'Page Size', }; + +export default locale; diff --git a/src/locale/he_IL.ts b/src/locale/he_IL.ts index 647abd16..f1825528 100644 --- a/src/locale/he_IL.ts +++ b/src/locale/he_IL.ts @@ -1,11 +1,13 @@ -export default { - // Options.jsx +import type { PaginationLocale } from '../interface'; + +const locale: PaginationLocale = { + // Options items_per_page: '/ עמוד', jump_to: 'עבור אל', jump_to_confirm: 'אישור', page: '', - // Pagination.jsx + // Pagination prev_page: 'העמוד הקודם', next_page: 'העמוד הבא', prev_5: '5 עמודים קודמים', @@ -14,3 +16,5 @@ export default { next_3: '3 עמודים הבאים', page_size: 'Page Size', }; + +export default locale; diff --git a/src/locale/hi_IN.ts b/src/locale/hi_IN.ts index 08242710..c204a323 100644 --- a/src/locale/hi_IN.ts +++ b/src/locale/hi_IN.ts @@ -1,11 +1,13 @@ -export default { - // Options.jsx +import type { PaginationLocale } from '../interface'; + +const locale: PaginationLocale = { + // Options items_per_page: '/ पृष्ठ', jump_to: 'इस पर चलें', jump_to_confirm: 'पुष्टि करें', page: '', - // Pagination.jsx + // Pagination prev_page: 'पिछला पृष्ठ', next_page: 'अगला पृष्ठ', prev_5: 'पिछले 5 पृष्ठ', @@ -14,3 +16,5 @@ export default { next_3: 'अगले 3 पेज', page_size: 'Page Size', }; + +export default locale; diff --git a/src/locale/hr_HR.ts b/src/locale/hr_HR.ts index c0af94fc..1d8ddd5c 100644 --- a/src/locale/hr_HR.ts +++ b/src/locale/hr_HR.ts @@ -1,11 +1,13 @@ -export default { - // Options.jsx +import type { PaginationLocale } from '../interface'; + +const locale: PaginationLocale = { + // Options items_per_page: '/ str', jump_to: 'Idi na', jump_to_confirm: 'potvrdi', page: '', - // Pagination.jsx + // Pagination prev_page: 'Prijašnja stranica', next_page: 'Sljedeća stranica', prev_5: 'Prijašnjih 5 stranica', @@ -14,3 +16,5 @@ export default { next_3: 'Sljedeće 3 stranice', page_size: 'Page Size', }; + +export default locale; diff --git a/src/locale/hu_HU.ts b/src/locale/hu_HU.ts index 58bc4ebc..5355c67c 100644 --- a/src/locale/hu_HU.ts +++ b/src/locale/hu_HU.ts @@ -1,11 +1,13 @@ -export default { - // Options.jsx +import type { PaginationLocale } from '../interface'; + +const locale: PaginationLocale = { + // Options items_per_page: '/ oldal', // '/ page', jump_to: 'Ugrás', // 'Goto', jump_to_confirm: 'megerősít', // 'confirm', page: '', - // Pagination.jsx + // Pagination prev_page: 'Előző oldal', // 'Previous Page', next_page: 'Következő oldal', // 'Next Page', prev_5: 'Előző 5 oldal', // 'Previous 5 Pages', @@ -14,3 +16,5 @@ export default { next_3: 'Következő 3 oldal', // 'Next 3 Pages', page_size: 'Page Size', }; + +export default locale; diff --git a/src/locale/id_ID.ts b/src/locale/id_ID.ts index 90f0a99e..0a96afab 100644 --- a/src/locale/id_ID.ts +++ b/src/locale/id_ID.ts @@ -1,11 +1,13 @@ -export default { - // Options.jsx +import type { PaginationLocale } from '../interface'; + +const locale: PaginationLocale = { + // Options items_per_page: '/ halaman', jump_to: 'Menuju', jump_to_confirm: 'konfirmasi', page: 'Halaman', - // Pagination.jsx + // Pagination prev_page: 'Halaman Sebelumnya', next_page: 'Halaman Berikutnya', prev_5: '5 Halaman Sebelumnya', @@ -14,3 +16,5 @@ export default { next_3: '3 Halaman Berikutnya', page_size: 'ukuran halaman', }; + +export default locale; diff --git a/src/locale/is_IS.ts b/src/locale/is_IS.ts index 5be73143..ef035104 100644 --- a/src/locale/is_IS.ts +++ b/src/locale/is_IS.ts @@ -1,11 +1,13 @@ -export default { - // Options.jsx +import type { PaginationLocale } from '../interface'; + +const locale: PaginationLocale = { + // Options items_per_page: '/ síðu', jump_to: 'Síða', jump_to_confirm: 'staðfest', page: '', - // Pagination.jsx + // Pagination prev_page: 'Fyrri síða', next_page: 'Næsta síða', prev_5: 'Til baka 5 síður', @@ -14,3 +16,5 @@ export default { next_3: 'Áfram 3 síður', page_size: 'Page Size', }; + +export default locale; diff --git a/src/locale/it_IT.ts b/src/locale/it_IT.ts index 94acd80f..ae3c8967 100644 --- a/src/locale/it_IT.ts +++ b/src/locale/it_IT.ts @@ -1,11 +1,13 @@ -export default { - // Options.jsx +import type { PaginationLocale } from '../interface'; + +const locale: PaginationLocale = { + // Options items_per_page: '/ pagina', jump_to: 'vai a', jump_to_confirm: 'Conferma', page: 'Pagina', - // Pagination.jsx + // Pagination prev_page: 'Pagina precedente', next_page: 'Pagina successiva', prev_5: 'Precedente 5 pagine', @@ -14,3 +16,5 @@ export default { next_3: 'Prossime 3 pagine', page_size: 'dimensioni della pagina', }; + +export default locale; diff --git a/src/locale/ja_JP.ts b/src/locale/ja_JP.ts index 2be659a2..a954e093 100644 --- a/src/locale/ja_JP.ts +++ b/src/locale/ja_JP.ts @@ -1,11 +1,13 @@ -export default { - // Options.jsx +import type { PaginationLocale } from '../interface'; + +const locale: PaginationLocale = { + // Options items_per_page: '件 / ページ', jump_to: '移動', jump_to_confirm: '確認する', page: 'ページ', - // Pagination.jsx + // Pagination prev_page: '前のページ', next_page: '次のページ', prev_5: '前 5ページ', @@ -14,3 +16,5 @@ export default { next_3: '次 3ページ', page_size: 'ページサイズ', }; + +export default locale; diff --git a/src/locale/ka_GE.ts b/src/locale/ka_GE.ts index 3777003f..db930520 100644 --- a/src/locale/ka_GE.ts +++ b/src/locale/ka_GE.ts @@ -1,10 +1,12 @@ -export default { - // Options.jsx +import type { PaginationLocale } from '../interface'; + +const locale: PaginationLocale = { + // Options items_per_page: '/ გვერდი.', jump_to: 'გადასვლა', jump_to_confirm: 'დადასტურება', page: '', - // Pagination.jsx + // Pagination prev_page: 'წინა გვერდი', next_page: 'შემდეგი გვერდი', prev_5: 'წინა 5 გვერდი', @@ -13,3 +15,5 @@ export default { next_3: 'შემდეგი 3 გვერდი', page_size: 'Page Size', }; + +export default locale; diff --git a/src/locale/kk_KZ.ts b/src/locale/kk_KZ.ts index 3e7913b5..3b4e9300 100644 --- a/src/locale/kk_KZ.ts +++ b/src/locale/kk_KZ.ts @@ -1,11 +1,13 @@ -export default { - // Options.jsx +import type { PaginationLocale } from '../interface'; + +const locale: PaginationLocale = { + // Options items_per_page: '/ бет', jump_to: 'Секіру', jump_to_confirm: 'Растау', page: '', - // Pagination.jsx + // Pagination prev_page: 'Артқа', next_page: 'Алға', prev_5: 'Алдыңғы 5', @@ -14,3 +16,5 @@ export default { next_3: 'Келесі 3', page_size: 'Page Size', }; + +export default locale; diff --git a/src/locale/km_KH.ts b/src/locale/km_KH.ts index 68ae005f..d7be29f5 100644 --- a/src/locale/km_KH.ts +++ b/src/locale/km_KH.ts @@ -1,11 +1,13 @@ -export default { - // Options.jsx +import type { PaginationLocale } from '../interface'; + +const locale: PaginationLocale = { + // Options items_per_page: '/ ទំព័រ', jump_to: 'លោត​ទៅ', jump_to_confirm: 'បញ្ជាក់', page: 'ទំព័រ', - // Pagination.jsx + // Pagination prev_page: 'ទំព័រ​មុន', next_page: 'ទំព័រ​​បន្ទាប់', prev_5: '៥ ទំព័រថយក្រោយ', @@ -14,3 +16,5 @@ export default { next_3: '៣ ទំព័រទៅមុខ', page_size: 'Page Size', }; + +export default locale; diff --git a/src/locale/kmr_IQ.ts b/src/locale/kmr_IQ.ts index 5ab84ba0..5995cf26 100644 --- a/src/locale/kmr_IQ.ts +++ b/src/locale/kmr_IQ.ts @@ -1,11 +1,13 @@ -export default { - // Options.jsx +import type { PaginationLocale } from '../interface'; + +const locale: PaginationLocale = { + // Options items_per_page: '/ rûpel', jump_to: 'Biçe', jump_to_confirm: 'piştrast bike', page: '', - // Pagination.jsx + // Pagination prev_page: 'Rûpelê Pêş', next_page: 'Rûpelê Paş', prev_5: '5 Rûpelên Pêş', @@ -14,3 +16,5 @@ export default { next_3: '3 Rûpelên Paş', page_size: 'Page Size', }; + +export default locale; diff --git a/src/locale/kn_IN.ts b/src/locale/kn_IN.ts index 35ee1284..085c7b76 100644 --- a/src/locale/kn_IN.ts +++ b/src/locale/kn_IN.ts @@ -1,11 +1,13 @@ -export default { - // Options.jsx +import type { PaginationLocale } from '../interface'; + +const locale: PaginationLocale = { + // Options items_per_page: '/ ಪುಟ', jump_to: 'ಜಿಗಿತವನ್ನು', jump_to_confirm: 'ಖಚಿತಪಡಿಸಲು ಜಿಗಿತವನ್ನು', page: '', - // Pagination.jsx + // Pagination prev_page: 'ಹಿಂದಿನ ಪುಟ', next_page: 'ಮುಂದಿನ ಪುಟ', prev_5: 'ಹಿಂದಿನ 5 ಪುಟಗಳು', @@ -14,3 +16,5 @@ export default { next_3: 'ಮುಂದಿನ 3 ಪುಟಗಳು', page_size: 'Page Size', }; + +export default locale; diff --git a/src/locale/ko_KR.ts b/src/locale/ko_KR.ts index e7600f3f..fa8acf1c 100644 --- a/src/locale/ko_KR.ts +++ b/src/locale/ko_KR.ts @@ -1,11 +1,13 @@ -export default { - // Options.jsx +import type { PaginationLocale } from '../interface'; + +const locale: PaginationLocale = { + // Options items_per_page: '/ 페이지', jump_to: '이동하기', jump_to_confirm: '확인하다', page: '페이지', - // Pagination.jsx + // Pagination prev_page: '이전 페이지', next_page: '다음 페이지', prev_5: '이전 5 페이지', @@ -14,3 +16,5 @@ export default { next_3: '다음 3 페이지', page_size: '페이지 크기', }; + +export default locale; diff --git a/src/locale/lt_LT.ts b/src/locale/lt_LT.ts index 26016d3f..e1066224 100644 --- a/src/locale/lt_LT.ts +++ b/src/locale/lt_LT.ts @@ -1,11 +1,13 @@ -export default { - // Options.jsx +import type { PaginationLocale } from '../interface'; + +const locale: PaginationLocale = { + // Options items_per_page: '/ psl.', jump_to: 'Pereiti į', jump_to_confirm: 'patvirtinti', page: 'psl.', - // Pagination.jsx + // Pagination prev_page: 'Atgal', next_page: 'Pirmyn', prev_5: 'Grįžti 5 psl.', @@ -14,3 +16,5 @@ export default { next_3: 'Peršokti 3 psl.', page_size: 'Puslapio dydis', }; + +export default locale; diff --git a/src/locale/lv_LV.ts b/src/locale/lv_LV.ts index dd883e51..320368b8 100644 --- a/src/locale/lv_LV.ts +++ b/src/locale/lv_LV.ts @@ -1,11 +1,13 @@ -export default { - // Options.jsx +import type { PaginationLocale } from '../interface'; + +const locale: PaginationLocale = { + // Options items_per_page: '/ lappuse', jump_to: 'iet uz', jump_to_confirm: 'apstiprināt', page: '', - // Pagination.jsx + // Pagination prev_page: 'Iepriekšējā lapa', next_page: 'Nākamā lapaspuse', prev_5: 'Iepriekšējās 5 lapas', @@ -14,3 +16,5 @@ export default { next_3: 'Nākamās 3 lapas', page_size: 'Page Size', }; + +export default locale; diff --git a/src/locale/mk_MK.ts b/src/locale/mk_MK.ts index 40b7cd86..e1c494ec 100644 --- a/src/locale/mk_MK.ts +++ b/src/locale/mk_MK.ts @@ -1,11 +1,13 @@ -export default { - // Options.jsx +import type { PaginationLocale } from '../interface'; + +const locale: PaginationLocale = { + // Options items_per_page: '/ стр', jump_to: 'Оди на', jump_to_confirm: 'потврди', page: '', - // Pagination.jsx + // Pagination prev_page: 'Претходна страница', next_page: 'Наредна страница', prev_5: 'Претходни 5 страници', @@ -14,3 +16,5 @@ export default { next_3: 'Наредни 3 страници', page_size: 'Page Size', }; + +export default locale; diff --git a/src/locale/ml_IN.ts b/src/locale/ml_IN.ts index 6b80ad52..d761ce46 100644 --- a/src/locale/ml_IN.ts +++ b/src/locale/ml_IN.ts @@ -1,11 +1,13 @@ -export default { - // Options.jsx +import type { PaginationLocale } from '../interface'; + +const locale: PaginationLocale = { + // Options items_per_page: '/ പേജ്', jump_to: 'അടുത്തത്', jump_to_confirm: 'ഉറപ്പാക്കുക', page: '', - // Pagination.jsx + // Pagination prev_page: 'മുൻപുള്ള പേജ്', next_page: 'അടുത്ത പേജ്', prev_5: 'മുൻപുള്ള 5 പേജുകൾ', @@ -14,3 +16,5 @@ export default { next_3: 'അടുത്ത 3 പേജുകൾ', page_size: 'Page Size', }; + +export default locale; diff --git a/src/locale/mn_MN.ts b/src/locale/mn_MN.ts index f5a58ac8..18199be9 100644 --- a/src/locale/mn_MN.ts +++ b/src/locale/mn_MN.ts @@ -1,11 +1,13 @@ -export default { - // Options.jsx +import type { PaginationLocale } from '../interface'; + +const locale: PaginationLocale = { + // Options items_per_page: '/ хуудас', jump_to: 'Шилжих', jump_to_confirm: 'сонгох', page: '', - // Pagination.jsx + // Pagination prev_page: 'Өмнөх хуудас', next_page: 'Дараагийн хуудас', prev_5: 'Дараагийн 5 хуудас', @@ -14,3 +16,5 @@ export default { next_3: 'Дараагийн 3 хуудас', page_size: 'Page Size', }; + +export default locale; diff --git a/src/locale/ms_MY.ts b/src/locale/ms_MY.ts index 45ccd3fa..2e3366d1 100644 --- a/src/locale/ms_MY.ts +++ b/src/locale/ms_MY.ts @@ -1,11 +1,13 @@ -export default { - // Options.jsx +import type { PaginationLocale } from '../interface'; + +const locale: PaginationLocale = { + // Options items_per_page: '/ halaman', jump_to: 'Lompat ke', jump_to_confirm: 'Sahkan', page: '', - // Pagination.jsx + // Pagination prev_page: 'Halaman sebelumnya', next_page: 'Halam seterusnya', prev_5: '5 halaman sebelum', @@ -14,3 +16,5 @@ export default { next_3: '3 halaman seterusnya', page_size: 'Page Size', }; + +export default locale; diff --git a/src/locale/my_MM.ts b/src/locale/my_MM.ts index fc49d785..ad84ab40 100644 --- a/src/locale/my_MM.ts +++ b/src/locale/my_MM.ts @@ -1,11 +1,13 @@ -export default { - // Options.jsx +import type { PaginationLocale } from '../interface'; + +const locale: PaginationLocale = { + // Options items_per_page: '/ စာမျက်နှာ', jump_to: 'သွားရန်', jump_to_confirm: 'သေချာပြီ', page: '', - // Pagination.jsx + // Pagination prev_page: 'ယခင်စာမျက်နှာ', next_page: 'နောက်စာမျက်နှာ', prev_5: 'ယခင် ၅ခုမြောက်', @@ -14,3 +16,5 @@ export default { next_3: 'နောက် ၃ခုမြောက်', page_size: 'Page Size', }; + +export default locale; diff --git a/src/locale/nb_NO.ts b/src/locale/nb_NO.ts index 8300a424..3b357934 100644 --- a/src/locale/nb_NO.ts +++ b/src/locale/nb_NO.ts @@ -1,10 +1,12 @@ -export default { - // Options.jsx +import type { PaginationLocale } from '../interface'; + +const locale: PaginationLocale = { + // Options items_per_page: '/ side', jump_to: 'Gå til side', page: 'Side', - // Pagination.jsx + // Pagination prev_page: 'Forrige side', next_page: 'Neste side', prev_5: '5 forrige', @@ -13,3 +15,5 @@ export default { next_3: '3 neste', page_size: 'sidestørrelse', }; + +export default locale; diff --git a/src/locale/nl_BE.ts b/src/locale/nl_BE.ts index 55a76ca3..f3264b4e 100644 --- a/src/locale/nl_BE.ts +++ b/src/locale/nl_BE.ts @@ -1,11 +1,13 @@ -export default { - // Options.jsx +import type { PaginationLocale } from '../interface'; + +const locale: PaginationLocale = { + // Options items_per_page: '/ pagina', jump_to: 'Ga naar', jump_to_confirm: 'bevestigen', page: '', - // Pagination.jsx + // Pagination prev_page: 'Vorige pagina', next_page: 'Volgende pagina', prev_5: "Vorige 5 pagina's", @@ -14,3 +16,5 @@ export default { next_3: "Volgende 3 pagina's", page_size: 'Page Size', }; + +export default locale; diff --git a/src/locale/nl_NL.ts b/src/locale/nl_NL.ts index c3773915..1a5375c1 100644 --- a/src/locale/nl_NL.ts +++ b/src/locale/nl_NL.ts @@ -1,11 +1,13 @@ -export default { - // Options.jsx +import type { PaginationLocale } from '../interface'; + +const locale: PaginationLocale = { + // Options items_per_page: '/ pagina', jump_to: 'Ga naar', jump_to_confirm: 'bevestigen', page: 'Pagina', - // Pagination.jsx + // Pagination prev_page: 'Vorige pagina', next_page: 'Volgende pagina', prev_5: "Vorige 5 pagina's", @@ -14,3 +16,5 @@ export default { next_3: "Volgende 3 pagina's", page_size: 'pagina grootte', }; + +export default locale; diff --git a/src/locale/pa_IN.ts b/src/locale/pa_IN.ts index 500c43d2..1df09fb0 100644 --- a/src/locale/pa_IN.ts +++ b/src/locale/pa_IN.ts @@ -1,11 +1,13 @@ -export default { - // Options.jsx +import type { PaginationLocale } from '../interface'; + +const locale: PaginationLocale = { + // Options items_per_page: '/ ਪੰਨਾ', jump_to: 'Goto', jump_to_confirm: 'ਪੁਸ਼ਟੀ ਕਰੋ', page: 'ਪੰਨਾ', - // Pagination.jsx + // Pagination prev_page: 'ਪਿਛਲਾ ਪੰਨਾ', next_page: 'ਅਗਲਾ ਪੰਨਾ', prev_5: 'ਪਿਛਲੇ 5 ਪੰਨੇ', @@ -14,3 +16,5 @@ export default { next_3: 'ਅਗਲੇ 3 ਪੰਨੇ', page_size: 'Page Size', }; + +export default locale; diff --git a/src/locale/pb_IN.ts b/src/locale/pb_IN.ts index 500c43d2..1df09fb0 100644 --- a/src/locale/pb_IN.ts +++ b/src/locale/pb_IN.ts @@ -1,11 +1,13 @@ -export default { - // Options.jsx +import type { PaginationLocale } from '../interface'; + +const locale: PaginationLocale = { + // Options items_per_page: '/ ਪੰਨਾ', jump_to: 'Goto', jump_to_confirm: 'ਪੁਸ਼ਟੀ ਕਰੋ', page: 'ਪੰਨਾ', - // Pagination.jsx + // Pagination prev_page: 'ਪਿਛਲਾ ਪੰਨਾ', next_page: 'ਅਗਲਾ ਪੰਨਾ', prev_5: 'ਪਿਛਲੇ 5 ਪੰਨੇ', @@ -14,3 +16,5 @@ export default { next_3: 'ਅਗਲੇ 3 ਪੰਨੇ', page_size: 'Page Size', }; + +export default locale; diff --git a/src/locale/pl_PL.ts b/src/locale/pl_PL.ts index 6a8288c9..94f2af73 100644 --- a/src/locale/pl_PL.ts +++ b/src/locale/pl_PL.ts @@ -1,11 +1,13 @@ -export default { - // Options.jsx +import type { PaginationLocale } from '../interface'; + +const locale: PaginationLocale = { + // Options items_per_page: 'na stronę', jump_to: 'Idź do', jump_to_confirm: 'potwierdź', page: '', - // Pagination.jsx + // Pagination prev_page: 'Poprzednia strona', next_page: 'Następna strona', prev_5: 'Poprzednie 5 stron', @@ -14,3 +16,5 @@ export default { next_3: 'Następne 3 strony', page_size: 'rozmiar strony', }; + +export default locale; diff --git a/src/locale/pt_BR.ts b/src/locale/pt_BR.ts index e241ed31..68713507 100644 --- a/src/locale/pt_BR.ts +++ b/src/locale/pt_BR.ts @@ -1,11 +1,13 @@ -export default { - // Options.jsx +import type { PaginationLocale } from '../interface'; + +const locale: PaginationLocale = { + // Options items_per_page: '/ página', jump_to: 'Vá até', jump_to_confirm: 'confirme', page: 'Página', - // Pagination.jsx + // Pagination prev_page: 'Página anterior', next_page: 'Próxima página', prev_5: '5 páginas anteriores', @@ -14,3 +16,5 @@ export default { next_3: '3 próximas páginas', page_size: 'tamanho da página', }; + +export default locale; diff --git a/src/locale/pt_PT.ts b/src/locale/pt_PT.ts index b45a690f..d82c1903 100644 --- a/src/locale/pt_PT.ts +++ b/src/locale/pt_PT.ts @@ -1,11 +1,13 @@ -export default { - // Options.jsx +import type { PaginationLocale } from '../interface'; + +const locale: PaginationLocale = { + // Options items_per_page: '/ página', jump_to: 'Saltar', jump_to_confirm: 'confirmar', page: 'Página', - // Pagination.jsx + // Pagination prev_page: 'Página Anterior', next_page: 'Página Seguinte', prev_5: 'Recuar 5 Páginas', @@ -14,3 +16,5 @@ export default { next_3: 'Avançar 3 Páginas', page_size: 'mărimea paginii', }; + +export default locale; diff --git a/src/locale/ro_RO.ts b/src/locale/ro_RO.ts index 8f7d967b..fe40e368 100644 --- a/src/locale/ro_RO.ts +++ b/src/locale/ro_RO.ts @@ -1,11 +1,13 @@ -export default { - // Options.jsx +import type { PaginationLocale } from '../interface'; + +const locale: PaginationLocale = { + // Options items_per_page: '/ pagină', jump_to: 'Mergi la', jump_to_confirm: 'confirm', page: '', - // Pagination.jsx + // Pagination prev_page: 'Pagina Anterioară', next_page: 'Pagina Următoare', prev_5: '5 Pagini Anterioare', @@ -14,3 +16,5 @@ export default { next_3: '3 Pagini Următoare', page_size: 'Page Size', }; + +export default locale; diff --git a/src/locale/ru_RU.ts b/src/locale/ru_RU.ts index c9dc5c53..7aa3fd1a 100644 --- a/src/locale/ru_RU.ts +++ b/src/locale/ru_RU.ts @@ -1,11 +1,13 @@ -export default { - // Options.jsx +import type { PaginationLocale } from '../interface'; + +const locale: PaginationLocale = { + // Options items_per_page: '/ стр.', jump_to: 'Перейти', jump_to_confirm: 'подтвердить', page: 'Страница', - // Pagination.jsx + // Pagination prev_page: 'Назад', next_page: 'Вперед', prev_5: 'Предыдущие 5', @@ -14,3 +16,5 @@ export default { next_3: 'Следующие 3', page_size: 'размер страницы', }; + +export default locale; diff --git a/src/locale/si_LK.ts b/src/locale/si_LK.ts index 43178591..cb83031b 100644 --- a/src/locale/si_LK.ts +++ b/src/locale/si_LK.ts @@ -1,11 +1,13 @@ -export default { - // Options.jsx +import type { PaginationLocale } from '../interface'; + +const locale: PaginationLocale = { + // Options items_per_page: '/ පිටුව', jump_to: 'වෙත යන්න', jump_to_confirm: 'තහවුරු', page: 'පිටුව', - // Pagination.jsx + // Pagination prev_page: 'කලින් පිටුව', next_page: 'ඊළඟ පිටුව', prev_5: 'කලින් පිටු 5', @@ -14,3 +16,5 @@ export default { next_3: 'ඊළඟ පිටු 3', page_size: 'පිටුවේ ප්‍රමාණය', }; + +export default locale; diff --git a/src/locale/sk_SK.ts b/src/locale/sk_SK.ts index e8c0ee04..a994cb5f 100644 --- a/src/locale/sk_SK.ts +++ b/src/locale/sk_SK.ts @@ -1,11 +1,13 @@ -export default { - // Options.jsx +import type { PaginationLocale } from '../interface'; + +const locale: PaginationLocale = { + // Options items_per_page: '/ strana', jump_to: 'Choď na', jump_to_confirm: 'potvrdit', page: '', - // Pagination.jsx + // Pagination prev_page: 'Predchádzajúca strana', next_page: 'Nasledujúca strana', prev_5: 'Predchádzajúcich 5 strán', @@ -14,3 +16,5 @@ export default { next_3: 'Nasledujúce 3 strany', page_size: 'Page Size', }; + +export default locale; diff --git a/src/locale/sl_SI.ts b/src/locale/sl_SI.ts index 47de1c17..e09728d7 100644 --- a/src/locale/sl_SI.ts +++ b/src/locale/sl_SI.ts @@ -1,11 +1,13 @@ -export default { - // Options.jsx +import type { PaginationLocale } from '../interface'; + +const locale: PaginationLocale = { + // Options items_per_page: '/ strani', jump_to: 'Pojdi na', jump_to_confirm: 'potrdi', page: '', - // Pagination.jsx + // Pagination prev_page: 'Prejšnja stran', next_page: 'Naslednja stran', prev_5: 'Prejšnjih 5 strani', @@ -14,3 +16,5 @@ export default { next_3: 'Naslednje 3 strani', page_size: 'Page Size', }; + +export default locale; diff --git a/src/locale/sr_RS.ts b/src/locale/sr_RS.ts index cce683b1..eee0cc12 100644 --- a/src/locale/sr_RS.ts +++ b/src/locale/sr_RS.ts @@ -1,10 +1,12 @@ -export default { - // Options.jsx +import type { PaginationLocale } from '../interface'; + +const locale: PaginationLocale = { + // Options items_per_page: '/ strani', jump_to: 'Idi na', page: '', - // Pagination.jsx + // Pagination prev_page: 'Prethodna strana', next_page: 'Sledeća strana', prev_5: 'Prethodnih 5 Strana', @@ -13,3 +15,5 @@ export default { next_3: 'Sledećih 3 Strane', page_size: 'Page Size', }; + +export default locale; diff --git a/src/locale/sv_SE.ts b/src/locale/sv_SE.ts index 8b492e10..e5ec562f 100644 --- a/src/locale/sv_SE.ts +++ b/src/locale/sv_SE.ts @@ -1,11 +1,13 @@ -export default { - // Options.jsx +import type { PaginationLocale } from '../interface'; + +const locale: PaginationLocale = { + // Options items_per_page: '/ sida', jump_to: 'Gå till', jump_to_confirm: 'bekräfta', page: 'Sida', - // Pagination.jsx + // Pagination prev_page: 'Föreg sida', next_page: 'Nästa sida', prev_5: 'Föreg 5 sidor', @@ -14,3 +16,5 @@ export default { next_3: 'Nästa 3 sidor', page_size: 'sidstorlek', }; + +export default locale; diff --git a/src/locale/ta_IN.ts b/src/locale/ta_IN.ts index f2e695a7..03fd8c16 100644 --- a/src/locale/ta_IN.ts +++ b/src/locale/ta_IN.ts @@ -1,11 +1,13 @@ -export default { - // Options.jsx +import type { PaginationLocale } from '../interface'; + +const locale: PaginationLocale = { + // Options items_per_page: '/ பக்கம்', jump_to: 'அடுத்த', jump_to_confirm: 'உறுதிப்படுத்தவும்', page: '', - // Pagination.jsx + // Pagination prev_page: 'முந்தைய பக்கம்', next_page: 'அடுத்த பக்கம்', prev_5: 'முந்தைய 5 பக்கங்கள்', @@ -14,3 +16,5 @@ export default { next_3: 'அடுத்த 3 பக்கங்கள்', page_size: 'Page Size', }; + +export default locale; diff --git a/src/locale/th_TH.ts b/src/locale/th_TH.ts index 47a6ce21..18a41cd5 100644 --- a/src/locale/th_TH.ts +++ b/src/locale/th_TH.ts @@ -1,11 +1,13 @@ -export default { - // Options.jsx +import type { PaginationLocale } from '../interface'; + +const locale: PaginationLocale = { + // Options items_per_page: '/ หน้า', jump_to: 'ไปยัง', jump_to_confirm: 'ยืนยัน', page: 'หน้า', - // Pagination.jsx + // Pagination prev_page: 'หน้าก่อนหน้า', next_page: 'หน้าถัดไป', prev_5: 'ย้อนกลับ 5 หน้า', @@ -14,3 +16,5 @@ export default { next_3: 'ถัดไป 3 หน้า', page_size: 'ขนาดหน้า', }; + +export default locale; diff --git a/src/locale/tk_TK.ts b/src/locale/tk_TK.ts index 503271cf..685c5ece 100644 --- a/src/locale/tk_TK.ts +++ b/src/locale/tk_TK.ts @@ -1,11 +1,13 @@ -export default { - // Options.jsx +import type { PaginationLocale } from '../interface'; + +const locale: PaginationLocale = { + // Options items_per_page: '/ sahypa', jump_to: 'Git', jump_to_confirm: 'tassykla', page: 'Sahypa', - // Pagination.jsx + // Pagination prev_page: 'Öňki sahypa', next_page: 'Soňky sahypa', prev_5: 'Öňki 5 sahypa', @@ -14,3 +16,5 @@ export default { next_3: 'Soňky 3 sahypa', page_size: 'Sahypa sany', }; + +export default locale; diff --git a/src/locale/tr_TR.ts b/src/locale/tr_TR.ts index 06c035e6..5e3b61b6 100644 --- a/src/locale/tr_TR.ts +++ b/src/locale/tr_TR.ts @@ -1,11 +1,13 @@ -export default { - // Options.jsx +import type { PaginationLocale } from '../interface'; + +const locale: PaginationLocale = { + // Options items_per_page: '/ sayfa', jump_to: 'Git', jump_to_confirm: 'onayla', page: 'Sayfa', - // Pagination.jsx + // Pagination prev_page: 'Önceki Sayfa', next_page: 'Sonraki Sayfa', prev_5: 'Önceki 5 Sayfa', @@ -14,3 +16,5 @@ export default { next_3: 'Sonraki 3 Sayfa', page_size: 'sayfa boyutu', }; + +export default locale; diff --git a/src/locale/ug_CN.ts b/src/locale/ug_CN.ts index 6d6d534f..5ee905ac 100644 --- a/src/locale/ug_CN.ts +++ b/src/locale/ug_CN.ts @@ -1,10 +1,12 @@ -export default { - // Options.jsx +import type { PaginationLocale } from '../interface'; + +const locale: PaginationLocale = { + // Options items_per_page: 'تال/ھەر بەت', jump_to: 'بەتكە سەكرەش', jump_to_confirm: 'مۇقىملاشتۇرۇش', page: 'بەت', - // Pagination.jsx + // Pagination prev_page: 'ئالدىنقى', next_page: 'كېيىنكى', prev_5: 'ئالدىغا 5 بەت', @@ -13,3 +15,5 @@ export default { next_3: 'كەينىگە 3 بەت', page_size: 'Page Size', }; + +export default locale; diff --git a/src/locale/uk_UA.ts b/src/locale/uk_UA.ts index 1ba87eec..9e2b4dc1 100644 --- a/src/locale/uk_UA.ts +++ b/src/locale/uk_UA.ts @@ -1,11 +1,13 @@ -export default { - // Options.jsx +import type { PaginationLocale } from '../interface'; + +const locale: PaginationLocale = { + // Options items_per_page: '/ сторінці', jump_to: 'Перейти', jump_to_confirm: 'підтвердити', page: '', - // Pagination.jsx + // Pagination prev_page: 'Попередня сторінка', next_page: 'Наступна сторінка', prev_5: 'Попередні 5 сторінок', @@ -14,3 +16,5 @@ export default { next_3: 'Наступні 3 сторінки', page_size: 'Page Size', }; + +export default locale; diff --git a/src/locale/ur_PK.ts b/src/locale/ur_PK.ts index a9a682e3..6fc2b210 100644 --- a/src/locale/ur_PK.ts +++ b/src/locale/ur_PK.ts @@ -1,11 +1,13 @@ -export default { - // Options.jsx +import type { PaginationLocale } from '../interface'; + +const locale: PaginationLocale = { + // Options items_per_page: '/ صفحہ', jump_to: 'پاس جاؤ', jump_to_confirm: 'تصدیق کریں', page: '', - // Pagination.jsx + // Pagination prev_page: 'پچھلا صفحہ', next_page: 'اگلا صفحہ', prev_5: 'پچھلے 5 صفحات', @@ -14,3 +16,5 @@ export default { next_3: 'اگلے 3 صفحات', page_size: 'Page Size', }; + +export default locale; diff --git a/src/locale/uz_UZ.ts b/src/locale/uz_UZ.ts index efb64933..5aef80d4 100644 --- a/src/locale/uz_UZ.ts +++ b/src/locale/uz_UZ.ts @@ -1,11 +1,13 @@ -export default { - // Options.jsx +import type { PaginationLocale } from '../interface'; + +const locale: PaginationLocale = { + // Options items_per_page: '/ sah.', jump_to: "O'tish", jump_to_confirm: 'tasdiqlash', page: 'Sahifa', - // Pagination.jsx + // Pagination prev_page: 'Orqaga', next_page: 'Oldinga', prev_5: 'Oldingi 5', @@ -14,3 +16,5 @@ export default { next_3: 'Keyingi 3', page_size: 'sahifa hajmi', }; + +export default locale; diff --git a/src/locale/vi_VN.ts b/src/locale/vi_VN.ts index d428369b..99b50aab 100644 --- a/src/locale/vi_VN.ts +++ b/src/locale/vi_VN.ts @@ -1,11 +1,13 @@ -export default { - // Options.jsx +import type { PaginationLocale } from '../interface'; + +const locale: PaginationLocale = { + // Options items_per_page: '/ trang', jump_to: 'Đến', jump_to_confirm: 'xác nhận', page: 'Trang', - // Pagination.jsx + // Pagination prev_page: 'Trang Trước', next_page: 'Trang Kế', prev_5: 'Về 5 Trang Trước', @@ -14,3 +16,5 @@ export default { next_3: 'Đến 3 Trang Kế', page_size: 'kích thước trang', }; + +export default locale; diff --git a/src/locale/zh_CN.ts b/src/locale/zh_CN.ts index e5a352ad..51ed359a 100644 --- a/src/locale/zh_CN.ts +++ b/src/locale/zh_CN.ts @@ -1,11 +1,13 @@ -export default { - // Options.jsx +import type { PaginationLocale } from '../interface'; + +const locale: PaginationLocale = { + // Options items_per_page: '条/页', jump_to: '跳至', jump_to_confirm: '确定', page: '页', - // Pagination.jsx + // Pagination prev_page: '上一页', next_page: '下一页', prev_5: '向前 5 页', @@ -14,3 +16,5 @@ export default { next_3: '向后 3 页', page_size: '页码', }; + +export default locale; diff --git a/src/locale/zh_TW.ts b/src/locale/zh_TW.ts index 38521119..57da9587 100644 --- a/src/locale/zh_TW.ts +++ b/src/locale/zh_TW.ts @@ -1,11 +1,13 @@ -export default { - // Options.jsx +import type { PaginationLocale } from '../interface'; + +const locale: PaginationLocale = { + // Options items_per_page: '條/頁', jump_to: '跳至', jump_to_confirm: '確定', page: '頁', - // Pagination.jsx + // Pagination prev_page: '上一頁', next_page: '下一頁', prev_5: '向前 5 頁', @@ -14,3 +16,5 @@ export default { next_3: '向後 3 頁', page_size: '頁碼', }; + +export default locale; From 3b141b65f7ad5f015b5dc481770f6669ffecc3b4 Mon Sep 17 00:00:00 2001 From: wuxh Date: Sat, 4 Nov 2023 09:28:56 +0800 Subject: [PATCH 09/64] chore: mark depredcated --- src/Pagination.tsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Pagination.tsx b/src/Pagination.tsx index 7f7128f1..b34268d2 100644 --- a/src/Pagination.tsx +++ b/src/Pagination.tsx @@ -37,7 +37,10 @@ function calculatePage( return Math.floor((props.total - 1) / pageSize) + 1; } -class Pagination extends React.Component { +/** + * @deprecated use `Pagination` instead. + */ +class _Pagination extends React.Component { static defaultProps = { defaultCurrent: 1, total: 0, @@ -752,4 +755,4 @@ class Pagination extends React.Component { } } -export default Pagination; +export default _Pagination; From aa9ef544ccca9c4f62f51ddd913d1349f8849053 Mon Sep 17 00:00:00 2001 From: wuxh Date: Mon, 6 Nov 2023 16:40:19 +0800 Subject: [PATCH 10/64] test: add debug demo --- docs/demo/debug.md | 9 +++++++++ docs/examples/_debug.tsx | 21 +++++++++++++++++++++ tests/demo.test.js | 2 +- 3 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 docs/demo/debug.md create mode 100644 docs/examples/_debug.tsx diff --git a/docs/demo/debug.md b/docs/demo/debug.md new file mode 100644 index 00000000..a46c37cd --- /dev/null +++ b/docs/demo/debug.md @@ -0,0 +1,9 @@ +--- +title: 调试用 +nav: + title: Debug + path: /debug +group: debug +--- + + diff --git a/docs/examples/_debug.tsx b/docs/examples/_debug.tsx new file mode 100644 index 00000000..007c06bb --- /dev/null +++ b/docs/examples/_debug.tsx @@ -0,0 +1,21 @@ +import * as React from 'react'; + +export interface _debugProps { + slogan?: React.ReactNode; +} + +function Debug(props: React.PropsWithChildren<_debugProps>) { + const { children } = props; + return ( + <> +
    +

    魔法师正在进行最后的仪式,为您带来一项惊艳功能

    + TBD: The Brilliant Discovery! +
    + {children} + {/* This is _debug.tsx} */} + + ); +} + +export default Debug; diff --git a/tests/demo.test.js b/tests/demo.test.js index f5cf65d1..1637c4e6 100644 --- a/tests/demo.test.js +++ b/tests/demo.test.js @@ -5,7 +5,7 @@ import path from 'path'; const exampleDir = path.resolve(__dirname, '../docs/examples'); const files = fs .readdirSync(exampleDir) - .filter((file) => file.endsWith('.tsx')); + .filter((file) => file.endsWith('.tsx') && !file.startsWith('_')); describe('Example', () => { files.forEach((file) => { From 748101df4b3eae6f14888901a813d3c5558295e8 Mon Sep 17 00:00:00 2001 From: wuxh Date: Tue, 7 Nov 2023 09:20:53 +0800 Subject: [PATCH 11/64] chore: 001 --- docs/examples/_debug.tsx | 29 ++-- src/NewPagination.tsx | 318 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 328 insertions(+), 19 deletions(-) create mode 100644 src/NewPagination.tsx diff --git a/docs/examples/_debug.tsx b/docs/examples/_debug.tsx index 007c06bb..f9f9bf99 100644 --- a/docs/examples/_debug.tsx +++ b/docs/examples/_debug.tsx @@ -1,21 +1,12 @@ -import * as React from 'react'; +import React from 'react'; +import '../../assets/index.less'; +import Pagination from '../../src/NewPagination'; +// import Pagination from '../../src/Pagination'; -export interface _debugProps { - slogan?: React.ReactNode; -} +const App = () => ( + <> + + +); -function Debug(props: React.PropsWithChildren<_debugProps>) { - const { children } = props; - return ( - <> -
    -

    魔法师正在进行最后的仪式,为您带来一项惊艳功能

    - TBD: The Brilliant Discovery! -
    - {children} - {/* This is _debug.tsx} */} - - ); -} - -export default Debug; +export default App; diff --git a/src/NewPagination.tsx b/src/NewPagination.tsx new file mode 100644 index 00000000..618e73ed --- /dev/null +++ b/src/NewPagination.tsx @@ -0,0 +1,318 @@ +import classNames from 'classnames'; +import useMergedState from 'rc-util/lib/hooks/useMergedState'; +import pickAttrs from 'rc-util/lib/pickAttrs'; +import warning from 'rc-util/lib/warning'; +import React from 'react'; +import type { PaginationProps } from './interface'; +import zhCN from './locale/zh_CN'; + +const defaultItemRender: PaginationProps['itemRender'] = ( + page, + type, + element, +) => element; + +function noop() {} + +function calculatePage(p: number | undefined, pageSize: number, total: number) { + const _pageSize = typeof p === 'undefined' ? pageSize : p; + return Math.floor((total - 1) / _pageSize) + 1; +} +function Pagination(props: PaginationProps) { + const { + prefixCls = 'rc-pagination', + selectPrefixCls = 'rc-select', + className, + current: currentProp, + defaultCurrent = 1, + total = 0, + pageSize: pageSizeProp, + defaultPageSize = 10, + onChange = noop, + selectComponentClass, + hideOnSinglePage, + showPrevNextJumpers = true, + showQuickJumper, + showLessItems, + showTitle = true, + onShowSizeChange = noop, + locale = zhCN, + style, + itemRender = defaultItemRender, + totalBoundaryShowSizeChanger = 50, + disabled, + simple, + showTotal, + // render + jumpPrevIcon, + prevIcon, + nextIcon, + } = props; + + const paginationRef = React.useRef(null); + + const [pageSize, setPageSize] = useMergedState(10, { + value: pageSizeProp, + defaultValue: defaultPageSize, + }); + + const [current, setCurrent] = useMergedState(1, { + value: currentProp, + defaultValue: defaultCurrent, + postState: (c) => Math.min(c, calculatePage(pageSize, undefined, total)), + }); + + const hasOnChange = onChange !== noop; + const hasCurrent = 'current' in props; + + if (process.env.NODE_ENV !== 'production') { + warning( + hasCurrent && hasOnChange, + 'Warning: You provided a `current` prop to a Pagination component without an `onChange` handler. This will render a read-only component.', + ); + } + + // TODO: Should be deleted. assign: @Wuxh + globalThis.console.log('%c', 'color:lightBlue;', { + total, + hasOnChange, + hasCurrent, + current, + pageSize, + }); + + const getJumpPrevPage = () => Math.max(1, current - (showLessItems ? 3 : 5)); + + const getJumpNextPage = () => + Math.min( + calculatePage(undefined, pageSize, total), + this.state.current + (this.props.showLessItems ? 3 : 5), + ); + + const getItemIcon = ( + icon: React.ReactNode | React.ComponentType, + label: string, + ) => { + let iconNode = icon || ( + + ); + } else { + gotoButton = ( + + {goButton} + + ); + } + gotoButton = ( +
  • + {gotoButton} +
  • + ); + } + + const prevNode = renderPrev(prevPage); + return ( +
      + {totalText} + {prevNode ? ( +
    • + {prevNode} +
    • + ) : null} +
    • + + / + {allPages} +
    • +
    • + {renderNext(nextPage)} +
    • +
    + ); + } + + return ( +
    +

    NEW Pagination

    +
    + ); +} + +export default Pagination; From 429c1e6e9b242c8f06ff6d5dcf16e99617534ada Mon Sep 17 00:00:00 2001 From: wuxh Date: Tue, 7 Nov 2023 11:05:20 +0800 Subject: [PATCH 12/64] chore: update --- src/usePagination.ts | 155 + .../__snapshots__/usePagination.test.js.snap | 8944 +++++++++++++++++ tests/usePagination.test.js | 38 + 3 files changed, 9137 insertions(+) create mode 100644 src/usePagination.ts create mode 100644 tests/__snapshots__/usePagination.test.js.snap create mode 100644 tests/usePagination.test.js diff --git a/src/usePagination.ts b/src/usePagination.ts new file mode 100644 index 00000000..43ad045e --- /dev/null +++ b/src/usePagination.ts @@ -0,0 +1,155 @@ +import useMergedState from 'rc-util/lib/hooks/useMergedState'; +import type * as React from 'react'; + +type ItemType = + | 'previous' + | 'start-ellipsis' + | 'page' + | 'end-ellipsis' + | 'next'; +type ItemList = (Exclude | number)[]; + +type UsePaginationProps = { + /** + * Total pages + * @default 1 + */ + count?: number; + current?: number; + defaultCurrent?: number; + onChange?: (page: number, prevPage: number) => void; + disabled?: boolean; + /** + * [1, 2, ..., 4, 5, [6], 7, 8, ..., 10, 11] // boundaryCount = 2 + * @default 1 + */ + boundaryCount?: number; + /** + * [1, ..., 4, [5], 6, ... 10] // siblingCount = 1 + * @default 2 + */ + siblingCount?: number; +}; + +interface UsePaginationItem { + onClick: React.ReactEventHandler; + type: ItemType; + page: number | null; + selected: boolean; + disabled: boolean; +} + +type UsePaginationResult = UsePaginationItem[]; + +function usePagination(props: UsePaginationProps = {}): UsePaginationResult { + const { + count = 1, + current: currentProp, + defaultCurrent, + onChange, + disabled = false, + boundaryCount = 1, + siblingCount = 2, + } = props; + + const [current, setCurrent] = useMergedState(1, { + defaultValue: defaultCurrent, + value: currentProp, + onChange, + }); + + const startPages = range(1, Math.min(boundaryCount, count)); + + const siblingsStart = Math.max( + Math.min(current - siblingCount, count - boundaryCount - siblingCount * 2), + boundaryCount + 1, + ); + const startEllipsis: ItemList = + siblingsStart > boundaryCount + 1 + ? ['start-ellipsis'] + : boundaryCount + 1 < count - boundaryCount + ? [boundaryCount + 1] + : []; + + const endPages = range( + Math.max(count - boundaryCount, boundaryCount + 1), + count, + ); + + const siblingsEnd = Math.min( + Math.max(current + siblingCount, boundaryCount + siblingCount * 2 + 1), + endPages.length > 0 ? endPages[0] - 2 : count - 1, + ); + + console.log({ + startPages, + siblingsStart, + startEllipsis, + endPages, + siblingsEnd, + }); + + const endEllipsis: ItemList = + siblingsEnd < count - boundaryCount - 1 + ? ['end-ellipsis'] + : count - boundaryCount > boundaryCount + ? [count - boundaryCount] + : []; + + const itemList: ItemList = [ + 'previous', + ...startPages, + ...startEllipsis, + ...range(siblingsStart, siblingsEnd), + ...endEllipsis, + ...endPages, + 'next', + ]; + + // Map the button type to its page number + const buttonPage = (type: ItemType) => { + switch (type) { + case 'previous': + return current - 1; + case 'next': + return current + 1; + default: + return null; + } + }; + + const items = itemList.map((item) => { + if (typeof item === 'number') { + return { + onClick() { + setCurrent(item); + }, + type: 'page', + page: item, + selected: item === current, + disabled, + }; + } + + return { + onClick() { + setCurrent(buttonPage(item)); + }, + type: item, + page: buttonPage(item), + selected: false, + disabled: + disabled || + (item.indexOf('ellipsis') === -1 && + (item === 'next' ? current >= count : current <= 1)), + }; + }); + + return items; +} + +function range(start: number, end: number) { + return Array.from({ length: end - start + 1 }, (_, i) => i + start); +} + +export default usePagination; diff --git a/tests/__snapshots__/usePagination.test.js.snap b/tests/__snapshots__/usePagination.test.js.snap new file mode 100644 index 00000000..4eca15f2 --- /dev/null +++ b/tests/__snapshots__/usePagination.test.js.snap @@ -0,0 +1,8944 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`usePagination default has 3 pages current page is 1 1`] = ` +[ + { + "disabled": true, + "onClick": [Function], + "page": 0, + "selected": false, + "type": "previous", + }, + { + "disabled": false, + "onClick": [Function], + "page": 1, + "selected": true, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 2, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 3, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 2, + "selected": false, + "type": "next", + }, +] +`; + +exports[`usePagination default has 3 pages current page is 2 1`] = ` +[ + { + "disabled": true, + "onClick": [Function], + "page": 0, + "selected": false, + "type": "previous", + }, + { + "disabled": false, + "onClick": [Function], + "page": 1, + "selected": true, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 2, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 3, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 2, + "selected": false, + "type": "next", + }, +] +`; + +exports[`usePagination default has 3 pages current page is 3 1`] = ` +[ + { + "disabled": true, + "onClick": [Function], + "page": 0, + "selected": false, + "type": "previous", + }, + { + "disabled": false, + "onClick": [Function], + "page": 1, + "selected": true, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 2, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 3, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 2, + "selected": false, + "type": "next", + }, +] +`; + +exports[`usePagination default has 5 pages current page is 1 1`] = ` +[ + { + "disabled": true, + "onClick": [Function], + "page": 0, + "selected": false, + "type": "previous", + }, + { + "disabled": false, + "onClick": [Function], + "page": 1, + "selected": true, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 2, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 2, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "end-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 4, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 5, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 2, + "selected": false, + "type": "next", + }, +] +`; + +exports[`usePagination default has 5 pages current page is 2 1`] = ` +[ + { + "disabled": false, + "onClick": [Function], + "page": 1, + "selected": false, + "type": "previous", + }, + { + "disabled": false, + "onClick": [Function], + "page": 1, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 2, + "selected": true, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 2, + "selected": true, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "end-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 4, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 5, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 3, + "selected": false, + "type": "next", + }, +] +`; + +exports[`usePagination default has 5 pages current page is 3 1`] = ` +[ + { + "disabled": false, + "onClick": [Function], + "page": 2, + "selected": false, + "type": "previous", + }, + { + "disabled": false, + "onClick": [Function], + "page": 1, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 2, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 2, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "end-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 4, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 5, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 4, + "selected": false, + "type": "next", + }, +] +`; + +exports[`usePagination default has 5 pages current page is 4 1`] = ` +[ + { + "disabled": false, + "onClick": [Function], + "page": 3, + "selected": false, + "type": "previous", + }, + { + "disabled": false, + "onClick": [Function], + "page": 1, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 2, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 2, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "end-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 4, + "selected": true, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 5, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 5, + "selected": false, + "type": "next", + }, +] +`; + +exports[`usePagination default has 5 pages current page is 5 1`] = ` +[ + { + "disabled": false, + "onClick": [Function], + "page": 4, + "selected": false, + "type": "previous", + }, + { + "disabled": false, + "onClick": [Function], + "page": 1, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 2, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 2, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "end-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 4, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 5, + "selected": true, + "type": "page", + }, + { + "disabled": true, + "onClick": [Function], + "page": 6, + "selected": false, + "type": "next", + }, +] +`; + +exports[`usePagination default has 6 pages current page is 1 1`] = ` +[ + { + "disabled": true, + "onClick": [Function], + "page": 0, + "selected": false, + "type": "previous", + }, + { + "disabled": false, + "onClick": [Function], + "page": 1, + "selected": true, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 2, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 2, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 3, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "end-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 5, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 6, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 2, + "selected": false, + "type": "next", + }, +] +`; + +exports[`usePagination default has 6 pages current page is 2 1`] = ` +[ + { + "disabled": false, + "onClick": [Function], + "page": 1, + "selected": false, + "type": "previous", + }, + { + "disabled": false, + "onClick": [Function], + "page": 1, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 2, + "selected": true, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 2, + "selected": true, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 3, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "end-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 5, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 6, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 3, + "selected": false, + "type": "next", + }, +] +`; + +exports[`usePagination default has 6 pages current page is 3 1`] = ` +[ + { + "disabled": false, + "onClick": [Function], + "page": 2, + "selected": false, + "type": "previous", + }, + { + "disabled": false, + "onClick": [Function], + "page": 1, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 2, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 2, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 3, + "selected": true, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "end-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 5, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 6, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 4, + "selected": false, + "type": "next", + }, +] +`; + +exports[`usePagination default has 6 pages current page is 4 1`] = ` +[ + { + "disabled": false, + "onClick": [Function], + "page": 3, + "selected": false, + "type": "previous", + }, + { + "disabled": false, + "onClick": [Function], + "page": 1, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 2, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 2, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 3, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "end-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 5, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 6, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 5, + "selected": false, + "type": "next", + }, +] +`; + +exports[`usePagination default has 6 pages current page is 5 1`] = ` +[ + { + "disabled": false, + "onClick": [Function], + "page": 4, + "selected": false, + "type": "previous", + }, + { + "disabled": false, + "onClick": [Function], + "page": 1, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 2, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 2, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 3, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "end-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 5, + "selected": true, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 6, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 6, + "selected": false, + "type": "next", + }, +] +`; + +exports[`usePagination default has 6 pages current page is 6 1`] = ` +[ + { + "disabled": false, + "onClick": [Function], + "page": 5, + "selected": false, + "type": "previous", + }, + { + "disabled": false, + "onClick": [Function], + "page": 1, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 2, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 2, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 3, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "end-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 5, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 6, + "selected": true, + "type": "page", + }, + { + "disabled": true, + "onClick": [Function], + "page": 7, + "selected": false, + "type": "next", + }, +] +`; + +exports[`usePagination default has 7 pages current page is 1 1`] = ` +[ + { + "disabled": true, + "onClick": [Function], + "page": 0, + "selected": false, + "type": "previous", + }, + { + "disabled": false, + "onClick": [Function], + "page": 1, + "selected": true, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 2, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 2, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 3, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 4, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "end-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 6, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 7, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 2, + "selected": false, + "type": "next", + }, +] +`; + +exports[`usePagination default has 7 pages current page is 2 1`] = ` +[ + { + "disabled": false, + "onClick": [Function], + "page": 1, + "selected": false, + "type": "previous", + }, + { + "disabled": false, + "onClick": [Function], + "page": 1, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 2, + "selected": true, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 2, + "selected": true, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 3, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 4, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "end-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 6, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 7, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 3, + "selected": false, + "type": "next", + }, +] +`; + +exports[`usePagination default has 7 pages current page is 3 1`] = ` +[ + { + "disabled": false, + "onClick": [Function], + "page": 2, + "selected": false, + "type": "previous", + }, + { + "disabled": false, + "onClick": [Function], + "page": 1, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 2, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 2, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 3, + "selected": true, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 4, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "end-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 6, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 7, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 4, + "selected": false, + "type": "next", + }, +] +`; + +exports[`usePagination default has 7 pages current page is 4 1`] = ` +[ + { + "disabled": false, + "onClick": [Function], + "page": 3, + "selected": false, + "type": "previous", + }, + { + "disabled": false, + "onClick": [Function], + "page": 1, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 2, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 2, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 3, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 4, + "selected": true, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "end-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 6, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 7, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 5, + "selected": false, + "type": "next", + }, +] +`; + +exports[`usePagination default has 7 pages current page is 5 1`] = ` +[ + { + "disabled": false, + "onClick": [Function], + "page": 4, + "selected": false, + "type": "previous", + }, + { + "disabled": false, + "onClick": [Function], + "page": 1, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 2, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 2, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 3, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 4, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "end-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 6, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 7, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 6, + "selected": false, + "type": "next", + }, +] +`; + +exports[`usePagination default has 7 pages current page is 6 1`] = ` +[ + { + "disabled": false, + "onClick": [Function], + "page": 5, + "selected": false, + "type": "previous", + }, + { + "disabled": false, + "onClick": [Function], + "page": 1, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 2, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 2, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 3, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 4, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "end-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 6, + "selected": true, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 7, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 7, + "selected": false, + "type": "next", + }, +] +`; + +exports[`usePagination default has 7 pages current page is 7 1`] = ` +[ + { + "disabled": false, + "onClick": [Function], + "page": 6, + "selected": false, + "type": "previous", + }, + { + "disabled": false, + "onClick": [Function], + "page": 1, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 2, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 2, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 3, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 4, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "end-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 6, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 7, + "selected": true, + "type": "page", + }, + { + "disabled": true, + "onClick": [Function], + "page": 8, + "selected": false, + "type": "next", + }, +] +`; + +exports[`usePagination default has 8 pages current page is 1 1`] = ` +[ + { + "disabled": true, + "onClick": [Function], + "page": 0, + "selected": false, + "type": "previous", + }, + { + "disabled": false, + "onClick": [Function], + "page": 1, + "selected": true, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 2, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 2, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 3, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 4, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 5, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "end-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 7, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 8, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 2, + "selected": false, + "type": "next", + }, +] +`; + +exports[`usePagination default has 8 pages current page is 2 1`] = ` +[ + { + "disabled": false, + "onClick": [Function], + "page": 1, + "selected": false, + "type": "previous", + }, + { + "disabled": false, + "onClick": [Function], + "page": 1, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 2, + "selected": true, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 2, + "selected": true, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 3, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 4, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 5, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "end-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 7, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 8, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 3, + "selected": false, + "type": "next", + }, +] +`; + +exports[`usePagination default has 8 pages current page is 3 1`] = ` +[ + { + "disabled": false, + "onClick": [Function], + "page": 2, + "selected": false, + "type": "previous", + }, + { + "disabled": false, + "onClick": [Function], + "page": 1, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 2, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 2, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 3, + "selected": true, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 4, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 5, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "end-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 7, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 8, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 4, + "selected": false, + "type": "next", + }, +] +`; + +exports[`usePagination default has 8 pages current page is 4 1`] = ` +[ + { + "disabled": false, + "onClick": [Function], + "page": 3, + "selected": false, + "type": "previous", + }, + { + "disabled": false, + "onClick": [Function], + "page": 1, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 2, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 2, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 3, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 4, + "selected": true, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 5, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "end-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 7, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 8, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 5, + "selected": false, + "type": "next", + }, +] +`; + +exports[`usePagination default has 8 pages current page is 5 1`] = ` +[ + { + "disabled": false, + "onClick": [Function], + "page": 4, + "selected": false, + "type": "previous", + }, + { + "disabled": false, + "onClick": [Function], + "page": 1, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "start-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 3, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 4, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 5, + "selected": true, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "end-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 7, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 8, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 6, + "selected": false, + "type": "next", + }, +] +`; + +exports[`usePagination default has 8 pages current page is 6 1`] = ` +[ + { + "disabled": false, + "onClick": [Function], + "page": 5, + "selected": false, + "type": "previous", + }, + { + "disabled": false, + "onClick": [Function], + "page": 1, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "start-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 3, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 4, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 5, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "end-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 7, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 8, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 7, + "selected": false, + "type": "next", + }, +] +`; + +exports[`usePagination default has 8 pages current page is 7 1`] = ` +[ + { + "disabled": false, + "onClick": [Function], + "page": 6, + "selected": false, + "type": "previous", + }, + { + "disabled": false, + "onClick": [Function], + "page": 1, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "start-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 3, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 4, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 5, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "end-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 7, + "selected": true, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 8, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 8, + "selected": false, + "type": "next", + }, +] +`; + +exports[`usePagination default has 8 pages current page is 8 1`] = ` +[ + { + "disabled": false, + "onClick": [Function], + "page": 7, + "selected": false, + "type": "previous", + }, + { + "disabled": false, + "onClick": [Function], + "page": 1, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "start-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 3, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 4, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 5, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "end-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 7, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 8, + "selected": true, + "type": "page", + }, + { + "disabled": true, + "onClick": [Function], + "page": 9, + "selected": false, + "type": "next", + }, +] +`; + +exports[`usePagination default has 9 pages current page is 1 1`] = ` +[ + { + "disabled": true, + "onClick": [Function], + "page": 0, + "selected": false, + "type": "previous", + }, + { + "disabled": false, + "onClick": [Function], + "page": 1, + "selected": true, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 2, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 2, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 3, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 4, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 5, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 6, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "end-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 8, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 9, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 2, + "selected": false, + "type": "next", + }, +] +`; + +exports[`usePagination default has 9 pages current page is 2 1`] = ` +[ + { + "disabled": false, + "onClick": [Function], + "page": 1, + "selected": false, + "type": "previous", + }, + { + "disabled": false, + "onClick": [Function], + "page": 1, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 2, + "selected": true, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 2, + "selected": true, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 3, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 4, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 5, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 6, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "end-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 8, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 9, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 3, + "selected": false, + "type": "next", + }, +] +`; + +exports[`usePagination default has 9 pages current page is 3 1`] = ` +[ + { + "disabled": false, + "onClick": [Function], + "page": 2, + "selected": false, + "type": "previous", + }, + { + "disabled": false, + "onClick": [Function], + "page": 1, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 2, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 2, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 3, + "selected": true, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 4, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 5, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 6, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "end-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 8, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 9, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 4, + "selected": false, + "type": "next", + }, +] +`; + +exports[`usePagination default has 9 pages current page is 4 1`] = ` +[ + { + "disabled": false, + "onClick": [Function], + "page": 3, + "selected": false, + "type": "previous", + }, + { + "disabled": false, + "onClick": [Function], + "page": 1, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 2, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 2, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 3, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 4, + "selected": true, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 5, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 6, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "end-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 8, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 9, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 5, + "selected": false, + "type": "next", + }, +] +`; + +exports[`usePagination default has 9 pages current page is 5 1`] = ` +[ + { + "disabled": false, + "onClick": [Function], + "page": 4, + "selected": false, + "type": "previous", + }, + { + "disabled": false, + "onClick": [Function], + "page": 1, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "start-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 3, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 4, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 5, + "selected": true, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 6, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "end-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 8, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 9, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 6, + "selected": false, + "type": "next", + }, +] +`; + +exports[`usePagination default has 9 pages current page is 6 1`] = ` +[ + { + "disabled": false, + "onClick": [Function], + "page": 5, + "selected": false, + "type": "previous", + }, + { + "disabled": false, + "onClick": [Function], + "page": 1, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "start-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 4, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 5, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 6, + "selected": true, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "end-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 8, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 9, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 7, + "selected": false, + "type": "next", + }, +] +`; + +exports[`usePagination default has 9 pages current page is 7 1`] = ` +[ + { + "disabled": false, + "onClick": [Function], + "page": 6, + "selected": false, + "type": "previous", + }, + { + "disabled": false, + "onClick": [Function], + "page": 1, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "start-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 4, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 5, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 6, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "end-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 8, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 9, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 8, + "selected": false, + "type": "next", + }, +] +`; + +exports[`usePagination default has 9 pages current page is 8 1`] = ` +[ + { + "disabled": false, + "onClick": [Function], + "page": 7, + "selected": false, + "type": "previous", + }, + { + "disabled": false, + "onClick": [Function], + "page": 1, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "start-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 4, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 5, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 6, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "end-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 8, + "selected": true, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 9, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 9, + "selected": false, + "type": "next", + }, +] +`; + +exports[`usePagination default has 9 pages current page is 9 1`] = ` +[ + { + "disabled": false, + "onClick": [Function], + "page": 8, + "selected": false, + "type": "previous", + }, + { + "disabled": false, + "onClick": [Function], + "page": 1, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "start-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 4, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 5, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 6, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "end-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 8, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 9, + "selected": true, + "type": "page", + }, + { + "disabled": true, + "onClick": [Function], + "page": 10, + "selected": false, + "type": "next", + }, +] +`; + +exports[`usePagination default has 10 pages current page is 1 1`] = ` +[ + { + "disabled": true, + "onClick": [Function], + "page": 0, + "selected": false, + "type": "previous", + }, + { + "disabled": false, + "onClick": [Function], + "page": 1, + "selected": true, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 2, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 2, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 3, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 4, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 5, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 6, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "end-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 9, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 10, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 2, + "selected": false, + "type": "next", + }, +] +`; + +exports[`usePagination default has 10 pages current page is 2 1`] = ` +[ + { + "disabled": false, + "onClick": [Function], + "page": 1, + "selected": false, + "type": "previous", + }, + { + "disabled": false, + "onClick": [Function], + "page": 1, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 2, + "selected": true, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 2, + "selected": true, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 3, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 4, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 5, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 6, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "end-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 9, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 10, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 3, + "selected": false, + "type": "next", + }, +] +`; + +exports[`usePagination default has 10 pages current page is 3 1`] = ` +[ + { + "disabled": false, + "onClick": [Function], + "page": 2, + "selected": false, + "type": "previous", + }, + { + "disabled": false, + "onClick": [Function], + "page": 1, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 2, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 2, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 3, + "selected": true, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 4, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 5, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 6, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "end-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 9, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 10, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 4, + "selected": false, + "type": "next", + }, +] +`; + +exports[`usePagination default has 10 pages current page is 4 1`] = ` +[ + { + "disabled": false, + "onClick": [Function], + "page": 3, + "selected": false, + "type": "previous", + }, + { + "disabled": false, + "onClick": [Function], + "page": 1, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 2, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 2, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 3, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 4, + "selected": true, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 5, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 6, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "end-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 9, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 10, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 5, + "selected": false, + "type": "next", + }, +] +`; + +exports[`usePagination default has 10 pages current page is 5 1`] = ` +[ + { + "disabled": false, + "onClick": [Function], + "page": 4, + "selected": false, + "type": "previous", + }, + { + "disabled": false, + "onClick": [Function], + "page": 1, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "start-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 3, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 4, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 5, + "selected": true, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 6, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 7, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "end-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 9, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 10, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 6, + "selected": false, + "type": "next", + }, +] +`; + +exports[`usePagination default has 10 pages current page is 6 1`] = ` +[ + { + "disabled": false, + "onClick": [Function], + "page": 5, + "selected": false, + "type": "previous", + }, + { + "disabled": false, + "onClick": [Function], + "page": 1, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "start-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 4, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 5, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 6, + "selected": true, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 7, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "end-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 9, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 10, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 7, + "selected": false, + "type": "next", + }, +] +`; + +exports[`usePagination default has 10 pages current page is 7 1`] = ` +[ + { + "disabled": false, + "onClick": [Function], + "page": 6, + "selected": false, + "type": "previous", + }, + { + "disabled": false, + "onClick": [Function], + "page": 1, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "start-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 5, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 6, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 7, + "selected": true, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "end-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 9, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 10, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 8, + "selected": false, + "type": "next", + }, +] +`; + +exports[`usePagination default has 10 pages current page is 8 1`] = ` +[ + { + "disabled": false, + "onClick": [Function], + "page": 7, + "selected": false, + "type": "previous", + }, + { + "disabled": false, + "onClick": [Function], + "page": 1, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "start-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 5, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 6, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 7, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "end-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 9, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 10, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 9, + "selected": false, + "type": "next", + }, +] +`; + +exports[`usePagination default has 10 pages current page is 9 1`] = ` +[ + { + "disabled": false, + "onClick": [Function], + "page": 8, + "selected": false, + "type": "previous", + }, + { + "disabled": false, + "onClick": [Function], + "page": 1, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "start-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 5, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 6, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 7, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "end-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 9, + "selected": true, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 10, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 10, + "selected": false, + "type": "next", + }, +] +`; + +exports[`usePagination default has 10 pages current page is 10 1`] = ` +[ + { + "disabled": false, + "onClick": [Function], + "page": 9, + "selected": false, + "type": "previous", + }, + { + "disabled": false, + "onClick": [Function], + "page": 1, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "start-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 5, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 6, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 7, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "end-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 9, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 10, + "selected": true, + "type": "page", + }, + { + "disabled": true, + "onClick": [Function], + "page": 11, + "selected": false, + "type": "next", + }, +] +`; + +exports[`usePagination default has 12 pages current page is 1 1`] = ` +[ + { + "disabled": true, + "onClick": [Function], + "page": 0, + "selected": false, + "type": "previous", + }, + { + "disabled": false, + "onClick": [Function], + "page": 1, + "selected": true, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 2, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 2, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 3, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 4, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 5, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 6, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "end-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 11, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 12, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 2, + "selected": false, + "type": "next", + }, +] +`; + +exports[`usePagination default has 12 pages current page is 2 1`] = ` +[ + { + "disabled": false, + "onClick": [Function], + "page": 1, + "selected": false, + "type": "previous", + }, + { + "disabled": false, + "onClick": [Function], + "page": 1, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 2, + "selected": true, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 2, + "selected": true, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 3, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 4, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 5, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 6, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "end-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 11, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 12, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 3, + "selected": false, + "type": "next", + }, +] +`; + +exports[`usePagination default has 12 pages current page is 3 1`] = ` +[ + { + "disabled": false, + "onClick": [Function], + "page": 2, + "selected": false, + "type": "previous", + }, + { + "disabled": false, + "onClick": [Function], + "page": 1, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 2, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 2, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 3, + "selected": true, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 4, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 5, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 6, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "end-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 11, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 12, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 4, + "selected": false, + "type": "next", + }, +] +`; + +exports[`usePagination default has 12 pages current page is 4 1`] = ` +[ + { + "disabled": false, + "onClick": [Function], + "page": 3, + "selected": false, + "type": "previous", + }, + { + "disabled": false, + "onClick": [Function], + "page": 1, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 2, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 2, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 3, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 4, + "selected": true, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 5, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 6, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "end-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 11, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 12, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 5, + "selected": false, + "type": "next", + }, +] +`; + +exports[`usePagination default has 12 pages current page is 5 1`] = ` +[ + { + "disabled": false, + "onClick": [Function], + "page": 4, + "selected": false, + "type": "previous", + }, + { + "disabled": false, + "onClick": [Function], + "page": 1, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "start-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 3, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 4, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 5, + "selected": true, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 6, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 7, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "end-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 11, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 12, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 6, + "selected": false, + "type": "next", + }, +] +`; + +exports[`usePagination default has 12 pages current page is 6 1`] = ` +[ + { + "disabled": false, + "onClick": [Function], + "page": 5, + "selected": false, + "type": "previous", + }, + { + "disabled": false, + "onClick": [Function], + "page": 1, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "start-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 4, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 5, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 6, + "selected": true, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 7, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 8, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "end-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 11, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 12, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 7, + "selected": false, + "type": "next", + }, +] +`; + +exports[`usePagination default has 12 pages current page is 7 1`] = ` +[ + { + "disabled": false, + "onClick": [Function], + "page": 6, + "selected": false, + "type": "previous", + }, + { + "disabled": false, + "onClick": [Function], + "page": 1, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "start-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 5, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 6, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 7, + "selected": true, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 8, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 9, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "end-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 11, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 12, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 8, + "selected": false, + "type": "next", + }, +] +`; + +exports[`usePagination default has 12 pages current page is 8 1`] = ` +[ + { + "disabled": false, + "onClick": [Function], + "page": 7, + "selected": false, + "type": "previous", + }, + { + "disabled": false, + "onClick": [Function], + "page": 1, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "start-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 6, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 7, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 8, + "selected": true, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 9, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "end-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 11, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 12, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 9, + "selected": false, + "type": "next", + }, +] +`; + +exports[`usePagination default has 12 pages current page is 9 1`] = ` +[ + { + "disabled": false, + "onClick": [Function], + "page": 8, + "selected": false, + "type": "previous", + }, + { + "disabled": false, + "onClick": [Function], + "page": 1, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "start-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 7, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 8, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 9, + "selected": true, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "end-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 11, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 12, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 10, + "selected": false, + "type": "next", + }, +] +`; + +exports[`usePagination default has 12 pages current page is 10 1`] = ` +[ + { + "disabled": false, + "onClick": [Function], + "page": 9, + "selected": false, + "type": "previous", + }, + { + "disabled": false, + "onClick": [Function], + "page": 1, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "start-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 7, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 8, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 9, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "end-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 11, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 12, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 11, + "selected": false, + "type": "next", + }, +] +`; + +exports[`usePagination default has 12 pages current page is 11 1`] = ` +[ + { + "disabled": false, + "onClick": [Function], + "page": 10, + "selected": false, + "type": "previous", + }, + { + "disabled": false, + "onClick": [Function], + "page": 1, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "start-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 7, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 8, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 9, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "end-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 11, + "selected": true, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 12, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 12, + "selected": false, + "type": "next", + }, +] +`; + +exports[`usePagination default has 12 pages current page is 12 1`] = ` +[ + { + "disabled": false, + "onClick": [Function], + "page": 11, + "selected": false, + "type": "previous", + }, + { + "disabled": false, + "onClick": [Function], + "page": 1, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "start-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 7, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 8, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 9, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "end-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 11, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 12, + "selected": true, + "type": "page", + }, + { + "disabled": true, + "onClick": [Function], + "page": 13, + "selected": false, + "type": "next", + }, +] +`; + +exports[`usePagination default has 50 pages current page is 1 1`] = ` +[ + { + "disabled": true, + "onClick": [Function], + "page": 0, + "selected": false, + "type": "previous", + }, + { + "disabled": false, + "onClick": [Function], + "page": 1, + "selected": true, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 2, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 2, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 3, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 4, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 5, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 6, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "end-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 49, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 50, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 2, + "selected": false, + "type": "next", + }, +] +`; + +exports[`usePagination default has 50 pages current page is 2 1`] = ` +[ + { + "disabled": false, + "onClick": [Function], + "page": 1, + "selected": false, + "type": "previous", + }, + { + "disabled": false, + "onClick": [Function], + "page": 1, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 2, + "selected": true, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 2, + "selected": true, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 3, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 4, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 5, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 6, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "end-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 49, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 50, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 3, + "selected": false, + "type": "next", + }, +] +`; + +exports[`usePagination default has 50 pages current page is 3 1`] = ` +[ + { + "disabled": false, + "onClick": [Function], + "page": 2, + "selected": false, + "type": "previous", + }, + { + "disabled": false, + "onClick": [Function], + "page": 1, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 2, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 2, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 3, + "selected": true, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 4, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 5, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 6, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "end-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 49, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 50, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 4, + "selected": false, + "type": "next", + }, +] +`; + +exports[`usePagination default has 50 pages current page is 4 1`] = ` +[ + { + "disabled": false, + "onClick": [Function], + "page": 3, + "selected": false, + "type": "previous", + }, + { + "disabled": false, + "onClick": [Function], + "page": 1, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 2, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 2, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 3, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 4, + "selected": true, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 5, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 6, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "end-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 49, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 50, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 5, + "selected": false, + "type": "next", + }, +] +`; + +exports[`usePagination default has 50 pages current page is 5 1`] = ` +[ + { + "disabled": false, + "onClick": [Function], + "page": 4, + "selected": false, + "type": "previous", + }, + { + "disabled": false, + "onClick": [Function], + "page": 1, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "start-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 3, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 4, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 5, + "selected": true, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 6, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 7, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "end-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 49, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 50, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 6, + "selected": false, + "type": "next", + }, +] +`; + +exports[`usePagination default has 50 pages current page is 6 1`] = ` +[ + { + "disabled": false, + "onClick": [Function], + "page": 5, + "selected": false, + "type": "previous", + }, + { + "disabled": false, + "onClick": [Function], + "page": 1, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "start-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 4, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 5, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 6, + "selected": true, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 7, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 8, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "end-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 49, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 50, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 7, + "selected": false, + "type": "next", + }, +] +`; + +exports[`usePagination default has 50 pages current page is 7 1`] = ` +[ + { + "disabled": false, + "onClick": [Function], + "page": 6, + "selected": false, + "type": "previous", + }, + { + "disabled": false, + "onClick": [Function], + "page": 1, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "start-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 5, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 6, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 7, + "selected": true, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 8, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 9, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "end-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 49, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 50, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 8, + "selected": false, + "type": "next", + }, +] +`; + +exports[`usePagination default has 50 pages current page is 8 1`] = ` +[ + { + "disabled": false, + "onClick": [Function], + "page": 7, + "selected": false, + "type": "previous", + }, + { + "disabled": false, + "onClick": [Function], + "page": 1, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "start-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 6, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 7, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 8, + "selected": true, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 9, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 10, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "end-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 49, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 50, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 9, + "selected": false, + "type": "next", + }, +] +`; + +exports[`usePagination default has 50 pages current page is 9 1`] = ` +[ + { + "disabled": false, + "onClick": [Function], + "page": 8, + "selected": false, + "type": "previous", + }, + { + "disabled": false, + "onClick": [Function], + "page": 1, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "start-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 7, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 8, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 9, + "selected": true, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 10, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 11, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "end-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 49, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 50, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 10, + "selected": false, + "type": "next", + }, +] +`; + +exports[`usePagination default has 50 pages current page is 10 1`] = ` +[ + { + "disabled": false, + "onClick": [Function], + "page": 9, + "selected": false, + "type": "previous", + }, + { + "disabled": false, + "onClick": [Function], + "page": 1, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "start-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 8, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 9, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 10, + "selected": true, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 11, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 12, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "end-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 49, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 50, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 11, + "selected": false, + "type": "next", + }, +] +`; + +exports[`usePagination default has 50 pages current page is 11 1`] = ` +[ + { + "disabled": false, + "onClick": [Function], + "page": 10, + "selected": false, + "type": "previous", + }, + { + "disabled": false, + "onClick": [Function], + "page": 1, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "start-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 9, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 10, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 11, + "selected": true, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 12, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 13, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "end-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 49, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 50, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 12, + "selected": false, + "type": "next", + }, +] +`; + +exports[`usePagination default has 50 pages current page is 12 1`] = ` +[ + { + "disabled": false, + "onClick": [Function], + "page": 11, + "selected": false, + "type": "previous", + }, + { + "disabled": false, + "onClick": [Function], + "page": 1, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "start-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 10, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 11, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 12, + "selected": true, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 13, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 14, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "end-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 49, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 50, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 13, + "selected": false, + "type": "next", + }, +] +`; + +exports[`usePagination default has 50 pages current page is 13 1`] = ` +[ + { + "disabled": false, + "onClick": [Function], + "page": 12, + "selected": false, + "type": "previous", + }, + { + "disabled": false, + "onClick": [Function], + "page": 1, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "start-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 11, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 12, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 13, + "selected": true, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 14, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 15, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "end-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 49, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 50, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 14, + "selected": false, + "type": "next", + }, +] +`; + +exports[`usePagination default has 50 pages current page is 14 1`] = ` +[ + { + "disabled": false, + "onClick": [Function], + "page": 13, + "selected": false, + "type": "previous", + }, + { + "disabled": false, + "onClick": [Function], + "page": 1, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "start-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 12, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 13, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 14, + "selected": true, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 15, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 16, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "end-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 49, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 50, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 15, + "selected": false, + "type": "next", + }, +] +`; + +exports[`usePagination default has 50 pages current page is 15 1`] = ` +[ + { + "disabled": false, + "onClick": [Function], + "page": 14, + "selected": false, + "type": "previous", + }, + { + "disabled": false, + "onClick": [Function], + "page": 1, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "start-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 13, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 14, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 15, + "selected": true, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 16, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 17, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "end-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 49, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 50, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 16, + "selected": false, + "type": "next", + }, +] +`; + +exports[`usePagination default has 50 pages current page is 16 1`] = ` +[ + { + "disabled": false, + "onClick": [Function], + "page": 15, + "selected": false, + "type": "previous", + }, + { + "disabled": false, + "onClick": [Function], + "page": 1, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "start-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 14, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 15, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 16, + "selected": true, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 17, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 18, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "end-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 49, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 50, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 17, + "selected": false, + "type": "next", + }, +] +`; + +exports[`usePagination default has 50 pages current page is 17 1`] = ` +[ + { + "disabled": false, + "onClick": [Function], + "page": 16, + "selected": false, + "type": "previous", + }, + { + "disabled": false, + "onClick": [Function], + "page": 1, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "start-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 15, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 16, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 17, + "selected": true, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 18, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 19, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "end-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 49, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 50, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 18, + "selected": false, + "type": "next", + }, +] +`; + +exports[`usePagination default has 50 pages current page is 18 1`] = ` +[ + { + "disabled": false, + "onClick": [Function], + "page": 17, + "selected": false, + "type": "previous", + }, + { + "disabled": false, + "onClick": [Function], + "page": 1, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "start-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 16, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 17, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 18, + "selected": true, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 19, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 20, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "end-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 49, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 50, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 19, + "selected": false, + "type": "next", + }, +] +`; + +exports[`usePagination default has 50 pages current page is 19 1`] = ` +[ + { + "disabled": false, + "onClick": [Function], + "page": 18, + "selected": false, + "type": "previous", + }, + { + "disabled": false, + "onClick": [Function], + "page": 1, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "start-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 17, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 18, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 19, + "selected": true, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 20, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 21, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "end-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 49, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 50, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 20, + "selected": false, + "type": "next", + }, +] +`; + +exports[`usePagination default has 50 pages current page is 20 1`] = ` +[ + { + "disabled": false, + "onClick": [Function], + "page": 19, + "selected": false, + "type": "previous", + }, + { + "disabled": false, + "onClick": [Function], + "page": 1, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "start-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 18, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 19, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 20, + "selected": true, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 21, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 22, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "end-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 49, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 50, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 21, + "selected": false, + "type": "next", + }, +] +`; + +exports[`usePagination default has 50 pages current page is 21 1`] = ` +[ + { + "disabled": false, + "onClick": [Function], + "page": 20, + "selected": false, + "type": "previous", + }, + { + "disabled": false, + "onClick": [Function], + "page": 1, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "start-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 19, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 20, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 21, + "selected": true, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 22, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 23, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "end-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 49, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 50, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 22, + "selected": false, + "type": "next", + }, +] +`; + +exports[`usePagination default has 50 pages current page is 22 1`] = ` +[ + { + "disabled": false, + "onClick": [Function], + "page": 21, + "selected": false, + "type": "previous", + }, + { + "disabled": false, + "onClick": [Function], + "page": 1, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "start-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 20, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 21, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 22, + "selected": true, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 23, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 24, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "end-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 49, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 50, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 23, + "selected": false, + "type": "next", + }, +] +`; + +exports[`usePagination default has 50 pages current page is 23 1`] = ` +[ + { + "disabled": false, + "onClick": [Function], + "page": 22, + "selected": false, + "type": "previous", + }, + { + "disabled": false, + "onClick": [Function], + "page": 1, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "start-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 21, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 22, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 23, + "selected": true, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 24, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 25, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "end-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 49, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 50, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 24, + "selected": false, + "type": "next", + }, +] +`; + +exports[`usePagination default has 50 pages current page is 24 1`] = ` +[ + { + "disabled": false, + "onClick": [Function], + "page": 23, + "selected": false, + "type": "previous", + }, + { + "disabled": false, + "onClick": [Function], + "page": 1, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "start-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 22, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 23, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 24, + "selected": true, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 25, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 26, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "end-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 49, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 50, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 25, + "selected": false, + "type": "next", + }, +] +`; + +exports[`usePagination default has 50 pages current page is 25 1`] = ` +[ + { + "disabled": false, + "onClick": [Function], + "page": 24, + "selected": false, + "type": "previous", + }, + { + "disabled": false, + "onClick": [Function], + "page": 1, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "start-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 23, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 24, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 25, + "selected": true, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 26, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 27, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "end-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 49, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 50, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 26, + "selected": false, + "type": "next", + }, +] +`; + +exports[`usePagination default has 50 pages current page is 26 1`] = ` +[ + { + "disabled": false, + "onClick": [Function], + "page": 25, + "selected": false, + "type": "previous", + }, + { + "disabled": false, + "onClick": [Function], + "page": 1, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "start-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 24, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 25, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 26, + "selected": true, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 27, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 28, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "end-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 49, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 50, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 27, + "selected": false, + "type": "next", + }, +] +`; + +exports[`usePagination default has 50 pages current page is 27 1`] = ` +[ + { + "disabled": false, + "onClick": [Function], + "page": 26, + "selected": false, + "type": "previous", + }, + { + "disabled": false, + "onClick": [Function], + "page": 1, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "start-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 25, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 26, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 27, + "selected": true, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 28, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 29, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "end-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 49, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 50, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 28, + "selected": false, + "type": "next", + }, +] +`; + +exports[`usePagination default has 50 pages current page is 28 1`] = ` +[ + { + "disabled": false, + "onClick": [Function], + "page": 27, + "selected": false, + "type": "previous", + }, + { + "disabled": false, + "onClick": [Function], + "page": 1, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "start-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 26, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 27, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 28, + "selected": true, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 29, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 30, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "end-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 49, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 50, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 29, + "selected": false, + "type": "next", + }, +] +`; + +exports[`usePagination default has 50 pages current page is 29 1`] = ` +[ + { + "disabled": false, + "onClick": [Function], + "page": 28, + "selected": false, + "type": "previous", + }, + { + "disabled": false, + "onClick": [Function], + "page": 1, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "start-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 27, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 28, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 29, + "selected": true, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 30, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 31, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "end-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 49, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 50, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 30, + "selected": false, + "type": "next", + }, +] +`; + +exports[`usePagination default has 50 pages current page is 30 1`] = ` +[ + { + "disabled": false, + "onClick": [Function], + "page": 29, + "selected": false, + "type": "previous", + }, + { + "disabled": false, + "onClick": [Function], + "page": 1, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "start-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 28, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 29, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 30, + "selected": true, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 31, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 32, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "end-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 49, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 50, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 31, + "selected": false, + "type": "next", + }, +] +`; + +exports[`usePagination default has 50 pages current page is 31 1`] = ` +[ + { + "disabled": false, + "onClick": [Function], + "page": 30, + "selected": false, + "type": "previous", + }, + { + "disabled": false, + "onClick": [Function], + "page": 1, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "start-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 29, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 30, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 31, + "selected": true, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 32, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 33, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "end-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 49, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 50, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 32, + "selected": false, + "type": "next", + }, +] +`; + +exports[`usePagination default has 50 pages current page is 32 1`] = ` +[ + { + "disabled": false, + "onClick": [Function], + "page": 31, + "selected": false, + "type": "previous", + }, + { + "disabled": false, + "onClick": [Function], + "page": 1, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "start-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 30, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 31, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 32, + "selected": true, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 33, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 34, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "end-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 49, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 50, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 33, + "selected": false, + "type": "next", + }, +] +`; + +exports[`usePagination default has 50 pages current page is 33 1`] = ` +[ + { + "disabled": false, + "onClick": [Function], + "page": 32, + "selected": false, + "type": "previous", + }, + { + "disabled": false, + "onClick": [Function], + "page": 1, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "start-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 31, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 32, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 33, + "selected": true, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 34, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 35, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "end-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 49, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 50, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 34, + "selected": false, + "type": "next", + }, +] +`; + +exports[`usePagination default has 50 pages current page is 34 1`] = ` +[ + { + "disabled": false, + "onClick": [Function], + "page": 33, + "selected": false, + "type": "previous", + }, + { + "disabled": false, + "onClick": [Function], + "page": 1, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "start-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 32, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 33, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 34, + "selected": true, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 35, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 36, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "end-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 49, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 50, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 35, + "selected": false, + "type": "next", + }, +] +`; + +exports[`usePagination default has 50 pages current page is 35 1`] = ` +[ + { + "disabled": false, + "onClick": [Function], + "page": 34, + "selected": false, + "type": "previous", + }, + { + "disabled": false, + "onClick": [Function], + "page": 1, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "start-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 33, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 34, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 35, + "selected": true, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 36, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 37, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "end-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 49, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 50, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 36, + "selected": false, + "type": "next", + }, +] +`; + +exports[`usePagination default has 50 pages current page is 36 1`] = ` +[ + { + "disabled": false, + "onClick": [Function], + "page": 35, + "selected": false, + "type": "previous", + }, + { + "disabled": false, + "onClick": [Function], + "page": 1, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "start-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 34, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 35, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 36, + "selected": true, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 37, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 38, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "end-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 49, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 50, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 37, + "selected": false, + "type": "next", + }, +] +`; + +exports[`usePagination default has 50 pages current page is 37 1`] = ` +[ + { + "disabled": false, + "onClick": [Function], + "page": 36, + "selected": false, + "type": "previous", + }, + { + "disabled": false, + "onClick": [Function], + "page": 1, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "start-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 35, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 36, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 37, + "selected": true, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 38, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 39, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "end-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 49, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 50, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 38, + "selected": false, + "type": "next", + }, +] +`; + +exports[`usePagination default has 50 pages current page is 38 1`] = ` +[ + { + "disabled": false, + "onClick": [Function], + "page": 37, + "selected": false, + "type": "previous", + }, + { + "disabled": false, + "onClick": [Function], + "page": 1, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "start-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 36, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 37, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 38, + "selected": true, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 39, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 40, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "end-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 49, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 50, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 39, + "selected": false, + "type": "next", + }, +] +`; + +exports[`usePagination default has 50 pages current page is 39 1`] = ` +[ + { + "disabled": false, + "onClick": [Function], + "page": 38, + "selected": false, + "type": "previous", + }, + { + "disabled": false, + "onClick": [Function], + "page": 1, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "start-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 37, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 38, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 39, + "selected": true, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 40, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 41, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "end-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 49, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 50, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 40, + "selected": false, + "type": "next", + }, +] +`; + +exports[`usePagination default has 50 pages current page is 40 1`] = ` +[ + { + "disabled": false, + "onClick": [Function], + "page": 39, + "selected": false, + "type": "previous", + }, + { + "disabled": false, + "onClick": [Function], + "page": 1, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "start-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 38, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 39, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 40, + "selected": true, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 41, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 42, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "end-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 49, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 50, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 41, + "selected": false, + "type": "next", + }, +] +`; + +exports[`usePagination default has 50 pages current page is 41 1`] = ` +[ + { + "disabled": false, + "onClick": [Function], + "page": 40, + "selected": false, + "type": "previous", + }, + { + "disabled": false, + "onClick": [Function], + "page": 1, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "start-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 39, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 40, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 41, + "selected": true, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 42, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 43, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "end-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 49, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 50, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 42, + "selected": false, + "type": "next", + }, +] +`; + +exports[`usePagination default has 50 pages current page is 42 1`] = ` +[ + { + "disabled": false, + "onClick": [Function], + "page": 41, + "selected": false, + "type": "previous", + }, + { + "disabled": false, + "onClick": [Function], + "page": 1, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "start-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 40, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 41, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 42, + "selected": true, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 43, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 44, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "end-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 49, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 50, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 43, + "selected": false, + "type": "next", + }, +] +`; + +exports[`usePagination default has 50 pages current page is 43 1`] = ` +[ + { + "disabled": false, + "onClick": [Function], + "page": 42, + "selected": false, + "type": "previous", + }, + { + "disabled": false, + "onClick": [Function], + "page": 1, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "start-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 41, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 42, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 43, + "selected": true, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 44, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 45, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "end-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 49, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 50, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 44, + "selected": false, + "type": "next", + }, +] +`; + +exports[`usePagination default has 50 pages current page is 44 1`] = ` +[ + { + "disabled": false, + "onClick": [Function], + "page": 43, + "selected": false, + "type": "previous", + }, + { + "disabled": false, + "onClick": [Function], + "page": 1, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "start-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 42, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 43, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 44, + "selected": true, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 45, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 46, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "end-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 49, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 50, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 45, + "selected": false, + "type": "next", + }, +] +`; + +exports[`usePagination default has 50 pages current page is 45 1`] = ` +[ + { + "disabled": false, + "onClick": [Function], + "page": 44, + "selected": false, + "type": "previous", + }, + { + "disabled": false, + "onClick": [Function], + "page": 1, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "start-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 43, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 44, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 45, + "selected": true, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 46, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 47, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "end-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 49, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 50, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 46, + "selected": false, + "type": "next", + }, +] +`; + +exports[`usePagination default has 50 pages current page is 46 1`] = ` +[ + { + "disabled": false, + "onClick": [Function], + "page": 45, + "selected": false, + "type": "previous", + }, + { + "disabled": false, + "onClick": [Function], + "page": 1, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "start-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 44, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 45, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 46, + "selected": true, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 47, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "end-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 49, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 50, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 47, + "selected": false, + "type": "next", + }, +] +`; + +exports[`usePagination default has 50 pages current page is 47 1`] = ` +[ + { + "disabled": false, + "onClick": [Function], + "page": 46, + "selected": false, + "type": "previous", + }, + { + "disabled": false, + "onClick": [Function], + "page": 1, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "start-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 45, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 46, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 47, + "selected": true, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "end-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 49, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 50, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 48, + "selected": false, + "type": "next", + }, +] +`; + +exports[`usePagination default has 50 pages current page is 48 1`] = ` +[ + { + "disabled": false, + "onClick": [Function], + "page": 47, + "selected": false, + "type": "previous", + }, + { + "disabled": false, + "onClick": [Function], + "page": 1, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "start-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 45, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 46, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 47, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "end-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 49, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 50, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 49, + "selected": false, + "type": "next", + }, +] +`; + +exports[`usePagination default has 50 pages current page is 49 1`] = ` +[ + { + "disabled": false, + "onClick": [Function], + "page": 48, + "selected": false, + "type": "previous", + }, + { + "disabled": false, + "onClick": [Function], + "page": 1, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "start-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 45, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 46, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 47, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "end-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 49, + "selected": true, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 50, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 50, + "selected": false, + "type": "next", + }, +] +`; + +exports[`usePagination default has 50 pages current page is 50 1`] = ` +[ + { + "disabled": false, + "onClick": [Function], + "page": 49, + "selected": false, + "type": "previous", + }, + { + "disabled": false, + "onClick": [Function], + "page": 1, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "start-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 45, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 46, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 47, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": null, + "selected": false, + "type": "end-ellipsis", + }, + { + "disabled": false, + "onClick": [Function], + "page": 49, + "selected": false, + "type": "page", + }, + { + "disabled": false, + "onClick": [Function], + "page": 50, + "selected": true, + "type": "page", + }, + { + "disabled": true, + "onClick": [Function], + "page": 51, + "selected": false, + "type": "next", + }, +] +`; diff --git a/tests/usePagination.test.js b/tests/usePagination.test.js new file mode 100644 index 00000000..df278e6e --- /dev/null +++ b/tests/usePagination.test.js @@ -0,0 +1,38 @@ +import { shallow } from 'enzyme'; +import React from 'react'; +import usePagination from '../src/usePagination'; + +describe('usePagination', () => { + const serialize = (items) => + items.map((item) => (item.type === 'page' ? item.page : item.type)); + + const renderHook = (useHook) => { + const result = {}; + function TestCase() { + result.current = useHook(); + return null; + } + shallow(); + return { result }; + }; + + it('has one page by default', () => { + const items = renderHook(() => usePagination()).result.current; + expect(items).toHaveLength(3); + expect(items[1]).toHaveProperty('page', 1); + }); + + describe('default', () => { + [3, 5, 6, 7, 8, 9, 10, 12, 50].forEach((count) => { + describe(`has ${count} pages`, () => { + for (let current = 1; current <= count; current++) { + it(`current page is ${current}`, () => { + const items = renderHook(() => usePagination({ count, current })) + .result.current; + expect(items).toMatchSnapshot(); + }); + } + }); + }); + }); +}); From cea540b0e51d37f0f4f9f667cfb527111b102994 Mon Sep 17 00:00:00 2001 From: wuxh Date: Tue, 7 Nov 2023 11:08:14 +0800 Subject: [PATCH 13/64] Revert "chore: update" This reverts commit 429c1e6e9b242c8f06ff6d5dcf16e99617534ada. --- src/usePagination.ts | 155 - .../__snapshots__/usePagination.test.js.snap | 8944 ----------------- tests/usePagination.test.js | 38 - 3 files changed, 9137 deletions(-) delete mode 100644 src/usePagination.ts delete mode 100644 tests/__snapshots__/usePagination.test.js.snap delete mode 100644 tests/usePagination.test.js diff --git a/src/usePagination.ts b/src/usePagination.ts deleted file mode 100644 index 43ad045e..00000000 --- a/src/usePagination.ts +++ /dev/null @@ -1,155 +0,0 @@ -import useMergedState from 'rc-util/lib/hooks/useMergedState'; -import type * as React from 'react'; - -type ItemType = - | 'previous' - | 'start-ellipsis' - | 'page' - | 'end-ellipsis' - | 'next'; -type ItemList = (Exclude | number)[]; - -type UsePaginationProps = { - /** - * Total pages - * @default 1 - */ - count?: number; - current?: number; - defaultCurrent?: number; - onChange?: (page: number, prevPage: number) => void; - disabled?: boolean; - /** - * [1, 2, ..., 4, 5, [6], 7, 8, ..., 10, 11] // boundaryCount = 2 - * @default 1 - */ - boundaryCount?: number; - /** - * [1, ..., 4, [5], 6, ... 10] // siblingCount = 1 - * @default 2 - */ - siblingCount?: number; -}; - -interface UsePaginationItem { - onClick: React.ReactEventHandler; - type: ItemType; - page: number | null; - selected: boolean; - disabled: boolean; -} - -type UsePaginationResult = UsePaginationItem[]; - -function usePagination(props: UsePaginationProps = {}): UsePaginationResult { - const { - count = 1, - current: currentProp, - defaultCurrent, - onChange, - disabled = false, - boundaryCount = 1, - siblingCount = 2, - } = props; - - const [current, setCurrent] = useMergedState(1, { - defaultValue: defaultCurrent, - value: currentProp, - onChange, - }); - - const startPages = range(1, Math.min(boundaryCount, count)); - - const siblingsStart = Math.max( - Math.min(current - siblingCount, count - boundaryCount - siblingCount * 2), - boundaryCount + 1, - ); - const startEllipsis: ItemList = - siblingsStart > boundaryCount + 1 - ? ['start-ellipsis'] - : boundaryCount + 1 < count - boundaryCount - ? [boundaryCount + 1] - : []; - - const endPages = range( - Math.max(count - boundaryCount, boundaryCount + 1), - count, - ); - - const siblingsEnd = Math.min( - Math.max(current + siblingCount, boundaryCount + siblingCount * 2 + 1), - endPages.length > 0 ? endPages[0] - 2 : count - 1, - ); - - console.log({ - startPages, - siblingsStart, - startEllipsis, - endPages, - siblingsEnd, - }); - - const endEllipsis: ItemList = - siblingsEnd < count - boundaryCount - 1 - ? ['end-ellipsis'] - : count - boundaryCount > boundaryCount - ? [count - boundaryCount] - : []; - - const itemList: ItemList = [ - 'previous', - ...startPages, - ...startEllipsis, - ...range(siblingsStart, siblingsEnd), - ...endEllipsis, - ...endPages, - 'next', - ]; - - // Map the button type to its page number - const buttonPage = (type: ItemType) => { - switch (type) { - case 'previous': - return current - 1; - case 'next': - return current + 1; - default: - return null; - } - }; - - const items = itemList.map((item) => { - if (typeof item === 'number') { - return { - onClick() { - setCurrent(item); - }, - type: 'page', - page: item, - selected: item === current, - disabled, - }; - } - - return { - onClick() { - setCurrent(buttonPage(item)); - }, - type: item, - page: buttonPage(item), - selected: false, - disabled: - disabled || - (item.indexOf('ellipsis') === -1 && - (item === 'next' ? current >= count : current <= 1)), - }; - }); - - return items; -} - -function range(start: number, end: number) { - return Array.from({ length: end - start + 1 }, (_, i) => i + start); -} - -export default usePagination; diff --git a/tests/__snapshots__/usePagination.test.js.snap b/tests/__snapshots__/usePagination.test.js.snap deleted file mode 100644 index 4eca15f2..00000000 --- a/tests/__snapshots__/usePagination.test.js.snap +++ /dev/null @@ -1,8944 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`usePagination default has 3 pages current page is 1 1`] = ` -[ - { - "disabled": true, - "onClick": [Function], - "page": 0, - "selected": false, - "type": "previous", - }, - { - "disabled": false, - "onClick": [Function], - "page": 1, - "selected": true, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 2, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 3, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 2, - "selected": false, - "type": "next", - }, -] -`; - -exports[`usePagination default has 3 pages current page is 2 1`] = ` -[ - { - "disabled": true, - "onClick": [Function], - "page": 0, - "selected": false, - "type": "previous", - }, - { - "disabled": false, - "onClick": [Function], - "page": 1, - "selected": true, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 2, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 3, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 2, - "selected": false, - "type": "next", - }, -] -`; - -exports[`usePagination default has 3 pages current page is 3 1`] = ` -[ - { - "disabled": true, - "onClick": [Function], - "page": 0, - "selected": false, - "type": "previous", - }, - { - "disabled": false, - "onClick": [Function], - "page": 1, - "selected": true, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 2, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 3, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 2, - "selected": false, - "type": "next", - }, -] -`; - -exports[`usePagination default has 5 pages current page is 1 1`] = ` -[ - { - "disabled": true, - "onClick": [Function], - "page": 0, - "selected": false, - "type": "previous", - }, - { - "disabled": false, - "onClick": [Function], - "page": 1, - "selected": true, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 2, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 2, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "end-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 4, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 5, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 2, - "selected": false, - "type": "next", - }, -] -`; - -exports[`usePagination default has 5 pages current page is 2 1`] = ` -[ - { - "disabled": false, - "onClick": [Function], - "page": 1, - "selected": false, - "type": "previous", - }, - { - "disabled": false, - "onClick": [Function], - "page": 1, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 2, - "selected": true, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 2, - "selected": true, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "end-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 4, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 5, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 3, - "selected": false, - "type": "next", - }, -] -`; - -exports[`usePagination default has 5 pages current page is 3 1`] = ` -[ - { - "disabled": false, - "onClick": [Function], - "page": 2, - "selected": false, - "type": "previous", - }, - { - "disabled": false, - "onClick": [Function], - "page": 1, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 2, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 2, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "end-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 4, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 5, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 4, - "selected": false, - "type": "next", - }, -] -`; - -exports[`usePagination default has 5 pages current page is 4 1`] = ` -[ - { - "disabled": false, - "onClick": [Function], - "page": 3, - "selected": false, - "type": "previous", - }, - { - "disabled": false, - "onClick": [Function], - "page": 1, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 2, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 2, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "end-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 4, - "selected": true, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 5, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 5, - "selected": false, - "type": "next", - }, -] -`; - -exports[`usePagination default has 5 pages current page is 5 1`] = ` -[ - { - "disabled": false, - "onClick": [Function], - "page": 4, - "selected": false, - "type": "previous", - }, - { - "disabled": false, - "onClick": [Function], - "page": 1, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 2, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 2, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "end-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 4, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 5, - "selected": true, - "type": "page", - }, - { - "disabled": true, - "onClick": [Function], - "page": 6, - "selected": false, - "type": "next", - }, -] -`; - -exports[`usePagination default has 6 pages current page is 1 1`] = ` -[ - { - "disabled": true, - "onClick": [Function], - "page": 0, - "selected": false, - "type": "previous", - }, - { - "disabled": false, - "onClick": [Function], - "page": 1, - "selected": true, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 2, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 2, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 3, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "end-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 5, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 6, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 2, - "selected": false, - "type": "next", - }, -] -`; - -exports[`usePagination default has 6 pages current page is 2 1`] = ` -[ - { - "disabled": false, - "onClick": [Function], - "page": 1, - "selected": false, - "type": "previous", - }, - { - "disabled": false, - "onClick": [Function], - "page": 1, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 2, - "selected": true, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 2, - "selected": true, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 3, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "end-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 5, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 6, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 3, - "selected": false, - "type": "next", - }, -] -`; - -exports[`usePagination default has 6 pages current page is 3 1`] = ` -[ - { - "disabled": false, - "onClick": [Function], - "page": 2, - "selected": false, - "type": "previous", - }, - { - "disabled": false, - "onClick": [Function], - "page": 1, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 2, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 2, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 3, - "selected": true, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "end-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 5, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 6, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 4, - "selected": false, - "type": "next", - }, -] -`; - -exports[`usePagination default has 6 pages current page is 4 1`] = ` -[ - { - "disabled": false, - "onClick": [Function], - "page": 3, - "selected": false, - "type": "previous", - }, - { - "disabled": false, - "onClick": [Function], - "page": 1, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 2, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 2, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 3, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "end-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 5, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 6, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 5, - "selected": false, - "type": "next", - }, -] -`; - -exports[`usePagination default has 6 pages current page is 5 1`] = ` -[ - { - "disabled": false, - "onClick": [Function], - "page": 4, - "selected": false, - "type": "previous", - }, - { - "disabled": false, - "onClick": [Function], - "page": 1, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 2, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 2, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 3, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "end-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 5, - "selected": true, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 6, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 6, - "selected": false, - "type": "next", - }, -] -`; - -exports[`usePagination default has 6 pages current page is 6 1`] = ` -[ - { - "disabled": false, - "onClick": [Function], - "page": 5, - "selected": false, - "type": "previous", - }, - { - "disabled": false, - "onClick": [Function], - "page": 1, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 2, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 2, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 3, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "end-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 5, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 6, - "selected": true, - "type": "page", - }, - { - "disabled": true, - "onClick": [Function], - "page": 7, - "selected": false, - "type": "next", - }, -] -`; - -exports[`usePagination default has 7 pages current page is 1 1`] = ` -[ - { - "disabled": true, - "onClick": [Function], - "page": 0, - "selected": false, - "type": "previous", - }, - { - "disabled": false, - "onClick": [Function], - "page": 1, - "selected": true, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 2, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 2, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 3, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 4, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "end-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 6, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 7, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 2, - "selected": false, - "type": "next", - }, -] -`; - -exports[`usePagination default has 7 pages current page is 2 1`] = ` -[ - { - "disabled": false, - "onClick": [Function], - "page": 1, - "selected": false, - "type": "previous", - }, - { - "disabled": false, - "onClick": [Function], - "page": 1, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 2, - "selected": true, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 2, - "selected": true, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 3, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 4, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "end-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 6, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 7, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 3, - "selected": false, - "type": "next", - }, -] -`; - -exports[`usePagination default has 7 pages current page is 3 1`] = ` -[ - { - "disabled": false, - "onClick": [Function], - "page": 2, - "selected": false, - "type": "previous", - }, - { - "disabled": false, - "onClick": [Function], - "page": 1, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 2, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 2, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 3, - "selected": true, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 4, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "end-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 6, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 7, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 4, - "selected": false, - "type": "next", - }, -] -`; - -exports[`usePagination default has 7 pages current page is 4 1`] = ` -[ - { - "disabled": false, - "onClick": [Function], - "page": 3, - "selected": false, - "type": "previous", - }, - { - "disabled": false, - "onClick": [Function], - "page": 1, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 2, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 2, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 3, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 4, - "selected": true, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "end-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 6, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 7, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 5, - "selected": false, - "type": "next", - }, -] -`; - -exports[`usePagination default has 7 pages current page is 5 1`] = ` -[ - { - "disabled": false, - "onClick": [Function], - "page": 4, - "selected": false, - "type": "previous", - }, - { - "disabled": false, - "onClick": [Function], - "page": 1, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 2, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 2, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 3, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 4, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "end-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 6, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 7, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 6, - "selected": false, - "type": "next", - }, -] -`; - -exports[`usePagination default has 7 pages current page is 6 1`] = ` -[ - { - "disabled": false, - "onClick": [Function], - "page": 5, - "selected": false, - "type": "previous", - }, - { - "disabled": false, - "onClick": [Function], - "page": 1, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 2, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 2, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 3, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 4, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "end-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 6, - "selected": true, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 7, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 7, - "selected": false, - "type": "next", - }, -] -`; - -exports[`usePagination default has 7 pages current page is 7 1`] = ` -[ - { - "disabled": false, - "onClick": [Function], - "page": 6, - "selected": false, - "type": "previous", - }, - { - "disabled": false, - "onClick": [Function], - "page": 1, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 2, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 2, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 3, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 4, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "end-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 6, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 7, - "selected": true, - "type": "page", - }, - { - "disabled": true, - "onClick": [Function], - "page": 8, - "selected": false, - "type": "next", - }, -] -`; - -exports[`usePagination default has 8 pages current page is 1 1`] = ` -[ - { - "disabled": true, - "onClick": [Function], - "page": 0, - "selected": false, - "type": "previous", - }, - { - "disabled": false, - "onClick": [Function], - "page": 1, - "selected": true, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 2, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 2, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 3, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 4, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 5, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "end-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 7, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 8, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 2, - "selected": false, - "type": "next", - }, -] -`; - -exports[`usePagination default has 8 pages current page is 2 1`] = ` -[ - { - "disabled": false, - "onClick": [Function], - "page": 1, - "selected": false, - "type": "previous", - }, - { - "disabled": false, - "onClick": [Function], - "page": 1, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 2, - "selected": true, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 2, - "selected": true, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 3, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 4, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 5, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "end-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 7, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 8, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 3, - "selected": false, - "type": "next", - }, -] -`; - -exports[`usePagination default has 8 pages current page is 3 1`] = ` -[ - { - "disabled": false, - "onClick": [Function], - "page": 2, - "selected": false, - "type": "previous", - }, - { - "disabled": false, - "onClick": [Function], - "page": 1, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 2, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 2, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 3, - "selected": true, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 4, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 5, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "end-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 7, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 8, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 4, - "selected": false, - "type": "next", - }, -] -`; - -exports[`usePagination default has 8 pages current page is 4 1`] = ` -[ - { - "disabled": false, - "onClick": [Function], - "page": 3, - "selected": false, - "type": "previous", - }, - { - "disabled": false, - "onClick": [Function], - "page": 1, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 2, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 2, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 3, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 4, - "selected": true, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 5, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "end-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 7, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 8, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 5, - "selected": false, - "type": "next", - }, -] -`; - -exports[`usePagination default has 8 pages current page is 5 1`] = ` -[ - { - "disabled": false, - "onClick": [Function], - "page": 4, - "selected": false, - "type": "previous", - }, - { - "disabled": false, - "onClick": [Function], - "page": 1, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "start-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 3, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 4, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 5, - "selected": true, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "end-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 7, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 8, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 6, - "selected": false, - "type": "next", - }, -] -`; - -exports[`usePagination default has 8 pages current page is 6 1`] = ` -[ - { - "disabled": false, - "onClick": [Function], - "page": 5, - "selected": false, - "type": "previous", - }, - { - "disabled": false, - "onClick": [Function], - "page": 1, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "start-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 3, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 4, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 5, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "end-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 7, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 8, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 7, - "selected": false, - "type": "next", - }, -] -`; - -exports[`usePagination default has 8 pages current page is 7 1`] = ` -[ - { - "disabled": false, - "onClick": [Function], - "page": 6, - "selected": false, - "type": "previous", - }, - { - "disabled": false, - "onClick": [Function], - "page": 1, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "start-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 3, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 4, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 5, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "end-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 7, - "selected": true, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 8, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 8, - "selected": false, - "type": "next", - }, -] -`; - -exports[`usePagination default has 8 pages current page is 8 1`] = ` -[ - { - "disabled": false, - "onClick": [Function], - "page": 7, - "selected": false, - "type": "previous", - }, - { - "disabled": false, - "onClick": [Function], - "page": 1, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "start-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 3, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 4, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 5, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "end-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 7, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 8, - "selected": true, - "type": "page", - }, - { - "disabled": true, - "onClick": [Function], - "page": 9, - "selected": false, - "type": "next", - }, -] -`; - -exports[`usePagination default has 9 pages current page is 1 1`] = ` -[ - { - "disabled": true, - "onClick": [Function], - "page": 0, - "selected": false, - "type": "previous", - }, - { - "disabled": false, - "onClick": [Function], - "page": 1, - "selected": true, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 2, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 2, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 3, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 4, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 5, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 6, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "end-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 8, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 9, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 2, - "selected": false, - "type": "next", - }, -] -`; - -exports[`usePagination default has 9 pages current page is 2 1`] = ` -[ - { - "disabled": false, - "onClick": [Function], - "page": 1, - "selected": false, - "type": "previous", - }, - { - "disabled": false, - "onClick": [Function], - "page": 1, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 2, - "selected": true, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 2, - "selected": true, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 3, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 4, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 5, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 6, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "end-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 8, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 9, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 3, - "selected": false, - "type": "next", - }, -] -`; - -exports[`usePagination default has 9 pages current page is 3 1`] = ` -[ - { - "disabled": false, - "onClick": [Function], - "page": 2, - "selected": false, - "type": "previous", - }, - { - "disabled": false, - "onClick": [Function], - "page": 1, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 2, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 2, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 3, - "selected": true, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 4, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 5, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 6, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "end-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 8, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 9, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 4, - "selected": false, - "type": "next", - }, -] -`; - -exports[`usePagination default has 9 pages current page is 4 1`] = ` -[ - { - "disabled": false, - "onClick": [Function], - "page": 3, - "selected": false, - "type": "previous", - }, - { - "disabled": false, - "onClick": [Function], - "page": 1, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 2, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 2, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 3, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 4, - "selected": true, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 5, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 6, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "end-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 8, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 9, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 5, - "selected": false, - "type": "next", - }, -] -`; - -exports[`usePagination default has 9 pages current page is 5 1`] = ` -[ - { - "disabled": false, - "onClick": [Function], - "page": 4, - "selected": false, - "type": "previous", - }, - { - "disabled": false, - "onClick": [Function], - "page": 1, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "start-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 3, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 4, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 5, - "selected": true, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 6, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "end-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 8, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 9, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 6, - "selected": false, - "type": "next", - }, -] -`; - -exports[`usePagination default has 9 pages current page is 6 1`] = ` -[ - { - "disabled": false, - "onClick": [Function], - "page": 5, - "selected": false, - "type": "previous", - }, - { - "disabled": false, - "onClick": [Function], - "page": 1, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "start-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 4, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 5, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 6, - "selected": true, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "end-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 8, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 9, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 7, - "selected": false, - "type": "next", - }, -] -`; - -exports[`usePagination default has 9 pages current page is 7 1`] = ` -[ - { - "disabled": false, - "onClick": [Function], - "page": 6, - "selected": false, - "type": "previous", - }, - { - "disabled": false, - "onClick": [Function], - "page": 1, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "start-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 4, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 5, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 6, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "end-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 8, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 9, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 8, - "selected": false, - "type": "next", - }, -] -`; - -exports[`usePagination default has 9 pages current page is 8 1`] = ` -[ - { - "disabled": false, - "onClick": [Function], - "page": 7, - "selected": false, - "type": "previous", - }, - { - "disabled": false, - "onClick": [Function], - "page": 1, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "start-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 4, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 5, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 6, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "end-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 8, - "selected": true, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 9, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 9, - "selected": false, - "type": "next", - }, -] -`; - -exports[`usePagination default has 9 pages current page is 9 1`] = ` -[ - { - "disabled": false, - "onClick": [Function], - "page": 8, - "selected": false, - "type": "previous", - }, - { - "disabled": false, - "onClick": [Function], - "page": 1, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "start-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 4, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 5, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 6, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "end-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 8, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 9, - "selected": true, - "type": "page", - }, - { - "disabled": true, - "onClick": [Function], - "page": 10, - "selected": false, - "type": "next", - }, -] -`; - -exports[`usePagination default has 10 pages current page is 1 1`] = ` -[ - { - "disabled": true, - "onClick": [Function], - "page": 0, - "selected": false, - "type": "previous", - }, - { - "disabled": false, - "onClick": [Function], - "page": 1, - "selected": true, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 2, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 2, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 3, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 4, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 5, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 6, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "end-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 9, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 10, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 2, - "selected": false, - "type": "next", - }, -] -`; - -exports[`usePagination default has 10 pages current page is 2 1`] = ` -[ - { - "disabled": false, - "onClick": [Function], - "page": 1, - "selected": false, - "type": "previous", - }, - { - "disabled": false, - "onClick": [Function], - "page": 1, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 2, - "selected": true, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 2, - "selected": true, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 3, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 4, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 5, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 6, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "end-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 9, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 10, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 3, - "selected": false, - "type": "next", - }, -] -`; - -exports[`usePagination default has 10 pages current page is 3 1`] = ` -[ - { - "disabled": false, - "onClick": [Function], - "page": 2, - "selected": false, - "type": "previous", - }, - { - "disabled": false, - "onClick": [Function], - "page": 1, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 2, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 2, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 3, - "selected": true, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 4, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 5, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 6, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "end-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 9, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 10, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 4, - "selected": false, - "type": "next", - }, -] -`; - -exports[`usePagination default has 10 pages current page is 4 1`] = ` -[ - { - "disabled": false, - "onClick": [Function], - "page": 3, - "selected": false, - "type": "previous", - }, - { - "disabled": false, - "onClick": [Function], - "page": 1, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 2, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 2, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 3, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 4, - "selected": true, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 5, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 6, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "end-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 9, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 10, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 5, - "selected": false, - "type": "next", - }, -] -`; - -exports[`usePagination default has 10 pages current page is 5 1`] = ` -[ - { - "disabled": false, - "onClick": [Function], - "page": 4, - "selected": false, - "type": "previous", - }, - { - "disabled": false, - "onClick": [Function], - "page": 1, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "start-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 3, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 4, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 5, - "selected": true, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 6, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 7, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "end-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 9, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 10, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 6, - "selected": false, - "type": "next", - }, -] -`; - -exports[`usePagination default has 10 pages current page is 6 1`] = ` -[ - { - "disabled": false, - "onClick": [Function], - "page": 5, - "selected": false, - "type": "previous", - }, - { - "disabled": false, - "onClick": [Function], - "page": 1, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "start-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 4, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 5, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 6, - "selected": true, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 7, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "end-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 9, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 10, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 7, - "selected": false, - "type": "next", - }, -] -`; - -exports[`usePagination default has 10 pages current page is 7 1`] = ` -[ - { - "disabled": false, - "onClick": [Function], - "page": 6, - "selected": false, - "type": "previous", - }, - { - "disabled": false, - "onClick": [Function], - "page": 1, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "start-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 5, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 6, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 7, - "selected": true, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "end-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 9, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 10, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 8, - "selected": false, - "type": "next", - }, -] -`; - -exports[`usePagination default has 10 pages current page is 8 1`] = ` -[ - { - "disabled": false, - "onClick": [Function], - "page": 7, - "selected": false, - "type": "previous", - }, - { - "disabled": false, - "onClick": [Function], - "page": 1, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "start-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 5, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 6, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 7, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "end-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 9, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 10, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 9, - "selected": false, - "type": "next", - }, -] -`; - -exports[`usePagination default has 10 pages current page is 9 1`] = ` -[ - { - "disabled": false, - "onClick": [Function], - "page": 8, - "selected": false, - "type": "previous", - }, - { - "disabled": false, - "onClick": [Function], - "page": 1, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "start-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 5, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 6, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 7, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "end-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 9, - "selected": true, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 10, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 10, - "selected": false, - "type": "next", - }, -] -`; - -exports[`usePagination default has 10 pages current page is 10 1`] = ` -[ - { - "disabled": false, - "onClick": [Function], - "page": 9, - "selected": false, - "type": "previous", - }, - { - "disabled": false, - "onClick": [Function], - "page": 1, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "start-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 5, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 6, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 7, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "end-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 9, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 10, - "selected": true, - "type": "page", - }, - { - "disabled": true, - "onClick": [Function], - "page": 11, - "selected": false, - "type": "next", - }, -] -`; - -exports[`usePagination default has 12 pages current page is 1 1`] = ` -[ - { - "disabled": true, - "onClick": [Function], - "page": 0, - "selected": false, - "type": "previous", - }, - { - "disabled": false, - "onClick": [Function], - "page": 1, - "selected": true, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 2, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 2, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 3, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 4, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 5, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 6, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "end-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 11, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 12, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 2, - "selected": false, - "type": "next", - }, -] -`; - -exports[`usePagination default has 12 pages current page is 2 1`] = ` -[ - { - "disabled": false, - "onClick": [Function], - "page": 1, - "selected": false, - "type": "previous", - }, - { - "disabled": false, - "onClick": [Function], - "page": 1, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 2, - "selected": true, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 2, - "selected": true, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 3, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 4, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 5, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 6, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "end-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 11, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 12, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 3, - "selected": false, - "type": "next", - }, -] -`; - -exports[`usePagination default has 12 pages current page is 3 1`] = ` -[ - { - "disabled": false, - "onClick": [Function], - "page": 2, - "selected": false, - "type": "previous", - }, - { - "disabled": false, - "onClick": [Function], - "page": 1, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 2, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 2, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 3, - "selected": true, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 4, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 5, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 6, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "end-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 11, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 12, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 4, - "selected": false, - "type": "next", - }, -] -`; - -exports[`usePagination default has 12 pages current page is 4 1`] = ` -[ - { - "disabled": false, - "onClick": [Function], - "page": 3, - "selected": false, - "type": "previous", - }, - { - "disabled": false, - "onClick": [Function], - "page": 1, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 2, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 2, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 3, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 4, - "selected": true, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 5, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 6, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "end-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 11, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 12, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 5, - "selected": false, - "type": "next", - }, -] -`; - -exports[`usePagination default has 12 pages current page is 5 1`] = ` -[ - { - "disabled": false, - "onClick": [Function], - "page": 4, - "selected": false, - "type": "previous", - }, - { - "disabled": false, - "onClick": [Function], - "page": 1, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "start-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 3, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 4, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 5, - "selected": true, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 6, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 7, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "end-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 11, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 12, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 6, - "selected": false, - "type": "next", - }, -] -`; - -exports[`usePagination default has 12 pages current page is 6 1`] = ` -[ - { - "disabled": false, - "onClick": [Function], - "page": 5, - "selected": false, - "type": "previous", - }, - { - "disabled": false, - "onClick": [Function], - "page": 1, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "start-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 4, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 5, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 6, - "selected": true, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 7, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 8, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "end-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 11, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 12, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 7, - "selected": false, - "type": "next", - }, -] -`; - -exports[`usePagination default has 12 pages current page is 7 1`] = ` -[ - { - "disabled": false, - "onClick": [Function], - "page": 6, - "selected": false, - "type": "previous", - }, - { - "disabled": false, - "onClick": [Function], - "page": 1, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "start-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 5, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 6, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 7, - "selected": true, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 8, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 9, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "end-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 11, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 12, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 8, - "selected": false, - "type": "next", - }, -] -`; - -exports[`usePagination default has 12 pages current page is 8 1`] = ` -[ - { - "disabled": false, - "onClick": [Function], - "page": 7, - "selected": false, - "type": "previous", - }, - { - "disabled": false, - "onClick": [Function], - "page": 1, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "start-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 6, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 7, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 8, - "selected": true, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 9, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "end-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 11, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 12, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 9, - "selected": false, - "type": "next", - }, -] -`; - -exports[`usePagination default has 12 pages current page is 9 1`] = ` -[ - { - "disabled": false, - "onClick": [Function], - "page": 8, - "selected": false, - "type": "previous", - }, - { - "disabled": false, - "onClick": [Function], - "page": 1, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "start-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 7, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 8, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 9, - "selected": true, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "end-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 11, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 12, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 10, - "selected": false, - "type": "next", - }, -] -`; - -exports[`usePagination default has 12 pages current page is 10 1`] = ` -[ - { - "disabled": false, - "onClick": [Function], - "page": 9, - "selected": false, - "type": "previous", - }, - { - "disabled": false, - "onClick": [Function], - "page": 1, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "start-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 7, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 8, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 9, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "end-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 11, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 12, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 11, - "selected": false, - "type": "next", - }, -] -`; - -exports[`usePagination default has 12 pages current page is 11 1`] = ` -[ - { - "disabled": false, - "onClick": [Function], - "page": 10, - "selected": false, - "type": "previous", - }, - { - "disabled": false, - "onClick": [Function], - "page": 1, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "start-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 7, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 8, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 9, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "end-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 11, - "selected": true, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 12, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 12, - "selected": false, - "type": "next", - }, -] -`; - -exports[`usePagination default has 12 pages current page is 12 1`] = ` -[ - { - "disabled": false, - "onClick": [Function], - "page": 11, - "selected": false, - "type": "previous", - }, - { - "disabled": false, - "onClick": [Function], - "page": 1, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "start-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 7, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 8, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 9, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "end-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 11, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 12, - "selected": true, - "type": "page", - }, - { - "disabled": true, - "onClick": [Function], - "page": 13, - "selected": false, - "type": "next", - }, -] -`; - -exports[`usePagination default has 50 pages current page is 1 1`] = ` -[ - { - "disabled": true, - "onClick": [Function], - "page": 0, - "selected": false, - "type": "previous", - }, - { - "disabled": false, - "onClick": [Function], - "page": 1, - "selected": true, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 2, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 2, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 3, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 4, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 5, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 6, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "end-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 49, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 50, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 2, - "selected": false, - "type": "next", - }, -] -`; - -exports[`usePagination default has 50 pages current page is 2 1`] = ` -[ - { - "disabled": false, - "onClick": [Function], - "page": 1, - "selected": false, - "type": "previous", - }, - { - "disabled": false, - "onClick": [Function], - "page": 1, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 2, - "selected": true, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 2, - "selected": true, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 3, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 4, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 5, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 6, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "end-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 49, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 50, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 3, - "selected": false, - "type": "next", - }, -] -`; - -exports[`usePagination default has 50 pages current page is 3 1`] = ` -[ - { - "disabled": false, - "onClick": [Function], - "page": 2, - "selected": false, - "type": "previous", - }, - { - "disabled": false, - "onClick": [Function], - "page": 1, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 2, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 2, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 3, - "selected": true, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 4, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 5, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 6, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "end-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 49, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 50, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 4, - "selected": false, - "type": "next", - }, -] -`; - -exports[`usePagination default has 50 pages current page is 4 1`] = ` -[ - { - "disabled": false, - "onClick": [Function], - "page": 3, - "selected": false, - "type": "previous", - }, - { - "disabled": false, - "onClick": [Function], - "page": 1, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 2, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 2, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 3, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 4, - "selected": true, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 5, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 6, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "end-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 49, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 50, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 5, - "selected": false, - "type": "next", - }, -] -`; - -exports[`usePagination default has 50 pages current page is 5 1`] = ` -[ - { - "disabled": false, - "onClick": [Function], - "page": 4, - "selected": false, - "type": "previous", - }, - { - "disabled": false, - "onClick": [Function], - "page": 1, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "start-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 3, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 4, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 5, - "selected": true, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 6, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 7, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "end-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 49, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 50, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 6, - "selected": false, - "type": "next", - }, -] -`; - -exports[`usePagination default has 50 pages current page is 6 1`] = ` -[ - { - "disabled": false, - "onClick": [Function], - "page": 5, - "selected": false, - "type": "previous", - }, - { - "disabled": false, - "onClick": [Function], - "page": 1, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "start-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 4, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 5, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 6, - "selected": true, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 7, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 8, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "end-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 49, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 50, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 7, - "selected": false, - "type": "next", - }, -] -`; - -exports[`usePagination default has 50 pages current page is 7 1`] = ` -[ - { - "disabled": false, - "onClick": [Function], - "page": 6, - "selected": false, - "type": "previous", - }, - { - "disabled": false, - "onClick": [Function], - "page": 1, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "start-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 5, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 6, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 7, - "selected": true, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 8, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 9, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "end-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 49, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 50, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 8, - "selected": false, - "type": "next", - }, -] -`; - -exports[`usePagination default has 50 pages current page is 8 1`] = ` -[ - { - "disabled": false, - "onClick": [Function], - "page": 7, - "selected": false, - "type": "previous", - }, - { - "disabled": false, - "onClick": [Function], - "page": 1, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "start-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 6, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 7, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 8, - "selected": true, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 9, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 10, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "end-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 49, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 50, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 9, - "selected": false, - "type": "next", - }, -] -`; - -exports[`usePagination default has 50 pages current page is 9 1`] = ` -[ - { - "disabled": false, - "onClick": [Function], - "page": 8, - "selected": false, - "type": "previous", - }, - { - "disabled": false, - "onClick": [Function], - "page": 1, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "start-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 7, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 8, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 9, - "selected": true, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 10, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 11, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "end-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 49, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 50, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 10, - "selected": false, - "type": "next", - }, -] -`; - -exports[`usePagination default has 50 pages current page is 10 1`] = ` -[ - { - "disabled": false, - "onClick": [Function], - "page": 9, - "selected": false, - "type": "previous", - }, - { - "disabled": false, - "onClick": [Function], - "page": 1, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "start-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 8, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 9, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 10, - "selected": true, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 11, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 12, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "end-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 49, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 50, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 11, - "selected": false, - "type": "next", - }, -] -`; - -exports[`usePagination default has 50 pages current page is 11 1`] = ` -[ - { - "disabled": false, - "onClick": [Function], - "page": 10, - "selected": false, - "type": "previous", - }, - { - "disabled": false, - "onClick": [Function], - "page": 1, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "start-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 9, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 10, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 11, - "selected": true, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 12, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 13, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "end-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 49, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 50, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 12, - "selected": false, - "type": "next", - }, -] -`; - -exports[`usePagination default has 50 pages current page is 12 1`] = ` -[ - { - "disabled": false, - "onClick": [Function], - "page": 11, - "selected": false, - "type": "previous", - }, - { - "disabled": false, - "onClick": [Function], - "page": 1, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "start-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 10, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 11, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 12, - "selected": true, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 13, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 14, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "end-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 49, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 50, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 13, - "selected": false, - "type": "next", - }, -] -`; - -exports[`usePagination default has 50 pages current page is 13 1`] = ` -[ - { - "disabled": false, - "onClick": [Function], - "page": 12, - "selected": false, - "type": "previous", - }, - { - "disabled": false, - "onClick": [Function], - "page": 1, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "start-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 11, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 12, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 13, - "selected": true, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 14, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 15, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "end-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 49, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 50, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 14, - "selected": false, - "type": "next", - }, -] -`; - -exports[`usePagination default has 50 pages current page is 14 1`] = ` -[ - { - "disabled": false, - "onClick": [Function], - "page": 13, - "selected": false, - "type": "previous", - }, - { - "disabled": false, - "onClick": [Function], - "page": 1, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "start-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 12, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 13, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 14, - "selected": true, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 15, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 16, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "end-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 49, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 50, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 15, - "selected": false, - "type": "next", - }, -] -`; - -exports[`usePagination default has 50 pages current page is 15 1`] = ` -[ - { - "disabled": false, - "onClick": [Function], - "page": 14, - "selected": false, - "type": "previous", - }, - { - "disabled": false, - "onClick": [Function], - "page": 1, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "start-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 13, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 14, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 15, - "selected": true, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 16, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 17, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "end-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 49, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 50, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 16, - "selected": false, - "type": "next", - }, -] -`; - -exports[`usePagination default has 50 pages current page is 16 1`] = ` -[ - { - "disabled": false, - "onClick": [Function], - "page": 15, - "selected": false, - "type": "previous", - }, - { - "disabled": false, - "onClick": [Function], - "page": 1, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "start-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 14, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 15, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 16, - "selected": true, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 17, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 18, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "end-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 49, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 50, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 17, - "selected": false, - "type": "next", - }, -] -`; - -exports[`usePagination default has 50 pages current page is 17 1`] = ` -[ - { - "disabled": false, - "onClick": [Function], - "page": 16, - "selected": false, - "type": "previous", - }, - { - "disabled": false, - "onClick": [Function], - "page": 1, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "start-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 15, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 16, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 17, - "selected": true, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 18, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 19, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "end-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 49, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 50, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 18, - "selected": false, - "type": "next", - }, -] -`; - -exports[`usePagination default has 50 pages current page is 18 1`] = ` -[ - { - "disabled": false, - "onClick": [Function], - "page": 17, - "selected": false, - "type": "previous", - }, - { - "disabled": false, - "onClick": [Function], - "page": 1, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "start-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 16, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 17, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 18, - "selected": true, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 19, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 20, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "end-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 49, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 50, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 19, - "selected": false, - "type": "next", - }, -] -`; - -exports[`usePagination default has 50 pages current page is 19 1`] = ` -[ - { - "disabled": false, - "onClick": [Function], - "page": 18, - "selected": false, - "type": "previous", - }, - { - "disabled": false, - "onClick": [Function], - "page": 1, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "start-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 17, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 18, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 19, - "selected": true, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 20, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 21, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "end-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 49, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 50, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 20, - "selected": false, - "type": "next", - }, -] -`; - -exports[`usePagination default has 50 pages current page is 20 1`] = ` -[ - { - "disabled": false, - "onClick": [Function], - "page": 19, - "selected": false, - "type": "previous", - }, - { - "disabled": false, - "onClick": [Function], - "page": 1, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "start-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 18, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 19, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 20, - "selected": true, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 21, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 22, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "end-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 49, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 50, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 21, - "selected": false, - "type": "next", - }, -] -`; - -exports[`usePagination default has 50 pages current page is 21 1`] = ` -[ - { - "disabled": false, - "onClick": [Function], - "page": 20, - "selected": false, - "type": "previous", - }, - { - "disabled": false, - "onClick": [Function], - "page": 1, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "start-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 19, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 20, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 21, - "selected": true, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 22, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 23, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "end-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 49, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 50, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 22, - "selected": false, - "type": "next", - }, -] -`; - -exports[`usePagination default has 50 pages current page is 22 1`] = ` -[ - { - "disabled": false, - "onClick": [Function], - "page": 21, - "selected": false, - "type": "previous", - }, - { - "disabled": false, - "onClick": [Function], - "page": 1, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "start-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 20, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 21, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 22, - "selected": true, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 23, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 24, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "end-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 49, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 50, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 23, - "selected": false, - "type": "next", - }, -] -`; - -exports[`usePagination default has 50 pages current page is 23 1`] = ` -[ - { - "disabled": false, - "onClick": [Function], - "page": 22, - "selected": false, - "type": "previous", - }, - { - "disabled": false, - "onClick": [Function], - "page": 1, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "start-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 21, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 22, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 23, - "selected": true, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 24, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 25, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "end-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 49, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 50, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 24, - "selected": false, - "type": "next", - }, -] -`; - -exports[`usePagination default has 50 pages current page is 24 1`] = ` -[ - { - "disabled": false, - "onClick": [Function], - "page": 23, - "selected": false, - "type": "previous", - }, - { - "disabled": false, - "onClick": [Function], - "page": 1, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "start-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 22, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 23, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 24, - "selected": true, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 25, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 26, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "end-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 49, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 50, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 25, - "selected": false, - "type": "next", - }, -] -`; - -exports[`usePagination default has 50 pages current page is 25 1`] = ` -[ - { - "disabled": false, - "onClick": [Function], - "page": 24, - "selected": false, - "type": "previous", - }, - { - "disabled": false, - "onClick": [Function], - "page": 1, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "start-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 23, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 24, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 25, - "selected": true, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 26, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 27, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "end-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 49, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 50, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 26, - "selected": false, - "type": "next", - }, -] -`; - -exports[`usePagination default has 50 pages current page is 26 1`] = ` -[ - { - "disabled": false, - "onClick": [Function], - "page": 25, - "selected": false, - "type": "previous", - }, - { - "disabled": false, - "onClick": [Function], - "page": 1, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "start-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 24, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 25, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 26, - "selected": true, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 27, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 28, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "end-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 49, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 50, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 27, - "selected": false, - "type": "next", - }, -] -`; - -exports[`usePagination default has 50 pages current page is 27 1`] = ` -[ - { - "disabled": false, - "onClick": [Function], - "page": 26, - "selected": false, - "type": "previous", - }, - { - "disabled": false, - "onClick": [Function], - "page": 1, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "start-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 25, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 26, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 27, - "selected": true, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 28, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 29, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "end-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 49, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 50, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 28, - "selected": false, - "type": "next", - }, -] -`; - -exports[`usePagination default has 50 pages current page is 28 1`] = ` -[ - { - "disabled": false, - "onClick": [Function], - "page": 27, - "selected": false, - "type": "previous", - }, - { - "disabled": false, - "onClick": [Function], - "page": 1, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "start-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 26, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 27, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 28, - "selected": true, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 29, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 30, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "end-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 49, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 50, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 29, - "selected": false, - "type": "next", - }, -] -`; - -exports[`usePagination default has 50 pages current page is 29 1`] = ` -[ - { - "disabled": false, - "onClick": [Function], - "page": 28, - "selected": false, - "type": "previous", - }, - { - "disabled": false, - "onClick": [Function], - "page": 1, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "start-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 27, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 28, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 29, - "selected": true, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 30, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 31, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "end-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 49, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 50, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 30, - "selected": false, - "type": "next", - }, -] -`; - -exports[`usePagination default has 50 pages current page is 30 1`] = ` -[ - { - "disabled": false, - "onClick": [Function], - "page": 29, - "selected": false, - "type": "previous", - }, - { - "disabled": false, - "onClick": [Function], - "page": 1, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "start-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 28, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 29, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 30, - "selected": true, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 31, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 32, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "end-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 49, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 50, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 31, - "selected": false, - "type": "next", - }, -] -`; - -exports[`usePagination default has 50 pages current page is 31 1`] = ` -[ - { - "disabled": false, - "onClick": [Function], - "page": 30, - "selected": false, - "type": "previous", - }, - { - "disabled": false, - "onClick": [Function], - "page": 1, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "start-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 29, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 30, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 31, - "selected": true, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 32, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 33, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "end-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 49, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 50, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 32, - "selected": false, - "type": "next", - }, -] -`; - -exports[`usePagination default has 50 pages current page is 32 1`] = ` -[ - { - "disabled": false, - "onClick": [Function], - "page": 31, - "selected": false, - "type": "previous", - }, - { - "disabled": false, - "onClick": [Function], - "page": 1, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "start-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 30, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 31, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 32, - "selected": true, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 33, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 34, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "end-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 49, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 50, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 33, - "selected": false, - "type": "next", - }, -] -`; - -exports[`usePagination default has 50 pages current page is 33 1`] = ` -[ - { - "disabled": false, - "onClick": [Function], - "page": 32, - "selected": false, - "type": "previous", - }, - { - "disabled": false, - "onClick": [Function], - "page": 1, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "start-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 31, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 32, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 33, - "selected": true, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 34, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 35, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "end-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 49, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 50, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 34, - "selected": false, - "type": "next", - }, -] -`; - -exports[`usePagination default has 50 pages current page is 34 1`] = ` -[ - { - "disabled": false, - "onClick": [Function], - "page": 33, - "selected": false, - "type": "previous", - }, - { - "disabled": false, - "onClick": [Function], - "page": 1, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "start-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 32, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 33, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 34, - "selected": true, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 35, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 36, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "end-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 49, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 50, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 35, - "selected": false, - "type": "next", - }, -] -`; - -exports[`usePagination default has 50 pages current page is 35 1`] = ` -[ - { - "disabled": false, - "onClick": [Function], - "page": 34, - "selected": false, - "type": "previous", - }, - { - "disabled": false, - "onClick": [Function], - "page": 1, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "start-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 33, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 34, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 35, - "selected": true, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 36, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 37, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "end-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 49, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 50, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 36, - "selected": false, - "type": "next", - }, -] -`; - -exports[`usePagination default has 50 pages current page is 36 1`] = ` -[ - { - "disabled": false, - "onClick": [Function], - "page": 35, - "selected": false, - "type": "previous", - }, - { - "disabled": false, - "onClick": [Function], - "page": 1, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "start-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 34, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 35, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 36, - "selected": true, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 37, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 38, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "end-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 49, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 50, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 37, - "selected": false, - "type": "next", - }, -] -`; - -exports[`usePagination default has 50 pages current page is 37 1`] = ` -[ - { - "disabled": false, - "onClick": [Function], - "page": 36, - "selected": false, - "type": "previous", - }, - { - "disabled": false, - "onClick": [Function], - "page": 1, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "start-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 35, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 36, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 37, - "selected": true, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 38, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 39, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "end-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 49, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 50, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 38, - "selected": false, - "type": "next", - }, -] -`; - -exports[`usePagination default has 50 pages current page is 38 1`] = ` -[ - { - "disabled": false, - "onClick": [Function], - "page": 37, - "selected": false, - "type": "previous", - }, - { - "disabled": false, - "onClick": [Function], - "page": 1, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "start-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 36, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 37, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 38, - "selected": true, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 39, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 40, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "end-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 49, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 50, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 39, - "selected": false, - "type": "next", - }, -] -`; - -exports[`usePagination default has 50 pages current page is 39 1`] = ` -[ - { - "disabled": false, - "onClick": [Function], - "page": 38, - "selected": false, - "type": "previous", - }, - { - "disabled": false, - "onClick": [Function], - "page": 1, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "start-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 37, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 38, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 39, - "selected": true, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 40, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 41, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "end-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 49, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 50, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 40, - "selected": false, - "type": "next", - }, -] -`; - -exports[`usePagination default has 50 pages current page is 40 1`] = ` -[ - { - "disabled": false, - "onClick": [Function], - "page": 39, - "selected": false, - "type": "previous", - }, - { - "disabled": false, - "onClick": [Function], - "page": 1, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "start-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 38, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 39, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 40, - "selected": true, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 41, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 42, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "end-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 49, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 50, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 41, - "selected": false, - "type": "next", - }, -] -`; - -exports[`usePagination default has 50 pages current page is 41 1`] = ` -[ - { - "disabled": false, - "onClick": [Function], - "page": 40, - "selected": false, - "type": "previous", - }, - { - "disabled": false, - "onClick": [Function], - "page": 1, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "start-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 39, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 40, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 41, - "selected": true, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 42, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 43, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "end-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 49, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 50, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 42, - "selected": false, - "type": "next", - }, -] -`; - -exports[`usePagination default has 50 pages current page is 42 1`] = ` -[ - { - "disabled": false, - "onClick": [Function], - "page": 41, - "selected": false, - "type": "previous", - }, - { - "disabled": false, - "onClick": [Function], - "page": 1, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "start-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 40, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 41, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 42, - "selected": true, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 43, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 44, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "end-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 49, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 50, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 43, - "selected": false, - "type": "next", - }, -] -`; - -exports[`usePagination default has 50 pages current page is 43 1`] = ` -[ - { - "disabled": false, - "onClick": [Function], - "page": 42, - "selected": false, - "type": "previous", - }, - { - "disabled": false, - "onClick": [Function], - "page": 1, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "start-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 41, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 42, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 43, - "selected": true, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 44, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 45, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "end-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 49, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 50, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 44, - "selected": false, - "type": "next", - }, -] -`; - -exports[`usePagination default has 50 pages current page is 44 1`] = ` -[ - { - "disabled": false, - "onClick": [Function], - "page": 43, - "selected": false, - "type": "previous", - }, - { - "disabled": false, - "onClick": [Function], - "page": 1, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "start-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 42, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 43, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 44, - "selected": true, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 45, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 46, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "end-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 49, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 50, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 45, - "selected": false, - "type": "next", - }, -] -`; - -exports[`usePagination default has 50 pages current page is 45 1`] = ` -[ - { - "disabled": false, - "onClick": [Function], - "page": 44, - "selected": false, - "type": "previous", - }, - { - "disabled": false, - "onClick": [Function], - "page": 1, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "start-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 43, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 44, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 45, - "selected": true, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 46, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 47, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "end-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 49, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 50, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 46, - "selected": false, - "type": "next", - }, -] -`; - -exports[`usePagination default has 50 pages current page is 46 1`] = ` -[ - { - "disabled": false, - "onClick": [Function], - "page": 45, - "selected": false, - "type": "previous", - }, - { - "disabled": false, - "onClick": [Function], - "page": 1, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "start-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 44, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 45, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 46, - "selected": true, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 47, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "end-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 49, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 50, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 47, - "selected": false, - "type": "next", - }, -] -`; - -exports[`usePagination default has 50 pages current page is 47 1`] = ` -[ - { - "disabled": false, - "onClick": [Function], - "page": 46, - "selected": false, - "type": "previous", - }, - { - "disabled": false, - "onClick": [Function], - "page": 1, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "start-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 45, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 46, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 47, - "selected": true, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "end-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 49, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 50, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 48, - "selected": false, - "type": "next", - }, -] -`; - -exports[`usePagination default has 50 pages current page is 48 1`] = ` -[ - { - "disabled": false, - "onClick": [Function], - "page": 47, - "selected": false, - "type": "previous", - }, - { - "disabled": false, - "onClick": [Function], - "page": 1, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "start-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 45, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 46, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 47, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "end-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 49, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 50, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 49, - "selected": false, - "type": "next", - }, -] -`; - -exports[`usePagination default has 50 pages current page is 49 1`] = ` -[ - { - "disabled": false, - "onClick": [Function], - "page": 48, - "selected": false, - "type": "previous", - }, - { - "disabled": false, - "onClick": [Function], - "page": 1, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "start-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 45, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 46, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 47, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "end-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 49, - "selected": true, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 50, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 50, - "selected": false, - "type": "next", - }, -] -`; - -exports[`usePagination default has 50 pages current page is 50 1`] = ` -[ - { - "disabled": false, - "onClick": [Function], - "page": 49, - "selected": false, - "type": "previous", - }, - { - "disabled": false, - "onClick": [Function], - "page": 1, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "start-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 45, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 46, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 47, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": null, - "selected": false, - "type": "end-ellipsis", - }, - { - "disabled": false, - "onClick": [Function], - "page": 49, - "selected": false, - "type": "page", - }, - { - "disabled": false, - "onClick": [Function], - "page": 50, - "selected": true, - "type": "page", - }, - { - "disabled": true, - "onClick": [Function], - "page": 51, - "selected": false, - "type": "next", - }, -] -`; diff --git a/tests/usePagination.test.js b/tests/usePagination.test.js deleted file mode 100644 index df278e6e..00000000 --- a/tests/usePagination.test.js +++ /dev/null @@ -1,38 +0,0 @@ -import { shallow } from 'enzyme'; -import React from 'react'; -import usePagination from '../src/usePagination'; - -describe('usePagination', () => { - const serialize = (items) => - items.map((item) => (item.type === 'page' ? item.page : item.type)); - - const renderHook = (useHook) => { - const result = {}; - function TestCase() { - result.current = useHook(); - return null; - } - shallow(); - return { result }; - }; - - it('has one page by default', () => { - const items = renderHook(() => usePagination()).result.current; - expect(items).toHaveLength(3); - expect(items[1]).toHaveProperty('page', 1); - }); - - describe('default', () => { - [3, 5, 6, 7, 8, 9, 10, 12, 50].forEach((count) => { - describe(`has ${count} pages`, () => { - for (let current = 1; current <= count; current++) { - it(`current page is ${current}`, () => { - const items = renderHook(() => usePagination({ count, current })) - .result.current; - expect(items).toMatchSnapshot(); - }); - } - }); - }); - }); -}); From a33c1b890a067cf438308246b34bd7bfa11ce455 Mon Sep 17 00:00:00 2001 From: wuxh Date: Wed, 8 Nov 2023 11:17:34 +0800 Subject: [PATCH 14/64] chore: useless --- docs/examples/_debug.tsx | 56 ++++++++++++-- src/usePagination.ts | 155 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 205 insertions(+), 6 deletions(-) create mode 100644 src/usePagination.ts diff --git a/docs/examples/_debug.tsx b/docs/examples/_debug.tsx index f9f9bf99..6a056b70 100644 --- a/docs/examples/_debug.tsx +++ b/docs/examples/_debug.tsx @@ -1,12 +1,56 @@ import React from 'react'; import '../../assets/index.less'; -import Pagination from '../../src/NewPagination'; +// import Pagination from '../../src/NewPagination'; + // import Pagination from '../../src/Pagination'; +import usePagination from '../../src/usePagination'; + +const App = () => { + const [total, setTotal] = React.useState(5); + const [current, setCurrent] = React.useState(1); + + const items = usePagination({ + // boundaryCount: 2, + // siblingCount: 1, + count: Number(total), + current: Number(current), + }); -const App = () => ( - <> - - -); + return ( + <> + + +
    +
      + {items.map((item, index) => ( +
    • +
      {JSON.stringify(item, null, 2)}
      +
    • + ))} +
    + + ); + // return ( + // <> + // + // + // ) +}; export default App; diff --git a/src/usePagination.ts b/src/usePagination.ts new file mode 100644 index 00000000..43ad045e --- /dev/null +++ b/src/usePagination.ts @@ -0,0 +1,155 @@ +import useMergedState from 'rc-util/lib/hooks/useMergedState'; +import type * as React from 'react'; + +type ItemType = + | 'previous' + | 'start-ellipsis' + | 'page' + | 'end-ellipsis' + | 'next'; +type ItemList = (Exclude | number)[]; + +type UsePaginationProps = { + /** + * Total pages + * @default 1 + */ + count?: number; + current?: number; + defaultCurrent?: number; + onChange?: (page: number, prevPage: number) => void; + disabled?: boolean; + /** + * [1, 2, ..., 4, 5, [6], 7, 8, ..., 10, 11] // boundaryCount = 2 + * @default 1 + */ + boundaryCount?: number; + /** + * [1, ..., 4, [5], 6, ... 10] // siblingCount = 1 + * @default 2 + */ + siblingCount?: number; +}; + +interface UsePaginationItem { + onClick: React.ReactEventHandler; + type: ItemType; + page: number | null; + selected: boolean; + disabled: boolean; +} + +type UsePaginationResult = UsePaginationItem[]; + +function usePagination(props: UsePaginationProps = {}): UsePaginationResult { + const { + count = 1, + current: currentProp, + defaultCurrent, + onChange, + disabled = false, + boundaryCount = 1, + siblingCount = 2, + } = props; + + const [current, setCurrent] = useMergedState(1, { + defaultValue: defaultCurrent, + value: currentProp, + onChange, + }); + + const startPages = range(1, Math.min(boundaryCount, count)); + + const siblingsStart = Math.max( + Math.min(current - siblingCount, count - boundaryCount - siblingCount * 2), + boundaryCount + 1, + ); + const startEllipsis: ItemList = + siblingsStart > boundaryCount + 1 + ? ['start-ellipsis'] + : boundaryCount + 1 < count - boundaryCount + ? [boundaryCount + 1] + : []; + + const endPages = range( + Math.max(count - boundaryCount, boundaryCount + 1), + count, + ); + + const siblingsEnd = Math.min( + Math.max(current + siblingCount, boundaryCount + siblingCount * 2 + 1), + endPages.length > 0 ? endPages[0] - 2 : count - 1, + ); + + console.log({ + startPages, + siblingsStart, + startEllipsis, + endPages, + siblingsEnd, + }); + + const endEllipsis: ItemList = + siblingsEnd < count - boundaryCount - 1 + ? ['end-ellipsis'] + : count - boundaryCount > boundaryCount + ? [count - boundaryCount] + : []; + + const itemList: ItemList = [ + 'previous', + ...startPages, + ...startEllipsis, + ...range(siblingsStart, siblingsEnd), + ...endEllipsis, + ...endPages, + 'next', + ]; + + // Map the button type to its page number + const buttonPage = (type: ItemType) => { + switch (type) { + case 'previous': + return current - 1; + case 'next': + return current + 1; + default: + return null; + } + }; + + const items = itemList.map((item) => { + if (typeof item === 'number') { + return { + onClick() { + setCurrent(item); + }, + type: 'page', + page: item, + selected: item === current, + disabled, + }; + } + + return { + onClick() { + setCurrent(buttonPage(item)); + }, + type: item, + page: buttonPage(item), + selected: false, + disabled: + disabled || + (item.indexOf('ellipsis') === -1 && + (item === 'next' ? current >= count : current <= 1)), + }; + }); + + return items; +} + +function range(start: number, end: number) { + return Array.from({ length: end - start + 1 }, (_, i) => i + start); +} + +export default usePagination; From 8f2e6a05ff37f89bfe747254cc7e45690cc2cb1d Mon Sep 17 00:00:00 2001 From: wuxh Date: Wed, 8 Nov 2023 11:17:47 +0800 Subject: [PATCH 15/64] Revert "chore: useless" This reverts commit a33c1b890a067cf438308246b34bd7bfa11ce455. --- docs/examples/_debug.tsx | 56 ++------------ src/usePagination.ts | 155 --------------------------------------- 2 files changed, 6 insertions(+), 205 deletions(-) delete mode 100644 src/usePagination.ts diff --git a/docs/examples/_debug.tsx b/docs/examples/_debug.tsx index 6a056b70..f9f9bf99 100644 --- a/docs/examples/_debug.tsx +++ b/docs/examples/_debug.tsx @@ -1,56 +1,12 @@ import React from 'react'; import '../../assets/index.less'; -// import Pagination from '../../src/NewPagination'; - +import Pagination from '../../src/NewPagination'; // import Pagination from '../../src/Pagination'; -import usePagination from '../../src/usePagination'; - -const App = () => { - const [total, setTotal] = React.useState(5); - const [current, setCurrent] = React.useState(1); - - const items = usePagination({ - // boundaryCount: 2, - // siblingCount: 1, - count: Number(total), - current: Number(current), - }); - return ( - <> - - -
    -
      - {items.map((item, index) => ( -
    • -
      {JSON.stringify(item, null, 2)}
      -
    • - ))} -
    - - ); - // return ( - // <> - // - // - // ) -}; +const App = () => ( + <> + + +); export default App; diff --git a/src/usePagination.ts b/src/usePagination.ts deleted file mode 100644 index 43ad045e..00000000 --- a/src/usePagination.ts +++ /dev/null @@ -1,155 +0,0 @@ -import useMergedState from 'rc-util/lib/hooks/useMergedState'; -import type * as React from 'react'; - -type ItemType = - | 'previous' - | 'start-ellipsis' - | 'page' - | 'end-ellipsis' - | 'next'; -type ItemList = (Exclude | number)[]; - -type UsePaginationProps = { - /** - * Total pages - * @default 1 - */ - count?: number; - current?: number; - defaultCurrent?: number; - onChange?: (page: number, prevPage: number) => void; - disabled?: boolean; - /** - * [1, 2, ..., 4, 5, [6], 7, 8, ..., 10, 11] // boundaryCount = 2 - * @default 1 - */ - boundaryCount?: number; - /** - * [1, ..., 4, [5], 6, ... 10] // siblingCount = 1 - * @default 2 - */ - siblingCount?: number; -}; - -interface UsePaginationItem { - onClick: React.ReactEventHandler; - type: ItemType; - page: number | null; - selected: boolean; - disabled: boolean; -} - -type UsePaginationResult = UsePaginationItem[]; - -function usePagination(props: UsePaginationProps = {}): UsePaginationResult { - const { - count = 1, - current: currentProp, - defaultCurrent, - onChange, - disabled = false, - boundaryCount = 1, - siblingCount = 2, - } = props; - - const [current, setCurrent] = useMergedState(1, { - defaultValue: defaultCurrent, - value: currentProp, - onChange, - }); - - const startPages = range(1, Math.min(boundaryCount, count)); - - const siblingsStart = Math.max( - Math.min(current - siblingCount, count - boundaryCount - siblingCount * 2), - boundaryCount + 1, - ); - const startEllipsis: ItemList = - siblingsStart > boundaryCount + 1 - ? ['start-ellipsis'] - : boundaryCount + 1 < count - boundaryCount - ? [boundaryCount + 1] - : []; - - const endPages = range( - Math.max(count - boundaryCount, boundaryCount + 1), - count, - ); - - const siblingsEnd = Math.min( - Math.max(current + siblingCount, boundaryCount + siblingCount * 2 + 1), - endPages.length > 0 ? endPages[0] - 2 : count - 1, - ); - - console.log({ - startPages, - siblingsStart, - startEllipsis, - endPages, - siblingsEnd, - }); - - const endEllipsis: ItemList = - siblingsEnd < count - boundaryCount - 1 - ? ['end-ellipsis'] - : count - boundaryCount > boundaryCount - ? [count - boundaryCount] - : []; - - const itemList: ItemList = [ - 'previous', - ...startPages, - ...startEllipsis, - ...range(siblingsStart, siblingsEnd), - ...endEllipsis, - ...endPages, - 'next', - ]; - - // Map the button type to its page number - const buttonPage = (type: ItemType) => { - switch (type) { - case 'previous': - return current - 1; - case 'next': - return current + 1; - default: - return null; - } - }; - - const items = itemList.map((item) => { - if (typeof item === 'number') { - return { - onClick() { - setCurrent(item); - }, - type: 'page', - page: item, - selected: item === current, - disabled, - }; - } - - return { - onClick() { - setCurrent(buttonPage(item)); - }, - type: item, - page: buttonPage(item), - selected: false, - disabled: - disabled || - (item.indexOf('ellipsis') === -1 && - (item === 'next' ? current >= count : current <= 1)), - }; - }); - - return items; -} - -function range(start: number, end: number) { - return Array.from({ length: end - start + 1 }, (_, i) => i + start); -} - -export default usePagination; From e4624df852a2d7d9caee064469f7ea642f8f6211 Mon Sep 17 00:00:00 2001 From: wuxh Date: Sun, 19 Nov 2023 22:39:49 +0800 Subject: [PATCH 16/64] test: debug --- docs/examples/_debug.tsx | 46 ++++++++++++++++++++++++ src/Simple.tsx | 23 ++++++++++++ src/hooks/usePagination.ts | 73 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 142 insertions(+) create mode 100644 src/Simple.tsx create mode 100644 src/hooks/usePagination.ts diff --git a/docs/examples/_debug.tsx b/docs/examples/_debug.tsx index f9f9bf99..591f66c5 100644 --- a/docs/examples/_debug.tsx +++ b/docs/examples/_debug.tsx @@ -10,3 +10,49 @@ const App = () => ( ); export default App; + +interface IProps { + value: string; + onChange: (info: { + firstName: string; + lastName: string; + fullName: string; + }) => void; + separator?: string; +} + +const MyComponent = (props: IProps) => { + const { value = '', onChange, separator = ' ' } = props; + const [firstName, lastName] = value.split(separator)[0]; + + const fullName = `${firstName}${separator}${lastName}`; + + const handleChange = ( + e: React.ChangeEvent, + type: 'firstName' | 'lastName', + ) => { + const { value: input } = e.target; + + onChange({ + firstName: type === 'firstName' ? input : firstName, + lastName: type === 'lastName' ? input : lastName, + fullName, + }); + }; + + return ( + <> + handleChange(e, 'firstName')} + /> + {separator} + handleChange(e, 'lastName')} + /> + + ); +}; diff --git a/src/Simple.tsx b/src/Simple.tsx new file mode 100644 index 00000000..f7be0b48 --- /dev/null +++ b/src/Simple.tsx @@ -0,0 +1,23 @@ +import * as React from 'react'; + +export interface SimpleProps { + slogan?: React.ReactNode; +} + +function Simple(props: React.PropsWithChildren) { + const { children } = props; + + return ( + <> +
    +

    魔法师正在进行最后的仪式,为您带来一项惊艳功能

    + TBD: + To Be Determined... +
    + {children} + + + ); +} + +export default Simple; diff --git a/src/hooks/usePagination.ts b/src/hooks/usePagination.ts new file mode 100644 index 00000000..cc4cfe37 --- /dev/null +++ b/src/hooks/usePagination.ts @@ -0,0 +1,73 @@ +import useMergedState from 'rc-util/lib/hooks/useMergedState'; + +type ItemType = + | 'prev' + | 'jump-prev' + | 'after-jump-prev' + | 'page' + | 'jump-next' + | 'before-jump-next' + | 'next'; +type ItemRenderType = Exclude< + ItemType, + 'page' | 'before-jump-next' | 'after-jump-prev' +>; + +type UsePaginationProps = { + /** @default 1 */ + total?: number; + current?: number; + /** @default 1 */ + defaultCurrent?: number; + onChange?: (page: number, prevPage: number) => void; + disabled?: boolean; + /** @default false */ + lessItems?: boolean; +}; + +// https://dev.to/namirsab/comment/2050 +const range = (start: number, end: number) => { + const length = end - start + 1; + return Array.from({ length }, (_, i) => start + i); +}; + +const usePagination = (props: UsePaginationProps = {}) => { + const { + total = 0, + defaultCurrent = 1, + current, + onChange, + disabled, + lessItems, + } = props; + + const [innerCurrent, setInnerCurrent] = useMergedState(1, { + value: current, + defaultValue: defaultCurrent, + }); + + const pageBufferSize = lessItems ? 1 : 2; + + let pagerList = []; + + if (total <= 3 + pageBufferSize * 2) { + pagerList = range(1, total); + } + + let left = Math.max(1, innerCurrent - pageBufferSize); + let right = Math.min(innerCurrent + pageBufferSize, total); + + if (innerCurrent - 1 <= pageBufferSize) { + right = 1 + pageBufferSize * 2; + } + + if (total - innerCurrent <= pageBufferSize) { + left = total - pageBufferSize * 2; + } + + const itemList = [ + 'prev', + // ...startPages, + // Start ellipsis + ]; +}; From ff751597226e03144c2a2a7922e7baa1ffd0c1d2 Mon Sep 17 00:00:00 2001 From: wuxh Date: Sun, 19 Nov 2023 23:35:29 +0800 Subject: [PATCH 17/64] feat: update pager --- src/Pager.tsx | 38 ++++++++++++++++++-------------------- 1 file changed, 18 insertions(+), 20 deletions(-) diff --git a/src/Pager.tsx b/src/Pager.tsx index 2755d919..a95d612d 100644 --- a/src/Pager.tsx +++ b/src/Pager.tsx @@ -1,10 +1,9 @@ /* eslint react/prop-types: 0 */ import classNames from 'classnames'; import React from 'react'; +import type { PaginationProps } from './interface'; -interface Props { - last?: boolean; - locale?: any; +export interface PagerProps extends Pick { rootPrefixCls: string; page: number; active?: boolean; @@ -13,17 +12,12 @@ interface Props { onClick?: (page: number) => void; onKeyPress?: ( e: React.KeyboardEvent, - onClick: Props['onClick'], - page: Props['page'], + onClick: PagerProps['onClick'], + page: PagerProps['page'], ) => void; - itemRender?: ( - page: number, - type: 'page' | 'prev' | 'next' | 'jump-prev' | 'jump-next', - element: React.ReactNode, - ) => React.ReactNode; } -const Pager: React.FC = (props) => { +const Pager: React.FC = (props) => { const { rootPrefixCls, page, @@ -35,11 +29,16 @@ const Pager: React.FC = (props) => { itemRender, } = props; const prefixCls = `${rootPrefixCls}-item`; - const cls = classNames(prefixCls, `${prefixCls}-${page}`, { - [`${prefixCls}-active`]: active, - [`${prefixCls}-disabled`]: !page, - [props.className]: className, - }); + + const cls = classNames( + prefixCls, + `${prefixCls}-${page}`, + { + [`${prefixCls}-active`]: active, + [`${prefixCls}-disabled`]: !page, + }, + className, + ); const handleClick = () => { onClick(page); @@ -50,11 +49,10 @@ const Pager: React.FC = (props) => { }; const pager = itemRender(page, 'page', {page}); - if (!pager) return null; - return ( + return pager ? (
  • = (props) => { > {pager}
  • - ); + ) : null; }; export default Pager; From b03fd1a00fdc3c145bbf418be49f3d71242dca8f Mon Sep 17 00:00:00 2001 From: wuxh Date: Mon, 20 Nov 2023 00:12:57 +0800 Subject: [PATCH 18/64] chore: update --- src/NewPagination.tsx | 486 +++++++++++++++++++++++++++++------------- 1 file changed, 333 insertions(+), 153 deletions(-) diff --git a/src/NewPagination.tsx b/src/NewPagination.tsx index 618e73ed..9fa2f83f 100644 --- a/src/NewPagination.tsx +++ b/src/NewPagination.tsx @@ -1,8 +1,12 @@ import classNames from 'classnames'; +import KeyCode from 'rc-util/lib/KeyCode'; import useMergedState from 'rc-util/lib/hooks/useMergedState'; import pickAttrs from 'rc-util/lib/pickAttrs'; import warning from 'rc-util/lib/warning'; import React from 'react'; +import Options from './Options'; +import type { PagerProps } from './Pager'; +import Pager from './Pager'; import type { PaginationProps } from './interface'; import zhCN from './locale/zh_CN'; @@ -14,22 +18,38 @@ const defaultItemRender: PaginationProps['itemRender'] = ( function noop() {} +function isInteger(v: number) { + const value = Number(v); + return ( + typeof value === 'number' && + !Number.isNaN(value) && + isFinite(value) && + Math.floor(value) === value + ); +} + function calculatePage(p: number | undefined, pageSize: number, total: number) { const _pageSize = typeof p === 'undefined' ? pageSize : p; return Math.floor((total - 1) / _pageSize) + 1; } + function Pagination(props: PaginationProps) { const { + // cls prefixCls = 'rc-pagination', selectPrefixCls = 'rc-select', className, + selectComponentClass, + + // control current: currentProp, defaultCurrent = 1, total = 0, pageSize: pageSizeProp, defaultPageSize = 10, onChange = noop, - selectComponentClass, + + // config hideOnSinglePage, showPrevNextJumpers = true, showQuickJumper, @@ -38,13 +58,17 @@ function Pagination(props: PaginationProps) { onShowSizeChange = noop, locale = zhCN, style, - itemRender = defaultItemRender, totalBoundaryShowSizeChanger = 50, disabled, simple, showTotal, + showSizeChanger: showSizeChangerProp, + pageSizeOptions, + // render + itemRender = defaultItemRender, jumpPrevIcon, + jumpNextIcon, prevIcon, nextIcon, } = props; @@ -72,27 +96,16 @@ function Pagination(props: PaginationProps) { ); } - // TODO: Should be deleted. assign: @Wuxh - globalThis.console.log('%c', 'color:lightBlue;', { - total, - hasOnChange, - hasCurrent, - current, - pageSize, - }); - - const getJumpPrevPage = () => Math.max(1, current - (showLessItems ? 3 : 5)); - - const getJumpNextPage = () => - Math.min( - calculatePage(undefined, pageSize, total), - this.state.current + (this.props.showLessItems ? 3 : 5), - ); + const jumpPrevPage = Math.max(1, current - (showLessItems ? 3 : 5)); + const jumpNextPage = Math.min( + calculatePage(undefined, pageSize, total), + current + (showLessItems ? 3 : 5), + ); - const getItemIcon = ( + function getItemIcon( icon: React.ReactNode | React.ComponentType, label: string, - ) => { + ) { let iconNode = icon || ( - ); - } else { - gotoButton = ( - - {goButton} - - ); - } - gotoButton = ( -
  • - {gotoButton} -
  • + // ================== Simple ================== + const gotoButton: React.ReactNode = null; + + // ====================== Normal ====================== + const pageBufferSize = showLessItems ? 1 : 2; + if (allPages <= 3 + pageBufferSize * 2) { + if (!allPages) { + pagerList.push( + , ); } - const prevNode = renderPrev(prevPage); - return ( -
      - {totalText} - {prevNode ? ( -
    • - {prevNode} -
    • - ) : null} + for (let i = 1; i <= allPages; i += 1) { + pagerList.push( + , + ); + } + } else { + const prevItemTitle = showLessItems ? locale.prev_3 : locale.prev_5; + const nextItemTitle = showLessItems ? locale.next_3 : locale.next_5; + + const jumpPrevContent = itemRender( + jumpPrevPage, + 'jump-prev', + getItemIcon(jumpPrevIcon, 'prev page'), + ); + const jumpNextContent = itemRender( + jumpNextPage, + 'jump-next', + getItemIcon(jumpNextIcon, 'next page'), + ); + + if (showPrevNextJumpers) { + jumpPrev = jumpPrevContent ? (
    • - - / - {allPages} + {jumpPrevContent}
    • + ) : null; + + jumpNext = jumpNextContent ? (
    • - {renderNext(nextPage)} + {jumpNextContent}
    • -
    + ) : null; + } + + let left = Math.max(1, current - pageBufferSize); + let right = Math.min(current + pageBufferSize, allPages); + + if (current - 1 <= pageBufferSize) { + right = 1 + pageBufferSize * 2; + } + if (allPages - current <= pageBufferSize) { + left = allPages - pageBufferSize * 2; + } + + for (let i = left; i <= right; i += 1) { + pagerList.push( + , + ); + } + + if (current - 1 >= pageBufferSize * 2 && current !== 1 + 2) { + pagerList[0] = React.cloneElement(pagerList[0], { + className: classNames( + `${prefixCls}-item-after-jump-prev`, + pagerList[0].props.className, + ), + }); + + pagerList.unshift(jumpPrev); + } + + if (allPages - current >= pageBufferSize * 2 && current !== allPages - 2) { + pagerList[pagerList.length - 1] = React.cloneElement(pagerList.at(-1), { + className: classNames( + `${prefixCls}-item-before-jump-next`, + pagerList.at(-1).props.className, + ), + }); + + pagerList.push(jumpNext); + } + + if (left !== 1) { + pagerList.unshift(); + } + if (right !== allPages) { + pagerList.push(); + } + } + + let prev = renderPrev(prevPage); + if (prev) { + const prevDisabled = !hasPrev || !allPages; + prev = ( +
  • + {prev} +
  • + ); + } + + let next = renderNext(nextPage); + if (next) { + const nextDisabled = !hasNext || !allPages; + + next = ( +
  • + {next} +
  • ); } return ( -
    -

    NEW Pagination

    -
    +
      + {totalText} + {prev} + {pagerList} + {next} + +
    ); } From 467b88613b2c710cd7136fee7bb5796024972c6d Mon Sep 17 00:00:00 2001 From: wuxh Date: Mon, 20 Nov 2023 00:34:09 +0800 Subject: [PATCH 19/64] chore: update --- src/NewPagination.tsx | 64 +++++++++++++++++++++++++++++++++++++++---- 1 file changed, 58 insertions(+), 6 deletions(-) diff --git a/src/NewPagination.tsx b/src/NewPagination.tsx index 9fa2f83f..ccdbca3a 100644 --- a/src/NewPagination.tsx +++ b/src/NewPagination.tsx @@ -271,6 +271,12 @@ function Pagination(props: PaginationProps) { : nextButton; } + function handleGoTO(event: any) { + if (event.type === 'click' || event.keyCode === KeyCode.ENTER) { + handleChange(current); + } + } + let jumpPrev: React.ReactElement = null; const dataOrAriaAttributeProps = pickAttrs(props, { @@ -312,7 +318,50 @@ function Pagination(props: PaginationProps) { const goButton = showQuickJumper && (showQuickJumper as any).goButton; // ================== Simple ================== - const gotoButton: React.ReactNode = null; + // FIXME: ts type + let gotoButton: any = goButton; + let simplePager: React.ReactNode = null; + + if (simple) { + if (typeof goButton === 'boolean') { + gotoButton = ( + + ); + } else { + + {goButton} + ; + } + + gotoButton = ( +
  • + {gotoButton} +
  • + ); + + simplePager = ( + <> + + / + {allPages} + + ); + } // ====================== Normal ====================== const pageBufferSize = showLessItems ? 1 : 2; @@ -465,18 +514,21 @@ function Pagination(props: PaginationProps) { ); } + const cls = classNames(prefixCls, className, { + [`${prefixCls}-simple`]: simple, + [`${prefixCls}-disabled`]: disabled, + }); + return (
      {totalText} {prev} - {pagerList} + {simple ? simplePager : pagerList} {next}
    ); From 2754b4425945aae5d8b891876a5d190c3fde8cfb Mon Sep 17 00:00:00 2001 From: wuxh Date: Mon, 20 Nov 2023 01:09:01 +0800 Subject: [PATCH 20/64] test: update demo --- docs/examples/_debug.tsx | 42 ++++++++++++++++++++++++++++++++++------ 1 file changed, 36 insertions(+), 6 deletions(-) diff --git a/docs/examples/_debug.tsx b/docs/examples/_debug.tsx index 591f66c5..f10fb34d 100644 --- a/docs/examples/_debug.tsx +++ b/docs/examples/_debug.tsx @@ -1,13 +1,43 @@ import React from 'react'; import '../../assets/index.less'; import Pagination from '../../src/NewPagination'; -// import Pagination from '../../src/Pagination'; +import OriginPagination from '../../src/Pagination'; +import type { PaginationProps } from '../../src/interface'; -const App = () => ( - <> - - -); +const App = () => { + const [origin, setOrigin] = React.useState(false); + const [all, setAll] = React.useState(false); + + const props: PaginationProps = { + total: 100, + defaultCurrent: 2, + }; + + const originTip = Origin; + const newTip = New; + + return ( + <> +

    {all ? null : origin ? originTip : newTip}

    + + +
    + {!all && + React.createElement(origin ? OriginPagination : Pagination, props)} + {all && ( + <> + {originTip} +
    + +
    + {newTip} +
    + + + )} + + ); +}; export default App; From c97235db7158b6ed8414b3891ab632acfae8da75 Mon Sep 17 00:00:00 2001 From: wuxh Date: Mon, 20 Nov 2023 01:18:19 +0800 Subject: [PATCH 21/64] chore: fix bug --- src/NewPagination.tsx | 34 +++++++++++++++++++++++++--------- 1 file changed, 25 insertions(+), 9 deletions(-) diff --git a/src/NewPagination.tsx b/src/NewPagination.tsx index ccdbca3a..13092897 100644 --- a/src/NewPagination.tsx +++ b/src/NewPagination.tsx @@ -84,6 +84,15 @@ function Pagination(props: PaginationProps) { value: currentProp, defaultValue: defaultCurrent, postState: (c) => Math.min(c, calculatePage(pageSize, undefined, total)), + onChange: (c) => onChange(c, pageSize), + }); + + const [internalInputVal, setInternalInputVal] = React.useState(current); + + // TODO: Should be deleted. assign: @Wuxh + globalThis.console.log('%c@Wuxh(Red)', 'color:red;', { + value: 1403439, + internalInputVal, }); const hasOnChange = onChange !== noop; @@ -126,7 +135,7 @@ function Pagination(props: PaginationProps) { if (inputValue === '') { value = inputValue; } else if (Number.isNaN(Number(inputValue))) { - value = current; + value = internalInputVal; } else if (inputValue >= allPages) { value = allPages; } else { @@ -149,8 +158,8 @@ function Pagination(props: PaginationProps) { function handleKeyUp(event: React.KeyboardEvent) { const value = getValidValue(event); - if (value !== current) { - setCurrent(value); + if (value !== internalInputVal) { + setInternalInputVal(value); } switch (event.keyCode) { @@ -178,8 +187,9 @@ function Pagination(props: PaginationProps) { current > newCurrent && newCurrent !== 0 ? newCurrent : current; setPageSize(size); + setCurrent(nextCurrent); + setInternalInputVal(newCurrent); onShowSizeChange?.(nextCurrent, size); - onChange?.(nextCurrent, size); } function handleChange(page: number) { @@ -191,7 +201,13 @@ function Pagination(props: PaginationProps) { } else if (page < 1) { newPage = 1; } - onChange?.(newPage, pageSize); + + if (newPage !== internalInputVal) { + setInternalInputVal(newPage); + } + + setCurrent(newPage); + return newPage; } @@ -267,13 +283,13 @@ function Pagination(props: PaginationProps) { getItemIcon(nextIcon, 'next page'), ); return React.isValidElement(nextButton) - ? React.cloneElement(nextButton, { disabled: hasNext }) + ? React.cloneElement(nextButton, { disabled: !hasNext }) : nextButton; } function handleGoTO(event: any) { if (event.type === 'click' || event.keyCode === KeyCode.ENTER) { - handleChange(current); + handleChange(internalInputVal); } } @@ -348,7 +364,7 @@ function Pagination(props: PaginationProps) { <> From e105db1a0b1b685cb5fbcd79fc4ed1fb2acda076 Mon Sep 17 00:00:00 2001 From: wuxh Date: Mon, 20 Nov 2023 01:21:08 +0800 Subject: [PATCH 22/64] chore: fix --- src/NewPagination.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/NewPagination.tsx b/src/NewPagination.tsx index 13092897..441621ae 100644 --- a/src/NewPagination.tsx +++ b/src/NewPagination.tsx @@ -346,7 +346,7 @@ function Pagination(props: PaginationProps) { ); } else { - + {goButton} ; } From 0d7714a349c5301a10b5d1468fac89a7daeb2c18 Mon Sep 17 00:00:00 2001 From: wuxh Date: Mon, 20 Nov 2023 01:23:05 +0800 Subject: [PATCH 23/64] fix: warper --- src/NewPagination.tsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/NewPagination.tsx b/src/NewPagination.tsx index 441621ae..706efde7 100644 --- a/src/NewPagination.tsx +++ b/src/NewPagination.tsx @@ -361,7 +361,10 @@ function Pagination(props: PaginationProps) { ); simplePager = ( - <> +
  • / {allPages} - +
  • ); } From cc2a61ee768b36cc7015ceea97b2da9ade689447 Mon Sep 17 00:00:00 2001 From: wuxh Date: Mon, 20 Nov 2023 01:41:21 +0800 Subject: [PATCH 24/64] fix: next --- src/NewPagination.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/NewPagination.tsx b/src/NewPagination.tsx index 706efde7..15397be2 100644 --- a/src/NewPagination.tsx +++ b/src/NewPagination.tsx @@ -215,7 +215,7 @@ function Pagination(props: PaginationProps) { } const hasPrev = current > 1; - const hasNext = current < calculatePage(undefined, current, total); + const hasNext = current < calculatePage(undefined, pageSize, total); const showSizeChanger = showSizeChangerProp ?? total > totalBoundaryShowSizeChanger; From 4c6f12bb28e3e66ff5dba2262bcf776a16dc5077 Mon Sep 17 00:00:00 2001 From: wuxh Date: Mon, 20 Nov 2023 02:04:50 +0800 Subject: [PATCH 25/64] fix: simple disable next --- src/NewPagination.tsx | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/NewPagination.tsx b/src/NewPagination.tsx index 15397be2..a47a7ede 100644 --- a/src/NewPagination.tsx +++ b/src/NewPagination.tsx @@ -515,13 +515,21 @@ function Pagination(props: PaginationProps) { let next = renderNext(nextPage); if (next) { - const nextDisabled = !hasNext || !allPages; + let nextDisabled: boolean, nextTabIndex: number | null; + + if (simple) { + nextDisabled = !hasNext; + nextTabIndex = hasPrev ? 0 : null; + } else { + nextDisabled = !hasNext || !allPages; + nextTabIndex = nextDisabled ? null : 0; + } next = (
  • Date: Mon, 20 Nov 2023 02:18:08 +0800 Subject: [PATCH 26/64] test: update test case --- tests/simple.test.js | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/tests/simple.test.js b/tests/simple.test.js index 00fce9d8..da2ef9d8 100644 --- a/tests/simple.test.js +++ b/tests/simple.test.js @@ -1,6 +1,6 @@ -import React, { useState } from 'react'; import { mount } from 'enzyme'; import Select from 'rc-select'; +import React, { useState } from 'react'; import Pagination from '../src'; describe('simple Pagination', () => { @@ -60,7 +60,13 @@ describe('simple Pagination', () => { }); it('default current page is 1', () => { - expect(wrapper.state().current).toBe(1); + // expect(wrapper.state().current).toBe(1); // Class Component + expect(wrapper.find('.rc-pagination-simple-pager').prop('title')).toBe( + '1/3', + ); + expect( + wrapper.find('.rc-pagination-simple').find('input').getDOMNode().value, + ).toBe('1'); }); it('prev-button should be disabled', () => { @@ -78,12 +84,18 @@ describe('simple Pagination', () => { const component = mount( , ); - expect(component.state().current).toBe(3); + // expect(component.state().current).toBe(3); // Class Component + expect(component.find('.rc-pagination-simple-pager').prop('title')).toBe( + '3/3', + ); const greaterCurrent = component.find('.rc-pagination-simple'); const input = greaterCurrent.find('input'); input.simulate('change', { target: { value: '313423434343343452121' } }); expect(input.getDOMNode().value).toBe('3'); - expect(component.state().current).toBe(3); + // expect(component.state().current).toBe(3); // Class Component + expect(component.find('.rc-pagination-simple-pager').prop('title')).toBe( + '3/3', + ); }); it('should merge custom pageSize to pageSizeOptions', () => { From d80309c39e8debddb1979202e92daa20cb874d7f Mon Sep 17 00:00:00 2001 From: wuxh Date: Mon, 20 Nov 2023 02:41:25 +0800 Subject: [PATCH 27/64] fix: fix simple bug --- src/NewPagination.tsx | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/NewPagination.tsx b/src/NewPagination.tsx index a47a7ede..4d80cf8d 100644 --- a/src/NewPagination.tsx +++ b/src/NewPagination.tsx @@ -177,8 +177,8 @@ function Pagination(props: PaginationProps) { } } - function handleBlur(event: React.FocusEvent) { - setCurrent(getValidValue(event)); + function handleBlur(event: React.FocusEvent) { + handleChange(getValidValue(event)); } function changePageSize(size: number) { @@ -187,8 +187,13 @@ function Pagination(props: PaginationProps) { current > newCurrent && newCurrent !== 0 ? newCurrent : current; setPageSize(size); - setCurrent(nextCurrent); - setInternalInputVal(newCurrent); + /** + * Not used `setCurrent` here. @see useMergedState + * It is possible that the current has not changed, but the page size has changed. + */ + onChange(nextCurrent, size); + + setInternalInputVal(nextCurrent); onShowSizeChange?.(nextCurrent, size); } From 87a20d40e8a75fbb5dadaa78f9ff5e4a60ecdd75 Mon Sep 17 00:00:00 2001 From: wuxh Date: Mon, 20 Nov 2023 03:03:50 +0800 Subject: [PATCH 28/64] test: update test case --- tests/two-pagination.test.js | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/tests/two-pagination.test.js b/tests/two-pagination.test.js index 75650b8d..74f08f78 100644 --- a/tests/two-pagination.test.js +++ b/tests/two-pagination.test.js @@ -1,5 +1,5 @@ -import React from 'react'; import { mount } from 'enzyme'; +import React from 'react'; import Pagination from '../src'; import TwoPagination from './two-pagination'; @@ -17,15 +17,22 @@ describe('Two Pagination', () => { it('should has initial pageSize 20', () => { const p1 = wrapper.find(Pagination).at(0); const p2 = wrapper.find(Pagination).at(1); - expect(p1.state().pageSize).toBe(20); - expect(p2.state().pageSize).toBe(20); + // expect(p1.state().pageSize).toBe(20); // Class component + expect(p1.props().pageSize).toBe(20); // Function component + // expect(p2.state().pageSize).toBe(20); // Class component + expect(p2.props().pageSize).toBe(20); // Function component }); it('should sync pageSize via state', () => { const p1 = wrapper.find(Pagination).at(0); const p2 = wrapper.find(Pagination).at(1); wrapper.find('.hook').simulate('click'); - expect(p1.state().pageSize).toBe(50); - expect(p2.state().pageSize).toBe(50); + // wrapper.update(); + const newP1 = wrapper.find(Pagination).at(0); + const newP2 = wrapper.find(Pagination).at(1); + // expect(p1.state().pageSize).toBe(50); // Class component + expect(newP1.props().pageSize).toBe(50); // Function component + // expect(p2.state().pageSize).toBe(50); // Class component + expect(newP2.props().pageSize).toBe(50); // Function component }); }); From a9e0061fac2c7c0561153c2c57f56c26ca246921 Mon Sep 17 00:00:00 2001 From: wuxh Date: Mon, 20 Nov 2023 03:19:20 +0800 Subject: [PATCH 29/64] test: update test --- tests/jumper.test.js | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/tests/jumper.test.js b/tests/jumper.test.js index 7dbc1f03..8acc6c86 100644 --- a/tests/jumper.test.js +++ b/tests/jumper.test.js @@ -26,7 +26,8 @@ describe('Pagination with jumper', () => { const input = quickJumper.find('input'); input.simulate('change', { target: { value: '-1' } }); input.simulate('keyUp', { key: 'Enter', keyCode: 13, which: 13 }); - expect(wrapper.state().current).toBe(1); + // expect(wrapper.state().current).toBe(1); // Class component + expect(wrapper.find('.rc-pagination-item-active').text()).toBe('1'); expect(onChange).toHaveBeenLastCalledWith(1, 10); }); @@ -34,7 +35,8 @@ describe('Pagination with jumper', () => { const quickJumper = wrapper.find('.rc-pagination-options-quick-jumper'); const input = quickJumper.find('input'); input.simulate('blur'); - expect(wrapper.state().current).toBe(10); + // expect(wrapper.state().current).toBe(10); // Class component + expect(wrapper.find('.rc-pagination-item-active').text()).toBe('10'); expect(onChange).not.toBeCalled(); }); @@ -103,7 +105,11 @@ describe('simple quick jumper', () => { const goButton = quickJumper.find('.go-button'); input.simulate('change', { target: { value: '2' } }); goButton.simulate('click'); - expect(wrapper.state().current).toBe(2); + // expect(wrapper.state().current).toBe(2); // Class component + expect( + wrapper.find('.rc-pagination-simple-pager').find('input').getDOMNode() + .value, + ).toBe('2'); expect(onChange).toHaveBeenLastCalledWith(2, 10); }); @@ -134,7 +140,8 @@ describe('simple quick jumper', () => { const goButton = quickJumper.find('.go-button'); input.simulate('change', { target: { value: '2' } }); goButton.simulate('click'); - expect(wrapper.state().current).toBe(2); + // expect(wrapper.state().current).toBe(2); // Class component + expect(wrapper.find('.rc-pagination-item-active').text()).toBe('2'); expect(onChange).toHaveBeenLastCalledWith(2, 10); }); @@ -145,7 +152,8 @@ describe('simple quick jumper', () => { const input = wrapper.find('input'); input.simulate('change', { target: { value: '&' } }); input.simulate('keyUp', { key: 'Enter', keyCode: 13, which: 13 }); - expect(wrapper.state().current).toBe(2); + // expect(wrapper.state().current).toBe(2); // Class component + expect(wrapper.find('.rc-pagination-item-active').text()).toBe('2'); expect(onChange).toHaveBeenLastCalledWith(2, 10); }); }); From 80f4fb1e488d742ea8ce5e72e13289093fee7919 Mon Sep 17 00:00:00 2001 From: wuxh Date: Mon, 20 Nov 2023 03:44:10 +0800 Subject: [PATCH 30/64] test: update --- tests/index.test.js | 55 +++++++++++++++++++++++++++++---------------- 1 file changed, 36 insertions(+), 19 deletions(-) diff --git a/tests/index.test.js b/tests/index.test.js index 73dba26a..6334f3c5 100644 --- a/tests/index.test.js +++ b/tests/index.test.js @@ -1,6 +1,6 @@ -import React from 'react'; import { mount } from 'enzyme'; import Select from 'rc-select'; +import React from 'react'; import Pagination from '../src'; describe('Default Pagination', () => { @@ -28,11 +28,12 @@ describe('Uncontrolled Pagination', () => { let wrapper; const onChange = jest.fn(); - function shouldHighlightRight() { + function shouldHighlightRight(current) { const pagers = wrapper.find('li:not(.rc-pagination-total-text)'); pagers.forEach((pager, index) => { - // page starts from 1 - if (index === wrapper.state().current) { + // if (index === wrapper.state().current) { // Class Component + const props = wrapper.props(); + if (index === (current ?? props.current ?? props.defaultCurrent)) { expect(pager.hasClass('rc-pagination-item-active')).toBe(true); } else { expect(pager.hasClass('rc-pagination-item-active')).toBe(false); @@ -60,7 +61,10 @@ describe('Uncontrolled Pagination', () => { }); it('default current page is 1', () => { - expect(wrapper.state().current).toBe(1); + // expect(wrapper.state().current).toBe(1); // Class Component + expect(wrapper.find('.rc-pagination-item-active').text()).toBe('1'); + expect(wrapper.find('.rc-pagination-item').first().text()).toBe('1'); + expect(wrapper.find('.rc-pagination-item').first().prop('title')).toBe('1'); }); it('prev-button should be disabled', () => { @@ -69,10 +73,8 @@ describe('Uncontrolled Pagination', () => { expect(prevButton.getDOMNode().getAttribute('aria-disabled')).toBe('true'); }); - it( - 'should hightlight current page and not highlight other page', - shouldHighlightRight, - ); + it('should hightlight current page and not highlight other page', () => + shouldHighlightRight()); it('should calc page right', () => { const pagers = wrapper.find( @@ -95,17 +97,19 @@ describe('Uncontrolled Pagination', () => { const page2 = pagers.at(1); expect(page2.hasClass('rc-pagination-item-2')).toBe(true); page2.simulate('click'); - expect(wrapper.state().current).toBe(2); + // expect(wrapper.state().current).toBe(2); // Class Component + expect(wrapper.find('.rc-pagination-item-active').text()).toBe('2'); expect(onChange).toHaveBeenLastCalledWith(2, 10); - shouldHighlightRight(); + shouldHighlightRight(2); }); it('should response next page', () => { const nextButton = wrapper.find('.rc-pagination-next'); nextButton.simulate('click'); - expect(wrapper.state().current).toBe(2); + // expect(wrapper.state().current).toBe(2); // Class Component + expect(wrapper.find('.rc-pagination-item-active').text()).toBe('2'); expect(onChange).toHaveBeenLastCalledWith(2, 10); - shouldHighlightRight(); + shouldHighlightRight(2); }); it('should quick jump to expect page', () => { @@ -116,7 +120,8 @@ describe('Uncontrolled Pagination', () => { ); input.simulate('change', { target: { value: '2' } }); goButton.simulate('click'); - expect(wrapper.state().current).toBe(2); + // expect(wrapper.state().current).toBe(2); // Class Component + expect(wrapper.find('.rc-pagination-item-active').text()).toBe('2'); expect(onChange).toHaveBeenLastCalledWith(2, 10); }); @@ -127,7 +132,8 @@ describe('Uncontrolled Pagination', () => { input.simulate('focus'); input.simulate('change', { target: { value: '2' } }); input.simulate('blur'); - expect(wrapper.state().current).toBe(1); + // expect(wrapper.state().current).toBe(1); + expect(wrapper.find('.rc-pagination-item-active').text()).toBe('1'); expect(onChange).not.toBeCalled(); }); @@ -140,7 +146,8 @@ describe('Uncontrolled Pagination', () => { const input = quickJumper.find('input'); input.simulate('change', { target: { value: '2' } }); input.simulate('blur'); - expect(component.state().current).toBe(2); + // expect(component.state().current).toBe(2); + expect(component.find('.rc-pagination-item-active').text()).toBe('2'); }); // https://github.com/ant-design/ant-design/issues/15539 @@ -177,13 +184,22 @@ describe('Controlled Pagination', () => { }); it('current should equal defaultCurrent', () => { - expect(wrapper.state().current).toBe(2); + // expect(wrapper.state().current).toBe(2); // Class Component + expect(wrapper.find('.rc-pagination-item-active').text()).toBe('2'); + expect(wrapper.find('.rc-pagination-item').first().text()).toBe('1'); + expect( + wrapper + .find('.rc-pagination-item') + .at(1) + .hasClass('rc-pagination-item-active'), + ).toBe(true); }); it('should not response mouse click', () => { const nextButton = wrapper.find('.rc-pagination-next'); nextButton.simulate('click'); - expect(wrapper.state().current).toBe(2); + // expect(wrapper.state().current).toBe(2); // Class Component + expect(wrapper.find('.rc-pagination-item-active').text()).toBe('2'); expect(onChange).toHaveBeenLastCalledWith(3, 10); }); }); @@ -340,7 +356,8 @@ describe('current value on onShowSizeChange when total is 0', () => { input.simulate('keyDown', { key: 'Down', keyCode: 40, which: 40 }); input.simulate('keyDown', { key: 'Enter', keyCode: 13, which: 13 }); expect(onShowSizeChange).toHaveBeenLastCalledWith( - wrapper.state().current, + // wrapper.state().current, + 0, 20, ); }); From 29520b738b3c49547e5d4670a202a77f418d3580 Mon Sep 17 00:00:00 2001 From: wuxh Date: Mon, 20 Nov 2023 03:44:39 +0800 Subject: [PATCH 31/64] chore: add debug --- docs/examples/_debug.tsx | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/docs/examples/_debug.tsx b/docs/examples/_debug.tsx index f10fb34d..91c239a0 100644 --- a/docs/examples/_debug.tsx +++ b/docs/examples/_debug.tsx @@ -9,10 +9,24 @@ const App = () => { const [all, setAll] = React.useState(false); const props: PaginationProps = { - total: 100, - defaultCurrent: 2, + onChange: console.log, + defaultCurrent: 1, + total: 25, + showQuickJumper: { + goButton: true, + }, + showTotal: (total, range) => `${range[0]} - ${range[1]} of ${total} items`, }; + // + // `${range[0]} - ${range[1]} of ${total} items` + // } + // />, + const originTip = Origin; const newTip = New; @@ -40,6 +54,7 @@ const App = () => { }; export default App; +// export { default } from '../../tests/two-pagination.jsx' interface IProps { value: string; From 78f2a40100f2c2b506c8666de7ac96d870261d73 Mon Sep 17 00:00:00 2001 From: wuxh Date: Mon, 20 Nov 2023 03:45:44 +0800 Subject: [PATCH 32/64] chore: remove debug console --- src/NewPagination.tsx | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/NewPagination.tsx b/src/NewPagination.tsx index 4d80cf8d..03e73c2b 100644 --- a/src/NewPagination.tsx +++ b/src/NewPagination.tsx @@ -89,12 +89,6 @@ function Pagination(props: PaginationProps) { const [internalInputVal, setInternalInputVal] = React.useState(current); - // TODO: Should be deleted. assign: @Wuxh - globalThis.console.log('%c@Wuxh(Red)', 'color:red;', { - value: 1403439, - internalInputVal, - }); - const hasOnChange = onChange !== noop; const hasCurrent = 'current' in props; From af70335969f00b9302664cb989e02472315f1f12 Mon Sep 17 00:00:00 2001 From: wuxh Date: Mon, 20 Nov 2023 03:46:37 +0800 Subject: [PATCH 33/64] chore: mark deprecated --- src/{Pagination.tsx => Pagination_deprecated.tsx} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename src/{Pagination.tsx => Pagination_deprecated.tsx} (100%) diff --git a/src/Pagination.tsx b/src/Pagination_deprecated.tsx similarity index 100% rename from src/Pagination.tsx rename to src/Pagination_deprecated.tsx From 3cfe9381d030aa4f8607ff3930c317acf31d6833 Mon Sep 17 00:00:00 2001 From: wuxh Date: Mon, 20 Nov 2023 03:46:56 +0800 Subject: [PATCH 34/64] chore: rename --- src/{NewPagination.tsx => Pagination.tsx} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename src/{NewPagination.tsx => Pagination.tsx} (100%) diff --git a/src/NewPagination.tsx b/src/Pagination.tsx similarity index 100% rename from src/NewPagination.tsx rename to src/Pagination.tsx From 47d058a3f41f9122b93e7414ff6c46bc85db6113 Mon Sep 17 00:00:00 2001 From: wuxh Date: Mon, 20 Nov 2023 03:48:00 +0800 Subject: [PATCH 35/64] chore: remove simple --- src/Simple.tsx | 23 ----------------------- 1 file changed, 23 deletions(-) delete mode 100644 src/Simple.tsx diff --git a/src/Simple.tsx b/src/Simple.tsx deleted file mode 100644 index f7be0b48..00000000 --- a/src/Simple.tsx +++ /dev/null @@ -1,23 +0,0 @@ -import * as React from 'react'; - -export interface SimpleProps { - slogan?: React.ReactNode; -} - -function Simple(props: React.PropsWithChildren) { - const { children } = props; - - return ( - <> -
    -

    魔法师正在进行最后的仪式,为您带来一项惊艳功能

    - TBD: - To Be Determined... -
    - {children} - - - ); -} - -export default Simple; From 8fcc39667a886ea2fc5faaeb37352835c3b6cd45 Mon Sep 17 00:00:00 2001 From: wuxh Date: Mon, 20 Nov 2023 03:48:14 +0800 Subject: [PATCH 36/64] chore: update default export --- src/index.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/index.ts b/src/index.ts index eaef04eb..47bf73a1 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1 +1,2 @@ export { default } from './Pagination'; +export type { PaginationProps } from './interface'; From f673fadb470157c3a8c9d73f7a0031ffc60304ca Mon Sep 17 00:00:00 2001 From: wuxh Date: Mon, 20 Nov 2023 03:48:55 +0800 Subject: [PATCH 37/64] chore: remove hooks --- src/hooks/usePagination.ts | 73 -------------------------------------- 1 file changed, 73 deletions(-) delete mode 100644 src/hooks/usePagination.ts diff --git a/src/hooks/usePagination.ts b/src/hooks/usePagination.ts deleted file mode 100644 index cc4cfe37..00000000 --- a/src/hooks/usePagination.ts +++ /dev/null @@ -1,73 +0,0 @@ -import useMergedState from 'rc-util/lib/hooks/useMergedState'; - -type ItemType = - | 'prev' - | 'jump-prev' - | 'after-jump-prev' - | 'page' - | 'jump-next' - | 'before-jump-next' - | 'next'; -type ItemRenderType = Exclude< - ItemType, - 'page' | 'before-jump-next' | 'after-jump-prev' ->; - -type UsePaginationProps = { - /** @default 1 */ - total?: number; - current?: number; - /** @default 1 */ - defaultCurrent?: number; - onChange?: (page: number, prevPage: number) => void; - disabled?: boolean; - /** @default false */ - lessItems?: boolean; -}; - -// https://dev.to/namirsab/comment/2050 -const range = (start: number, end: number) => { - const length = end - start + 1; - return Array.from({ length }, (_, i) => start + i); -}; - -const usePagination = (props: UsePaginationProps = {}) => { - const { - total = 0, - defaultCurrent = 1, - current, - onChange, - disabled, - lessItems, - } = props; - - const [innerCurrent, setInnerCurrent] = useMergedState(1, { - value: current, - defaultValue: defaultCurrent, - }); - - const pageBufferSize = lessItems ? 1 : 2; - - let pagerList = []; - - if (total <= 3 + pageBufferSize * 2) { - pagerList = range(1, total); - } - - let left = Math.max(1, innerCurrent - pageBufferSize); - let right = Math.min(innerCurrent + pageBufferSize, total); - - if (innerCurrent - 1 <= pageBufferSize) { - right = 1 + pageBufferSize * 2; - } - - if (total - innerCurrent <= pageBufferSize) { - left = total - pageBufferSize * 2; - } - - const itemList = [ - 'prev', - // ...startPages, - // Start ellipsis - ]; -}; From db552d0dca5e8cba485a6523acd321bae522a475 Mon Sep 17 00:00:00 2001 From: wuxh Date: Mon, 20 Nov 2023 04:02:15 +0800 Subject: [PATCH 38/64] chore: fix compile error --- docs/examples/_debug.tsx | 4 ++-- src/Pagination.tsx | 8 ++++++-- src/Pagination_deprecated.tsx | 4 ---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/docs/examples/_debug.tsx b/docs/examples/_debug.tsx index 91c239a0..b2997936 100644 --- a/docs/examples/_debug.tsx +++ b/docs/examples/_debug.tsx @@ -1,7 +1,7 @@ import React from 'react'; import '../../assets/index.less'; -import Pagination from '../../src/NewPagination'; -import OriginPagination from '../../src/Pagination'; +import Pagination from '../../src/Pagination'; +import OriginPagination from '../../src/Pagination_deprecated'; import type { PaginationProps } from '../../src/interface'; const App = () => { diff --git a/src/Pagination.tsx b/src/Pagination.tsx index 03e73c2b..fd42a3b7 100644 --- a/src/Pagination.tsx +++ b/src/Pagination.tsx @@ -150,13 +150,17 @@ function Pagination(props: PaginationProps) { } } - function handleKeyUp(event: React.KeyboardEvent) { + function handleKeyUp( + event: + | React.KeyboardEvent + | React.ChangeEvent, + ) { const value = getValidValue(event); if (value !== internalInputVal) { setInternalInputVal(value); } - switch (event.keyCode) { + switch ((event as React.KeyboardEvent).keyCode) { case KeyCode.ENTER: handleChange(value); break; diff --git a/src/Pagination_deprecated.tsx b/src/Pagination_deprecated.tsx index b34268d2..3adf879c 100644 --- a/src/Pagination_deprecated.tsx +++ b/src/Pagination_deprecated.tsx @@ -612,8 +612,6 @@ class _Pagination extends React.Component { } lastPager = ( { ); firstPager = ( { const active = current === i; pagerList.push( Date: Mon, 20 Nov 2023 04:28:29 +0800 Subject: [PATCH 39/64] fix: readonly warn --- src/Pagination.tsx | 4 ++-- tests/index.test.js | 9 +++++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/Pagination.tsx b/src/Pagination.tsx index fd42a3b7..c32443ac 100644 --- a/src/Pagination.tsx +++ b/src/Pagination.tsx @@ -94,8 +94,8 @@ function Pagination(props: PaginationProps) { if (process.env.NODE_ENV !== 'production') { warning( - hasCurrent && hasOnChange, - 'Warning: You provided a `current` prop to a Pagination component without an `onChange` handler. This will render a read-only component.', + hasCurrent ? hasOnChange : true, + 'You provided a `current` prop to a Pagination component without an `onChange` handler. This will render a read-only component.', ); } diff --git a/tests/index.test.js b/tests/index.test.js index 6334f3c5..c5f6f31e 100644 --- a/tests/index.test.js +++ b/tests/index.test.js @@ -168,6 +168,15 @@ describe('Uncontrolled Pagination', () => { nextButton.simulate('click'); expect(totalText.text()).toBe('21 - 25 of 25 items'); }); + + it('readonly warning should be displayed', () => { + const warnSpy = jest.spyOn(console, 'error').mockImplementation(() => {}); + mount(); + expect(warnSpy).toHaveBeenCalledWith( + 'Warning: You provided a `current` prop to a Pagination component without an `onChange` handler. This will render a read-only component.', + ); + warnSpy.mockRestore(); + }); }); describe('Controlled Pagination', () => { From cf14695c29203e7834ca3df0636573df156b6472 Mon Sep 17 00:00:00 2001 From: wuxh Date: Mon, 20 Nov 2023 04:47:33 +0800 Subject: [PATCH 40/64] test: add case --- tests/index.test.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/index.test.js b/tests/index.test.js index c5f6f31e..d5eddd2d 100644 --- a/tests/index.test.js +++ b/tests/index.test.js @@ -323,6 +323,7 @@ describe('Other props', () => { describe('current value on onShowSizeChange when total is 0', () => { let wrapper; const onShowSizeChange = jest.fn(); + const onChange = jest.fn(); beforeEach(() => { wrapper = mount( @@ -330,6 +331,7 @@ describe('current value on onShowSizeChange when total is 0', () => { selectComponentClass={Select} showSizeChanger onShowSizeChange={onShowSizeChange} + onChange={onChange} current={1} total={0} showTotal={(total, range) => @@ -342,6 +344,7 @@ describe('current value on onShowSizeChange when total is 0', () => { afterEach(() => { wrapper.unmount(); onShowSizeChange.mockReset(); + onChange.mockReset(); }); it('should call onShowSizeChange when no change', () => { @@ -353,6 +356,7 @@ describe('current value on onShowSizeChange when total is 0', () => { input.simulate('keyDown', { key: 'Down', keyCode: 40, which: 40 }); input.simulate('keyDown', { key: 'Enter', keyCode: 13, which: 13 }); expect(onShowSizeChange).not.toBeCalled(); + expect(onChange).not.toBeCalled(); }); it('current should equal to the current in onShowSizeChange', () => { @@ -366,9 +370,10 @@ describe('current value on onShowSizeChange when total is 0', () => { input.simulate('keyDown', { key: 'Enter', keyCode: 13, which: 13 }); expect(onShowSizeChange).toHaveBeenLastCalledWith( // wrapper.state().current, - 0, + 1, 20, ); + expect(onChange).toHaveBeenLastCalledWith(1, 20); }); it('when total is 0, pager should show `1` and being disabled', () => { From 8be707214715fc6d54852084c90db217feaaa408 Mon Sep 17 00:00:00 2001 From: wuxh Date: Mon, 20 Nov 2023 04:47:53 +0800 Subject: [PATCH 41/64] chore: update debug demo --- docs/examples/_debug.tsx | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/docs/examples/_debug.tsx b/docs/examples/_debug.tsx index b2997936..5eda0f75 100644 --- a/docs/examples/_debug.tsx +++ b/docs/examples/_debug.tsx @@ -1,3 +1,4 @@ +import Select from 'rc-select'; import React from 'react'; import '../../assets/index.less'; import Pagination from '../../src/Pagination'; @@ -9,12 +10,12 @@ const App = () => { const [all, setAll] = React.useState(false); const props: PaginationProps = { - onChange: console.log, - defaultCurrent: 1, - total: 25, - showQuickJumper: { - goButton: true, - }, + selectComponentClass: Select, + showSizeChanger: true, + onShowSizeChange: console.log, + onChange: console.warn, + current: 1, + total: 0, showTotal: (total, range) => `${range[0]} - ${range[1]} of ${total} items`, }; From 3e970f9fa81a13c9fced68638b3fadf9479bafc5 Mon Sep 17 00:00:00 2001 From: wuxh Date: Mon, 20 Nov 2023 10:36:39 +0800 Subject: [PATCH 42/64] fix: onsizeChange --- src/Pagination.tsx | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/src/Pagination.tsx b/src/Pagination.tsx index c32443ac..f35b905b 100644 --- a/src/Pagination.tsx +++ b/src/Pagination.tsx @@ -83,8 +83,8 @@ function Pagination(props: PaginationProps) { const [current, setCurrent] = useMergedState(1, { value: currentProp, defaultValue: defaultCurrent, - postState: (c) => Math.min(c, calculatePage(pageSize, undefined, total)), - onChange: (c) => onChange(c, pageSize), + postState: (c) => + Math.max(1, Math.min(c, calculatePage(undefined, pageSize, total))), }); const [internalInputVal, setInternalInputVal] = React.useState(current); @@ -185,14 +185,10 @@ function Pagination(props: PaginationProps) { current > newCurrent && newCurrent !== 0 ? newCurrent : current; setPageSize(size); - /** - * Not used `setCurrent` here. @see useMergedState - * It is possible that the current has not changed, but the page size has changed. - */ - onChange(nextCurrent, size); - setInternalInputVal(nextCurrent); - onShowSizeChange?.(nextCurrent, size); + onShowSizeChange?.(current, size); + setCurrent(nextCurrent); + onChange?.(nextCurrent, size); } function handleChange(page: number) { @@ -210,6 +206,7 @@ function Pagination(props: PaginationProps) { } setCurrent(newPage); + onChange?.(newPage, pageSize); return newPage; } From 1bf070adafd4693eca8bfdb5c19a13bd40c209d2 Mon Sep 17 00:00:00 2001 From: wuxh Date: Mon, 20 Nov 2023 11:15:02 +0800 Subject: [PATCH 43/64] chore: update --- src/Pagination.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Pagination.tsx b/src/Pagination.tsx index f35b905b..7cee4c49 100644 --- a/src/Pagination.tsx +++ b/src/Pagination.tsx @@ -371,7 +371,6 @@ function Pagination(props: PaginationProps) { disabled={disabled} onKeyDown={handleKeyDown} onKeyUp={handleKeyUp} - // fixme: ts type onChange={handleKeyUp} onBlur={handleBlur} size={3} From bc382ec48bb36f2693ab7d86763de85e0295aeec Mon Sep 17 00:00:00 2001 From: wuxh Date: Mon, 20 Nov 2023 11:28:36 +0800 Subject: [PATCH 44/64] chore: fix TS type --- src/Options.tsx | 26 +++++++++++++------------- src/Pagination.tsx | 1 - src/Pagination_deprecated.tsx | 2 -- 3 files changed, 13 insertions(+), 16 deletions(-) diff --git a/src/Options.tsx b/src/Options.tsx index 86df7eb4..e558e66a 100644 --- a/src/Options.tsx +++ b/src/Options.tsx @@ -1,21 +1,22 @@ +import type { SelectProps } from 'rc-select'; +import type { OptionProps } from 'rc-select/es/Option'; import KEYCODE from 'rc-util/lib/KeyCode'; import React from 'react'; import type { PaginationLocale } from './interface'; interface OptionsProps { - disabled: boolean; + disabled?: boolean; locale: PaginationLocale; rootPrefixCls: string; - selectPrefixCls: string; - current: number; + selectPrefixCls?: string; pageSize: number; - pageSizeOptions: (string | number)[]; - goButton: boolean | string; - changeSize: (size: number) => void; - quickGo: (value: number) => void; + pageSizeOptions?: (string | number)[]; + goButton?: boolean | string; + changeSize?: (size: number) => void; + quickGo?: (value: number) => void; buildOptionText?: (value: string | number) => string; - selectComponentClass: React.ComponentType & { - Option?: React.ComponentType; + selectComponentClass: React.ComponentType> & { + Option?: React.ComponentType>; }; } @@ -50,7 +51,7 @@ function Options(props: OptionsProps) { : (value: string) => `${value} ${locale.items_per_page}`; const changeSizeHandle = (value: number) => { - changeSize(Number(value)); + changeSize?.(Number(value)); }; const handleChange = (e: React.ChangeEvent) => { @@ -69,7 +70,7 @@ function Options(props: OptionsProps) { ) { return; } - quickGo(getValidValue()); + quickGo?.(getValidValue()); }; const go = (e: any) => { @@ -78,7 +79,7 @@ function Options(props: OptionsProps) { } if (e.keyCode === KEYCODE.ENTER || e.type === 'click') { setGoInputText(''); - quickGo(getValidValue()); + quickGo?.(getValidValue()); } }; @@ -123,7 +124,6 @@ function Options(props: OptionsProps) { showSearch={false} className={`${prefixCls}-size-changer`} optionLabelProp="children" - popupMatchSelectWidth={false} value={(pageSize || pageSizeOptions[0]).toString()} onChange={changeSizeHandle} getPopupContainer={(triggerNode) => triggerNode.parentNode} diff --git a/src/Pagination.tsx b/src/Pagination.tsx index 7cee4c49..1d587625 100644 --- a/src/Pagination.tsx +++ b/src/Pagination.tsx @@ -563,7 +563,6 @@ function Pagination(props: PaginationProps) { selectComponentClass={selectComponentClass} selectPrefixCls={selectPrefixCls} changeSize={showSizeChanger ? changePageSize : null} - current={current} pageSize={pageSize} pageSizeOptions={pageSizeOptions} quickGo={shouldDisplayQuickJumper ? handleChange : null} diff --git a/src/Pagination_deprecated.tsx b/src/Pagination_deprecated.tsx index 3adf879c..865ef901 100644 --- a/src/Pagination_deprecated.tsx +++ b/src/Pagination_deprecated.tsx @@ -531,7 +531,6 @@ class _Pagination extends React.Component { selectComponentClass={selectComponentClass} selectPrefixCls={selectPrefixCls} changeSize={this.getShowSizeChanger() ? this.changePageSize : null} - current={current} pageSize={pageSize} pageSizeOptions={pageSizeOptions} quickGo={this.shouldDisplayQuickJumper() ? this.handleChange : null} @@ -740,7 +739,6 @@ class _Pagination extends React.Component { selectComponentClass={selectComponentClass} selectPrefixCls={selectPrefixCls} changeSize={this.getShowSizeChanger() ? this.changePageSize : null} - current={current} pageSize={pageSize} pageSizeOptions={pageSizeOptions} quickGo={this.shouldDisplayQuickJumper() ? this.handleChange : null} From cb88add465ec54115b987506a9a48876b3e78d3d Mon Sep 17 00:00:00 2001 From: wuxh Date: Mon, 20 Nov 2023 11:48:39 +0800 Subject: [PATCH 45/64] chore: update snap --- tests/__snapshots__/demo.test.js.snap | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/__snapshots__/demo.test.js.snap b/tests/__snapshots__/demo.test.js.snap index b04aad6e..ea30afad 100644 --- a/tests/__snapshots__/demo.test.js.snap +++ b/tests/__snapshots__/demo.test.js.snap @@ -6,13 +6,13 @@ exports[`Example controlled 1`] = `""`; -exports[`Example jumper 1`] = `"

    默认

    禁用

    单页默认隐藏

    • 1
    • 10 条/页

    • 1
    • 10 条/页
    "`; +exports[`Example jumper 1`] = `"

    默认

    禁用

    单页默认隐藏

    • 1
    • 10 条/页

    • 1
    • 10 条/页
    "`; -exports[`Example jumperWithGoButton 1`] = `"

    customize node

    default node

    • /5
    • 跳至
    "`; +exports[`Example jumperWithGoButton 1`] = `"

    customize node

    default node

    • /5
    • 跳至
    "`; exports[`Example lessPages 1`] = `"
    Is using icon: true
    "`; -exports[`Example locale 1`] = `""`; +exports[`Example locale 1`] = `""`; exports[`Example more 1`] = `""`; @@ -20,8 +20,8 @@ exports[`Example showTitle 1`] = `"


    • 0 - 0 of 0 items
    • 1
    "`; -exports[`Example simple 1`] = `"
    • /5

    • Total 50 items
    • /5

    • /5
    • 10 条/页
    "`; +exports[`Example simple 1`] = `"
    • /5

    • Total 50 items
    • /5

    • /5
    • 10 条/页
    "`; -exports[`Example sizer 1`] = `"
    "`; +exports[`Example sizer 1`] = `"
    "`; exports[`Example styles 1`] = `""`; From 5df833587de8f6871ff1af773ea7bee0ac890f58 Mon Sep 17 00:00:00 2001 From: wuxh Date: Mon, 20 Nov 2023 13:07:44 +0800 Subject: [PATCH 46/64] =?UTF-8?q?test:=20add=20exhaustive=20testing=20?= =?UTF-8?q?=F0=9F=98=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/__snapshots__/index.test.js.snap | 926 +++++++++++++++++++++++++ tests/index.test.js | 34 + 2 files changed, 960 insertions(+) create mode 100644 tests/__snapshots__/index.test.js.snap diff --git a/tests/__snapshots__/index.test.js.snap b/tests/__snapshots__/index.test.js.snap new file mode 100644 index 00000000..3401e5ed --- /dev/null +++ b/tests/__snapshots__/index.test.js.snap @@ -0,0 +1,926 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[` 1`] = ` +[ + "rc-pagination-prev rc-pagination-disabled", + "rc-pagination-item rc-pagination-item-1 rc-pagination-item-active", + "rc-pagination-item rc-pagination-item-2", + "rc-pagination-item rc-pagination-item-3", + "rc-pagination-next", +] +`; + +exports[` 2`] = ` +[ + "rc-pagination-prev rc-pagination-disabled", + "rc-pagination-item rc-pagination-item-1 rc-pagination-item-active", + "rc-pagination-item rc-pagination-item-2", + "rc-pagination-item rc-pagination-item-3", + "rc-pagination-item rc-pagination-item-4", + "rc-pagination-item rc-pagination-item-5", + "rc-pagination-next", +] +`; + +exports[` 3`] = ` +[ + "rc-pagination-prev rc-pagination-disabled", + "rc-pagination-item rc-pagination-item-1 rc-pagination-item-active", + "rc-pagination-item rc-pagination-item-2", + "rc-pagination-item rc-pagination-item-3", + "rc-pagination-item rc-pagination-item-4", + "rc-pagination-item rc-pagination-item-5", + "rc-pagination-item rc-pagination-item-6", + "rc-pagination-next", + "rc-pagination-options", +] +`; + +exports[` 4`] = ` +[ + "rc-pagination-prev rc-pagination-disabled", + "rc-pagination-item rc-pagination-item-1 rc-pagination-item-active", + "rc-pagination-item rc-pagination-item-2", + "rc-pagination-item rc-pagination-item-3", + "rc-pagination-item rc-pagination-item-4", + "rc-pagination-item rc-pagination-item-5", + "rc-pagination-item rc-pagination-item-6", + "rc-pagination-item rc-pagination-item-7", + "rc-pagination-next", + "rc-pagination-options", +] +`; + +exports[` 5`] = ` +[ + "rc-pagination-prev rc-pagination-disabled", + "rc-pagination-item rc-pagination-item-1 rc-pagination-item-active", + "rc-pagination-item rc-pagination-item-2", + "rc-pagination-item rc-pagination-item-3", + "rc-pagination-item rc-pagination-item-4", + "rc-pagination-item rc-pagination-item-5 rc-pagination-item-before-jump-next", + "rc-pagination-jump-next", + "rc-pagination-item rc-pagination-item-8", + "rc-pagination-next", + "rc-pagination-options", +] +`; + +exports[` 6`] = ` +[ + "rc-pagination-prev rc-pagination-disabled", + "rc-pagination-item rc-pagination-item-1 rc-pagination-item-active", + "rc-pagination-item rc-pagination-item-2", + "rc-pagination-item rc-pagination-item-3", + "rc-pagination-item rc-pagination-item-4", + "rc-pagination-item rc-pagination-item-5 rc-pagination-item-before-jump-next", + "rc-pagination-jump-next", + "rc-pagination-item rc-pagination-item-8", + "rc-pagination-next", + "rc-pagination-options", +] +`; + +exports[` 7`] = ` +[ + "rc-pagination-prev rc-pagination-disabled", + "rc-pagination-item rc-pagination-item-1 rc-pagination-item-active", + "rc-pagination-item rc-pagination-item-2", + "rc-pagination-item rc-pagination-item-3", + "rc-pagination-item rc-pagination-item-4", + "rc-pagination-item rc-pagination-item-5 rc-pagination-item-before-jump-next", + "rc-pagination-jump-next", + "rc-pagination-item rc-pagination-item-10", + "rc-pagination-next", + "rc-pagination-options", +] +`; + +exports[` 8`] = ` +[ + "rc-pagination-prev rc-pagination-disabled", + "rc-pagination-item rc-pagination-item-1 rc-pagination-item-active", + "rc-pagination-item rc-pagination-item-2", + "rc-pagination-item rc-pagination-item-3", + "rc-pagination-item rc-pagination-item-4", + "rc-pagination-item rc-pagination-item-5 rc-pagination-item-before-jump-next", + "rc-pagination-jump-next", + "rc-pagination-item rc-pagination-item-12", + "rc-pagination-next", + "rc-pagination-options", +] +`; + +exports[` 9`] = ` +[ + "rc-pagination-prev rc-pagination-disabled", + "rc-pagination-item rc-pagination-item-1 rc-pagination-item-active", + "rc-pagination-item rc-pagination-item-2", + "rc-pagination-item rc-pagination-item-3", + "rc-pagination-item rc-pagination-item-4", + "rc-pagination-item rc-pagination-item-5 rc-pagination-item-before-jump-next", + "rc-pagination-jump-next", + "rc-pagination-item rc-pagination-item-50", + "rc-pagination-next", + "rc-pagination-options", +] +`; + +exports[`select in sequence should sequence select 25 pages should select page 2 1`] = ` +[ + "rc-pagination-prev", + "rc-pagination-item rc-pagination-item-1", + "rc-pagination-item rc-pagination-item-2 rc-pagination-item-active", + "rc-pagination-item rc-pagination-item-3", + "rc-pagination-next", +] +`; + +exports[`select in sequence should sequence select 25 pages should select page 3 1`] = ` +[ + "rc-pagination-prev", + "rc-pagination-item rc-pagination-item-1", + "rc-pagination-item rc-pagination-item-2", + "rc-pagination-item rc-pagination-item-3 rc-pagination-item-active", + "rc-pagination-next rc-pagination-disabled", +] +`; + +exports[`select in sequence should sequence select 50 pages should select page 2 1`] = ` +[ + "rc-pagination-prev", + "rc-pagination-item rc-pagination-item-1", + "rc-pagination-item rc-pagination-item-2 rc-pagination-item-active", + "rc-pagination-item rc-pagination-item-3", + "rc-pagination-item rc-pagination-item-4", + "rc-pagination-item rc-pagination-item-5", + "rc-pagination-next", +] +`; + +exports[`select in sequence should sequence select 50 pages should select page 3 1`] = ` +[ + "rc-pagination-prev", + "rc-pagination-item rc-pagination-item-1", + "rc-pagination-item rc-pagination-item-2", + "rc-pagination-item rc-pagination-item-3 rc-pagination-item-active", + "rc-pagination-item rc-pagination-item-4", + "rc-pagination-item rc-pagination-item-5", + "rc-pagination-next", +] +`; + +exports[`select in sequence should sequence select 50 pages should select page 4 1`] = ` +[ + "rc-pagination-prev", + "rc-pagination-item rc-pagination-item-1", + "rc-pagination-item rc-pagination-item-2", + "rc-pagination-item rc-pagination-item-3", + "rc-pagination-item rc-pagination-item-4 rc-pagination-item-active", + "rc-pagination-item rc-pagination-item-5", + "rc-pagination-next", +] +`; + +exports[`select in sequence should sequence select 50 pages should select page 5 1`] = ` +[ + "rc-pagination-prev", + "rc-pagination-item rc-pagination-item-1", + "rc-pagination-item rc-pagination-item-2", + "rc-pagination-item rc-pagination-item-3", + "rc-pagination-item rc-pagination-item-4", + "rc-pagination-item rc-pagination-item-5 rc-pagination-item-active", + "rc-pagination-next rc-pagination-disabled", +] +`; + +exports[`select in sequence should sequence select 60 pages should select page 2 1`] = ` +[ + "rc-pagination-prev", + "rc-pagination-item rc-pagination-item-1", + "rc-pagination-item rc-pagination-item-2 rc-pagination-item-active", + "rc-pagination-item rc-pagination-item-3", + "rc-pagination-item rc-pagination-item-4", + "rc-pagination-item rc-pagination-item-5", + "rc-pagination-item rc-pagination-item-6", + "rc-pagination-next", + "rc-pagination-options", +] +`; + +exports[`select in sequence should sequence select 60 pages should select page 3 1`] = ` +[ + "rc-pagination-prev", + "rc-pagination-item rc-pagination-item-1", + "rc-pagination-item rc-pagination-item-2", + "rc-pagination-item rc-pagination-item-3 rc-pagination-item-active", + "rc-pagination-item rc-pagination-item-4", + "rc-pagination-item rc-pagination-item-5", + "rc-pagination-item rc-pagination-item-6", + "rc-pagination-next", + "rc-pagination-options", +] +`; + +exports[`select in sequence should sequence select 60 pages should select page 4 1`] = ` +[ + "rc-pagination-prev", + "rc-pagination-item rc-pagination-item-1", + "rc-pagination-item rc-pagination-item-2", + "rc-pagination-item rc-pagination-item-3", + "rc-pagination-item rc-pagination-item-4 rc-pagination-item-active", + "rc-pagination-item rc-pagination-item-5", + "rc-pagination-item rc-pagination-item-6", + "rc-pagination-next", + "rc-pagination-options", +] +`; + +exports[`select in sequence should sequence select 60 pages should select page 5 1`] = ` +[ + "rc-pagination-prev", + "rc-pagination-item rc-pagination-item-1", + "rc-pagination-item rc-pagination-item-2", + "rc-pagination-item rc-pagination-item-3", + "rc-pagination-item rc-pagination-item-4", + "rc-pagination-item rc-pagination-item-5 rc-pagination-item-active", + "rc-pagination-item rc-pagination-item-6", + "rc-pagination-next", + "rc-pagination-options", +] +`; + +exports[`select in sequence should sequence select 60 pages should select page 6 1`] = ` +[ + "rc-pagination-prev", + "rc-pagination-item rc-pagination-item-1", + "rc-pagination-item rc-pagination-item-2", + "rc-pagination-item rc-pagination-item-3", + "rc-pagination-item rc-pagination-item-4", + "rc-pagination-item rc-pagination-item-5", + "rc-pagination-item rc-pagination-item-6 rc-pagination-item-active", + "rc-pagination-next rc-pagination-disabled", + "rc-pagination-options", +] +`; + +exports[`select in sequence should sequence select 60 pages should select page 7 1`] = ` +[ + "rc-pagination-prev", + "rc-pagination-item rc-pagination-item-1", + "rc-pagination-item rc-pagination-item-2", + "rc-pagination-item rc-pagination-item-3", + "rc-pagination-item rc-pagination-item-4", + "rc-pagination-item rc-pagination-item-5", + "rc-pagination-item rc-pagination-item-6 rc-pagination-item-active", + "rc-pagination-next rc-pagination-disabled", + "rc-pagination-options", +] +`; + +exports[`select in sequence should sequence select 70 pages should select page 2 1`] = ` +[ + "rc-pagination-prev", + "rc-pagination-item rc-pagination-item-1", + "rc-pagination-item rc-pagination-item-2 rc-pagination-item-active", + "rc-pagination-item rc-pagination-item-3", + "rc-pagination-item rc-pagination-item-4", + "rc-pagination-item rc-pagination-item-5", + "rc-pagination-item rc-pagination-item-6", + "rc-pagination-item rc-pagination-item-7", + "rc-pagination-next", + "rc-pagination-options", +] +`; + +exports[`select in sequence should sequence select 70 pages should select page 3 1`] = ` +[ + "rc-pagination-prev", + "rc-pagination-item rc-pagination-item-1", + "rc-pagination-item rc-pagination-item-2", + "rc-pagination-item rc-pagination-item-3 rc-pagination-item-active", + "rc-pagination-item rc-pagination-item-4", + "rc-pagination-item rc-pagination-item-5", + "rc-pagination-item rc-pagination-item-6", + "rc-pagination-item rc-pagination-item-7", + "rc-pagination-next", + "rc-pagination-options", +] +`; + +exports[`select in sequence should sequence select 70 pages should select page 4 1`] = ` +[ + "rc-pagination-prev", + "rc-pagination-item rc-pagination-item-1", + "rc-pagination-item rc-pagination-item-2", + "rc-pagination-item rc-pagination-item-3", + "rc-pagination-item rc-pagination-item-4 rc-pagination-item-active", + "rc-pagination-item rc-pagination-item-5", + "rc-pagination-item rc-pagination-item-6", + "rc-pagination-item rc-pagination-item-7", + "rc-pagination-next", + "rc-pagination-options", +] +`; + +exports[`select in sequence should sequence select 70 pages should select page 5 1`] = ` +[ + "rc-pagination-prev", + "rc-pagination-item rc-pagination-item-1", + "rc-pagination-item rc-pagination-item-2", + "rc-pagination-item rc-pagination-item-3", + "rc-pagination-item rc-pagination-item-4", + "rc-pagination-item rc-pagination-item-5 rc-pagination-item-active", + "rc-pagination-item rc-pagination-item-6", + "rc-pagination-item rc-pagination-item-7", + "rc-pagination-next", + "rc-pagination-options", +] +`; + +exports[`select in sequence should sequence select 70 pages should select page 6 1`] = ` +[ + "rc-pagination-prev", + "rc-pagination-item rc-pagination-item-1", + "rc-pagination-item rc-pagination-item-2", + "rc-pagination-item rc-pagination-item-3", + "rc-pagination-item rc-pagination-item-4", + "rc-pagination-item rc-pagination-item-5", + "rc-pagination-item rc-pagination-item-6 rc-pagination-item-active", + "rc-pagination-item rc-pagination-item-7", + "rc-pagination-next", + "rc-pagination-options", +] +`; + +exports[`select in sequence should sequence select 70 pages should select page 7 1`] = ` +[ + "rc-pagination-prev", + "rc-pagination-item rc-pagination-item-1", + "rc-pagination-item rc-pagination-item-2", + "rc-pagination-item rc-pagination-item-3", + "rc-pagination-item rc-pagination-item-4", + "rc-pagination-item rc-pagination-item-5", + "rc-pagination-item rc-pagination-item-6", + "rc-pagination-item rc-pagination-item-7 rc-pagination-item-active", + "rc-pagination-next rc-pagination-disabled", + "rc-pagination-options", +] +`; + +exports[`select in sequence should sequence select 70 pages should select page 8 1`] = ` +[ + "rc-pagination-prev", + "rc-pagination-item rc-pagination-item-1", + "rc-pagination-item rc-pagination-item-2", + "rc-pagination-item rc-pagination-item-3", + "rc-pagination-item rc-pagination-item-4", + "rc-pagination-item rc-pagination-item-5", + "rc-pagination-item rc-pagination-item-6", + "rc-pagination-item rc-pagination-item-7 rc-pagination-item-active", + "rc-pagination-next rc-pagination-disabled", + "rc-pagination-options", +] +`; + +exports[`select in sequence should sequence select 80 pages should select page 2 1`] = ` +[ + "rc-pagination-prev", + "rc-pagination-item rc-pagination-item-1", + "rc-pagination-item rc-pagination-item-2 rc-pagination-item-active", + "rc-pagination-item rc-pagination-item-3", + "rc-pagination-item rc-pagination-item-4", + "rc-pagination-item rc-pagination-item-5 rc-pagination-item-before-jump-next", + "rc-pagination-jump-next", + "rc-pagination-item rc-pagination-item-8", + "rc-pagination-next", + "rc-pagination-options", +] +`; + +exports[`select in sequence should sequence select 80 pages should select page 2 2`] = ` +[ + "rc-pagination-prev", + "rc-pagination-item rc-pagination-item-1", + "rc-pagination-item rc-pagination-item-2 rc-pagination-item-active", + "rc-pagination-item rc-pagination-item-3", + "rc-pagination-item rc-pagination-item-4", + "rc-pagination-item rc-pagination-item-5 rc-pagination-item-before-jump-next", + "rc-pagination-jump-next", + "rc-pagination-item rc-pagination-item-8", + "rc-pagination-next", + "rc-pagination-options", +] +`; + +exports[`select in sequence should sequence select 80 pages should select page 3 1`] = ` +[ + "rc-pagination-prev", + "rc-pagination-item rc-pagination-item-1", + "rc-pagination-item rc-pagination-item-2", + "rc-pagination-item rc-pagination-item-3 rc-pagination-item-active", + "rc-pagination-item rc-pagination-item-4", + "rc-pagination-item rc-pagination-item-5 rc-pagination-item-before-jump-next", + "rc-pagination-jump-next", + "rc-pagination-item rc-pagination-item-8", + "rc-pagination-next", + "rc-pagination-options", +] +`; + +exports[`select in sequence should sequence select 80 pages should select page 3 2`] = ` +[ + "rc-pagination-prev", + "rc-pagination-item rc-pagination-item-1", + "rc-pagination-item rc-pagination-item-2", + "rc-pagination-item rc-pagination-item-3 rc-pagination-item-active", + "rc-pagination-item rc-pagination-item-4", + "rc-pagination-item rc-pagination-item-5 rc-pagination-item-before-jump-next", + "rc-pagination-jump-next", + "rc-pagination-item rc-pagination-item-8", + "rc-pagination-next", + "rc-pagination-options", +] +`; + +exports[`select in sequence should sequence select 80 pages should select page 4 1`] = ` +[ + "rc-pagination-prev", + "rc-pagination-item rc-pagination-item-1", + "rc-pagination-item rc-pagination-item-2", + "rc-pagination-item rc-pagination-item-3", + "rc-pagination-item rc-pagination-item-4 rc-pagination-item-active", + "rc-pagination-item rc-pagination-item-5", + "rc-pagination-item rc-pagination-item-6 rc-pagination-item-before-jump-next", + "rc-pagination-jump-next", + "rc-pagination-item rc-pagination-item-8", + "rc-pagination-next", + "rc-pagination-options", +] +`; + +exports[`select in sequence should sequence select 80 pages should select page 4 2`] = ` +[ + "rc-pagination-prev", + "rc-pagination-item rc-pagination-item-1", + "rc-pagination-item rc-pagination-item-2", + "rc-pagination-item rc-pagination-item-3", + "rc-pagination-item rc-pagination-item-4 rc-pagination-item-active", + "rc-pagination-item rc-pagination-item-5", + "rc-pagination-item rc-pagination-item-6 rc-pagination-item-before-jump-next", + "rc-pagination-jump-next", + "rc-pagination-item rc-pagination-item-8", + "rc-pagination-next", + "rc-pagination-options", +] +`; + +exports[`select in sequence should sequence select 80 pages should select page 5 1`] = ` +[ + "rc-pagination-prev", + "rc-pagination-item rc-pagination-item-1", + "rc-pagination-jump-prev", + "rc-pagination-item rc-pagination-item-3 rc-pagination-item-after-jump-prev", + "rc-pagination-item rc-pagination-item-4", + "rc-pagination-item rc-pagination-item-5 rc-pagination-item-active", + "rc-pagination-item rc-pagination-item-6", + "rc-pagination-item rc-pagination-item-7", + "rc-pagination-item rc-pagination-item-8", + "rc-pagination-next", + "rc-pagination-options", +] +`; + +exports[`select in sequence should sequence select 80 pages should select page 5 2`] = ` +[ + "rc-pagination-prev", + "rc-pagination-item rc-pagination-item-1", + "rc-pagination-jump-prev", + "rc-pagination-item rc-pagination-item-3 rc-pagination-item-after-jump-prev", + "rc-pagination-item rc-pagination-item-4", + "rc-pagination-item rc-pagination-item-5 rc-pagination-item-active", + "rc-pagination-item rc-pagination-item-6", + "rc-pagination-item rc-pagination-item-7", + "rc-pagination-item rc-pagination-item-8", + "rc-pagination-next", + "rc-pagination-options", +] +`; + +exports[`select in sequence should sequence select 80 pages should select page 6 1`] = ` +[ + "rc-pagination-prev", + "rc-pagination-item rc-pagination-item-1", + "rc-pagination-jump-prev", + "rc-pagination-item rc-pagination-item-3 rc-pagination-item-after-jump-prev", + "rc-pagination-item rc-pagination-item-4", + "rc-pagination-item rc-pagination-item-5 rc-pagination-item-active", + "rc-pagination-item rc-pagination-item-6", + "rc-pagination-item rc-pagination-item-7", + "rc-pagination-item rc-pagination-item-8", + "rc-pagination-next", + "rc-pagination-options", +] +`; + +exports[`select in sequence should sequence select 80 pages should select page 6 2`] = ` +[ + "rc-pagination-prev", + "rc-pagination-item rc-pagination-item-1", + "rc-pagination-jump-prev", + "rc-pagination-item rc-pagination-item-3 rc-pagination-item-after-jump-prev", + "rc-pagination-item rc-pagination-item-4", + "rc-pagination-item rc-pagination-item-5 rc-pagination-item-active", + "rc-pagination-item rc-pagination-item-6", + "rc-pagination-item rc-pagination-item-7", + "rc-pagination-item rc-pagination-item-8", + "rc-pagination-next", + "rc-pagination-options", +] +`; + +exports[`select in sequence should sequence select 80 pages should select page 7 1`] = ` +[ + "rc-pagination-prev", + "rc-pagination-item rc-pagination-item-1", + "rc-pagination-jump-prev", + "rc-pagination-item rc-pagination-item-4 rc-pagination-item-after-jump-prev", + "rc-pagination-item rc-pagination-item-5", + "rc-pagination-item rc-pagination-item-6", + "rc-pagination-item rc-pagination-item-7", + "rc-pagination-item rc-pagination-item-8 rc-pagination-item-active", + "rc-pagination-next rc-pagination-disabled", + "rc-pagination-options", +] +`; + +exports[`select in sequence should sequence select 80 pages should select page 7 2`] = ` +[ + "rc-pagination-prev", + "rc-pagination-item rc-pagination-item-1", + "rc-pagination-jump-prev", + "rc-pagination-item rc-pagination-item-4 rc-pagination-item-after-jump-prev", + "rc-pagination-item rc-pagination-item-5", + "rc-pagination-item rc-pagination-item-6", + "rc-pagination-item rc-pagination-item-7", + "rc-pagination-item rc-pagination-item-8 rc-pagination-item-active", + "rc-pagination-next rc-pagination-disabled", + "rc-pagination-options", +] +`; + +exports[`select in sequence should sequence select 80 pages should select page 8 1`] = ` +[ + "rc-pagination-prev", + "rc-pagination-item rc-pagination-item-1", + "rc-pagination-jump-prev", + "rc-pagination-item rc-pagination-item-4 rc-pagination-item-after-jump-prev", + "rc-pagination-item rc-pagination-item-5", + "rc-pagination-item rc-pagination-item-6", + "rc-pagination-item rc-pagination-item-7", + "rc-pagination-item rc-pagination-item-8 rc-pagination-item-active", + "rc-pagination-next rc-pagination-disabled", + "rc-pagination-options", +] +`; + +exports[`select in sequence should sequence select 80 pages should select page 8 2`] = ` +[ + "rc-pagination-prev", + "rc-pagination-item rc-pagination-item-1", + "rc-pagination-jump-prev", + "rc-pagination-item rc-pagination-item-4 rc-pagination-item-after-jump-prev", + "rc-pagination-item rc-pagination-item-5", + "rc-pagination-item rc-pagination-item-6", + "rc-pagination-item rc-pagination-item-7", + "rc-pagination-item rc-pagination-item-8 rc-pagination-item-active", + "rc-pagination-next rc-pagination-disabled", + "rc-pagination-options", +] +`; + +exports[`select in sequence should sequence select 100 pages should select page 2 1`] = ` +[ + "rc-pagination-prev", + "rc-pagination-item rc-pagination-item-1", + "rc-pagination-item rc-pagination-item-2 rc-pagination-item-active", + "rc-pagination-item rc-pagination-item-3", + "rc-pagination-item rc-pagination-item-4", + "rc-pagination-item rc-pagination-item-5 rc-pagination-item-before-jump-next", + "rc-pagination-jump-next", + "rc-pagination-item rc-pagination-item-10", + "rc-pagination-next", + "rc-pagination-options", +] +`; + +exports[`select in sequence should sequence select 100 pages should select page 3 1`] = ` +[ + "rc-pagination-prev", + "rc-pagination-item rc-pagination-item-1", + "rc-pagination-item rc-pagination-item-2", + "rc-pagination-item rc-pagination-item-3 rc-pagination-item-active", + "rc-pagination-item rc-pagination-item-4", + "rc-pagination-item rc-pagination-item-5 rc-pagination-item-before-jump-next", + "rc-pagination-jump-next", + "rc-pagination-item rc-pagination-item-10", + "rc-pagination-next", + "rc-pagination-options", +] +`; + +exports[`select in sequence should sequence select 100 pages should select page 4 1`] = ` +[ + "rc-pagination-prev", + "rc-pagination-item rc-pagination-item-1", + "rc-pagination-item rc-pagination-item-2", + "rc-pagination-item rc-pagination-item-3", + "rc-pagination-item rc-pagination-item-4 rc-pagination-item-active", + "rc-pagination-item rc-pagination-item-5", + "rc-pagination-item rc-pagination-item-6 rc-pagination-item-before-jump-next", + "rc-pagination-jump-next", + "rc-pagination-item rc-pagination-item-10", + "rc-pagination-next", + "rc-pagination-options", +] +`; + +exports[`select in sequence should sequence select 100 pages should select page 5 1`] = ` +[ + "rc-pagination-prev", + "rc-pagination-item rc-pagination-item-1", + "rc-pagination-jump-prev", + "rc-pagination-item rc-pagination-item-3 rc-pagination-item-after-jump-prev", + "rc-pagination-item rc-pagination-item-4", + "rc-pagination-item rc-pagination-item-5 rc-pagination-item-active", + "rc-pagination-item rc-pagination-item-6", + "rc-pagination-item rc-pagination-item-7 rc-pagination-item-before-jump-next", + "rc-pagination-jump-next", + "rc-pagination-item rc-pagination-item-10", + "rc-pagination-next", + "rc-pagination-options", +] +`; + +exports[`select in sequence should sequence select 100 pages should select page 6 1`] = ` +[ + "rc-pagination-prev", + "rc-pagination-item rc-pagination-item-1", + "rc-pagination-jump-prev", + "rc-pagination-item rc-pagination-item-6 rc-pagination-item-after-jump-prev", + "rc-pagination-item rc-pagination-item-7", + "rc-pagination-item rc-pagination-item-8", + "rc-pagination-item rc-pagination-item-9", + "rc-pagination-item rc-pagination-item-10 rc-pagination-item-active", + "rc-pagination-next rc-pagination-disabled", + "rc-pagination-options", +] +`; + +exports[`select in sequence should sequence select 100 pages should select page 7 1`] = ` +[ + "rc-pagination-prev", + "rc-pagination-item rc-pagination-item-1", + "rc-pagination-jump-prev", + "rc-pagination-item rc-pagination-item-6 rc-pagination-item-after-jump-prev", + "rc-pagination-item rc-pagination-item-7", + "rc-pagination-item rc-pagination-item-8", + "rc-pagination-item rc-pagination-item-9", + "rc-pagination-item rc-pagination-item-10 rc-pagination-item-active", + "rc-pagination-next rc-pagination-disabled", + "rc-pagination-options", +] +`; + +exports[`select in sequence should sequence select 100 pages should select page 8 1`] = ` +[ + "rc-pagination-prev", + "rc-pagination-item rc-pagination-item-1", + "rc-pagination-jump-prev", + "rc-pagination-item rc-pagination-item-6 rc-pagination-item-after-jump-prev", + "rc-pagination-item rc-pagination-item-7", + "rc-pagination-item rc-pagination-item-8", + "rc-pagination-item rc-pagination-item-9", + "rc-pagination-item rc-pagination-item-10 rc-pagination-item-active", + "rc-pagination-next rc-pagination-disabled", + "rc-pagination-options", +] +`; + +exports[`select in sequence should sequence select 120 pages should select page 2 1`] = ` +[ + "rc-pagination-prev", + "rc-pagination-item rc-pagination-item-1", + "rc-pagination-item rc-pagination-item-2 rc-pagination-item-active", + "rc-pagination-item rc-pagination-item-3", + "rc-pagination-item rc-pagination-item-4", + "rc-pagination-item rc-pagination-item-5 rc-pagination-item-before-jump-next", + "rc-pagination-jump-next", + "rc-pagination-item rc-pagination-item-12", + "rc-pagination-next", + "rc-pagination-options", +] +`; + +exports[`select in sequence should sequence select 120 pages should select page 3 1`] = ` +[ + "rc-pagination-prev", + "rc-pagination-item rc-pagination-item-1", + "rc-pagination-item rc-pagination-item-2", + "rc-pagination-item rc-pagination-item-3 rc-pagination-item-active", + "rc-pagination-item rc-pagination-item-4", + "rc-pagination-item rc-pagination-item-5 rc-pagination-item-before-jump-next", + "rc-pagination-jump-next", + "rc-pagination-item rc-pagination-item-12", + "rc-pagination-next", + "rc-pagination-options", +] +`; + +exports[`select in sequence should sequence select 120 pages should select page 4 1`] = ` +[ + "rc-pagination-prev", + "rc-pagination-item rc-pagination-item-1", + "rc-pagination-item rc-pagination-item-2", + "rc-pagination-item rc-pagination-item-3", + "rc-pagination-item rc-pagination-item-4 rc-pagination-item-active", + "rc-pagination-item rc-pagination-item-5", + "rc-pagination-item rc-pagination-item-6 rc-pagination-item-before-jump-next", + "rc-pagination-jump-next", + "rc-pagination-item rc-pagination-item-12", + "rc-pagination-next", + "rc-pagination-options", +] +`; + +exports[`select in sequence should sequence select 120 pages should select page 5 1`] = ` +[ + "rc-pagination-prev", + "rc-pagination-item rc-pagination-item-1", + "rc-pagination-jump-prev", + "rc-pagination-item rc-pagination-item-3 rc-pagination-item-after-jump-prev", + "rc-pagination-item rc-pagination-item-4", + "rc-pagination-item rc-pagination-item-5 rc-pagination-item-active", + "rc-pagination-item rc-pagination-item-6", + "rc-pagination-item rc-pagination-item-7 rc-pagination-item-before-jump-next", + "rc-pagination-jump-next", + "rc-pagination-item rc-pagination-item-12", + "rc-pagination-next", + "rc-pagination-options", +] +`; + +exports[`select in sequence should sequence select 120 pages should select page 6 1`] = ` +[ + "rc-pagination-prev", + "rc-pagination-item rc-pagination-item-1", + "rc-pagination-jump-prev", + "rc-pagination-item rc-pagination-item-8 rc-pagination-item-after-jump-prev", + "rc-pagination-item rc-pagination-item-9", + "rc-pagination-item rc-pagination-item-10 rc-pagination-item-active", + "rc-pagination-item rc-pagination-item-11", + "rc-pagination-item rc-pagination-item-12", + "rc-pagination-next", + "rc-pagination-options", +] +`; + +exports[`select in sequence should sequence select 120 pages should select page 7 1`] = ` +[ + "rc-pagination-prev", + "rc-pagination-item rc-pagination-item-1", + "rc-pagination-jump-prev", + "rc-pagination-item rc-pagination-item-8 rc-pagination-item-after-jump-prev", + "rc-pagination-item rc-pagination-item-9", + "rc-pagination-item rc-pagination-item-10", + "rc-pagination-item rc-pagination-item-11", + "rc-pagination-item rc-pagination-item-12 rc-pagination-item-active", + "rc-pagination-next rc-pagination-disabled", + "rc-pagination-options", +] +`; + +exports[`select in sequence should sequence select 120 pages should select page 8 1`] = ` +[ + "rc-pagination-prev", + "rc-pagination-item rc-pagination-item-1", + "rc-pagination-jump-prev", + "rc-pagination-item rc-pagination-item-8 rc-pagination-item-after-jump-prev", + "rc-pagination-item rc-pagination-item-9", + "rc-pagination-item rc-pagination-item-10", + "rc-pagination-item rc-pagination-item-11", + "rc-pagination-item rc-pagination-item-12 rc-pagination-item-active", + "rc-pagination-next rc-pagination-disabled", + "rc-pagination-options", +] +`; + +exports[`select in sequence should sequence select 500 pages should select page 2 1`] = ` +[ + "rc-pagination-prev", + "rc-pagination-item rc-pagination-item-1", + "rc-pagination-item rc-pagination-item-2 rc-pagination-item-active", + "rc-pagination-item rc-pagination-item-3", + "rc-pagination-item rc-pagination-item-4", + "rc-pagination-item rc-pagination-item-5 rc-pagination-item-before-jump-next", + "rc-pagination-jump-next", + "rc-pagination-item rc-pagination-item-50", + "rc-pagination-next", + "rc-pagination-options", +] +`; + +exports[`select in sequence should sequence select 500 pages should select page 3 1`] = ` +[ + "rc-pagination-prev", + "rc-pagination-item rc-pagination-item-1", + "rc-pagination-item rc-pagination-item-2", + "rc-pagination-item rc-pagination-item-3 rc-pagination-item-active", + "rc-pagination-item rc-pagination-item-4", + "rc-pagination-item rc-pagination-item-5 rc-pagination-item-before-jump-next", + "rc-pagination-jump-next", + "rc-pagination-item rc-pagination-item-50", + "rc-pagination-next", + "rc-pagination-options", +] +`; + +exports[`select in sequence should sequence select 500 pages should select page 4 1`] = ` +[ + "rc-pagination-prev", + "rc-pagination-item rc-pagination-item-1", + "rc-pagination-item rc-pagination-item-2", + "rc-pagination-item rc-pagination-item-3", + "rc-pagination-item rc-pagination-item-4 rc-pagination-item-active", + "rc-pagination-item rc-pagination-item-5", + "rc-pagination-item rc-pagination-item-6 rc-pagination-item-before-jump-next", + "rc-pagination-jump-next", + "rc-pagination-item rc-pagination-item-50", + "rc-pagination-next", + "rc-pagination-options", +] +`; + +exports[`select in sequence should sequence select 500 pages should select page 5 1`] = ` +[ + "rc-pagination-prev", + "rc-pagination-item rc-pagination-item-1", + "rc-pagination-jump-prev", + "rc-pagination-item rc-pagination-item-3 rc-pagination-item-after-jump-prev", + "rc-pagination-item rc-pagination-item-4", + "rc-pagination-item rc-pagination-item-5 rc-pagination-item-active", + "rc-pagination-item rc-pagination-item-6", + "rc-pagination-item rc-pagination-item-7 rc-pagination-item-before-jump-next", + "rc-pagination-jump-next", + "rc-pagination-item rc-pagination-item-50", + "rc-pagination-next", + "rc-pagination-options", +] +`; + +exports[`select in sequence should sequence select 500 pages should select page 6 1`] = ` +[ + "rc-pagination-prev", + "rc-pagination-item rc-pagination-item-1", + "rc-pagination-jump-prev", + "rc-pagination-item rc-pagination-item-8 rc-pagination-item-after-jump-prev", + "rc-pagination-item rc-pagination-item-9", + "rc-pagination-item rc-pagination-item-10 rc-pagination-item-active", + "rc-pagination-item rc-pagination-item-11", + "rc-pagination-item rc-pagination-item-12 rc-pagination-item-before-jump-next", + "rc-pagination-jump-next", + "rc-pagination-item rc-pagination-item-50", + "rc-pagination-next", + "rc-pagination-options", +] +`; + +exports[`select in sequence should sequence select 500 pages should select page 7 1`] = ` +[ + "rc-pagination-prev", + "rc-pagination-item rc-pagination-item-1", + "rc-pagination-jump-prev", + "rc-pagination-item rc-pagination-item-46 rc-pagination-item-after-jump-prev", + "rc-pagination-item rc-pagination-item-47", + "rc-pagination-item rc-pagination-item-48", + "rc-pagination-item rc-pagination-item-49", + "rc-pagination-item rc-pagination-item-50 rc-pagination-item-active", + "rc-pagination-next rc-pagination-disabled", + "rc-pagination-options", +] +`; + +exports[`select in sequence should sequence select 500 pages should select page 8 1`] = ` +[ + "rc-pagination-prev", + "rc-pagination-item rc-pagination-item-1", + "rc-pagination-jump-prev", + "rc-pagination-item rc-pagination-item-46 rc-pagination-item-after-jump-prev", + "rc-pagination-item rc-pagination-item-47", + "rc-pagination-item rc-pagination-item-48", + "rc-pagination-item rc-pagination-item-49", + "rc-pagination-item rc-pagination-item-50 rc-pagination-item-active", + "rc-pagination-next rc-pagination-disabled", + "rc-pagination-options", +] +`; diff --git a/tests/index.test.js b/tests/index.test.js index d5eddd2d..3750f553 100644 --- a/tests/index.test.js +++ b/tests/index.test.js @@ -470,3 +470,37 @@ describe('should emit onChange when total is string', () => { expect(onChange).toBeCalledWith(3, 10); }); }); + +describe('select in sequence', () => { + const serializeCls = (items) => items.map((item) => item.prop('className')); + + function sequenceSelector(total) { + describe(`should sequence select ${total} pages`, () => { + const wrapper = mount(); + const items = wrapper.find('li'); + const cls = serializeCls(items); + + expect(cls).toMatchSnapshot(); + + for (let i = 2; i < items.length - 1; i++) { + it(`should select page ${i}`, () => { + items.at(i).simulate('click'); + const newItems = wrapper.find('li'); + const newCls = serializeCls(newItems); + expect(newCls).toMatchSnapshot(); + }); + } + }); + } + + // coped examples/basic.tsx + sequenceSelector(25); + sequenceSelector(50); + sequenceSelector(60); + sequenceSelector(70); + sequenceSelector(80); + sequenceSelector(80); + sequenceSelector(100); + sequenceSelector(120); + sequenceSelector(500); +}); From 9f72ed956641a55ce044a7832339fb3f1590fdc2 Mon Sep 17 00:00:00 2001 From: wuxh Date: Mon, 20 Nov 2023 13:20:49 +0800 Subject: [PATCH 47/64] chore: update collectCoverageFrom --- jest.config.js | 1 + 1 file changed, 1 insertion(+) diff --git a/jest.config.js b/jest.config.js index cdd7872b..4453ec07 100644 --- a/jest.config.js +++ b/jest.config.js @@ -5,4 +5,5 @@ module.exports = { [pkg.name]: '/src/index.ts', '\\.less$': 'identity-obj-proxy', }, + collectCoverageFrom: ['src/**', '!src/Pagination_deprecated.tsx'], }; From 88f8ad9433da8fb583b7a10b31824e2cb8220044 Mon Sep 17 00:00:00 2001 From: wuxh Date: Mon, 20 Nov 2023 13:38:42 +0800 Subject: [PATCH 48/64] test: add case --- tests/jumper.test.js | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/tests/jumper.test.js b/tests/jumper.test.js index 8acc6c86..f4370cc4 100644 --- a/tests/jumper.test.js +++ b/tests/jumper.test.js @@ -67,6 +67,33 @@ describe('Pagination with jumper', () => { expect(input.instance().value).toBe(''); expect(onChange).not.toBeCalled(); }); + + it('should not jump when input empty string', () => { + const onChange = jest.fn(); + const wrapper = mount( + + go + + ), + }} + />, + ); + const quickJumper = wrapper.find('.rc-pagination-options-quick-jumper'); + const input = quickJumper.find('input'); + const goButton = quickJumper.find('.go-button'); + input.simulate('change', { target: { value: '3' } }); + goButton.simulate('click'); + expect(wrapper.find('.rc-pagination-item-active').text()).toBe('3'); + input.simulate('change', { target: { value: '' } }); + goButton.simulate('click'); + expect(wrapper.find('.rc-pagination-item-active').text()).toBe('3'); + expect(onChange).toHaveBeenLastCalledWith(3, 10); + }); }); describe('simple quick jumper', () => { From 80655eb1a32325d17d5852c3d0ff752ed027b774 Mon Sep 17 00:00:00 2001 From: wuxh Date: Mon, 20 Nov 2023 13:47:23 +0800 Subject: [PATCH 49/64] test: add case --- tests/index.test.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/index.test.js b/tests/index.test.js index 3750f553..b313acad 100644 --- a/tests/index.test.js +++ b/tests/index.test.js @@ -177,6 +177,14 @@ describe('Uncontrolled Pagination', () => { ); warnSpy.mockRestore(); }); + + it('should response keyboard event', () => { + const pagers = wrapper.find('.rc-pagination-item'); + const page2 = pagers.at(2); + page2.simulate('keyDown', { key: 'Enter', keyCode: 13, which: 13 }); + expect(wrapper.find('.rc-pagination-item-active').text()).toBe('3'); + expect(onChange).toHaveBeenLastCalledWith(3, 10); + }); }); describe('Controlled Pagination', () => { From f68d85868c8604e5a2e933b57dbf1d003f69d8a7 Mon Sep 17 00:00:00 2001 From: wuxh Date: Mon, 20 Nov 2023 13:47:46 +0800 Subject: [PATCH 50/64] feat: replace keyPress to keyDown --- src/Pager.tsx | 2 +- src/Pagination.tsx | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/Pager.tsx b/src/Pager.tsx index a95d612d..41d2e2b2 100644 --- a/src/Pager.tsx +++ b/src/Pager.tsx @@ -55,7 +55,7 @@ const Pager: React.FC = (props) => { title={showTitle ? String(page) : null} className={cls} onClick={handleClick} - onKeyPress={handleKeyPress} + onKeyDown={handleKeyPress} tabIndex={0} > {pager} diff --git a/src/Pagination.tsx b/src/Pagination.tsx index 1d587625..66cda6c2 100644 --- a/src/Pagination.tsx +++ b/src/Pagination.tsx @@ -1,14 +1,14 @@ import classNames from 'classnames'; -import KeyCode from 'rc-util/lib/KeyCode'; import useMergedState from 'rc-util/lib/hooks/useMergedState'; +import KeyCode from 'rc-util/lib/KeyCode'; import pickAttrs from 'rc-util/lib/pickAttrs'; import warning from 'rc-util/lib/warning'; import React from 'react'; +import type { PaginationProps } from './interface'; +import zhCN from './locale/zh_CN'; import Options from './Options'; import type { PagerProps } from './Pager'; import Pager from './Pager'; -import type { PaginationProps } from './interface'; -import zhCN from './locale/zh_CN'; const defaultItemRender: PaginationProps['itemRender'] = ( page, @@ -422,7 +422,7 @@ function Pagination(props: PaginationProps) { key="prev" onClick={jumpPrevHandle} tabIndex={0} - onKeyPress={runIfEnterJumpPrev} + onKeyDown={runIfEnterJumpPrev} className={classNames(`${prefixCls}-jump-prev`, { [`${prefixCls}-jump-prev-custom-icon`]: !!jumpPrevIcon, })} @@ -437,7 +437,7 @@ function Pagination(props: PaginationProps) { key="next" onClick={jumpNextHandle} tabIndex={0} - onKeyPress={runIfEnterJumpNext} + onKeyDown={runIfEnterJumpNext} className={classNames(`${prefixCls}-jump-next`, { [`${prefixCls}-jump-next-custom-icon`]: !!jumpNextIcon, })} @@ -501,7 +501,7 @@ function Pagination(props: PaginationProps) { title={showTitle ? locale.prev_page : null} onClick={prevHandle} tabIndex={prevDisabled ? null : 0} - onKeyPress={runIfEnterPrev} + onKeyDown={runIfEnterPrev} className={classNames(`${prefixCls}-prev`, { [`${prefixCls}-disabled`]: prevDisabled, })} @@ -529,7 +529,7 @@ function Pagination(props: PaginationProps) { title={showTitle ? locale.next_page : null} onClick={nextHandle} tabIndex={nextTabIndex} - onKeyPress={runIfEnterNext} + onKeyDown={runIfEnterNext} className={classNames(`${prefixCls}-next`, { [`${prefixCls}-disabled`]: nextDisabled, })} From b47880a2ac65f37d3ba29fecbb0f58dc70f46f48 Mon Sep 17 00:00:00 2001 From: wuxh Date: Mon, 20 Nov 2023 13:56:37 +0800 Subject: [PATCH 51/64] chore: update note --- src/Pagination_deprecated.tsx | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/Pagination_deprecated.tsx b/src/Pagination_deprecated.tsx index 865ef901..7b2d038e 100644 --- a/src/Pagination_deprecated.tsx +++ b/src/Pagination_deprecated.tsx @@ -2,10 +2,10 @@ import classNames from 'classnames'; import KEYCODE from 'rc-util/lib/KeyCode'; import pickAttrs from 'rc-util/lib/pickAttrs'; import React, { cloneElement, isValidElement } from 'react'; -import Options from './Options'; -import Pager from './Pager'; import type { PaginationProps, PaginationState } from './interface'; import LOCALE from './locale/zh_CN'; +import Options from './Options'; +import Pager from './Pager'; function noop() {} @@ -38,7 +38,12 @@ function calculatePage( } /** - * @deprecated use `Pagination` instead. + * @summary This is a deprecated component. Do not use it. + * @since 3.8.0 below + * @deprecated use `Pagination` instead. next minor version will remove + * @description + * I'm a little concerned that there aren't enough test cases to support refactoring😭 + * So I keep the old code here. */ class _Pagination extends React.Component { static defaultProps = { From d6067297a4932fd2891491de908b1764fe5c638c Mon Sep 17 00:00:00 2001 From: wuxh Date: Mon, 20 Nov 2023 14:02:34 +0800 Subject: [PATCH 52/64] test: add case --- tests/simple.test.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/tests/simple.test.js b/tests/simple.test.js index da2ef9d8..a831d5b6 100644 --- a/tests/simple.test.js +++ b/tests/simple.test.js @@ -132,4 +132,21 @@ describe('simple Pagination', () => { expect(onChange).toBeCalled(); expect(onChange).toHaveBeenLastCalledWith(1, 10); }); + + it('should support keyboard event', () => { + const input = wrapper.find('.rc-pagination-simple').find('input'); + input.simulate('change', { target: { value: '2' } }); + input.simulate('keyDown', { key: 'Enter', keyCode: 13, which: 13 }); + expect(input.getDOMNode().value).toBe('2'); + }); + + it('should support keyboard event when press up or down key', () => { + const input = wrapper.find('.rc-pagination-simple').find('input'); + input.simulate('keyUp', { key: 'ArrowDown', keyCode: 40, which: 40 }); + input.simulate('keyUp', { key: 'ArrowDown', keyCode: 40, which: 40 }); + expect(input.getDOMNode().value).toBe('3'); + + input.simulate('keyUp', { key: 'ArrowUp', keyCode: 38, which: 38 }); + expect(input.getDOMNode().value).toBe('2'); + }); }); From 0f3ed84b055ca6968cc5aa1fbf14b1b54f332abc Mon Sep 17 00:00:00 2001 From: wuxh Date: Mon, 20 Nov 2023 14:22:06 +0800 Subject: [PATCH 53/64] test: add case --- tests/index.test.js | 70 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) diff --git a/tests/index.test.js b/tests/index.test.js index b313acad..541b0cbc 100644 --- a/tests/index.test.js +++ b/tests/index.test.js @@ -479,6 +479,76 @@ describe('should emit onChange when total is string', () => { }); }); +describe('keyboard support', () => { + let wrapper; + const onChange = jest.fn(); + + beforeEach(() => { + wrapper = mount( + , + ); + }); + + afterEach(() => { + wrapper.unmount(); + onChange.mockReset(); + }); + + it('should work for prev page', () => { + const prevButton = wrapper.find('li.rc-pagination-prev'); + expect(prevButton.exists()).toBeTruthy(); + + prevButton.simulate('click'); + prevButton.simulate('click'); + + prevButton.simulate('keyDown', { key: 'Enter', keyCode: 13, which: 13 }); + prevButton.simulate('keyDown', { key: 'Enter', keyCode: 13, which: 13 }); + + expect(onChange).toHaveBeenLastCalledWith(46, 10); + }); + + it('should work for next page', () => { + const nextButton = wrapper.find('li.rc-pagination-next'); + expect(nextButton.exists()).toBeTruthy(); + + nextButton.simulate('keyDown', { key: 'Enter', keyCode: 13, which: 13 }); + nextButton.simulate('keyDown', { key: 'Enter', keyCode: 13, which: 13 }); + + nextButton.simulate('click'); + nextButton.simulate('click'); + + expect(onChange).toHaveBeenLastCalledWith(54, 10); + }); + + it('should work for jump prev page', () => { + const jumpPrevButton = wrapper.find('li.rc-pagination-jump-prev'); + expect(jumpPrevButton.exists()).toBeTruthy(); + + jumpPrevButton.simulate('keyDown', { + key: 'Enter', + keyCode: 13, + which: 13, + }); + jumpPrevButton.simulate('click'); + + expect(onChange).toHaveBeenLastCalledWith(40, 10); + }); + + it('should work for jump next page', () => { + const jumpNextButton = wrapper.find('li.rc-pagination-jump-next'); + expect(jumpNextButton.exists()).toBeTruthy(); + + jumpNextButton.simulate('click'); + jumpNextButton.simulate('keyDown', { + key: 'Enter', + keyCode: 13, + which: 13, + }); + + expect(onChange).toHaveBeenLastCalledWith(60, 10); + }); +}); + describe('select in sequence', () => { const serializeCls = (items) => items.map((item) => item.prop('className')); From c4b45f16a501468fa1ca7dd0b418a32dead39e11 Mon Sep 17 00:00:00 2001 From: wuxh Date: Mon, 20 Nov 2023 14:34:00 +0800 Subject: [PATCH 54/64] test: add case --- tests/simple.test.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tests/simple.test.js b/tests/simple.test.js index a831d5b6..7b440430 100644 --- a/tests/simple.test.js +++ b/tests/simple.test.js @@ -149,4 +149,20 @@ describe('simple Pagination', () => { input.simulate('keyUp', { key: 'ArrowUp', keyCode: 38, which: 38 }); expect(input.getDOMNode().value).toBe('2'); }); + + it('gotoButton should work', () => { + const wrapper = mount( + , + ); + + const input = wrapper.find('.rc-pagination-options').find('input'); + const gotoButton = wrapper.find('.rc-pagination-options').find('button'); + + input.simulate('change', { target: { value: '2' } }); + gotoButton.simulate('click'); + + expect( + wrapper.find('.rc-pagination-simple-pager').at(0).prop('title'), + ).toBe('2/3'); + }); }); From 6ed81de4d5cb5fe59566686b6d7a2bd3cdebbae8 Mon Sep 17 00:00:00 2001 From: wuxh Date: Mon, 20 Nov 2023 14:41:29 +0800 Subject: [PATCH 55/64] fix: type --- src/Options.tsx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/Options.tsx b/src/Options.tsx index e558e66a..14b8cf8f 100644 --- a/src/Options.tsx +++ b/src/Options.tsx @@ -4,6 +4,13 @@ import KEYCODE from 'rc-util/lib/KeyCode'; import React from 'react'; import type { PaginationLocale } from './interface'; +interface InternalSelectProps extends SelectProps { + /** + * form antd v5.5.0, popupMatchSelectWidth default is true + */ + popupMatchSelectWidth?: boolean; +} + interface OptionsProps { disabled?: boolean; locale: PaginationLocale; @@ -15,7 +22,7 @@ interface OptionsProps { changeSize?: (size: number) => void; quickGo?: (value: number) => void; buildOptionText?: (value: string | number) => string; - selectComponentClass: React.ComponentType> & { + selectComponentClass: React.ComponentType> & { Option?: React.ComponentType>; }; } @@ -124,6 +131,7 @@ function Options(props: OptionsProps) { showSearch={false} className={`${prefixCls}-size-changer`} optionLabelProp="children" + popupMatchSelectWidth={false} value={(pageSize || pageSizeOptions[0]).toString()} onChange={changeSizeHandle} getPopupContainer={(triggerNode) => triggerNode.parentNode} From 6d6c486a7578920517404e5334def03d0fdef419 Mon Sep 17 00:00:00 2001 From: wuxh Date: Mon, 20 Nov 2023 14:45:32 +0800 Subject: [PATCH 56/64] chore: update demo --- docs/examples/_debug.tsx | 63 ++++------------------------------------ 1 file changed, 6 insertions(+), 57 deletions(-) diff --git a/docs/examples/_debug.tsx b/docs/examples/_debug.tsx index 5eda0f75..749acd8d 100644 --- a/docs/examples/_debug.tsx +++ b/docs/examples/_debug.tsx @@ -1,9 +1,9 @@ import Select from 'rc-select'; import React from 'react'; import '../../assets/index.less'; +import type { PaginationProps } from '../../src/interface'; import Pagination from '../../src/Pagination'; import OriginPagination from '../../src/Pagination_deprecated'; -import type { PaginationProps } from '../../src/interface'; const App = () => { const [origin, setOrigin] = React.useState(false); @@ -19,22 +19,17 @@ const App = () => { showTotal: (total, range) => `${range[0]} - ${range[1]} of ${total} items`, }; - // - // `${range[0]} - ${range[1]} of ${total} items` - // } - // />, - const originTip = Origin; const newTip = New; return ( <>

    {all ? null : origin ? originTip : newTip}

    - + {!all && ( + + )}
    {!all && @@ -56,49 +51,3 @@ const App = () => { export default App; // export { default } from '../../tests/two-pagination.jsx' - -interface IProps { - value: string; - onChange: (info: { - firstName: string; - lastName: string; - fullName: string; - }) => void; - separator?: string; -} - -const MyComponent = (props: IProps) => { - const { value = '', onChange, separator = ' ' } = props; - const [firstName, lastName] = value.split(separator)[0]; - - const fullName = `${firstName}${separator}${lastName}`; - - const handleChange = ( - e: React.ChangeEvent, - type: 'firstName' | 'lastName', - ) => { - const { value: input } = e.target; - - onChange({ - firstName: type === 'firstName' ? input : firstName, - lastName: type === 'lastName' ? input : lastName, - fullName, - }); - }; - - return ( - <> - handleChange(e, 'firstName')} - /> - {separator} - handleChange(e, 'lastName')} - /> - - ); -}; From 85874a05387803e8bd84ae574e8235f5baa2d79a Mon Sep 17 00:00:00 2001 From: wuxh Date: Mon, 20 Nov 2023 14:56:05 +0800 Subject: [PATCH 57/64] chore: update coverageFrom --- jest.config.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/jest.config.js b/jest.config.js index 4453ec07..5dd41d32 100644 --- a/jest.config.js +++ b/jest.config.js @@ -5,5 +5,9 @@ module.exports = { [pkg.name]: '/src/index.ts', '\\.less$': 'identity-obj-proxy', }, - collectCoverageFrom: ['src/**', '!src/Pagination_deprecated.tsx'], + collectCoverageFrom: [ + 'src/**', + '!src/Pagination_deprecated.tsx', + '!src/locale/**', + ], }; From 115b28e083d4b7f3e0f77b95a65af27e79e24094 Mon Sep 17 00:00:00 2001 From: wuxh Date: Mon, 20 Nov 2023 20:59:17 +0800 Subject: [PATCH 58/64] test: fix bad case --- tests/__snapshots__/index.test.js.snap | 2057 ++++++++++++++++-------- tests/index.test.js | 40 +- 2 files changed, 1455 insertions(+), 642 deletions(-) diff --git a/tests/__snapshots__/index.test.js.snap b/tests/__snapshots__/index.test.js.snap index 3401e5ed..d53ac7bf 100644 --- a/tests/__snapshots__/index.test.js.snap +++ b/tests/__snapshots__/index.test.js.snap @@ -2,925 +2,1722 @@ exports[` 1`] = ` [ - "rc-pagination-prev rc-pagination-disabled", - "rc-pagination-item rc-pagination-item-1 rc-pagination-item-active", - "rc-pagination-item rc-pagination-item-2", - "rc-pagination-item rc-pagination-item-3", - "rc-pagination-next", + "prev disabled", + "item item-1 item-active", + "item item-2", + "item item-3", + "next", ] `; exports[` 2`] = ` [ - "rc-pagination-prev rc-pagination-disabled", - "rc-pagination-item rc-pagination-item-1 rc-pagination-item-active", - "rc-pagination-item rc-pagination-item-2", - "rc-pagination-item rc-pagination-item-3", - "rc-pagination-item rc-pagination-item-4", - "rc-pagination-item rc-pagination-item-5", - "rc-pagination-next", + "prev disabled", + "item item-1 item-active", + "item item-2", + "item item-3", + "item item-4", + "item item-5", + "next", ] `; exports[` 3`] = ` [ - "rc-pagination-prev rc-pagination-disabled", - "rc-pagination-item rc-pagination-item-1 rc-pagination-item-active", - "rc-pagination-item rc-pagination-item-2", - "rc-pagination-item rc-pagination-item-3", - "rc-pagination-item rc-pagination-item-4", - "rc-pagination-item rc-pagination-item-5", - "rc-pagination-item rc-pagination-item-6", - "rc-pagination-next", - "rc-pagination-options", + "prev disabled", + "item item-1 item-active", + "item item-2", + "item item-3", + "item item-4", + "item item-5", + "item item-6", + "next", + "options", ] `; exports[` 4`] = ` [ - "rc-pagination-prev rc-pagination-disabled", - "rc-pagination-item rc-pagination-item-1 rc-pagination-item-active", - "rc-pagination-item rc-pagination-item-2", - "rc-pagination-item rc-pagination-item-3", - "rc-pagination-item rc-pagination-item-4", - "rc-pagination-item rc-pagination-item-5", - "rc-pagination-item rc-pagination-item-6", - "rc-pagination-item rc-pagination-item-7", - "rc-pagination-next", - "rc-pagination-options", + "prev disabled", + "item item-1 item-active", + "item item-2", + "item item-3", + "item item-4", + "item item-5", + "item item-6", + "item item-7", + "next", + "options", ] `; exports[` 5`] = ` [ - "rc-pagination-prev rc-pagination-disabled", - "rc-pagination-item rc-pagination-item-1 rc-pagination-item-active", - "rc-pagination-item rc-pagination-item-2", - "rc-pagination-item rc-pagination-item-3", - "rc-pagination-item rc-pagination-item-4", - "rc-pagination-item rc-pagination-item-5 rc-pagination-item-before-jump-next", - "rc-pagination-jump-next", - "rc-pagination-item rc-pagination-item-8", - "rc-pagination-next", - "rc-pagination-options", + "prev disabled", + "item item-1 item-active", + "item item-2", + "item item-3", + "item item-4", + "item item-5 item-before-jump-next", + "jump-next", + "item item-8", + "next", + "options", ] `; exports[` 6`] = ` [ - "rc-pagination-prev rc-pagination-disabled", - "rc-pagination-item rc-pagination-item-1 rc-pagination-item-active", - "rc-pagination-item rc-pagination-item-2", - "rc-pagination-item rc-pagination-item-3", - "rc-pagination-item rc-pagination-item-4", - "rc-pagination-item rc-pagination-item-5 rc-pagination-item-before-jump-next", - "rc-pagination-jump-next", - "rc-pagination-item rc-pagination-item-8", - "rc-pagination-next", - "rc-pagination-options", + "prev disabled", + "item item-1 item-active", + "item item-2", + "item item-3", + "item item-4", + "item item-5 item-before-jump-next", + "jump-next", + "item item-9", + "next", + "options", ] `; exports[` 7`] = ` [ - "rc-pagination-prev rc-pagination-disabled", - "rc-pagination-item rc-pagination-item-1 rc-pagination-item-active", - "rc-pagination-item rc-pagination-item-2", - "rc-pagination-item rc-pagination-item-3", - "rc-pagination-item rc-pagination-item-4", - "rc-pagination-item rc-pagination-item-5 rc-pagination-item-before-jump-next", - "rc-pagination-jump-next", - "rc-pagination-item rc-pagination-item-10", - "rc-pagination-next", - "rc-pagination-options", + "prev disabled", + "item item-1 item-active", + "item item-2", + "item item-3", + "item item-4", + "item item-5 item-before-jump-next", + "jump-next", + "item item-10", + "next", + "options", ] `; exports[` 8`] = ` [ - "rc-pagination-prev rc-pagination-disabled", - "rc-pagination-item rc-pagination-item-1 rc-pagination-item-active", - "rc-pagination-item rc-pagination-item-2", - "rc-pagination-item rc-pagination-item-3", - "rc-pagination-item rc-pagination-item-4", - "rc-pagination-item rc-pagination-item-5 rc-pagination-item-before-jump-next", - "rc-pagination-jump-next", - "rc-pagination-item rc-pagination-item-12", - "rc-pagination-next", - "rc-pagination-options", + "prev disabled", + "item item-1 item-active", + "item item-2", + "item item-3", + "item item-4", + "item item-5 item-before-jump-next", + "jump-next", + "item item-12", + "next", + "options", ] `; exports[` 9`] = ` [ - "rc-pagination-prev rc-pagination-disabled", - "rc-pagination-item rc-pagination-item-1 rc-pagination-item-active", - "rc-pagination-item rc-pagination-item-2", - "rc-pagination-item rc-pagination-item-3", - "rc-pagination-item rc-pagination-item-4", - "rc-pagination-item rc-pagination-item-5 rc-pagination-item-before-jump-next", - "rc-pagination-jump-next", - "rc-pagination-item rc-pagination-item-50", - "rc-pagination-next", - "rc-pagination-options", + "prev disabled", + "item item-1 item-active", + "item item-2", + "item item-3", + "item item-4", + "item item-5 item-before-jump-next", + "jump-next", + "item item-50", + "next", + "options", ] `; exports[`select in sequence should sequence select 25 pages should select page 2 1`] = ` [ - "rc-pagination-prev", - "rc-pagination-item rc-pagination-item-1", - "rc-pagination-item rc-pagination-item-2 rc-pagination-item-active", - "rc-pagination-item rc-pagination-item-3", - "rc-pagination-next", + "prev", + "item item-1", + "item item-2 item-active", + "item item-3", + "next", ] `; exports[`select in sequence should sequence select 25 pages should select page 3 1`] = ` [ - "rc-pagination-prev", - "rc-pagination-item rc-pagination-item-1", - "rc-pagination-item rc-pagination-item-2", - "rc-pagination-item rc-pagination-item-3 rc-pagination-item-active", - "rc-pagination-next rc-pagination-disabled", + "prev", + "item item-1", + "item item-2", + "item item-3 item-active", + "next disabled", ] `; exports[`select in sequence should sequence select 50 pages should select page 2 1`] = ` [ - "rc-pagination-prev", - "rc-pagination-item rc-pagination-item-1", - "rc-pagination-item rc-pagination-item-2 rc-pagination-item-active", - "rc-pagination-item rc-pagination-item-3", - "rc-pagination-item rc-pagination-item-4", - "rc-pagination-item rc-pagination-item-5", - "rc-pagination-next", + "prev", + "item item-1", + "item item-2 item-active", + "item item-3", + "item item-4", + "item item-5", + "next", ] `; exports[`select in sequence should sequence select 50 pages should select page 3 1`] = ` [ - "rc-pagination-prev", - "rc-pagination-item rc-pagination-item-1", - "rc-pagination-item rc-pagination-item-2", - "rc-pagination-item rc-pagination-item-3 rc-pagination-item-active", - "rc-pagination-item rc-pagination-item-4", - "rc-pagination-item rc-pagination-item-5", - "rc-pagination-next", + "prev", + "item item-1", + "item item-2", + "item item-3 item-active", + "item item-4", + "item item-5", + "next", ] `; exports[`select in sequence should sequence select 50 pages should select page 4 1`] = ` [ - "rc-pagination-prev", - "rc-pagination-item rc-pagination-item-1", - "rc-pagination-item rc-pagination-item-2", - "rc-pagination-item rc-pagination-item-3", - "rc-pagination-item rc-pagination-item-4 rc-pagination-item-active", - "rc-pagination-item rc-pagination-item-5", - "rc-pagination-next", + "prev", + "item item-1", + "item item-2", + "item item-3", + "item item-4 item-active", + "item item-5", + "next", ] `; exports[`select in sequence should sequence select 50 pages should select page 5 1`] = ` [ - "rc-pagination-prev", - "rc-pagination-item rc-pagination-item-1", - "rc-pagination-item rc-pagination-item-2", - "rc-pagination-item rc-pagination-item-3", - "rc-pagination-item rc-pagination-item-4", - "rc-pagination-item rc-pagination-item-5 rc-pagination-item-active", - "rc-pagination-next rc-pagination-disabled", + "prev", + "item item-1", + "item item-2", + "item item-3", + "item item-4", + "item item-5 item-active", + "next disabled", ] `; exports[`select in sequence should sequence select 60 pages should select page 2 1`] = ` [ - "rc-pagination-prev", - "rc-pagination-item rc-pagination-item-1", - "rc-pagination-item rc-pagination-item-2 rc-pagination-item-active", - "rc-pagination-item rc-pagination-item-3", - "rc-pagination-item rc-pagination-item-4", - "rc-pagination-item rc-pagination-item-5", - "rc-pagination-item rc-pagination-item-6", - "rc-pagination-next", - "rc-pagination-options", + "prev", + "item item-1", + "item item-2 item-active", + "item item-3", + "item item-4", + "item item-5", + "item item-6", + "next", + "options", ] `; exports[`select in sequence should sequence select 60 pages should select page 3 1`] = ` [ - "rc-pagination-prev", - "rc-pagination-item rc-pagination-item-1", - "rc-pagination-item rc-pagination-item-2", - "rc-pagination-item rc-pagination-item-3 rc-pagination-item-active", - "rc-pagination-item rc-pagination-item-4", - "rc-pagination-item rc-pagination-item-5", - "rc-pagination-item rc-pagination-item-6", - "rc-pagination-next", - "rc-pagination-options", + "prev", + "item item-1", + "item item-2", + "item item-3 item-active", + "item item-4", + "item item-5", + "item item-6", + "next", + "options", ] `; exports[`select in sequence should sequence select 60 pages should select page 4 1`] = ` [ - "rc-pagination-prev", - "rc-pagination-item rc-pagination-item-1", - "rc-pagination-item rc-pagination-item-2", - "rc-pagination-item rc-pagination-item-3", - "rc-pagination-item rc-pagination-item-4 rc-pagination-item-active", - "rc-pagination-item rc-pagination-item-5", - "rc-pagination-item rc-pagination-item-6", - "rc-pagination-next", - "rc-pagination-options", + "prev", + "item item-1", + "item item-2", + "item item-3", + "item item-4 item-active", + "item item-5", + "item item-6", + "next", + "options", ] `; exports[`select in sequence should sequence select 60 pages should select page 5 1`] = ` [ - "rc-pagination-prev", - "rc-pagination-item rc-pagination-item-1", - "rc-pagination-item rc-pagination-item-2", - "rc-pagination-item rc-pagination-item-3", - "rc-pagination-item rc-pagination-item-4", - "rc-pagination-item rc-pagination-item-5 rc-pagination-item-active", - "rc-pagination-item rc-pagination-item-6", - "rc-pagination-next", - "rc-pagination-options", + "prev", + "item item-1", + "item item-2", + "item item-3", + "item item-4", + "item item-5 item-active", + "item item-6", + "next", + "options", ] `; exports[`select in sequence should sequence select 60 pages should select page 6 1`] = ` [ - "rc-pagination-prev", - "rc-pagination-item rc-pagination-item-1", - "rc-pagination-item rc-pagination-item-2", - "rc-pagination-item rc-pagination-item-3", - "rc-pagination-item rc-pagination-item-4", - "rc-pagination-item rc-pagination-item-5", - "rc-pagination-item rc-pagination-item-6 rc-pagination-item-active", - "rc-pagination-next rc-pagination-disabled", - "rc-pagination-options", -] -`; - -exports[`select in sequence should sequence select 60 pages should select page 7 1`] = ` -[ - "rc-pagination-prev", - "rc-pagination-item rc-pagination-item-1", - "rc-pagination-item rc-pagination-item-2", - "rc-pagination-item rc-pagination-item-3", - "rc-pagination-item rc-pagination-item-4", - "rc-pagination-item rc-pagination-item-5", - "rc-pagination-item rc-pagination-item-6 rc-pagination-item-active", - "rc-pagination-next rc-pagination-disabled", - "rc-pagination-options", + "prev", + "item item-1", + "item item-2", + "item item-3", + "item item-4", + "item item-5", + "item item-6 item-active", + "next disabled", + "options", ] `; exports[`select in sequence should sequence select 70 pages should select page 2 1`] = ` [ - "rc-pagination-prev", - "rc-pagination-item rc-pagination-item-1", - "rc-pagination-item rc-pagination-item-2 rc-pagination-item-active", - "rc-pagination-item rc-pagination-item-3", - "rc-pagination-item rc-pagination-item-4", - "rc-pagination-item rc-pagination-item-5", - "rc-pagination-item rc-pagination-item-6", - "rc-pagination-item rc-pagination-item-7", - "rc-pagination-next", - "rc-pagination-options", + "prev", + "item item-1", + "item item-2 item-active", + "item item-3", + "item item-4", + "item item-5", + "item item-6", + "item item-7", + "next", + "options", ] `; exports[`select in sequence should sequence select 70 pages should select page 3 1`] = ` [ - "rc-pagination-prev", - "rc-pagination-item rc-pagination-item-1", - "rc-pagination-item rc-pagination-item-2", - "rc-pagination-item rc-pagination-item-3 rc-pagination-item-active", - "rc-pagination-item rc-pagination-item-4", - "rc-pagination-item rc-pagination-item-5", - "rc-pagination-item rc-pagination-item-6", - "rc-pagination-item rc-pagination-item-7", - "rc-pagination-next", - "rc-pagination-options", + "prev", + "item item-1", + "item item-2", + "item item-3 item-active", + "item item-4", + "item item-5", + "item item-6", + "item item-7", + "next", + "options", ] `; exports[`select in sequence should sequence select 70 pages should select page 4 1`] = ` [ - "rc-pagination-prev", - "rc-pagination-item rc-pagination-item-1", - "rc-pagination-item rc-pagination-item-2", - "rc-pagination-item rc-pagination-item-3", - "rc-pagination-item rc-pagination-item-4 rc-pagination-item-active", - "rc-pagination-item rc-pagination-item-5", - "rc-pagination-item rc-pagination-item-6", - "rc-pagination-item rc-pagination-item-7", - "rc-pagination-next", - "rc-pagination-options", + "prev", + "item item-1", + "item item-2", + "item item-3", + "item item-4 item-active", + "item item-5", + "item item-6", + "item item-7", + "next", + "options", ] `; exports[`select in sequence should sequence select 70 pages should select page 5 1`] = ` [ - "rc-pagination-prev", - "rc-pagination-item rc-pagination-item-1", - "rc-pagination-item rc-pagination-item-2", - "rc-pagination-item rc-pagination-item-3", - "rc-pagination-item rc-pagination-item-4", - "rc-pagination-item rc-pagination-item-5 rc-pagination-item-active", - "rc-pagination-item rc-pagination-item-6", - "rc-pagination-item rc-pagination-item-7", - "rc-pagination-next", - "rc-pagination-options", + "prev", + "item item-1", + "item item-2", + "item item-3", + "item item-4", + "item item-5 item-active", + "item item-6", + "item item-7", + "next", + "options", ] `; exports[`select in sequence should sequence select 70 pages should select page 6 1`] = ` [ - "rc-pagination-prev", - "rc-pagination-item rc-pagination-item-1", - "rc-pagination-item rc-pagination-item-2", - "rc-pagination-item rc-pagination-item-3", - "rc-pagination-item rc-pagination-item-4", - "rc-pagination-item rc-pagination-item-5", - "rc-pagination-item rc-pagination-item-6 rc-pagination-item-active", - "rc-pagination-item rc-pagination-item-7", - "rc-pagination-next", - "rc-pagination-options", + "prev", + "item item-1", + "item item-2", + "item item-3", + "item item-4", + "item item-5", + "item item-6 item-active", + "item item-7", + "next", + "options", ] `; exports[`select in sequence should sequence select 70 pages should select page 7 1`] = ` [ - "rc-pagination-prev", - "rc-pagination-item rc-pagination-item-1", - "rc-pagination-item rc-pagination-item-2", - "rc-pagination-item rc-pagination-item-3", - "rc-pagination-item rc-pagination-item-4", - "rc-pagination-item rc-pagination-item-5", - "rc-pagination-item rc-pagination-item-6", - "rc-pagination-item rc-pagination-item-7 rc-pagination-item-active", - "rc-pagination-next rc-pagination-disabled", - "rc-pagination-options", + "prev", + "item item-1", + "item item-2", + "item item-3", + "item item-4", + "item item-5", + "item item-6", + "item item-7 item-active", + "next disabled", + "options", ] `; -exports[`select in sequence should sequence select 70 pages should select page 8 1`] = ` +exports[`select in sequence should sequence select 80 pages should select page 2 1`] = ` [ - "rc-pagination-prev", - "rc-pagination-item rc-pagination-item-1", - "rc-pagination-item rc-pagination-item-2", - "rc-pagination-item rc-pagination-item-3", - "rc-pagination-item rc-pagination-item-4", - "rc-pagination-item rc-pagination-item-5", - "rc-pagination-item rc-pagination-item-6", - "rc-pagination-item rc-pagination-item-7 rc-pagination-item-active", - "rc-pagination-next rc-pagination-disabled", - "rc-pagination-options", + "prev", + "item item-1", + "item item-2 item-active", + "item item-3", + "item item-4", + "item item-5 item-before-jump-next", + "jump-next", + "item item-8", + "next", + "options", ] `; -exports[`select in sequence should sequence select 80 pages should select page 2 1`] = ` +exports[`select in sequence should sequence select 80 pages should select page 3 1`] = ` [ - "rc-pagination-prev", - "rc-pagination-item rc-pagination-item-1", - "rc-pagination-item rc-pagination-item-2 rc-pagination-item-active", - "rc-pagination-item rc-pagination-item-3", - "rc-pagination-item rc-pagination-item-4", - "rc-pagination-item rc-pagination-item-5 rc-pagination-item-before-jump-next", - "rc-pagination-jump-next", - "rc-pagination-item rc-pagination-item-8", - "rc-pagination-next", - "rc-pagination-options", + "prev", + "item item-1", + "item item-2", + "item item-3 item-active", + "item item-4", + "item item-5 item-before-jump-next", + "jump-next", + "item item-8", + "next", + "options", ] `; -exports[`select in sequence should sequence select 80 pages should select page 2 2`] = ` +exports[`select in sequence should sequence select 80 pages should select page 4 1`] = ` [ - "rc-pagination-prev", - "rc-pagination-item rc-pagination-item-1", - "rc-pagination-item rc-pagination-item-2 rc-pagination-item-active", - "rc-pagination-item rc-pagination-item-3", - "rc-pagination-item rc-pagination-item-4", - "rc-pagination-item rc-pagination-item-5 rc-pagination-item-before-jump-next", - "rc-pagination-jump-next", - "rc-pagination-item rc-pagination-item-8", - "rc-pagination-next", - "rc-pagination-options", + "prev", + "item item-1", + "item item-2", + "item item-3", + "item item-4 item-active", + "item item-5", + "item item-6 item-before-jump-next", + "jump-next", + "item item-8", + "next", + "options", ] `; -exports[`select in sequence should sequence select 80 pages should select page 3 1`] = ` +exports[`select in sequence should sequence select 80 pages should select page 5 1`] = ` [ - "rc-pagination-prev", - "rc-pagination-item rc-pagination-item-1", - "rc-pagination-item rc-pagination-item-2", - "rc-pagination-item rc-pagination-item-3 rc-pagination-item-active", - "rc-pagination-item rc-pagination-item-4", - "rc-pagination-item rc-pagination-item-5 rc-pagination-item-before-jump-next", - "rc-pagination-jump-next", - "rc-pagination-item rc-pagination-item-8", - "rc-pagination-next", - "rc-pagination-options", + "prev", + "item item-1", + "jump-prev", + "item item-3 item-after-jump-prev", + "item item-4", + "item item-5 item-active", + "item item-6", + "item item-7", + "item item-8", + "next", + "options", ] `; -exports[`select in sequence should sequence select 80 pages should select page 3 2`] = ` +exports[`select in sequence should sequence select 80 pages should select page 6 1`] = ` [ - "rc-pagination-prev", - "rc-pagination-item rc-pagination-item-1", - "rc-pagination-item rc-pagination-item-2", - "rc-pagination-item rc-pagination-item-3 rc-pagination-item-active", - "rc-pagination-item rc-pagination-item-4", - "rc-pagination-item rc-pagination-item-5 rc-pagination-item-before-jump-next", - "rc-pagination-jump-next", - "rc-pagination-item rc-pagination-item-8", - "rc-pagination-next", - "rc-pagination-options", + "prev", + "item item-1", + "jump-prev", + "item item-4 item-after-jump-prev", + "item item-5", + "item item-6 item-active", + "item item-7", + "item item-8", + "next", + "options", ] `; -exports[`select in sequence should sequence select 80 pages should select page 4 1`] = ` +exports[`select in sequence should sequence select 80 pages should select page 7 1`] = ` [ - "rc-pagination-prev", - "rc-pagination-item rc-pagination-item-1", - "rc-pagination-item rc-pagination-item-2", - "rc-pagination-item rc-pagination-item-3", - "rc-pagination-item rc-pagination-item-4 rc-pagination-item-active", - "rc-pagination-item rc-pagination-item-5", - "rc-pagination-item rc-pagination-item-6 rc-pagination-item-before-jump-next", - "rc-pagination-jump-next", - "rc-pagination-item rc-pagination-item-8", - "rc-pagination-next", - "rc-pagination-options", + "prev", + "item item-1", + "jump-prev", + "item item-4 item-after-jump-prev", + "item item-5", + "item item-6", + "item item-7 item-active", + "item item-8", + "next", + "options", ] `; -exports[`select in sequence should sequence select 80 pages should select page 4 2`] = ` +exports[`select in sequence should sequence select 80 pages should select page 8 1`] = ` [ - "rc-pagination-prev", - "rc-pagination-item rc-pagination-item-1", - "rc-pagination-item rc-pagination-item-2", - "rc-pagination-item rc-pagination-item-3", - "rc-pagination-item rc-pagination-item-4 rc-pagination-item-active", - "rc-pagination-item rc-pagination-item-5", - "rc-pagination-item rc-pagination-item-6 rc-pagination-item-before-jump-next", - "rc-pagination-jump-next", - "rc-pagination-item rc-pagination-item-8", - "rc-pagination-next", - "rc-pagination-options", + "prev", + "item item-1", + "jump-prev", + "item item-4 item-after-jump-prev", + "item item-5", + "item item-6", + "item item-7", + "item item-8 item-active", + "next disabled", + "options", ] `; -exports[`select in sequence should sequence select 80 pages should select page 5 1`] = ` +exports[`select in sequence should sequence select 90 pages should select page 2 1`] = ` [ - "rc-pagination-prev", - "rc-pagination-item rc-pagination-item-1", - "rc-pagination-jump-prev", - "rc-pagination-item rc-pagination-item-3 rc-pagination-item-after-jump-prev", - "rc-pagination-item rc-pagination-item-4", - "rc-pagination-item rc-pagination-item-5 rc-pagination-item-active", - "rc-pagination-item rc-pagination-item-6", - "rc-pagination-item rc-pagination-item-7", - "rc-pagination-item rc-pagination-item-8", - "rc-pagination-next", - "rc-pagination-options", + "prev", + "item item-1", + "item item-2 item-active", + "item item-3", + "item item-4", + "item item-5 item-before-jump-next", + "jump-next", + "item item-9", + "next", + "options", ] `; -exports[`select in sequence should sequence select 80 pages should select page 5 2`] = ` +exports[`select in sequence should sequence select 90 pages should select page 3 1`] = ` [ - "rc-pagination-prev", - "rc-pagination-item rc-pagination-item-1", - "rc-pagination-jump-prev", - "rc-pagination-item rc-pagination-item-3 rc-pagination-item-after-jump-prev", - "rc-pagination-item rc-pagination-item-4", - "rc-pagination-item rc-pagination-item-5 rc-pagination-item-active", - "rc-pagination-item rc-pagination-item-6", - "rc-pagination-item rc-pagination-item-7", - "rc-pagination-item rc-pagination-item-8", - "rc-pagination-next", - "rc-pagination-options", + "prev", + "item item-1", + "item item-2", + "item item-3 item-active", + "item item-4", + "item item-5 item-before-jump-next", + "jump-next", + "item item-9", + "next", + "options", ] `; -exports[`select in sequence should sequence select 80 pages should select page 6 1`] = ` +exports[`select in sequence should sequence select 90 pages should select page 4 1`] = ` [ - "rc-pagination-prev", - "rc-pagination-item rc-pagination-item-1", - "rc-pagination-jump-prev", - "rc-pagination-item rc-pagination-item-3 rc-pagination-item-after-jump-prev", - "rc-pagination-item rc-pagination-item-4", - "rc-pagination-item rc-pagination-item-5 rc-pagination-item-active", - "rc-pagination-item rc-pagination-item-6", - "rc-pagination-item rc-pagination-item-7", - "rc-pagination-item rc-pagination-item-8", - "rc-pagination-next", - "rc-pagination-options", + "prev", + "item item-1", + "item item-2", + "item item-3", + "item item-4 item-active", + "item item-5", + "item item-6 item-before-jump-next", + "jump-next", + "item item-9", + "next", + "options", ] `; -exports[`select in sequence should sequence select 80 pages should select page 6 2`] = ` +exports[`select in sequence should sequence select 90 pages should select page 5 1`] = ` [ - "rc-pagination-prev", - "rc-pagination-item rc-pagination-item-1", - "rc-pagination-jump-prev", - "rc-pagination-item rc-pagination-item-3 rc-pagination-item-after-jump-prev", - "rc-pagination-item rc-pagination-item-4", - "rc-pagination-item rc-pagination-item-5 rc-pagination-item-active", - "rc-pagination-item rc-pagination-item-6", - "rc-pagination-item rc-pagination-item-7", - "rc-pagination-item rc-pagination-item-8", - "rc-pagination-next", - "rc-pagination-options", + "prev", + "item item-1", + "jump-prev", + "item item-3 item-after-jump-prev", + "item item-4", + "item item-5 item-active", + "item item-6", + "item item-7 item-before-jump-next", + "jump-next", + "item item-9", + "next", + "options", ] `; -exports[`select in sequence should sequence select 80 pages should select page 7 1`] = ` +exports[`select in sequence should sequence select 90 pages should select page 6 1`] = ` [ - "rc-pagination-prev", - "rc-pagination-item rc-pagination-item-1", - "rc-pagination-jump-prev", - "rc-pagination-item rc-pagination-item-4 rc-pagination-item-after-jump-prev", - "rc-pagination-item rc-pagination-item-5", - "rc-pagination-item rc-pagination-item-6", - "rc-pagination-item rc-pagination-item-7", - "rc-pagination-item rc-pagination-item-8 rc-pagination-item-active", - "rc-pagination-next rc-pagination-disabled", - "rc-pagination-options", + "prev", + "item item-1", + "jump-prev", + "item item-4 item-after-jump-prev", + "item item-5", + "item item-6 item-active", + "item item-7", + "item item-8", + "item item-9", + "next", + "options", ] `; -exports[`select in sequence should sequence select 80 pages should select page 7 2`] = ` +exports[`select in sequence should sequence select 90 pages should select page 7 1`] = ` [ - "rc-pagination-prev", - "rc-pagination-item rc-pagination-item-1", - "rc-pagination-jump-prev", - "rc-pagination-item rc-pagination-item-4 rc-pagination-item-after-jump-prev", - "rc-pagination-item rc-pagination-item-5", - "rc-pagination-item rc-pagination-item-6", - "rc-pagination-item rc-pagination-item-7", - "rc-pagination-item rc-pagination-item-8 rc-pagination-item-active", - "rc-pagination-next rc-pagination-disabled", - "rc-pagination-options", + "prev", + "item item-1", + "jump-prev", + "item item-5 item-after-jump-prev", + "item item-6", + "item item-7 item-active", + "item item-8", + "item item-9", + "next", + "options", ] `; -exports[`select in sequence should sequence select 80 pages should select page 8 1`] = ` +exports[`select in sequence should sequence select 90 pages should select page 8 1`] = ` [ - "rc-pagination-prev", - "rc-pagination-item rc-pagination-item-1", - "rc-pagination-jump-prev", - "rc-pagination-item rc-pagination-item-4 rc-pagination-item-after-jump-prev", - "rc-pagination-item rc-pagination-item-5", - "rc-pagination-item rc-pagination-item-6", - "rc-pagination-item rc-pagination-item-7", - "rc-pagination-item rc-pagination-item-8 rc-pagination-item-active", - "rc-pagination-next rc-pagination-disabled", - "rc-pagination-options", + "prev", + "item item-1", + "jump-prev", + "item item-5 item-after-jump-prev", + "item item-6", + "item item-7", + "item item-8 item-active", + "item item-9", + "next", + "options", ] `; -exports[`select in sequence should sequence select 80 pages should select page 8 2`] = ` +exports[`select in sequence should sequence select 90 pages should select page 9 1`] = ` [ - "rc-pagination-prev", - "rc-pagination-item rc-pagination-item-1", - "rc-pagination-jump-prev", - "rc-pagination-item rc-pagination-item-4 rc-pagination-item-after-jump-prev", - "rc-pagination-item rc-pagination-item-5", - "rc-pagination-item rc-pagination-item-6", - "rc-pagination-item rc-pagination-item-7", - "rc-pagination-item rc-pagination-item-8 rc-pagination-item-active", - "rc-pagination-next rc-pagination-disabled", - "rc-pagination-options", + "prev", + "item item-1", + "jump-prev", + "item item-5 item-after-jump-prev", + "item item-6", + "item item-7", + "item item-8", + "item item-9 item-active", + "next disabled", + "options", ] `; exports[`select in sequence should sequence select 100 pages should select page 2 1`] = ` [ - "rc-pagination-prev", - "rc-pagination-item rc-pagination-item-1", - "rc-pagination-item rc-pagination-item-2 rc-pagination-item-active", - "rc-pagination-item rc-pagination-item-3", - "rc-pagination-item rc-pagination-item-4", - "rc-pagination-item rc-pagination-item-5 rc-pagination-item-before-jump-next", - "rc-pagination-jump-next", - "rc-pagination-item rc-pagination-item-10", - "rc-pagination-next", - "rc-pagination-options", + "prev", + "item item-1", + "item item-2 item-active", + "item item-3", + "item item-4", + "item item-5 item-before-jump-next", + "jump-next", + "item item-10", + "next", + "options", ] `; exports[`select in sequence should sequence select 100 pages should select page 3 1`] = ` [ - "rc-pagination-prev", - "rc-pagination-item rc-pagination-item-1", - "rc-pagination-item rc-pagination-item-2", - "rc-pagination-item rc-pagination-item-3 rc-pagination-item-active", - "rc-pagination-item rc-pagination-item-4", - "rc-pagination-item rc-pagination-item-5 rc-pagination-item-before-jump-next", - "rc-pagination-jump-next", - "rc-pagination-item rc-pagination-item-10", - "rc-pagination-next", - "rc-pagination-options", + "prev", + "item item-1", + "item item-2", + "item item-3 item-active", + "item item-4", + "item item-5 item-before-jump-next", + "jump-next", + "item item-10", + "next", + "options", ] `; exports[`select in sequence should sequence select 100 pages should select page 4 1`] = ` [ - "rc-pagination-prev", - "rc-pagination-item rc-pagination-item-1", - "rc-pagination-item rc-pagination-item-2", - "rc-pagination-item rc-pagination-item-3", - "rc-pagination-item rc-pagination-item-4 rc-pagination-item-active", - "rc-pagination-item rc-pagination-item-5", - "rc-pagination-item rc-pagination-item-6 rc-pagination-item-before-jump-next", - "rc-pagination-jump-next", - "rc-pagination-item rc-pagination-item-10", - "rc-pagination-next", - "rc-pagination-options", + "prev", + "item item-1", + "item item-2", + "item item-3", + "item item-4 item-active", + "item item-5", + "item item-6 item-before-jump-next", + "jump-next", + "item item-10", + "next", + "options", ] `; exports[`select in sequence should sequence select 100 pages should select page 5 1`] = ` [ - "rc-pagination-prev", - "rc-pagination-item rc-pagination-item-1", - "rc-pagination-jump-prev", - "rc-pagination-item rc-pagination-item-3 rc-pagination-item-after-jump-prev", - "rc-pagination-item rc-pagination-item-4", - "rc-pagination-item rc-pagination-item-5 rc-pagination-item-active", - "rc-pagination-item rc-pagination-item-6", - "rc-pagination-item rc-pagination-item-7 rc-pagination-item-before-jump-next", - "rc-pagination-jump-next", - "rc-pagination-item rc-pagination-item-10", - "rc-pagination-next", - "rc-pagination-options", + "prev", + "item item-1", + "jump-prev", + "item item-3 item-after-jump-prev", + "item item-4", + "item item-5 item-active", + "item item-6", + "item item-7 item-before-jump-next", + "jump-next", + "item item-10", + "next", + "options", ] `; exports[`select in sequence should sequence select 100 pages should select page 6 1`] = ` [ - "rc-pagination-prev", - "rc-pagination-item rc-pagination-item-1", - "rc-pagination-jump-prev", - "rc-pagination-item rc-pagination-item-6 rc-pagination-item-after-jump-prev", - "rc-pagination-item rc-pagination-item-7", - "rc-pagination-item rc-pagination-item-8", - "rc-pagination-item rc-pagination-item-9", - "rc-pagination-item rc-pagination-item-10 rc-pagination-item-active", - "rc-pagination-next rc-pagination-disabled", - "rc-pagination-options", + "prev", + "item item-1", + "jump-prev", + "item item-4 item-after-jump-prev", + "item item-5", + "item item-6 item-active", + "item item-7", + "item item-8 item-before-jump-next", + "jump-next", + "item item-10", + "next", + "options", ] `; exports[`select in sequence should sequence select 100 pages should select page 7 1`] = ` [ - "rc-pagination-prev", - "rc-pagination-item rc-pagination-item-1", - "rc-pagination-jump-prev", - "rc-pagination-item rc-pagination-item-6 rc-pagination-item-after-jump-prev", - "rc-pagination-item rc-pagination-item-7", - "rc-pagination-item rc-pagination-item-8", - "rc-pagination-item rc-pagination-item-9", - "rc-pagination-item rc-pagination-item-10 rc-pagination-item-active", - "rc-pagination-next rc-pagination-disabled", - "rc-pagination-options", + "prev", + "item item-1", + "jump-prev", + "item item-5 item-after-jump-prev", + "item item-6", + "item item-7 item-active", + "item item-8", + "item item-9", + "item item-10", + "next", + "options", ] `; exports[`select in sequence should sequence select 100 pages should select page 8 1`] = ` [ - "rc-pagination-prev", - "rc-pagination-item rc-pagination-item-1", - "rc-pagination-jump-prev", - "rc-pagination-item rc-pagination-item-6 rc-pagination-item-after-jump-prev", - "rc-pagination-item rc-pagination-item-7", - "rc-pagination-item rc-pagination-item-8", - "rc-pagination-item rc-pagination-item-9", - "rc-pagination-item rc-pagination-item-10 rc-pagination-item-active", - "rc-pagination-next rc-pagination-disabled", - "rc-pagination-options", + "prev", + "item item-1", + "jump-prev", + "item item-6 item-after-jump-prev", + "item item-7", + "item item-8 item-active", + "item item-9", + "item item-10", + "next", + "options", +] +`; + +exports[`select in sequence should sequence select 100 pages should select page 9 1`] = ` +[ + "prev", + "item item-1", + "jump-prev", + "item item-6 item-after-jump-prev", + "item item-7", + "item item-8", + "item item-9 item-active", + "item item-10", + "next", + "options", +] +`; + +exports[`select in sequence should sequence select 100 pages should select page 10 1`] = ` +[ + "prev", + "item item-1", + "jump-prev", + "item item-6 item-after-jump-prev", + "item item-7", + "item item-8", + "item item-9", + "item item-10 item-active", + "next disabled", + "options", ] `; exports[`select in sequence should sequence select 120 pages should select page 2 1`] = ` [ - "rc-pagination-prev", - "rc-pagination-item rc-pagination-item-1", - "rc-pagination-item rc-pagination-item-2 rc-pagination-item-active", - "rc-pagination-item rc-pagination-item-3", - "rc-pagination-item rc-pagination-item-4", - "rc-pagination-item rc-pagination-item-5 rc-pagination-item-before-jump-next", - "rc-pagination-jump-next", - "rc-pagination-item rc-pagination-item-12", - "rc-pagination-next", - "rc-pagination-options", + "prev", + "item item-1", + "item item-2 item-active", + "item item-3", + "item item-4", + "item item-5 item-before-jump-next", + "jump-next", + "item item-12", + "next", + "options", ] `; exports[`select in sequence should sequence select 120 pages should select page 3 1`] = ` [ - "rc-pagination-prev", - "rc-pagination-item rc-pagination-item-1", - "rc-pagination-item rc-pagination-item-2", - "rc-pagination-item rc-pagination-item-3 rc-pagination-item-active", - "rc-pagination-item rc-pagination-item-4", - "rc-pagination-item rc-pagination-item-5 rc-pagination-item-before-jump-next", - "rc-pagination-jump-next", - "rc-pagination-item rc-pagination-item-12", - "rc-pagination-next", - "rc-pagination-options", + "prev", + "item item-1", + "item item-2", + "item item-3 item-active", + "item item-4", + "item item-5 item-before-jump-next", + "jump-next", + "item item-12", + "next", + "options", ] `; exports[`select in sequence should sequence select 120 pages should select page 4 1`] = ` [ - "rc-pagination-prev", - "rc-pagination-item rc-pagination-item-1", - "rc-pagination-item rc-pagination-item-2", - "rc-pagination-item rc-pagination-item-3", - "rc-pagination-item rc-pagination-item-4 rc-pagination-item-active", - "rc-pagination-item rc-pagination-item-5", - "rc-pagination-item rc-pagination-item-6 rc-pagination-item-before-jump-next", - "rc-pagination-jump-next", - "rc-pagination-item rc-pagination-item-12", - "rc-pagination-next", - "rc-pagination-options", + "prev", + "item item-1", + "item item-2", + "item item-3", + "item item-4 item-active", + "item item-5", + "item item-6 item-before-jump-next", + "jump-next", + "item item-12", + "next", + "options", ] `; exports[`select in sequence should sequence select 120 pages should select page 5 1`] = ` [ - "rc-pagination-prev", - "rc-pagination-item rc-pagination-item-1", - "rc-pagination-jump-prev", - "rc-pagination-item rc-pagination-item-3 rc-pagination-item-after-jump-prev", - "rc-pagination-item rc-pagination-item-4", - "rc-pagination-item rc-pagination-item-5 rc-pagination-item-active", - "rc-pagination-item rc-pagination-item-6", - "rc-pagination-item rc-pagination-item-7 rc-pagination-item-before-jump-next", - "rc-pagination-jump-next", - "rc-pagination-item rc-pagination-item-12", - "rc-pagination-next", - "rc-pagination-options", + "prev", + "item item-1", + "jump-prev", + "item item-3 item-after-jump-prev", + "item item-4", + "item item-5 item-active", + "item item-6", + "item item-7 item-before-jump-next", + "jump-next", + "item item-12", + "next", + "options", ] `; exports[`select in sequence should sequence select 120 pages should select page 6 1`] = ` [ - "rc-pagination-prev", - "rc-pagination-item rc-pagination-item-1", - "rc-pagination-jump-prev", - "rc-pagination-item rc-pagination-item-8 rc-pagination-item-after-jump-prev", - "rc-pagination-item rc-pagination-item-9", - "rc-pagination-item rc-pagination-item-10 rc-pagination-item-active", - "rc-pagination-item rc-pagination-item-11", - "rc-pagination-item rc-pagination-item-12", - "rc-pagination-next", - "rc-pagination-options", + "prev", + "item item-1", + "jump-prev", + "item item-4 item-after-jump-prev", + "item item-5", + "item item-6 item-active", + "item item-7", + "item item-8 item-before-jump-next", + "jump-next", + "item item-12", + "next", + "options", ] `; exports[`select in sequence should sequence select 120 pages should select page 7 1`] = ` [ - "rc-pagination-prev", - "rc-pagination-item rc-pagination-item-1", - "rc-pagination-jump-prev", - "rc-pagination-item rc-pagination-item-8 rc-pagination-item-after-jump-prev", - "rc-pagination-item rc-pagination-item-9", - "rc-pagination-item rc-pagination-item-10", - "rc-pagination-item rc-pagination-item-11", - "rc-pagination-item rc-pagination-item-12 rc-pagination-item-active", - "rc-pagination-next rc-pagination-disabled", - "rc-pagination-options", + "prev", + "item item-1", + "jump-prev", + "item item-5 item-after-jump-prev", + "item item-6", + "item item-7 item-active", + "item item-8", + "item item-9 item-before-jump-next", + "jump-next", + "item item-12", + "next", + "options", ] `; exports[`select in sequence should sequence select 120 pages should select page 8 1`] = ` [ - "rc-pagination-prev", - "rc-pagination-item rc-pagination-item-1", - "rc-pagination-jump-prev", - "rc-pagination-item rc-pagination-item-8 rc-pagination-item-after-jump-prev", - "rc-pagination-item rc-pagination-item-9", - "rc-pagination-item rc-pagination-item-10", - "rc-pagination-item rc-pagination-item-11", - "rc-pagination-item rc-pagination-item-12 rc-pagination-item-active", - "rc-pagination-next rc-pagination-disabled", - "rc-pagination-options", + "prev", + "item item-1", + "jump-prev", + "item item-6 item-after-jump-prev", + "item item-7", + "item item-8 item-active", + "item item-9", + "item item-10 item-before-jump-next", + "jump-next", + "item item-12", + "next", + "options", +] +`; + +exports[`select in sequence should sequence select 120 pages should select page 9 1`] = ` +[ + "prev", + "item item-1", + "jump-prev", + "item item-7 item-after-jump-prev", + "item item-8", + "item item-9 item-active", + "item item-10", + "item item-11", + "item item-12", + "next", + "options", +] +`; + +exports[`select in sequence should sequence select 120 pages should select page 10 1`] = ` +[ + "prev", + "item item-1", + "jump-prev", + "item item-8 item-after-jump-prev", + "item item-9", + "item item-10 item-active", + "item item-11", + "item item-12", + "next", + "options", +] +`; + +exports[`select in sequence should sequence select 120 pages should select page 11 1`] = ` +[ + "prev", + "item item-1", + "jump-prev", + "item item-8 item-after-jump-prev", + "item item-9", + "item item-10", + "item item-11 item-active", + "item item-12", + "next", + "options", +] +`; + +exports[`select in sequence should sequence select 120 pages should select page 12 1`] = ` +[ + "prev", + "item item-1", + "jump-prev", + "item item-8 item-after-jump-prev", + "item item-9", + "item item-10", + "item item-11", + "item item-12 item-active", + "next disabled", + "options", ] `; exports[`select in sequence should sequence select 500 pages should select page 2 1`] = ` [ - "rc-pagination-prev", - "rc-pagination-item rc-pagination-item-1", - "rc-pagination-item rc-pagination-item-2 rc-pagination-item-active", - "rc-pagination-item rc-pagination-item-3", - "rc-pagination-item rc-pagination-item-4", - "rc-pagination-item rc-pagination-item-5 rc-pagination-item-before-jump-next", - "rc-pagination-jump-next", - "rc-pagination-item rc-pagination-item-50", - "rc-pagination-next", - "rc-pagination-options", + "prev", + "item item-1", + "item item-2 item-active", + "item item-3", + "item item-4", + "item item-5 item-before-jump-next", + "jump-next", + "item item-50", + "next", + "options", ] `; exports[`select in sequence should sequence select 500 pages should select page 3 1`] = ` [ - "rc-pagination-prev", - "rc-pagination-item rc-pagination-item-1", - "rc-pagination-item rc-pagination-item-2", - "rc-pagination-item rc-pagination-item-3 rc-pagination-item-active", - "rc-pagination-item rc-pagination-item-4", - "rc-pagination-item rc-pagination-item-5 rc-pagination-item-before-jump-next", - "rc-pagination-jump-next", - "rc-pagination-item rc-pagination-item-50", - "rc-pagination-next", - "rc-pagination-options", + "prev", + "item item-1", + "item item-2", + "item item-3 item-active", + "item item-4", + "item item-5 item-before-jump-next", + "jump-next", + "item item-50", + "next", + "options", ] `; exports[`select in sequence should sequence select 500 pages should select page 4 1`] = ` [ - "rc-pagination-prev", - "rc-pagination-item rc-pagination-item-1", - "rc-pagination-item rc-pagination-item-2", - "rc-pagination-item rc-pagination-item-3", - "rc-pagination-item rc-pagination-item-4 rc-pagination-item-active", - "rc-pagination-item rc-pagination-item-5", - "rc-pagination-item rc-pagination-item-6 rc-pagination-item-before-jump-next", - "rc-pagination-jump-next", - "rc-pagination-item rc-pagination-item-50", - "rc-pagination-next", - "rc-pagination-options", + "prev", + "item item-1", + "item item-2", + "item item-3", + "item item-4 item-active", + "item item-5", + "item item-6 item-before-jump-next", + "jump-next", + "item item-50", + "next", + "options", ] `; exports[`select in sequence should sequence select 500 pages should select page 5 1`] = ` [ - "rc-pagination-prev", - "rc-pagination-item rc-pagination-item-1", - "rc-pagination-jump-prev", - "rc-pagination-item rc-pagination-item-3 rc-pagination-item-after-jump-prev", - "rc-pagination-item rc-pagination-item-4", - "rc-pagination-item rc-pagination-item-5 rc-pagination-item-active", - "rc-pagination-item rc-pagination-item-6", - "rc-pagination-item rc-pagination-item-7 rc-pagination-item-before-jump-next", - "rc-pagination-jump-next", - "rc-pagination-item rc-pagination-item-50", - "rc-pagination-next", - "rc-pagination-options", + "prev", + "item item-1", + "jump-prev", + "item item-3 item-after-jump-prev", + "item item-4", + "item item-5 item-active", + "item item-6", + "item item-7 item-before-jump-next", + "jump-next", + "item item-50", + "next", + "options", ] `; exports[`select in sequence should sequence select 500 pages should select page 6 1`] = ` [ - "rc-pagination-prev", - "rc-pagination-item rc-pagination-item-1", - "rc-pagination-jump-prev", - "rc-pagination-item rc-pagination-item-8 rc-pagination-item-after-jump-prev", - "rc-pagination-item rc-pagination-item-9", - "rc-pagination-item rc-pagination-item-10 rc-pagination-item-active", - "rc-pagination-item rc-pagination-item-11", - "rc-pagination-item rc-pagination-item-12 rc-pagination-item-before-jump-next", - "rc-pagination-jump-next", - "rc-pagination-item rc-pagination-item-50", - "rc-pagination-next", - "rc-pagination-options", + "prev", + "item item-1", + "jump-prev", + "item item-4 item-after-jump-prev", + "item item-5", + "item item-6 item-active", + "item item-7", + "item item-8 item-before-jump-next", + "jump-next", + "item item-50", + "next", + "options", ] `; exports[`select in sequence should sequence select 500 pages should select page 7 1`] = ` [ - "rc-pagination-prev", - "rc-pagination-item rc-pagination-item-1", - "rc-pagination-jump-prev", - "rc-pagination-item rc-pagination-item-46 rc-pagination-item-after-jump-prev", - "rc-pagination-item rc-pagination-item-47", - "rc-pagination-item rc-pagination-item-48", - "rc-pagination-item rc-pagination-item-49", - "rc-pagination-item rc-pagination-item-50 rc-pagination-item-active", - "rc-pagination-next rc-pagination-disabled", - "rc-pagination-options", + "prev", + "item item-1", + "jump-prev", + "item item-5 item-after-jump-prev", + "item item-6", + "item item-7 item-active", + "item item-8", + "item item-9 item-before-jump-next", + "jump-next", + "item item-50", + "next", + "options", ] `; exports[`select in sequence should sequence select 500 pages should select page 8 1`] = ` [ - "rc-pagination-prev", - "rc-pagination-item rc-pagination-item-1", - "rc-pagination-jump-prev", - "rc-pagination-item rc-pagination-item-46 rc-pagination-item-after-jump-prev", - "rc-pagination-item rc-pagination-item-47", - "rc-pagination-item rc-pagination-item-48", - "rc-pagination-item rc-pagination-item-49", - "rc-pagination-item rc-pagination-item-50 rc-pagination-item-active", - "rc-pagination-next rc-pagination-disabled", - "rc-pagination-options", + "prev", + "item item-1", + "jump-prev", + "item item-6 item-after-jump-prev", + "item item-7", + "item item-8 item-active", + "item item-9", + "item item-10 item-before-jump-next", + "jump-next", + "item item-50", + "next", + "options", +] +`; + +exports[`select in sequence should sequence select 500 pages should select page 9 1`] = ` +[ + "prev", + "item item-1", + "jump-prev", + "item item-7 item-after-jump-prev", + "item item-8", + "item item-9 item-active", + "item item-10", + "item item-11 item-before-jump-next", + "jump-next", + "item item-50", + "next", + "options", +] +`; + +exports[`select in sequence should sequence select 500 pages should select page 10 1`] = ` +[ + "prev", + "item item-1", + "jump-prev", + "item item-8 item-after-jump-prev", + "item item-9", + "item item-10 item-active", + "item item-11", + "item item-12 item-before-jump-next", + "jump-next", + "item item-50", + "next", + "options", +] +`; + +exports[`select in sequence should sequence select 500 pages should select page 11 1`] = ` +[ + "prev", + "item item-1", + "jump-prev", + "item item-9 item-after-jump-prev", + "item item-10", + "item item-11 item-active", + "item item-12", + "item item-13 item-before-jump-next", + "jump-next", + "item item-50", + "next", + "options", +] +`; + +exports[`select in sequence should sequence select 500 pages should select page 12 1`] = ` +[ + "prev", + "item item-1", + "jump-prev", + "item item-10 item-after-jump-prev", + "item item-11", + "item item-12 item-active", + "item item-13", + "item item-14 item-before-jump-next", + "jump-next", + "item item-50", + "next", + "options", +] +`; + +exports[`select in sequence should sequence select 500 pages should select page 13 1`] = ` +[ + "prev", + "item item-1", + "jump-prev", + "item item-11 item-after-jump-prev", + "item item-12", + "item item-13 item-active", + "item item-14", + "item item-15 item-before-jump-next", + "jump-next", + "item item-50", + "next", + "options", +] +`; + +exports[`select in sequence should sequence select 500 pages should select page 14 1`] = ` +[ + "prev", + "item item-1", + "jump-prev", + "item item-12 item-after-jump-prev", + "item item-13", + "item item-14 item-active", + "item item-15", + "item item-16 item-before-jump-next", + "jump-next", + "item item-50", + "next", + "options", +] +`; + +exports[`select in sequence should sequence select 500 pages should select page 15 1`] = ` +[ + "prev", + "item item-1", + "jump-prev", + "item item-13 item-after-jump-prev", + "item item-14", + "item item-15 item-active", + "item item-16", + "item item-17 item-before-jump-next", + "jump-next", + "item item-50", + "next", + "options", +] +`; + +exports[`select in sequence should sequence select 500 pages should select page 16 1`] = ` +[ + "prev", + "item item-1", + "jump-prev", + "item item-14 item-after-jump-prev", + "item item-15", + "item item-16 item-active", + "item item-17", + "item item-18 item-before-jump-next", + "jump-next", + "item item-50", + "next", + "options", +] +`; + +exports[`select in sequence should sequence select 500 pages should select page 17 1`] = ` +[ + "prev", + "item item-1", + "jump-prev", + "item item-15 item-after-jump-prev", + "item item-16", + "item item-17 item-active", + "item item-18", + "item item-19 item-before-jump-next", + "jump-next", + "item item-50", + "next", + "options", +] +`; + +exports[`select in sequence should sequence select 500 pages should select page 18 1`] = ` +[ + "prev", + "item item-1", + "jump-prev", + "item item-16 item-after-jump-prev", + "item item-17", + "item item-18 item-active", + "item item-19", + "item item-20 item-before-jump-next", + "jump-next", + "item item-50", + "next", + "options", +] +`; + +exports[`select in sequence should sequence select 500 pages should select page 19 1`] = ` +[ + "prev", + "item item-1", + "jump-prev", + "item item-17 item-after-jump-prev", + "item item-18", + "item item-19 item-active", + "item item-20", + "item item-21 item-before-jump-next", + "jump-next", + "item item-50", + "next", + "options", +] +`; + +exports[`select in sequence should sequence select 500 pages should select page 20 1`] = ` +[ + "prev", + "item item-1", + "jump-prev", + "item item-18 item-after-jump-prev", + "item item-19", + "item item-20 item-active", + "item item-21", + "item item-22 item-before-jump-next", + "jump-next", + "item item-50", + "next", + "options", +] +`; + +exports[`select in sequence should sequence select 500 pages should select page 21 1`] = ` +[ + "prev", + "item item-1", + "jump-prev", + "item item-19 item-after-jump-prev", + "item item-20", + "item item-21 item-active", + "item item-22", + "item item-23 item-before-jump-next", + "jump-next", + "item item-50", + "next", + "options", +] +`; + +exports[`select in sequence should sequence select 500 pages should select page 22 1`] = ` +[ + "prev", + "item item-1", + "jump-prev", + "item item-20 item-after-jump-prev", + "item item-21", + "item item-22 item-active", + "item item-23", + "item item-24 item-before-jump-next", + "jump-next", + "item item-50", + "next", + "options", +] +`; + +exports[`select in sequence should sequence select 500 pages should select page 23 1`] = ` +[ + "prev", + "item item-1", + "jump-prev", + "item item-21 item-after-jump-prev", + "item item-22", + "item item-23 item-active", + "item item-24", + "item item-25 item-before-jump-next", + "jump-next", + "item item-50", + "next", + "options", +] +`; + +exports[`select in sequence should sequence select 500 pages should select page 24 1`] = ` +[ + "prev", + "item item-1", + "jump-prev", + "item item-22 item-after-jump-prev", + "item item-23", + "item item-24 item-active", + "item item-25", + "item item-26 item-before-jump-next", + "jump-next", + "item item-50", + "next", + "options", +] +`; + +exports[`select in sequence should sequence select 500 pages should select page 25 1`] = ` +[ + "prev", + "item item-1", + "jump-prev", + "item item-23 item-after-jump-prev", + "item item-24", + "item item-25 item-active", + "item item-26", + "item item-27 item-before-jump-next", + "jump-next", + "item item-50", + "next", + "options", +] +`; + +exports[`select in sequence should sequence select 500 pages should select page 26 1`] = ` +[ + "prev", + "item item-1", + "jump-prev", + "item item-24 item-after-jump-prev", + "item item-25", + "item item-26 item-active", + "item item-27", + "item item-28 item-before-jump-next", + "jump-next", + "item item-50", + "next", + "options", +] +`; + +exports[`select in sequence should sequence select 500 pages should select page 27 1`] = ` +[ + "prev", + "item item-1", + "jump-prev", + "item item-25 item-after-jump-prev", + "item item-26", + "item item-27 item-active", + "item item-28", + "item item-29 item-before-jump-next", + "jump-next", + "item item-50", + "next", + "options", +] +`; + +exports[`select in sequence should sequence select 500 pages should select page 28 1`] = ` +[ + "prev", + "item item-1", + "jump-prev", + "item item-26 item-after-jump-prev", + "item item-27", + "item item-28 item-active", + "item item-29", + "item item-30 item-before-jump-next", + "jump-next", + "item item-50", + "next", + "options", +] +`; + +exports[`select in sequence should sequence select 500 pages should select page 29 1`] = ` +[ + "prev", + "item item-1", + "jump-prev", + "item item-27 item-after-jump-prev", + "item item-28", + "item item-29 item-active", + "item item-30", + "item item-31 item-before-jump-next", + "jump-next", + "item item-50", + "next", + "options", +] +`; + +exports[`select in sequence should sequence select 500 pages should select page 30 1`] = ` +[ + "prev", + "item item-1", + "jump-prev", + "item item-28 item-after-jump-prev", + "item item-29", + "item item-30 item-active", + "item item-31", + "item item-32 item-before-jump-next", + "jump-next", + "item item-50", + "next", + "options", +] +`; + +exports[`select in sequence should sequence select 500 pages should select page 31 1`] = ` +[ + "prev", + "item item-1", + "jump-prev", + "item item-29 item-after-jump-prev", + "item item-30", + "item item-31 item-active", + "item item-32", + "item item-33 item-before-jump-next", + "jump-next", + "item item-50", + "next", + "options", +] +`; + +exports[`select in sequence should sequence select 500 pages should select page 32 1`] = ` +[ + "prev", + "item item-1", + "jump-prev", + "item item-30 item-after-jump-prev", + "item item-31", + "item item-32 item-active", + "item item-33", + "item item-34 item-before-jump-next", + "jump-next", + "item item-50", + "next", + "options", +] +`; + +exports[`select in sequence should sequence select 500 pages should select page 33 1`] = ` +[ + "prev", + "item item-1", + "jump-prev", + "item item-31 item-after-jump-prev", + "item item-32", + "item item-33 item-active", + "item item-34", + "item item-35 item-before-jump-next", + "jump-next", + "item item-50", + "next", + "options", +] +`; + +exports[`select in sequence should sequence select 500 pages should select page 34 1`] = ` +[ + "prev", + "item item-1", + "jump-prev", + "item item-32 item-after-jump-prev", + "item item-33", + "item item-34 item-active", + "item item-35", + "item item-36 item-before-jump-next", + "jump-next", + "item item-50", + "next", + "options", +] +`; + +exports[`select in sequence should sequence select 500 pages should select page 35 1`] = ` +[ + "prev", + "item item-1", + "jump-prev", + "item item-33 item-after-jump-prev", + "item item-34", + "item item-35 item-active", + "item item-36", + "item item-37 item-before-jump-next", + "jump-next", + "item item-50", + "next", + "options", +] +`; + +exports[`select in sequence should sequence select 500 pages should select page 36 1`] = ` +[ + "prev", + "item item-1", + "jump-prev", + "item item-34 item-after-jump-prev", + "item item-35", + "item item-36 item-active", + "item item-37", + "item item-38 item-before-jump-next", + "jump-next", + "item item-50", + "next", + "options", +] +`; + +exports[`select in sequence should sequence select 500 pages should select page 37 1`] = ` +[ + "prev", + "item item-1", + "jump-prev", + "item item-35 item-after-jump-prev", + "item item-36", + "item item-37 item-active", + "item item-38", + "item item-39 item-before-jump-next", + "jump-next", + "item item-50", + "next", + "options", +] +`; + +exports[`select in sequence should sequence select 500 pages should select page 38 1`] = ` +[ + "prev", + "item item-1", + "jump-prev", + "item item-36 item-after-jump-prev", + "item item-37", + "item item-38 item-active", + "item item-39", + "item item-40 item-before-jump-next", + "jump-next", + "item item-50", + "next", + "options", +] +`; + +exports[`select in sequence should sequence select 500 pages should select page 39 1`] = ` +[ + "prev", + "item item-1", + "jump-prev", + "item item-37 item-after-jump-prev", + "item item-38", + "item item-39 item-active", + "item item-40", + "item item-41 item-before-jump-next", + "jump-next", + "item item-50", + "next", + "options", +] +`; + +exports[`select in sequence should sequence select 500 pages should select page 40 1`] = ` +[ + "prev", + "item item-1", + "jump-prev", + "item item-38 item-after-jump-prev", + "item item-39", + "item item-40 item-active", + "item item-41", + "item item-42 item-before-jump-next", + "jump-next", + "item item-50", + "next", + "options", +] +`; + +exports[`select in sequence should sequence select 500 pages should select page 41 1`] = ` +[ + "prev", + "item item-1", + "jump-prev", + "item item-39 item-after-jump-prev", + "item item-40", + "item item-41 item-active", + "item item-42", + "item item-43 item-before-jump-next", + "jump-next", + "item item-50", + "next", + "options", +] +`; + +exports[`select in sequence should sequence select 500 pages should select page 42 1`] = ` +[ + "prev", + "item item-1", + "jump-prev", + "item item-40 item-after-jump-prev", + "item item-41", + "item item-42 item-active", + "item item-43", + "item item-44 item-before-jump-next", + "jump-next", + "item item-50", + "next", + "options", +] +`; + +exports[`select in sequence should sequence select 500 pages should select page 43 1`] = ` +[ + "prev", + "item item-1", + "jump-prev", + "item item-41 item-after-jump-prev", + "item item-42", + "item item-43 item-active", + "item item-44", + "item item-45 item-before-jump-next", + "jump-next", + "item item-50", + "next", + "options", +] +`; + +exports[`select in sequence should sequence select 500 pages should select page 44 1`] = ` +[ + "prev", + "item item-1", + "jump-prev", + "item item-42 item-after-jump-prev", + "item item-43", + "item item-44 item-active", + "item item-45", + "item item-46 item-before-jump-next", + "jump-next", + "item item-50", + "next", + "options", +] +`; + +exports[`select in sequence should sequence select 500 pages should select page 45 1`] = ` +[ + "prev", + "item item-1", + "jump-prev", + "item item-43 item-after-jump-prev", + "item item-44", + "item item-45 item-active", + "item item-46", + "item item-47 item-before-jump-next", + "jump-next", + "item item-50", + "next", + "options", +] +`; + +exports[`select in sequence should sequence select 500 pages should select page 46 1`] = ` +[ + "prev", + "item item-1", + "jump-prev", + "item item-44 item-after-jump-prev", + "item item-45", + "item item-46 item-active", + "item item-47", + "item item-48 item-before-jump-next", + "jump-next", + "item item-50", + "next", + "options", +] +`; + +exports[`select in sequence should sequence select 500 pages should select page 47 1`] = ` +[ + "prev", + "item item-1", + "jump-prev", + "item item-45 item-after-jump-prev", + "item item-46", + "item item-47 item-active", + "item item-48", + "item item-49", + "item item-50", + "next", + "options", +] +`; + +exports[`select in sequence should sequence select 500 pages should select page 48 1`] = ` +[ + "prev", + "item item-1", + "jump-prev", + "item item-46 item-after-jump-prev", + "item item-47", + "item item-48 item-active", + "item item-49", + "item item-50", + "next", + "options", +] +`; + +exports[`select in sequence should sequence select 500 pages should select page 49 1`] = ` +[ + "prev", + "item item-1", + "jump-prev", + "item item-46 item-after-jump-prev", + "item item-47", + "item item-48", + "item item-49 item-active", + "item item-50", + "next", + "options", +] +`; + +exports[`select in sequence should sequence select 500 pages should select page 50 1`] = ` +[ + "prev", + "item item-1", + "jump-prev", + "item item-46 item-after-jump-prev", + "item item-47", + "item item-48", + "item item-49", + "item item-50 item-active", + "next disabled", + "options", ] `; diff --git a/tests/index.test.js b/tests/index.test.js index 541b0cbc..fbd8f56e 100644 --- a/tests/index.test.js +++ b/tests/index.test.js @@ -550,34 +550,50 @@ describe('keyboard support', () => { }); describe('select in sequence', () => { - const serializeCls = (items) => items.map((item) => item.prop('className')); + const serializeCls = (items) => + items.map((item) => + String(item.prop('className')).replaceAll('rc-pagination-', ''), + ); + + class Demo extends React.Component { + state = { current: 1 }; + + changeHandle = (current) => this.setState({ current }); + + render() { + return ( + + ); + } + } function sequenceSelector(total) { describe(`should sequence select ${total} pages`, () => { - const wrapper = mount(); - const items = wrapper.find('li'); - const cls = serializeCls(items); - + const wrapper = mount(); + const cls = serializeCls(wrapper.find('li')); expect(cls).toMatchSnapshot(); - for (let i = 2; i < items.length - 1; i++) { + const pages = Math.floor((total - 1) / 10) + 1; + for (let i = 2; i <= pages; i++) { it(`should select page ${i}`, () => { - items.at(i).simulate('click'); - const newItems = wrapper.find('li'); - const newCls = serializeCls(newItems); - expect(newCls).toMatchSnapshot(); + wrapper.setState({ current: i }); + const cls = serializeCls(wrapper.find('li')); + expect(cls).toMatchSnapshot(); }); } }); } - // coped examples/basic.tsx sequenceSelector(25); sequenceSelector(50); sequenceSelector(60); sequenceSelector(70); sequenceSelector(80); - sequenceSelector(80); + sequenceSelector(90); sequenceSelector(100); sequenceSelector(120); sequenceSelector(500); From 01777a2814e8ee5ef2bfd15a4f4cf79aaf5fef8a Mon Sep 17 00:00:00 2001 From: wuxh Date: Mon, 27 Nov 2023 17:37:25 +0800 Subject: [PATCH 59/64] test: add case --- tests/simple.test.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/simple.test.js b/tests/simple.test.js index 7b440430..51cf2e46 100644 --- a/tests/simple.test.js +++ b/tests/simple.test.js @@ -150,6 +150,20 @@ describe('simple Pagination', () => { expect(input.getDOMNode().value).toBe('2'); }); + it('should work form keyboard enter', () => { + const wrapper = mount(); + const input = wrapper.find('.rc-pagination-simple').find('input'); + + expect(input.exists()).toBeTruthy(); + + input.simulate('change', { target: { value: '8' } }); + input.simulate('keyUp', { key: 'Enter', keyCode: 13, which: 13 }); + + expect( + wrapper.find('.rc-pagination-simple-pager').at(0).prop('title'), + ).toBe('8/10'); + }); + it('gotoButton should work', () => { const wrapper = mount( , From 54ff9dbfcca6d4b7295c11c10a6fa4e7b3c31db3 Mon Sep 17 00:00:00 2001 From: wuxh Date: Mon, 27 Nov 2023 18:17:21 +0800 Subject: [PATCH 60/64] chore: update comment & test case --- src/Pagination.tsx | 4 ++++ tests/simple.test.js | 19 +++++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/src/Pagination.tsx b/src/Pagination.tsx index 66cda6c2..f4ad1a4b 100644 --- a/src/Pagination.tsx +++ b/src/Pagination.tsx @@ -144,6 +144,10 @@ function Pagination(props: PaginationProps) { const shouldDisplayQuickJumper = total > pageSize ? showQuickJumper : false; + /** + * prevent "up arrow" key reseting cursor position within textbox + * @see https://stackoverflow.com/a/1081114 + */ function handleKeyDown(event: React.KeyboardEvent) { if (event.keyCode === KeyCode.UP || event.keyCode === KeyCode.DOWN) { event.preventDefault(); diff --git a/tests/simple.test.js b/tests/simple.test.js index 51cf2e46..35f794b9 100644 --- a/tests/simple.test.js +++ b/tests/simple.test.js @@ -164,6 +164,25 @@ describe('simple Pagination', () => { ).toBe('8/10'); }); + it(`prevent "up arrow" key reseting cursor position within textbox`, () => { + const mockPreventDefault = jest.fn(); + const wrapper = mount(); + const input = wrapper.find('.rc-pagination-simple').find('input'); + + expect(input.exists()).toBeTruthy(); + + input.simulate('change', { target: { value: '8' } }); + input.simulate('keyDown', { + key: 'ArrowUp', + keyCode: 38, + which: 38, + preventDefault: mockPreventDefault, + }); + + expect(mockPreventDefault).toHaveBeenCalled(); + expect(input.getDOMNode().value).toBe('8'); + }); + it('gotoButton should work', () => { const wrapper = mount( , From ed9dac85d132a79135bc95d35ee89bc21db5de1f Mon Sep 17 00:00:00 2001 From: wuxh Date: Mon, 27 Nov 2023 18:35:13 +0800 Subject: [PATCH 61/64] test: add case --- tests/simple.test.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/simple.test.js b/tests/simple.test.js index 35f794b9..f0aada33 100644 --- a/tests/simple.test.js +++ b/tests/simple.test.js @@ -183,6 +183,20 @@ describe('simple Pagination', () => { expect(input.getDOMNode().value).toBe('8'); }); + it('should work when input is not number', () => { + const wrapper = mount(); + const input = wrapper.find('.rc-pagination-simple').find('input'); + + expect(input.exists()).toBeTruthy(); + + input.simulate('change', { target: { value: 'a' } }); // NaN case + input.simulate('blur'); + + expect( + wrapper.find('.rc-pagination-simple-pager').at(0).prop('title'), + ).toBe('5/10'); + }); + it('gotoButton should work', () => { const wrapper = mount( , From f0edee4d2c45466886fe3125d5963dc38a8555eb Mon Sep 17 00:00:00 2001 From: wuxh Date: Mon, 27 Nov 2023 21:36:21 +0800 Subject: [PATCH 62/64] chore: remove debug --- docs/demo/debug.md | 9 - docs/examples/_debug.tsx | 53 --- src/Pagination_deprecated.tsx | 757 ---------------------------------- 3 files changed, 819 deletions(-) delete mode 100644 docs/demo/debug.md delete mode 100644 docs/examples/_debug.tsx delete mode 100644 src/Pagination_deprecated.tsx diff --git a/docs/demo/debug.md b/docs/demo/debug.md deleted file mode 100644 index a46c37cd..00000000 --- a/docs/demo/debug.md +++ /dev/null @@ -1,9 +0,0 @@ ---- -title: 调试用 -nav: - title: Debug - path: /debug -group: debug ---- - - diff --git a/docs/examples/_debug.tsx b/docs/examples/_debug.tsx deleted file mode 100644 index 749acd8d..00000000 --- a/docs/examples/_debug.tsx +++ /dev/null @@ -1,53 +0,0 @@ -import Select from 'rc-select'; -import React from 'react'; -import '../../assets/index.less'; -import type { PaginationProps } from '../../src/interface'; -import Pagination from '../../src/Pagination'; -import OriginPagination from '../../src/Pagination_deprecated'; - -const App = () => { - const [origin, setOrigin] = React.useState(false); - const [all, setAll] = React.useState(false); - - const props: PaginationProps = { - selectComponentClass: Select, - showSizeChanger: true, - onShowSizeChange: console.log, - onChange: console.warn, - current: 1, - total: 0, - showTotal: (total, range) => `${range[0]} - ${range[1]} of ${total} items`, - }; - - const originTip = Origin; - const newTip = New; - - return ( - <> -

    {all ? null : origin ? originTip : newTip}

    - {!all && ( - - )} - -
    - {!all && - React.createElement(origin ? OriginPagination : Pagination, props)} - {all && ( - <> - {originTip} -
    - -
    - {newTip} -
    - - - )} - - ); -}; - -export default App; -// export { default } from '../../tests/two-pagination.jsx' diff --git a/src/Pagination_deprecated.tsx b/src/Pagination_deprecated.tsx deleted file mode 100644 index 7b2d038e..00000000 --- a/src/Pagination_deprecated.tsx +++ /dev/null @@ -1,757 +0,0 @@ -import classNames from 'classnames'; -import KEYCODE from 'rc-util/lib/KeyCode'; -import pickAttrs from 'rc-util/lib/pickAttrs'; -import React, { cloneElement, isValidElement } from 'react'; -import type { PaginationProps, PaginationState } from './interface'; -import LOCALE from './locale/zh_CN'; -import Options from './Options'; -import Pager from './Pager'; - -function noop() {} - -function isInteger(v: number) { - const value = Number(v); - return ( - // eslint-disable-next-line no-restricted-globals - typeof value === 'number' && - !Number.isNaN(value) && - isFinite(value) && - Math.floor(value) === value - ); -} - -const defaultItemRender: PaginationProps['itemRender'] = ( - page, - type, - element, -) => { - return element; -}; - -function calculatePage( - p: number | undefined, - state: PaginationState, - props: PaginationProps, -) { - const pageSize = typeof p === 'undefined' ? state.pageSize : p; - return Math.floor((props.total - 1) / pageSize) + 1; -} - -/** - * @summary This is a deprecated component. Do not use it. - * @since 3.8.0 below - * @deprecated use `Pagination` instead. next minor version will remove - * @description - * I'm a little concerned that there aren't enough test cases to support refactoring😭 - * So I keep the old code here. - */ -class _Pagination extends React.Component { - static defaultProps = { - defaultCurrent: 1, - total: 0, - defaultPageSize: 10, - onChange: noop, - className: '', - selectPrefixCls: 'rc-select', - prefixCls: 'rc-pagination', - selectComponentClass: null, - hideOnSinglePage: false, - showPrevNextJumpers: true, - showQuickJumper: false, - showLessItems: false, - showTitle: true, - onShowSizeChange: noop, - locale: LOCALE, - style: {}, - itemRender: defaultItemRender, - totalBoundaryShowSizeChanger: 50, - }; - paginationNode = React.createRef(); - - constructor(props: PaginationProps) { - super(props); - - const hasOnChange = props.onChange !== noop; - const hasCurrent = 'current' in props; - if (hasCurrent && !hasOnChange) { - // eslint-disable-next-line no-console - console.warn( - 'Warning: You provided a `current` prop to a Pagination component without an `onChange` handler. This will render a read-only component.', - ); - } - - let current = props.defaultCurrent; - if ('current' in props) { - // eslint-disable-next-line prefer-destructuring - current = props.current; - } - - let pageSize = props.defaultPageSize; - if ('pageSize' in props) { - // eslint-disable-next-line prefer-destructuring - pageSize = props.pageSize; - } - - current = Math.min(current, calculatePage(pageSize, undefined, props)); - - this.state = { - current, - currentInputValue: current, - pageSize, - }; - } - - componentDidUpdate(_: PaginationProps, prevState: PaginationState) { - // When current page change, fix focused style of prev item - // A hacky solution of https://github.com/ant-design/ant-design/issues/8948 - const { prefixCls } = this.props; - if ( - prevState.current !== this.state.current && - this.paginationNode.current - ) { - const lastCurrentNode = - this.paginationNode.current.querySelector( - `.${prefixCls}-item-${prevState.current}`, - ); - if (lastCurrentNode && document.activeElement === lastCurrentNode) { - lastCurrentNode?.blur?.(); - } - } - } - - static getDerivedStateFromProps( - props: PaginationProps, - prevState: PaginationState, - ) { - const newState: Partial = {}; - - if ('current' in props) { - newState.current = props.current; - - if (props.current !== prevState.current) { - newState.currentInputValue = newState.current; - } - } - - if ('pageSize' in props && props.pageSize !== prevState.pageSize) { - let { current } = prevState; - const newCurrent = calculatePage(props.pageSize, prevState, props); - current = current > newCurrent ? newCurrent : current; - - if (!('current' in props)) { - newState.current = current; - newState.currentInputValue = current; - } - newState.pageSize = props.pageSize; - } - - return newState; - } - - getJumpPrevPage = () => - Math.max(1, this.state.current - (this.props.showLessItems ? 3 : 5)); - - getJumpNextPage = () => - Math.min( - calculatePage(undefined, this.state, this.props), - this.state.current + (this.props.showLessItems ? 3 : 5), - ); - - getItemIcon = ( - icon: React.ReactNode | React.ComponentType, - label: string, - ) => { - const { prefixCls } = this.props; - let iconNode = icon || ( - - ); - } else { - gotoButton = ( - - {goButton} - - ); - } - gotoButton = ( -
  • - {gotoButton} -
  • - ); - } - - const prev = this.renderPrev(prevPage); - return ( -
      - {totalText} - {prev ? ( -
    • - {prev} -
    • - ) : null} -
    • - - / - {allPages} -
    • -
    • - {this.renderNext(nextPage)} -
    • - -
    - ); - } - - if (allPages <= 3 + pageBufferSize * 2) { - const pagerProps = { - locale, - rootPrefixCls: prefixCls, - onClick: this.handleChange, - onKeyPress: this.runIfEnter, - showTitle, - itemRender, - }; - if (!allPages) { - pagerList.push( - , - ); - } - for (let i = 1; i <= allPages; i += 1) { - const active = current === i; - pagerList.push( - , - ); - } - } else { - const prevItemTitle = showLessItems ? locale.prev_3 : locale.prev_5; - const nextItemTitle = showLessItems ? locale.next_3 : locale.next_5; - - const jumpPrevContent = itemRender( - this.getJumpPrevPage(), - 'jump-prev', - this.getItemIcon(jumpPrevIcon, 'prev page'), - ); - const jumpNextContent = itemRender( - this.getJumpNextPage(), - 'jump-next', - this.getItemIcon(jumpNextIcon, 'next page'), - ); - if (showPrevNextJumpers) { - jumpPrev = jumpPrevContent ? ( -
  • - {jumpPrevContent} -
  • - ) : null; - jumpNext = jumpNextContent ? ( -
  • - {jumpNextContent} -
  • - ) : null; - } - lastPager = ( - - ); - firstPager = ( - - ); - - let left = Math.max(1, current - pageBufferSize); - let right = Math.min(current + pageBufferSize, allPages); - - if (current - 1 <= pageBufferSize) { - right = 1 + pageBufferSize * 2; - } - - if (allPages - current <= pageBufferSize) { - left = allPages - pageBufferSize * 2; - } - - for (let i = left; i <= right; i += 1) { - const active = current === i; - pagerList.push( - , - ); - } - - if (current - 1 >= pageBufferSize * 2 && current !== 1 + 2) { - pagerList[0] = cloneElement(pagerList[0], { - className: `${prefixCls}-item-after-jump-prev`, - }); - pagerList.unshift(jumpPrev); - } - if ( - allPages - current >= pageBufferSize * 2 && - current !== allPages - 2 - ) { - pagerList[pagerList.length - 1] = cloneElement( - pagerList[pagerList.length - 1], - { - className: `${prefixCls}-item-before-jump-next`, - }, - ); - pagerList.push(jumpNext); - } - - if (left !== 1) { - pagerList.unshift(firstPager); - } - if (right !== allPages) { - pagerList.push(lastPager); - } - } - - const prevDisabled = !this.hasPrev() || !allPages; - const nextDisabled = !this.hasNext() || !allPages; - - const prev = this.renderPrev(prevPage); - const next = this.renderNext(nextPage); - return ( -
      - {totalText} - {prev ? ( -
    • - {prev} -
    • - ) : null} - {pagerList} - {next ? ( -
    • - {next} -
    • - ) : null} - -
    - ); - } -} - -export default _Pagination; From 8e7e387a2371c486afed423a7246c0d4b8146ab3 Mon Sep 17 00:00:00 2001 From: wuxh Date: Tue, 28 Nov 2023 10:19:19 +0800 Subject: [PATCH 63/64] test: add case --- tests/__snapshots__/options.test.js.snap | 3 ++ tests/options.test.js | 41 ++++++++++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 tests/__snapshots__/options.test.js.snap create mode 100644 tests/options.test.js diff --git a/tests/__snapshots__/options.test.js.snap b/tests/__snapshots__/options.test.js.snap new file mode 100644 index 00000000..7e59d697 --- /dev/null +++ b/tests/__snapshots__/options.test.js.snap @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`Options should render correctly 1`] = `"
  • 10 条/页
    跳至
  • "`; diff --git a/tests/options.test.js b/tests/options.test.js new file mode 100644 index 00000000..f8d456de --- /dev/null +++ b/tests/options.test.js @@ -0,0 +1,41 @@ +import { mount } from 'enzyme'; +import Select from 'rc-select'; +import zhCN from '../src/locale/zh_CN'; +import Options from '../src/Options'; + +const WrapperOptions = (props) => { + return ( + + ); +}; + +describe('Options', () => { + it('should render correctly', () => { + const wrapper = mount(); + expect(wrapper.html()).toMatchSnapshot(); + }); + + describe('props:buildOptionText', () => { + it('should render correctly', () => { + const mockBuildOptionText = jest + .fn() + .mockImplementation((value) => ( +
    buildOptionText-{value}
    + )); + const wrapper = mount( + , + ); + const options = wrapper.find('.custom-options'); + expect(options).toBeTruthy(); + expect(options.text()).toBe('buildOptionText-10'); + }); + }); +}); From e711387575bd3de9dee0575408f540d5e3f6c079 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=BA=A2?= Date: Tue, 28 Nov 2023 14:19:57 +0800 Subject: [PATCH 64/64] Update jest.config.js Co-authored-by: MadCcc <1075746765@qq.com> --- jest.config.js | 1 - 1 file changed, 1 deletion(-) diff --git a/jest.config.js b/jest.config.js index 5dd41d32..55b2a26f 100644 --- a/jest.config.js +++ b/jest.config.js @@ -7,7 +7,6 @@ module.exports = { }, collectCoverageFrom: [ 'src/**', - '!src/Pagination_deprecated.tsx', '!src/locale/**', ], };