From 2200cf0a03887137db85a9cd70aefd0ec5ca42c7 Mon Sep 17 00:00:00 2001
From: tangjinzhou <415800467@qq.com>
Date: Sat, 22 Feb 2020 17:31:19 +0800
Subject: [PATCH] feat: add pagination disabled support
---
build/config.js | 2 +-
components/pagination/Pagination.jsx | 4 +-
.../__tests__/__snapshots__/demo.test.js.snap | 74 ++++++++++++-------
components/pagination/__tests__/index.test.js | 6 ++
components/pagination/demo/basic.md | 2 +-
components/pagination/demo/changer.md | 1 +
components/pagination/demo/jump.md | 4 +
components/pagination/index.en-US.md | 33 +++++----
components/pagination/index.zh-CN.md | 32 ++++----
components/vc-pagination/Options.jsx | 11 ++-
components/vc-pagination/Pager.jsx | 28 ++-----
components/vc-pagination/Pagination.jsx | 18 +++--
components/vc-pagination/index.js | 2 +-
components/vc-pagination/locale/az_AZ.js | 15 ++++
components/vc-pagination/locale/en_GB.js | 2 +-
components/vc-pagination/locale/en_US.js | 2 +-
components/vc-pagination/locale/mk_MK.js | 15 ++++
components/vc-pagination/locale/pa_IN.js | 15 ++++
components/vc-pagination/locale/pb_IN.js | 15 ++++
types/pagination.d.ts | 2 +-
20 files changed, 193 insertions(+), 90 deletions(-)
create mode 100644 components/pagination/__tests__/index.test.js
create mode 100644 components/vc-pagination/locale/az_AZ.js
create mode 100644 components/vc-pagination/locale/mk_MK.js
create mode 100644 components/vc-pagination/locale/pa_IN.js
create mode 100644 components/vc-pagination/locale/pb_IN.js
diff --git a/build/config.js b/build/config.js
index 711f8e157..e041cab95 100644
--- a/build/config.js
+++ b/build/config.js
@@ -1,5 +1,5 @@
module.exports = {
dev: {
- componentName: 'notification', // dev components
+ componentName: 'pagination', // dev components
},
};
diff --git a/components/pagination/Pagination.jsx b/components/pagination/Pagination.jsx
index c3fbd049a..a4df55765 100644
--- a/components/pagination/Pagination.jsx
+++ b/components/pagination/Pagination.jsx
@@ -11,6 +11,7 @@ import { ConfigConsumerProps } from '../config-provider';
export const PaginationProps = () => ({
total: PropTypes.number,
defaultCurrent: PropTypes.number,
+ disabled: PropTypes.bool,
current: PropTypes.number,
defaultPageSize: PropTypes.number,
pageSize: PropTypes.number,
@@ -19,7 +20,7 @@ export const PaginationProps = () => ({
pageSizeOptions: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.number, PropTypes.string])),
buildOptionText: PropTypes.func,
showSizeChange: PropTypes.func,
- showQuickJumper: PropTypes.bool,
+ showQuickJumper: PropTypes.oneOfType([PropTypes.bool, PropTypes.object]),
showTotal: PropTypes.any,
size: PropTypes.string,
simple: PropTypes.bool,
@@ -28,6 +29,7 @@ export const PaginationProps = () => ({
selectPrefixCls: PropTypes.string,
itemRender: PropTypes.any,
role: PropTypes.string,
+ showLessItems: PropTypes.bool,
});
export const PaginationConfig = () => ({
diff --git a/components/pagination/__tests__/__snapshots__/demo.test.js.snap b/components/pagination/__tests__/__snapshots__/demo.test.js.snap
index 074576555..a61e5256e 100644
--- a/components/pagination/__tests__/__snapshots__/demo.test.js.snap
+++ b/components/pagination/__tests__/__snapshots__/demo.test.js.snap
@@ -47,7 +47,7 @@ exports[`renders ./components/pagination/demo/changer.md correctly 1`] = `
-