From a11a3ffd72622b813fd5e25f4157edfef51f7960 Mon Sep 17 00:00:00 2001 From: Prakash K <59553606+prakashks20@users.noreply.github.com> Date: Tue, 2 Jan 2024 23:33:53 +0530 Subject: [PATCH 1/6] Handle Pagination's pageSiseOptions Select showSearch props handle dynamically --- README.md | 1 + src/Options.tsx | 3 ++- src/Pagination.tsx | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index efc21403..265322e3 100644 --- a/README.md +++ b/README.md @@ -64,6 +64,7 @@ ReactDOM.render(, container); | showSizeChanger | show pageSize changer | Bool | `false` when total less then `totalBoundaryShowSizeChanger`, `true` when otherwise | | totalBoundaryShowSizeChanger | when total larger than it, `showSizeChanger` will be true | number | 50 | | pageSizeOptions | specify the sizeChanger selections | Array | ['10', '20', '50', '100'] | +| showSizeOptionsSearch | show the pageSizeOptions Select component search | Bool | Default value is `false`. `false` when total less then `totalBoundaryShowSizeChanger`, `true` when otherwise | | onShowSizeChange | pageSize change callback | Function(current, size) | - | | hideOnSinglePage | hide on single page | Bool | false | | showPrevNextJumpers | show jump-prev, jump-next | Bool | true | diff --git a/src/Options.tsx b/src/Options.tsx index 99733aaf..74cb2814 100644 --- a/src/Options.tsx +++ b/src/Options.tsx @@ -42,6 +42,7 @@ const Options: React.FC = (props) => { selectPrefixCls, disabled, buildOptionText, + showsSizeOtionsSearch } = props; const [goInputText, setGoInputText] = React.useState(''); @@ -128,7 +129,7 @@ const Options: React.FC = (props) => { = (props) => { showTotal, showSizeChanger: showSizeChangerProp, pageSizeOptions, - showsSizeOtionsSearch = false, + showSizeOptionsSearch = false, // render itemRender = defaultItemRender, @@ -583,7 +583,7 @@ const Pagination: React.FC = (props) => { pageSizeOptions={pageSizeOptions} quickGo={shouldDisplayQuickJumper ? handleChange : null} goButton={gotoButton} - showsSizeOtionsSearch={showsSizeOtionsSearch} + showSizeOptionsSearch={showSizeOptionsSearch} /> ); diff --git a/src/interface.ts b/src/interface.ts index 56838c8e..cbea7b83 100644 --- a/src/interface.ts +++ b/src/interface.ts @@ -38,6 +38,7 @@ export interface PaginationData { showTitle: boolean; simple: boolean; disabled: boolean; + showSizeOptionsSearch: boolean; locale: PaginationLocale; From 0bcabf1e73dd17fcf59fd26bef2037f7581bdfd5 Mon Sep 17 00:00:00 2001 From: Prakash K <59553606+prakashks20@users.noreply.github.com> Date: Tue, 9 Jan 2024 22:48:03 +0530 Subject: [PATCH 6/6] Example added for showSizeOptionsSearch in the page options Select component --- docs/examples/jumper.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/examples/jumper.tsx b/docs/examples/jumper.tsx index 182c195b..af5273dc 100644 --- a/docs/examples/jumper.tsx +++ b/docs/examples/jumper.tsx @@ -50,6 +50,7 @@ const App = () => ( total={8} />
+

Page options showSizeOptionsSearch is enabled

( onChange={onChange} pageSize={10} total={8} + showSizeOptionsSearch={true} /> );