This repository has been archived by the owner on May 24, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 166
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Terra-Paginator] Added
hidePageCount
prop to hide default page cou…
…nt provided by Paginator (#3924) Co-authored-by: SM051274 <sm051274@cerner.net>
- Loading branch information
1 parent
fc0fdb6
commit 3b26f35
Showing
21 changed files
with
162 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
56 changes: 56 additions & 0 deletions
56
...s/src/terra-dev-site/doc/paginator/example/ProgressivePaginatorCustomPageCountExample.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
import React from 'react'; | ||
import Dialog from 'terra-dialog'; | ||
import ProgressivePaginator from 'terra-paginator/lib/ProgressivePaginator'; | ||
import classNames from 'classnames/bind'; | ||
import styles from './PaginatorExampleCommon.module.scss'; | ||
|
||
const cx = classNames.bind(styles); | ||
const totalCount = 450; | ||
|
||
const buildPage = () => { | ||
const fullContent = [<p>Patients are requesting greater affordability and efficiency in healthcare. With procedures performed in an ambulatory surgery center costing up to 60% less compared to a hospital outpatient department (1), the demand for these facilities is increasing. In fact, the U.S. ambulatory surgery center market is expected to see a 6.9 % compound annual growth rate, reaching $33 billion by 2028. (2) Cerner understands the urgency to grow in the ambulatory surgery center market while continuing to deliver excellent care. Healthcare IT products can help improve clinician efficiency and patient outcomes, as well as enhance communication and data exchange between ambulatory surgery center providers and patients.</p>]; | ||
|
||
return ( | ||
fullContent | ||
); | ||
}; | ||
|
||
class ProgressivePaginatorCustomPageCountExample extends React.Component { | ||
constructor(props) { | ||
super(props); | ||
|
||
this.state = { | ||
content: buildPage(), | ||
currentPage: 1, | ||
pageLabel: `Summary 1 in ${totalCount}`, | ||
}; | ||
|
||
this.changePages = this.changePages.bind(this); | ||
} | ||
|
||
changePages(index) { | ||
this.setState({ currentPage: index }); | ||
this.setState({ pageLabel: `Summary ${index} of total ${totalCount}` }); | ||
} | ||
|
||
render() { | ||
return ( | ||
<div className={cx('paginator-wrapper')}> | ||
<Dialog | ||
header={( | ||
<h1 id="progressive_paginator_header_id"> | ||
Progressive Paginator With Custom PageLabel and Page Count | ||
</h1> | ||
)} | ||
// eslint-disable-next-line react/prop-types | ||
footer={<ProgressivePaginator onPageChange={this.changePages} selectedPage={this.state.currentPage} totalCount={totalCount} itemCountPerPage={10} ariaLabelledBy="progressive_paginator_header_id" pageLabel={this.state.pageLabel} hidePageCount />} | ||
> | ||
{this.state.content} | ||
</Dialog> | ||
<b>Note: Ensure translated string is provided for pageLabel to make it accessible in different locales</b> | ||
</div> | ||
); | ||
} | ||
} | ||
|
||
export default ProgressivePaginatorCustomPageCountExample; |
55 changes: 55 additions & 0 deletions
55
...s/src/terra-dev-site/doc/paginator/example/ProgressivePaginatorCustomPageLabelExample.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
import React from 'react'; | ||
import Dialog from 'terra-dialog'; | ||
import ProgressivePaginator from 'terra-paginator/lib/ProgressivePaginator'; | ||
import classNames from 'classnames/bind'; | ||
import styles from './PaginatorExampleCommon.module.scss'; | ||
|
||
const cx = classNames.bind(styles); | ||
const totalCount = 450; | ||
const pageLabel = 'Summary'; | ||
|
||
const buildPage = () => { | ||
const fullContent = [<p>Patients are requesting greater affordability and efficiency in healthcare. With procedures performed in an ambulatory surgery center costing up to 60% less compared to a hospital outpatient department (1), the demand for these facilities is increasing. In fact, the U.S. ambulatory surgery center market is expected to see a 6.9 % compound annual growth rate, reaching $33 billion by 2028. (2) Cerner understands the urgency to grow in the ambulatory surgery center market while continuing to deliver excellent care. Healthcare IT products can help improve clinician efficiency and patient outcomes, as well as enhance communication and data exchange between ambulatory surgery center providers and patients.</p>]; | ||
|
||
return ( | ||
fullContent | ||
); | ||
}; | ||
|
||
class ProgressivePaginatorCustomPageLabelExample extends React.Component { | ||
constructor(props) { | ||
super(props); | ||
|
||
this.state = { | ||
content: buildPage(), | ||
currentPage: 1, | ||
}; | ||
|
||
this.changePages = this.changePages.bind(this); | ||
} | ||
|
||
changePages(index) { | ||
this.setState({ currentPage: index }); | ||
} | ||
|
||
render() { | ||
return ( | ||
<div className={cx('paginator-wrapper')}> | ||
<Dialog | ||
header={( | ||
<h1 id="progressive_paginator_header_id"> | ||
Progressive Paginator With Custom Page Label | ||
</h1> | ||
)} | ||
// eslint-disable-next-line react/prop-types | ||
footer={<ProgressivePaginator onPageChange={this.changePages} selectedPage={this.state.currentPage} totalCount={totalCount} itemCountPerPage={10} ariaLabelledBy="progressive_paginator_header_id" pageLabel={pageLabel} />} | ||
> | ||
{this.state.content} | ||
</Dialog> | ||
<b>Note: Ensure translated string is provided for pageLabel to make it accessible in different locales</b> | ||
</div> | ||
); | ||
} | ||
} | ||
|
||
export default ProgressivePaginatorCustomPageLabelExample; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+12.5 KB
...eme/en/chrome_large/paginator-spec/custom_page_label_with_custom_page_count.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+4.03 KB
(150%)
...ght-theme/en/chrome_large/paginator-spec/custom_page_label_with_total_count.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+4.04 KB
(160%)
...-theme/en/chrome_large/paginator-spec/custom_page_label_without_total_count.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+11.4 KB
...ight-theme/en/chrome_large/paginator-spec/paginator_with_default_page_count.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+12.4 KB
...eme/en/chrome_large/paginator-spec/custom_page_label_with_custom_page_count.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+3.89 KB
(150%)
...ion-theme/en/chrome_large/paginator-spec/custom_page_label_with_total_count.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+3.88 KB
(160%)
...-theme/en/chrome_large/paginator-spec/custom_page_label_without_total_count.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+11.4 KB
...sion-theme/en/chrome_large/paginator-spec/paginator_with_default_page_count.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+13 KB
...eme/en/chrome_large/paginator-spec/custom_page_label_with_custom_page_count.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+4.2 KB
(150%)
...ult-theme/en/chrome_large/paginator-spec/custom_page_label_with_total_count.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+4.2 KB
(160%)
...-theme/en/chrome_large/paginator-spec/custom_page_label_without_total_count.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+11.9 KB
...ault-theme/en/chrome_large/paginator-spec/paginator_with_default_page_count.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters