Skip to content

Commit 1784380

Browse files
authored
feat: Add sizeChangerRender instead of selectComponentClass (#631)
* chore: init docs * docs: all cover * test: fix index test * test: fix test * fix: type * test: fix test * chore: update demo * docs: back * test: fix test * test: fix test * chore: fix lint * test: update snapshot
1 parent 8f26e36 commit 1784380

29 files changed

+753
-601
lines changed

docs/examples/align.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import '../../assets/index.less';
22
import React from 'react';
3-
import Pagination from 'rc-pagination';
3+
import Pagination from '../../src';
44

55
const App = () => (
66
<>

docs/examples/basic.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import '../../assets/index.less';
22
import React from 'react';
3-
import Pagination from 'rc-pagination';
3+
import Pagination from '../../src';
44

55
const App = () => (
66
<>

docs/examples/controlled.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React, { useState } from 'react';
2-
import Pagination from 'rc-pagination';
2+
import Pagination from '../../src';
33
import '../../assets/index.less';
44
import 'rc-select/assets/index.less';
55

docs/examples/itemRender.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import '../../assets/index.less';
22
import React from 'react';
3-
import Pagination from 'rc-pagination';
3+
import Pagination from '../../src';
44

55
const itemRender = (current, type, element) => {
66
if (type === 'page') {

docs/examples/jumper.tsx

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
/* eslint func-names: 0, no-console: 0 */
22
import React from 'react';
3-
import Select from 'rc-select';
4-
import Pagination from 'rc-pagination';
53
import '../../assets/index.less';
64
import 'rc-select/assets/index.less';
5+
import PaginationWithSizeChanger from './utils/commonUtil';
76

87
function onShowSizeChange(current, pageSize) {
98
console.log(current);
@@ -18,8 +17,8 @@ function onChange(current, pageSize) {
1817
const App = () => (
1918
<>
2019
<h3>默认</h3>
21-
<Pagination
22-
selectComponentClass={Select}
20+
<PaginationWithSizeChanger
21+
// selectComponentClass={Select}
2322
showQuickJumper
2423
showSizeChanger
2524
defaultPageSize={20}
@@ -29,8 +28,8 @@ const App = () => (
2928
total={450}
3029
/>
3130
<h3>禁用</h3>
32-
<Pagination
33-
selectComponentClass={Select}
31+
<PaginationWithSizeChanger
32+
// selectComponentClass={Select}
3433
showQuickJumper
3534
showSizeChanger
3635
defaultPageSize={20}
@@ -41,17 +40,17 @@ const App = () => (
4140
disabled
4241
/>
4342
<h3>单页默认隐藏</h3>
44-
<Pagination
45-
selectComponentClass={Select}
43+
<PaginationWithSizeChanger
44+
// selectComponentClass={Select}
4645
showQuickJumper
4746
showSizeChanger
4847
onShowSizeChange={onShowSizeChange}
4948
onChange={onChange}
5049
total={8}
5150
/>
5251
<br />
53-
<Pagination
54-
selectComponentClass={Select}
52+
<PaginationWithSizeChanger
53+
// selectComponentClass={Select}
5554
showQuickJumper
5655
showSizeChanger
5756
onShowSizeChange={onShowSizeChange}

docs/examples/jumperWithGoButton.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
/* eslint func-names: 0, no-console: 0 */
22
import React from 'react';
3-
import Select from 'rc-select';
4-
import Pagination from 'rc-pagination';
3+
import Pagination from '../../src';
54
import '../../assets/index.less';
65
import 'rc-select/assets/index.less';
6+
import PaginationWithSizeChanger from './utils/commonUtil';
77

88
class App extends React.Component {
99
onShowSizeChange = (current, pageSize) => {
@@ -20,8 +20,8 @@ class App extends React.Component {
2020
return (
2121
<>
2222
<p> customize node </p>
23-
<Pagination
24-
selectComponentClass={Select}
23+
<PaginationWithSizeChanger
24+
// selectComponentClass={Select}
2525
showSizeChanger
2626
showQuickJumper={{ goButton: <button type="button">确定</button> }}
2727
defaultPageSize={20}

docs/examples/lessPages.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* eslint func-names: 0, no-console: 0 */
22
import React from 'react';
3-
import Pagination from 'rc-pagination';
3+
import Pagination from '../../src';
44
import '../../assets/index.less';
55

66
const arrowPath =

docs/examples/locale.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
/* eslint func-names: 0, no-console: 0 */
22
import React from 'react';
3-
import Select from 'rc-select';
4-
import Pagination from 'rc-pagination';
53
import localeInfo from '../../src/locale/en_US';
64
import '../../assets/index.less';
75
import 'rc-select/assets/index.less';
6+
import PaginationWithSizeChanger from './utils/commonUtil';
87

98
function onShowSizeChange(current, pageSize) {
109
console.log(current);
@@ -17,8 +16,8 @@ function onChange(current, pageSize) {
1716
}
1817

1918
const App = () => (
20-
<Pagination
21-
selectComponentClass={Select}
19+
<PaginationWithSizeChanger
20+
// selectComponentClass={Select}
2221
showQuickJumper
2322
showSizeChanger
2423
defaultPageSize={20}

docs/examples/more.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import '../../assets/index.less';
22
import React from 'react';
3-
import Pagination from 'rc-pagination';
3+
import Pagination from '../../src';
44

55
const App = () => (
66
<Pagination className="ant-pagination" defaultCurrent={3} total={450} />

docs/examples/showSizeChanger.tsx

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import React from 'react';
2-
import Pagination from 'rc-pagination';
3-
import Select from 'rc-select';
42
import '../../assets/index.less';
3+
import PaginationWithSizeChanger from './utils/commonUtil';
54

65
export default () => {
76
const onPageSizeOnChange = (value) => {
@@ -10,31 +9,31 @@ export default () => {
109

1110
return (
1211
<>
13-
<Pagination
12+
<PaginationWithSizeChanger
1413
defaultCurrent={1}
1514
total={50}
16-
selectComponentClass={Select}
15+
// selectComponentClass={Select}
1716
showSizeChanger={false}
1817
/>
19-
<Pagination
18+
<PaginationWithSizeChanger
2019
defaultCurrent={1}
2120
total={50}
22-
selectComponentClass={Select}
21+
// selectComponentClass={Select}
2322
showSizeChanger
2423
/>
25-
<Pagination
24+
<PaginationWithSizeChanger
2625
defaultCurrent={1}
27-
total={50}
28-
selectComponentClass={Select}
29-
showSizeChanger={{
26+
showSizeChanger
27+
// selectComponentClass={Select}
28+
sizeChangerProps={{
3029
options: [
31-
{ value: '10', label: '10 条每页' },
32-
{ value: '25', label: '25 条每页' },
33-
{ value: '100', label: '100 条每页' },
30+
{ value: 10, label: '10 条每页' },
31+
{ value: 25, label: '25 条每页' },
32+
{ value: 100, label: '100 条每页' },
3433
],
35-
className: 'my-select',
36-
showSearch: true,
37-
onChange: onPageSizeOnChange,
34+
// className: 'my-select',
35+
// showSearch: true,
36+
// onChange: onPageSizeOnChange,
3837
}}
3938
/>
4039
</>

0 commit comments

Comments
 (0)