From fd65f75d71d495fcb79dbbcd4d3157c4d4716347 Mon Sep 17 00:00:00 2001 From: Yuwei Ba Date: Thu, 7 Jan 2016 17:46:36 +0800 Subject: [PATCH 1/6] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20Pagination=20=E6=96=87?= =?UTF-8?q?=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/pagination/index.md | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/components/pagination/index.md b/components/pagination/index.md index b4c62886c1..b9acffad65 100644 --- a/components/pagination/index.md +++ b/components/pagination/index.md @@ -19,15 +19,16 @@ ``` -| 参数 | 说明 | 类型 | 默认值 | -|------------------|------------------------------------|----------|----------------| -| current | 当前页数 | Number | 无 | -| defaultCurrent | 默认的当前页数 | Number | 1 | -| total | 数据总数 | Number | 0 | -| pageSize | 每页条数 | Number | 10 | -| onChange | 页码改变的回调,参数是改变后的页码 | Function | noop | -| showSizeChanger | 是否可以改变 pageSize | Bool | false | -| onShowSizeChange | pageSize 变化的回调 | Function | noop | -| showQuickJumper | 是否可以快速跳转至某页 | Bool | false | -| size | 当为「small」时,是小尺寸分页 | String | "" | -| simple | 当添加该属性时,显示为简单分页 | Object | 无 | +| 参数 | 说明 | 类型 | 默认值 | +|------------------|------------------------------------|---------------|--------------------------| +| current | 当前页数 | Number | 无 | +| defaultCurrent | 默认的当前页数 | Number | 1 | +| total | 数据总数 | Number | 0 | +| pageSize | 每页条数 | Number | 10 | +| onChange | 页码改变的回调,参数是改变后的页码 | Function | noop | +| showSizeChanger | 是否可以改变 pageSize | Bool | false | +| pageSizeOptions | 指定每页可以显示多少条 | Array | ['10', '20', '30', '40'] | +| onShowSizeChange | pageSize 变化的回调 | Function | noop | +| showQuickJumper | 是否可以快速跳转至某页 | Bool | false | +| size | 当为「small」时,是小尺寸分页 | String | "" | +| simple | 当添加该属性时,显示为简单分页 | Object | 无 | From a1040e5ce10f3d17822d7159fd19cd280dccd6ea Mon Sep 17 00:00:00 2001 From: afc163 Date: Thu, 7 Jan 2016 23:56:48 +0800 Subject: [PATCH 2/6] fix time-picker panel width, close #826 --- style/components/timepicker/Picker.less | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/style/components/timepicker/Picker.less b/style/components/timepicker/Picker.less index 25dbc5dcc9..a6c307a944 100644 --- a/style/components/timepicker/Picker.less +++ b/style/components/timepicker/Picker.less @@ -1,5 +1,5 @@ .@{timepicker-prefix-cls}-panel { - min-width: 168px; + max-width: 168px; z-index: 1070; position: absolute; From 1cff3f77f061b96f9ff6121df21e7f8be38f6187 Mon Sep 17 00:00:00 2001 From: afc163 Date: Fri, 8 Jan 2016 00:22:18 +0800 Subject: [PATCH 3/6] fix disabled a style, close #823 --- style/core/base.less | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/style/core/base.less b/style/core/base.less index b678c43e88..8cb73a4fbd 100644 --- a/style/core/base.less +++ b/style/core/base.less @@ -70,7 +70,7 @@ a { } &[disabled] { - // color: @grey-200; + color: #ccc; cursor: not-allowed; pointer-events: none; } From 64cde2e9059de40f8fdedff0b91e86ca7f867725 Mon Sep 17 00:00:00 2001 From: Benjy Cui Date: Fri, 8 Jan 2016 15:28:32 +0800 Subject: [PATCH 4/6] fix: Pagination.onChange should be called #824 --- components/table/demo/paging.md | 3 +++ components/table/index.jsx | 2 ++ 2 files changed, 5 insertions(+) diff --git a/components/table/demo/paging.md b/components/table/demo/paging.md index 9e3917f53b..2459cae6d9 100644 --- a/components/table/demo/paging.md +++ b/components/table/demo/paging.md @@ -39,6 +39,9 @@ const pagination = { showSizeChanger: true, onShowSizeChange: function(current, pageSize) { console.log('Current: ', current, '; PageSize: ', pageSize); + }, + onChange: function(current) { + console.log('Current: ', current); } }; diff --git a/components/table/index.jsx b/components/table/index.jsx index c2c0e73049..3f7e8f815e 100644 --- a/components/table/index.jsx +++ b/components/table/index.jsx @@ -253,6 +253,8 @@ let AntTable = React.createClass({ } else { pagination.current = pagination.current || 1; } + pagination.onChange(pagination.current); + const newState = { selectionDirty: false, pagination From b58142081cb9d23fadb8afd211df3fa646aa7a5e Mon Sep 17 00:00:00 2001 From: Benjy Cui Date: Fri, 8 Jan 2016 16:53:25 +0800 Subject: [PATCH 5/6] feat: add defaultValue for onChange onShowSizeChange --- components/table/index.jsx | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/components/table/index.jsx b/components/table/index.jsx index 3f7e8f815e..b0ca7a8314 100644 --- a/components/table/index.jsx +++ b/components/table/index.jsx @@ -19,6 +19,13 @@ const defaultLocale = { emptyText: '暂无数据', }; +const defaultPagination = { + pageSize: 10, + current: 1, + onChange: noop, + onShowSizeChange: noop, +}; + let AntTable = React.createClass({ getInitialState() { return { @@ -30,10 +37,9 @@ let AntTable = React.createClass({ sortOrder: '', sorter: null, radioIndex: null, - pagination: this.hasPagination() ? objectAssign({ - pageSize: 10, - current: 1 - }, this.props.pagination) : {} + pagination: this.hasPagination() ? + objectAssign({}, defaultPagination, this.props.pagination) : + {}, }; }, @@ -425,9 +431,7 @@ let AntTable = React.createClass({ handleShowSizeChange(current, pageSize) { const pagination = this.state.pagination; - if (pagination.onShowSizeChange) { - pagination.onShowSizeChange(current, pageSize); - } + pagination.onShowSizeChange(current, pageSize); let nextPagination = objectAssign(pagination, { pageSize: pageSize From 5ea2775197c26f04fb2c099a81cb05c6d4833990 Mon Sep 17 00:00:00 2001 From: Benjy Cui Date: Fri, 8 Jan 2016 17:43:04 +0800 Subject: [PATCH 6/6] fix: should not set default value for `open` #818 --- components/time-picker/index.jsx | 1 - 1 file changed, 1 deletion(-) diff --git a/components/time-picker/index.jsx b/components/time-picker/index.jsx index 259773e6c5..750485201c 100644 --- a/components/time-picker/index.jsx +++ b/components/time-picker/index.jsx @@ -15,7 +15,6 @@ const AntTimePicker = React.createClass({ align: { offset: [0, -2], }, - open: false, disabled: false, disabledHours: undefined, disabledMinutes: undefined,