From 16dfa6edaba961ec4c281338ed9fb0a96151bf32 Mon Sep 17 00:00:00 2001 From: ZOPEUGAH Date: Thu, 24 Mar 2022 13:58:14 +0100 Subject: [PATCH 1/3] fixed issue #373 --- src/components/Pagination/index.tsx | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/components/Pagination/index.tsx b/src/components/Pagination/index.tsx index 47fa9f70..b093c5f7 100644 --- a/src/components/Pagination/index.tsx +++ b/src/components/Pagination/index.tsx @@ -9,6 +9,12 @@ export interface PaginationChangeEvent { */ value: number; } +export interface PaginationSizeChangeEvent { + /** + * The current item size per page. + */ + value: number; +} export interface PaginationState { current: number; @@ -68,6 +74,10 @@ export interface PaginationProps extends StandardProps { * Event fired when the selected page changes. */ onChange?(e: PaginationChangeEvent): void; + /** + * Event fired when the size per page changes. + */ + onSizeChanged?(e: PaginationSizeChangeEvent): void; /** * The optional footer info label override, e.g., for localization. */ @@ -137,7 +147,7 @@ export class Pagination extends React.Component { - const { children } = this.props; + const { children, onSizeChanged } = this.props; const { current } = this.state; const total = React.Children.count(children); const maxPageCount = Math.max(Math.ceil(total / size) - 1, 0); @@ -145,6 +155,12 @@ export class Pagination extends React.Component Date: Thu, 24 Mar 2022 14:05:06 +0100 Subject: [PATCH 2/3] updated changelog and package.json --- CHANGELOG.md | 3 +++ package.json | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 59d88d77..975db129 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ # Precise UI Changelog +## 2.1.11 + +- fixed issue 373, passed onSizeChanged event as a prop to the Pagination component ## 2.1.10 - Fix WCAG error: Empty table header diff --git a/package.json b/package.json index ba0185c8..0bd0f850 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "precise-ui", - "version": "2.1.10", + "version": "2.1.11", "description": "Precise UI React component library powered by Styled Components.", "keywords": [ "react", From 4e049f04c8e1a7f80d9d090d243b66078b96f677 Mon Sep 17 00:00:00 2001 From: peterugah Date: Thu, 24 Mar 2022 15:51:08 +0100 Subject: [PATCH 3/3] added space to changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 975db129..8b387609 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ## 2.1.11 - fixed issue 373, passed onSizeChanged event as a prop to the Pagination component + ## 2.1.10 - Fix WCAG error: Empty table header