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.
- Loading branch information
1 parent
d069686
commit 22baadd
Showing
21 changed files
with
118 additions
and
4 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
File renamed without changes.
File renamed without changes.
63 changes: 63 additions & 0 deletions
63
...ages/terra-paginator/src/terra-dev-site/doc/example/ControlledPaginatorNoPagesExample.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,63 @@ | ||
import React, { useState } from 'react'; | ||
import Dialog from 'terra-dialog'; | ||
import Button from 'terra-button'; | ||
import ControlledPaginator from 'terra-paginator/lib/ControlledPaginator'; | ||
import classNames from 'classnames/bind'; | ||
import styles from './ControlledPaginatorCommon.module.scss'; | ||
|
||
const cx = classNames.bind(styles); | ||
|
||
const fillArray = (value, len) => { | ||
const arr = []; | ||
for (let i = 0; i < len; i += 1) { | ||
arr.push(<p key={Math.floor(Math.random() * Math.floor(100000))}>{value}</p>); | ||
} | ||
return arr; | ||
}; | ||
|
||
const buildPage = () => { | ||
let fullContent = []; | ||
const content = ('Lorem ipsum dolor sit amet, consectetur adipiscing elit. ' | ||
+ 'Fusce porttitor ullamcorper nisi, vel tincidunt dui pharetra vel. ' | ||
+ 'Morbi eu rutrum nibh, sit amet placerat libero. Integer vel dapibus nibh. ' | ||
+ 'Donec tempor mi vitae lorem congue, ut ultrices metus feugiat. Sed non commodo felis. ' | ||
+ 'Aliquam eget maximus dui, ut rhoncus augue.'); | ||
|
||
fullContent = fillArray(content, 10); | ||
|
||
return ( | ||
fullContent | ||
); | ||
}; | ||
|
||
const ControlledPaginatorExample = () => { | ||
const [content, setContent] = useState(buildPage()); | ||
const [currentPage, setCurrentPage] = useState(1); | ||
|
||
const changePages = (index) => { | ||
setCurrentPage(index); | ||
} | ||
|
||
return ( | ||
<div className={cx('paginator-wrapper')}> | ||
<Dialog | ||
header={( | ||
<h1> | ||
Page | ||
{currentPage} | ||
</h1> | ||
)} | ||
footer={<ControlledPaginator onPageChange={changePages} selectedPage={currentPage} />} | ||
> | ||
<div> | ||
<Button text="Set Page to 9" onClick={() => { setCurrentPage(9); }} /> | ||
<Button text="Set Page to 15" onClick={() => { setCurrentPage(15); }} /> | ||
<Button text="Set Page to 45" onClick={() => { setCurrentPage(45); }} /> | ||
</div> | ||
{content} | ||
</Dialog> | ||
</div> | ||
); | ||
} | ||
|
||
export default ControlledPaginatorExample; |
File renamed without changes.
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
2 changes: 1 addition & 1 deletion
2
...nator/src/terra-dev-site/doc/paginator/ProgressivePaginatorControlled.4.doc.mdx
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
26 changes: 26 additions & 0 deletions
26
...ges/terra-paginator/src/terra-dev-site/test/paginator/ControlledPaginatorNoPages.test.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,26 @@ | ||
import React, { useState } from 'react'; | ||
import Button from 'terra-button'; | ||
import classNames from 'classnames/bind'; | ||
import ControlledPaginator from '../../../ControlledPaginator'; | ||
import styles from './ControlledPaginatorTestCommon.module.scss'; | ||
|
||
const cx = classNames.bind(styles); | ||
|
||
const ControlledPaginatorExample = () => { | ||
const [currentPage, setCurrentPage] = useState(1); | ||
|
||
const changePages = (index) => { | ||
setCurrentPage(index); | ||
} | ||
|
||
return ( | ||
<div className={cx('paginator-wrapper')}> | ||
<Button id="button-9" text="Set Page to 9" onClick={() => { setCurrentPage(9); }} /> | ||
<Button id="button-15" text="Set Page to 15" onClick={() => { setCurrentPage(15); }} /> | ||
<Button id="button-45" text="Set Page to 45" onClick={() => { setCurrentPage(45); }} /> | ||
<ControlledPaginator onPageChange={changePages} selectedPage={currentPage} /> | ||
</div> | ||
); | ||
} | ||
|
||
export default ControlledPaginatorExample; |
Binary file added
BIN
+11.9 KB
.../en/chrome_large/paginator-spec/Controlled_Paginator_without_Total_count[0].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
.../en/chrome_large/paginator-spec/Controlled_Paginator_without_Total_count[1].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
.../en/chrome_large/paginator-spec/Controlled_Paginator_without_Total_count[2].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
.../en/chrome_large/paginator-spec/Controlled_Paginator_without_Total_count[3].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.2 KB
.../en/chrome_large/paginator-spec/Controlled_Paginator_without_Total_count[0].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.3 KB
.../en/chrome_large/paginator-spec/Controlled_Paginator_without_Total_count[1].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.3 KB
.../en/chrome_large/paginator-spec/Controlled_Paginator_without_Total_count[2].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.3 KB
.../en/chrome_large/paginator-spec/Controlled_Paginator_without_Total_count[3].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.7 KB
.../en/chrome_large/paginator-spec/Controlled_Paginator_without_Total_count[0].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.8 KB
.../en/chrome_large/paginator-spec/Controlled_Paginator_without_Total_count[1].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.8 KB
.../en/chrome_large/paginator-spec/Controlled_Paginator_without_Total_count[2].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.8 KB
.../en/chrome_large/paginator-spec/Controlled_Paginator_without_Total_count[3].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