Skip to content

Commit 686779a

Browse files
committed
fix(TablePagination): page max filter removed
1 parent 1a461e8 commit 686779a

File tree

8 files changed

+27
-68
lines changed

8 files changed

+27
-68
lines changed

examples/create-react-app/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"private": true,
55
"dependencies": {
66
"@wfp/icons": "^0.0.57",
7-
"@wfp/ui": "^1.1.42",
7+
"@wfp/ui": "^1.2.0-alpha.4",
88
"node-sass": "^4.9.3",
99
"react": "^16.5.2",
1010
"react-dom": "^16.5.2",

examples/create-react-app/src/App.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import {
1313
Search,
1414
SubNavigation,
1515
User,
16+
InlineLoading,
1617
} from '@wfp/ui';
1718
import logo from './logo.svg';
1819
import './App.scss';
@@ -80,6 +81,7 @@ class App extends Component {
8081
Primary button as link
8182
</Button>
8283
</article>
84+
<InlineLoading />
8385
<Footer
8486
className="some-class"
8587
metaContent="WFP UI Kit version 1.0 – powered by RMT with full …"

examples/create-react-app/yarn.lock

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -892,9 +892,9 @@
892892
version "0.0.57"
893893
resolved "https://registry.yarnpkg.com/@wfp/icons/-/icons-0.0.57.tgz#a8042f75e2017ef46470f983f9d3e1ad20c2f9b6"
894894

895-
"@wfp/ui@^1.1.42":
896-
version "1.1.42"
897-
resolved "https://registry.yarnpkg.com/@wfp/ui/-/ui-1.1.42.tgz#40bb3c08ae2cffefa82db3348c7116c06fbd4441"
895+
"@wfp/ui@^1.2.0-alpha.4":
896+
version "1.2.0-alpha.4"
897+
resolved "https://registry.yarnpkg.com/@wfp/ui/-/ui-1.2.0-alpha.4.tgz#0f0a68a73bf928c4ca893905f02d777afe47ac8c"
898898
dependencies:
899899
classnames "2.2.6"
900900
downshift "^1.31.14"

src/components/InlineLoading/InlineLoading-story.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ const props = () => ({
2929

3030
storiesOf('InlineLoading', module)
3131
.addDecorator(withKnobs)
32-
.add('Inline loading', () => (
32+
.add('Inline loading (draft)', () => (
3333
<div>
3434
<InlineLoading {...props()} />
3535
</div>

src/components/Loading/Loading-story.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,6 @@ const props = () => ({
1919

2020
storiesOf('Loading', module)
2121
.addDecorator(withKnobs)
22-
.add('Default', () => {
22+
.add('Default (Draft)', () => {
2323
return <Loading {...props()} className={'some-class'} />;
2424
});

src/components/Loading/README.md

Lines changed: 11 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1,68 +1,20 @@
1-
### SCSS
1+
Use the **Loading** spinner to indicate a loading time between 1 and 7 seconds. For shorter loading times don't use any loader and for longer use a progress bar to indicate the remaining time.
22

3-
#### Modifiers
4-
5-
Use these modifiers with `.wfp--loading` class.
6-
7-
| Selector | Description |
8-
| -------------------------- | ---------------------------------------- |
9-
| .wfp--loading--small | Class for small loading spinner |
10-
| .wfp--loading--stop | Class for stopping the loading animation |
11-
| .wfp--loading-overlay--stop | Class for hiding the overlay |
12-
13-
### JavaScript
14-
15-
#### Getting component class reference
16-
17-
##### ES2015
18-
19-
```javascript
20-
import { Loading } from 'carbon-components';
21-
```
22-
23-
##### With pre-build bundle (`carbon-components.min.js`)
24-
25-
```javascript
26-
var Loading = CarbonComponents.Loading;
27-
```
28-
29-
#### Instantiating
3+
### Usage (react)
304

315
```javascript
32-
// `#my-loading` is an element with `[data-loading]` attribute
33-
Loading.create(document.getElementById('my-loading'));
34-
```
6+
import { Loading } from '@wfp/ui';
357

36-
#### Public Methods
378

38-
| Name | Params | Description |
39-
| -------- | ---------------- | ----------------------------------------------------------- |
40-
| release | | Deletes the instance |
41-
| set | active : Boolean | Sets the active/inactive state |
42-
| toggle | | Toggles active/inactive state |
43-
| isActive | | Returns current state |
44-
| end | | Runs end animation and then delete the element from the DOM |
45-
46-
##### Example - Activating the loading spinner
47-
48-
```javascript
49-
// `#my-loading` is an element with `[data-loading]` attribute
50-
var loadingInstance = Loading.create(document.getElementById('my-loading'));
51-
loadingInstance.set(true);
9+
<Loading withOverlay={false} active />
5210
```
5311

54-
#### Options
55-
56-
| Option | Default Selector | Description |
57-
| ----------------------- | ------------------------- | ---------------------------------------------------------------- |
58-
| selectorInit | [data-loading] | The CSS selector to find the loading component |
59-
| selectorLoadingOverlay | .wfp--loading-overlay | The selector for the loading overlay. |
60-
| classLoadingOverlayStop | wfp--loading-overlay--stop | The class for the loading overlay's stopped state. |
61-
| active | true | A boolean value representing the initial state of the component. |
12+
#### css Modifiers
6213

63-
##### Example - Activating upon instantiating
14+
Use these modifiers with `.wfp--loading` class.
6415

65-
```javascript
66-
// `#my-loading` is an element with `[data-loading]` attribute
67-
Loading.create(document.getElementById('my-loading'), { active: true });
68-
```
16+
| Selector | Description |
17+
| -------------------------- | ---------------------------------------- |
18+
| .wfp--loading--small | Class for small loading spinner |
19+
| .wfp--loading--stop | Class for stopping the loading animation |
20+
| .wfp--loading-overlay--stop | Class for hiding the overlay |

src/components/Table/README.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,19 @@ We recommend [React-Table](https://react-table.js.org/) for Tables.
22

33
### Pagination
44

5-
To use the custom Pagination you can use the TablePagination component.
5+
To use the custom Pagination you can use the TablePagination component. Additional props for the TablePagination can be directly added to the `ReactTable` component (see Pagination component).
6+
67

78
```js
89
import { TablePagination } from '@wfp/ui';
910

1011
// Replacing the Pagination Component of React-Table
1112

12-
<ReactTable PaginationComponent={TablePagination} />;
13+
<ReactTable
14+
PaginationComponent={TablePagination}
15+
{...yourOtherProps}
16+
{...otherPropsForThePaginationToo}
17+
/>
1318
```
1419

1520
### Responsive

src/components/TablePagination/TablePagination.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ const ReactTablePagination = ({
3434
if (isNaN(newPage)) {
3535
newPage = page;
3636
}
37-
return Math.min(Math.max(newPage, 0), pages - 1);
37+
return newPage;
3838
};
3939

4040
const changePage = page => {

0 commit comments

Comments
 (0)