Skip to content

Commit 62e50ed

Browse files
committed
Add itemTitle in pager
1 parent 5e9eb0d commit 62e50ed

File tree

5 files changed

+42
-6
lines changed

5 files changed

+42
-6
lines changed

components/Action/Button/index.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,10 @@ const propTypes = {
7676
transparent: PropTypes.bool,
7777

7878
type: PropTypes.string,
79+
onClickParams: PropTypes.oneOfType([
80+
PropTypes.object,
81+
PropTypes.func,
82+
]),
7983

8084
changeDelay: PropTypes.number,
8185
};
@@ -88,6 +92,7 @@ const defaultProps = {
8892
pending: false,
8993
iconName: undefined,
9094
onClick: () => {}, // no-op
95+
onClickParams: {},
9196
children: undefined,
9297
smallHorizontalPadding: false,
9398
smallVerticalPadding: false,

components/Action/ConditionalActionButton/index.js

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,24 @@ import Button from '../Button';
66
import styles from './styles.scss';
77

88
const propTypes = {
9+
className: PropTypes.string,
10+
activeClassName: PropTypes.string,
11+
condition: PropTypes.func,
12+
value: PropTypes.oneOfType([
13+
PropTypes.string,
14+
PropTypes.object,
15+
PropTypes.array,
16+
PropTypes.number,
17+
]),
18+
onClick: PropTypes.func,
919
};
1020

1121
const defaultProps = {
22+
className: '',
23+
onClick: () => {},
24+
value: {},
25+
condition: () => false,
26+
activeClassName: '',
1227
};
1328

1429
class ConditionalActionButton extends React.PureComponent {
@@ -32,7 +47,6 @@ class ConditionalActionButton extends React.PureComponent {
3247
classNames.push(styles.active);
3348
classNames.push(activeClassName);
3449
}
35-
console.warn(classNames);
3650
return classNames.join(' ');
3751
}
3852

@@ -51,10 +65,11 @@ class ConditionalActionButton extends React.PureComponent {
5165

5266
render() {
5367
const {
54-
value,
55-
className,
56-
onClick,
57-
condition,
68+
value, // eslint-disable-line no-unused-vars
69+
className, // eslint-disable-line no-unused-vars
70+
activeClassName, // eslint-disable-line no-unused-vars
71+
onClick, // eslint-disable-line no-unused-vars
72+
condition, // eslint-disable-line no-unused-vars
5873
...otherProps
5974
} = this.props;
6075

components/Input/MultiSelectInput/index.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,13 @@ export const propTypes = {
4444
label: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
4545
labelSelector: PropTypes.func,
4646
onChange: PropTypes.func.isRequired,
47-
options: PropTypes.arrayOf(PropTypes.object),
47+
options: PropTypes.arrayOf(
48+
PropTypes.oneOfType([
49+
PropTypes.object,
50+
PropTypes.string,
51+
PropTypes.number,
52+
]),
53+
),
4854
optionsClassName: PropTypes.string,
4955
placeholder: PropTypes.string,
5056
renderEmpty: PropTypes.func,

components/View/Pager/index.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ const propTypes = {
1010
activePage: PropTypes.number,
1111
className: PropTypes.string,
1212
itemsCount: PropTypes.number,
13+
itemTitle: PropTypes.string,
1314
maxItemsPerPage: PropTypes.number,
1415
onPageClick: PropTypes.func.isRequired,
1516
totalCapacity: PropTypes.number,
@@ -25,6 +26,7 @@ const defaultProps = {
2526
className: '',
2627
itemsCount: 0,
2728
maxItemsPerPage: 10,
29+
itemTitle: 'items',
2830
totalCapacity: 7,
2931
onItemsPerPageChange: () => {},
3032
options: [
@@ -212,6 +214,7 @@ export default class Pager extends React.PureComponent {
212214
className: classNameFromProps,
213215
itemsCount,
214216
maxItemsPerPage,
217+
itemTitle,
215218
totalCapacity,
216219
showItemsPerPageChange,
217220
options,
@@ -276,6 +279,9 @@ export default class Pager extends React.PureComponent {
276279
<div className={styles.currentItemsEnd}>
277280
{ currentItemsEnd }
278281
</div>
282+
<div className={styles.itemTitle}>
283+
{ itemTitle }
284+
</div>
279285
<div className={styles.of}>
280286
{ ofTitle }
281287
</div>

components/View/Pager/styles.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ $width-item-per-page-input: 48px;
4545
padding: 0 $spacing-extra-small;
4646
}
4747

48+
.item-title {
49+
padding-left: $spacing-small;
50+
}
51+
4852
.current-items-end {
4953
font-family: $font-family-monospace;
5054
}

0 commit comments

Comments
 (0)