@dhis2-ui/pagination 8.1.11 → 8.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cjs/__fixtures__/index.js +16 -2
- package/build/cjs/__tests__/get-item-range.test.js +9 -9
- package/build/cjs/__tests__/page-controls.test.js +11 -11
- package/build/cjs/__tests__/page-summary.test.js +3 -3
- package/build/cjs/__tests__/pagination.test.js +124 -32
- package/build/cjs/get-default-page-summary-text.js +9 -7
- package/build/cjs/get-item-range.js +8 -7
- package/build/cjs/page-controls.js +34 -30
- package/build/cjs/page-select.js +36 -27
- package/build/cjs/page-size-select.js +36 -27
- package/build/cjs/page-summary.js +22 -15
- package/build/cjs/pagination.js +30 -23
- package/build/cjs/pagination.stories.js +10 -15
- package/build/es/__fixtures__/index.js +13 -1
- package/build/es/__tests__/get-item-range.test.js +9 -9
- package/build/es/__tests__/page-controls.test.js +11 -11
- package/build/es/__tests__/page-summary.test.js +3 -3
- package/build/es/__tests__/pagination.test.js +122 -29
- package/build/es/get-default-page-summary-text.js +9 -7
- package/build/es/get-item-range.js +8 -7
- package/build/es/page-controls.js +35 -30
- package/build/es/page-select.js +36 -27
- package/build/es/page-size-select.js +36 -27
- package/build/es/page-summary.js +21 -15
- package/build/es/pagination.js +30 -23
- package/build/es/pagination.stories.js +8 -14
- package/package.json +5 -5
|
@@ -3,7 +3,7 @@ import { Button } from '@dhis2-ui/button';
|
|
|
3
3
|
import { spacers } from '@dhis2/ui-constants';
|
|
4
4
|
import { IconChevronLeft16, IconChevronRight16 } from '@dhis2/ui-icons';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
|
-
import React from 'react';
|
|
6
|
+
import React from 'react';
|
|
7
7
|
|
|
8
8
|
const translate = (prop, interpolationObject) => {
|
|
9
9
|
if (typeof prop === 'function') {
|
|
@@ -13,34 +13,38 @@ const translate = (prop, interpolationObject) => {
|
|
|
13
13
|
return prop;
|
|
14
14
|
};
|
|
15
15
|
|
|
16
|
-
const PageControls =
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
},
|
|
16
|
+
const PageControls = _ref => {
|
|
17
|
+
let {
|
|
18
|
+
dataTest,
|
|
19
|
+
isNextDisabled,
|
|
20
|
+
isPreviousDisabled,
|
|
21
|
+
nextPageText,
|
|
22
|
+
page,
|
|
23
|
+
previousPageText,
|
|
24
|
+
onClick
|
|
25
|
+
} = _ref;
|
|
26
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
27
|
+
"data-test": "".concat(dataTest, "-pagecontrols"),
|
|
28
|
+
className: _JSXStyle.dynamic([["2407365506", [spacers.dp4]]])
|
|
29
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
|
30
|
+
secondary: true,
|
|
31
|
+
className: "button-previous",
|
|
32
|
+
small: true,
|
|
33
|
+
disabled: isPreviousDisabled,
|
|
34
|
+
onClick: () => onClick(page - 1),
|
|
35
|
+
dataTest: "".concat(dataTest, "-page-previous")
|
|
36
|
+
}, /*#__PURE__*/React.createElement(IconChevronLeft16, null), translate(previousPageText)), /*#__PURE__*/React.createElement(Button, {
|
|
37
|
+
secondary: true,
|
|
38
|
+
className: "button-next",
|
|
39
|
+
small: true,
|
|
40
|
+
disabled: isNextDisabled,
|
|
41
|
+
onClick: () => onClick(page + 1),
|
|
42
|
+
dataTest: "".concat(dataTest, "-page-next")
|
|
43
|
+
}, translate(nextPageText), /*#__PURE__*/React.createElement(IconChevronRight16, null)), /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
44
|
+
id: "2407365506",
|
|
45
|
+
dynamic: [spacers.dp4]
|
|
46
|
+
}, ["div.__jsx-style-dynamic-selector{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;}", "div.__jsx-style-dynamic-selector .button-previous{height:32px;padding-left:0;}", "div.__jsx-style-dynamic-selector .button-next{height:32px;padding-right:0;margin-left:".concat(spacers.dp4, ";}")]));
|
|
47
|
+
};
|
|
44
48
|
|
|
45
49
|
PageControls.propTypes = {
|
|
46
50
|
dataTest: PropTypes.string.isRequired,
|
|
@@ -48,6 +52,7 @@ PageControls.propTypes = {
|
|
|
48
52
|
page: PropTypes.number.isRequired,
|
|
49
53
|
previousPageText: PropTypes.oneOfType([PropTypes.string, PropTypes.func]).isRequired,
|
|
50
54
|
onClick: PropTypes.func.isRequired,
|
|
51
|
-
|
|
55
|
+
isNextDisabled: PropTypes.bool,
|
|
56
|
+
isPreviousDisabled: PropTypes.bool
|
|
52
57
|
};
|
|
53
58
|
export { PageControls };
|
package/build/es/page-select.js
CHANGED
|
@@ -16,38 +16,47 @@ const createAvailablePages = length => Array.from({
|
|
|
16
16
|
length
|
|
17
17
|
}, (_x, i) => (i + 1).toString());
|
|
18
18
|
|
|
19
|
-
const PageSelect =
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
},
|
|
19
|
+
const PageSelect = _ref => {
|
|
20
|
+
let {
|
|
21
|
+
dataTest,
|
|
22
|
+
disabled,
|
|
23
|
+
pageSelectText,
|
|
24
|
+
onChange,
|
|
25
|
+
page,
|
|
26
|
+
pageCount
|
|
27
|
+
} = _ref;
|
|
28
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
29
|
+
"data-test": "".concat(dataTest, "-gotopage"),
|
|
30
|
+
className: _JSXStyle.dynamic([["485717002", [spacers.dp12]]])
|
|
31
|
+
}, /*#__PURE__*/React.createElement(SingleSelect, {
|
|
32
|
+
dense: true,
|
|
33
|
+
disabled: disabled,
|
|
34
|
+
selected: page.toString(),
|
|
35
|
+
onChange: _ref2 => {
|
|
36
|
+
let {
|
|
37
|
+
selected
|
|
38
|
+
} = _ref2;
|
|
39
|
+
return onChange(parseInt(selected, 10));
|
|
40
|
+
},
|
|
41
|
+
className: "select",
|
|
42
|
+
dataTest: "".concat(dataTest, "-page-select"),
|
|
43
|
+
prefix: translate(pageSelectText)
|
|
44
|
+
}, createAvailablePages(pageCount).map(availablePage => /*#__PURE__*/React.createElement(SingleSelectOption, {
|
|
45
|
+
key: availablePage,
|
|
46
|
+
value: availablePage,
|
|
47
|
+
label: availablePage
|
|
48
|
+
}))), /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
49
|
+
id: "485717002",
|
|
50
|
+
dynamic: [spacers.dp12]
|
|
51
|
+
}, ["div.__jsx-style-dynamic-selector{margin-right:".concat(spacers.dp12, ";}")]));
|
|
52
|
+
};
|
|
45
53
|
|
|
46
54
|
PageSelect.propTypes = {
|
|
47
55
|
dataTest: PropTypes.string.isRequired,
|
|
48
56
|
page: PropTypes.number.isRequired,
|
|
49
57
|
pageCount: PropTypes.number.isRequired,
|
|
50
58
|
pageSelectText: PropTypes.oneOfType([PropTypes.string, PropTypes.func]).isRequired,
|
|
51
|
-
onChange: PropTypes.func.isRequired
|
|
59
|
+
onChange: PropTypes.func.isRequired,
|
|
60
|
+
disabled: PropTypes.bool
|
|
52
61
|
};
|
|
53
62
|
export { PageSelect, createAvailablePages };
|
|
@@ -12,38 +12,47 @@ const translate = (prop, interpolationObject) => {
|
|
|
12
12
|
return prop;
|
|
13
13
|
};
|
|
14
14
|
|
|
15
|
-
const PageSizeSelect =
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
},
|
|
15
|
+
const PageSizeSelect = _ref => {
|
|
16
|
+
let {
|
|
17
|
+
dataTest,
|
|
18
|
+
disabled,
|
|
19
|
+
pageSizeSelectText,
|
|
20
|
+
pageSize,
|
|
21
|
+
pageSizes,
|
|
22
|
+
onChange
|
|
23
|
+
} = _ref;
|
|
24
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
25
|
+
"data-test": "".concat(dataTest, "-pagesize"),
|
|
26
|
+
className: _JSXStyle.dynamic([["1934482915", [spacers.dp12]]])
|
|
27
|
+
}, /*#__PURE__*/React.createElement(SingleSelect, {
|
|
28
|
+
dense: true,
|
|
29
|
+
disabled: disabled,
|
|
30
|
+
selected: pageSize.toString(),
|
|
31
|
+
onChange: _ref2 => {
|
|
32
|
+
let {
|
|
33
|
+
selected
|
|
34
|
+
} = _ref2;
|
|
35
|
+
return onChange(parseInt(selected, 10));
|
|
36
|
+
},
|
|
37
|
+
className: "select",
|
|
38
|
+
dataTest: "".concat(dataTest, "-pagesize-select"),
|
|
39
|
+
prefix: translate(pageSizeSelectText)
|
|
40
|
+
}, pageSizes.map(length => /*#__PURE__*/React.createElement(SingleSelectOption, {
|
|
41
|
+
key: length,
|
|
42
|
+
value: length,
|
|
43
|
+
label: length
|
|
44
|
+
}))), /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
45
|
+
id: "1934482915",
|
|
46
|
+
dynamic: [spacers.dp12]
|
|
47
|
+
}, ["div.__jsx-style-dynamic-selector{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-flex-shrink:0;-ms-flex-negative:0;flex-shrink:0;min-height:32px;margin-right:".concat(spacers.dp12, ";-webkit-box-flex:1;-webkit-flex-grow:1;-ms-flex-positive:1;flex-grow:1;}")]));
|
|
48
|
+
};
|
|
41
49
|
|
|
42
50
|
PageSizeSelect.propTypes = {
|
|
43
51
|
dataTest: PropTypes.string.isRequired,
|
|
44
52
|
pageSize: PropTypes.number.isRequired,
|
|
45
53
|
pageSizeSelectText: PropTypes.oneOfType([PropTypes.string, PropTypes.func]).isRequired,
|
|
46
54
|
pageSizes: PropTypes.arrayOf(PropTypes.string).isRequired,
|
|
47
|
-
onChange: PropTypes.func.isRequired
|
|
55
|
+
onChange: PropTypes.func.isRequired,
|
|
56
|
+
disabled: PropTypes.bool
|
|
48
57
|
};
|
|
49
58
|
export { PageSizeSelect };
|
package/build/es/page-summary.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import _JSXStyle from "styled-jsx/style";
|
|
2
2
|
import { colors, spacers } from '@dhis2/ui-constants';
|
|
3
|
+
import cx from 'classnames';
|
|
3
4
|
import PropTypes from 'prop-types';
|
|
4
5
|
import React from 'react';
|
|
5
6
|
|
|
@@ -11,15 +12,17 @@ const translate = (prop, interpolationObject) => {
|
|
|
11
12
|
return prop;
|
|
12
13
|
};
|
|
13
14
|
|
|
14
|
-
const PageSummary =
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
15
|
+
const PageSummary = _ref => {
|
|
16
|
+
let {
|
|
17
|
+
dataTest,
|
|
18
|
+
firstItem,
|
|
19
|
+
inactive,
|
|
20
|
+
lastItem,
|
|
21
|
+
page,
|
|
22
|
+
pageCount,
|
|
23
|
+
pageSummaryText,
|
|
24
|
+
total
|
|
25
|
+
} = _ref;
|
|
23
26
|
const summary = translate(pageSummaryText, {
|
|
24
27
|
firstItem,
|
|
25
28
|
lastItem,
|
|
@@ -28,14 +31,16 @@ const PageSummary = ({
|
|
|
28
31
|
total
|
|
29
32
|
});
|
|
30
33
|
return /*#__PURE__*/React.createElement("div", {
|
|
31
|
-
"data-test":
|
|
32
|
-
className: _JSXStyle.dynamic([["
|
|
34
|
+
"data-test": "".concat(dataTest, "-summary"),
|
|
35
|
+
className: _JSXStyle.dynamic([["1022808428", [spacers.dp12, colors.grey700, colors.grey500]]])
|
|
33
36
|
}, /*#__PURE__*/React.createElement("span", {
|
|
34
|
-
className: _JSXStyle.dynamic([["
|
|
37
|
+
className: _JSXStyle.dynamic([["1022808428", [spacers.dp12, colors.grey700, colors.grey500]]]) + " " + (cx({
|
|
38
|
+
inactive
|
|
39
|
+
}) || "")
|
|
35
40
|
}, summary), /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
36
|
-
id: "
|
|
37
|
-
dynamic: [spacers.dp12, colors.grey700]
|
|
38
|
-
}, [
|
|
41
|
+
id: "1022808428",
|
|
42
|
+
dynamic: [spacers.dp12, colors.grey700, colors.grey500]
|
|
43
|
+
}, ["div.__jsx-style-dynamic-selector{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-flex-shrink:0;-ms-flex-negative:0;flex-shrink:0;min-height:32px;margin-right:".concat(spacers.dp12, ";}"), "span.__jsx-style-dynamic-selector{color:".concat(colors.grey700, ";font-size:14px;}"), "span.inactive.__jsx-style-dynamic-selector{color:".concat(colors.grey500, ";}")]));
|
|
39
44
|
};
|
|
40
45
|
|
|
41
46
|
PageSummary.propTypes = {
|
|
@@ -43,6 +48,7 @@ PageSummary.propTypes = {
|
|
|
43
48
|
page: PropTypes.number.isRequired,
|
|
44
49
|
pageSummaryText: PropTypes.oneOfType([PropTypes.string, PropTypes.func]).isRequired,
|
|
45
50
|
firstItem: PropTypes.number,
|
|
51
|
+
inactive: PropTypes.bool,
|
|
46
52
|
lastItem: PropTypes.number,
|
|
47
53
|
pageCount: PropTypes.number,
|
|
48
54
|
total: PropTypes.number
|
package/build/es/pagination.js
CHANGED
|
@@ -12,27 +12,29 @@ import { PageSizeSelect } from './page-size-select.js';
|
|
|
12
12
|
import { PageSummary } from './page-summary.js';
|
|
13
13
|
const MAX_PAGE_COUNT = 2000;
|
|
14
14
|
|
|
15
|
-
const Pagination =
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
15
|
+
const Pagination = _ref => {
|
|
16
|
+
let {
|
|
17
|
+
className,
|
|
18
|
+
dataTest,
|
|
19
|
+
disabled,
|
|
20
|
+
hidePageSelect,
|
|
21
|
+
hidePageSizeSelect,
|
|
22
|
+
hidePageSummary,
|
|
23
|
+
isLastPage,
|
|
24
|
+
nextPageText,
|
|
25
|
+
onPageChange,
|
|
26
|
+
onPageSizeChange,
|
|
27
|
+
page,
|
|
28
|
+
pageCount,
|
|
29
|
+
pageLength,
|
|
30
|
+
pageSelectText,
|
|
31
|
+
pageSize,
|
|
32
|
+
pageSizes,
|
|
33
|
+
pageSizeSelectText,
|
|
34
|
+
pageSummaryText,
|
|
35
|
+
previousPageText,
|
|
36
|
+
total
|
|
37
|
+
} = _ref;
|
|
36
38
|
const {
|
|
37
39
|
firstItem,
|
|
38
40
|
lastItem
|
|
@@ -51,12 +53,14 @@ const Pagination = ({
|
|
|
51
53
|
className: "jsx-3647884394" + " " + "spacer"
|
|
52
54
|
}) : /*#__PURE__*/React.createElement(PageSizeSelect, {
|
|
53
55
|
dataTest: dataTest,
|
|
56
|
+
disabled: disabled,
|
|
54
57
|
pageSize: pageSize,
|
|
55
58
|
pageSizes: pageSizes,
|
|
56
59
|
onChange: onPageSizeChange,
|
|
57
60
|
pageSizeSelectText: pageSizeSelectText
|
|
58
61
|
}), !hidePageSummary && /*#__PURE__*/React.createElement(PageSummary, {
|
|
59
62
|
dataTest: dataTest,
|
|
63
|
+
inactive: disabled,
|
|
60
64
|
firstItem: firstItem,
|
|
61
65
|
lastItem: lastItem,
|
|
62
66
|
page: page,
|
|
@@ -67,17 +71,19 @@ const Pagination = ({
|
|
|
67
71
|
className: "jsx-3647884394" + " " + "page-navigation"
|
|
68
72
|
}, showPageSelect && /*#__PURE__*/React.createElement(PageSelect, {
|
|
69
73
|
dataTest: dataTest,
|
|
74
|
+
disabled: disabled,
|
|
70
75
|
pageSelectText: pageSelectText,
|
|
71
76
|
page: page,
|
|
72
77
|
pageCount: pageCount,
|
|
73
78
|
onChange: onPageChange
|
|
74
79
|
}), /*#__PURE__*/React.createElement(PageControls, {
|
|
75
80
|
dataTest: dataTest,
|
|
76
|
-
isLastPage: isLastPage || page === pageCount,
|
|
77
81
|
nextPageText: nextPageText,
|
|
78
82
|
page: page,
|
|
79
83
|
previousPageText: previousPageText,
|
|
80
|
-
onClick: onPageChange
|
|
84
|
+
onClick: onPageChange,
|
|
85
|
+
isNextDisabled: disabled || isLastPage || page === pageCount,
|
|
86
|
+
isPreviousDisabled: disabled || page === 1
|
|
81
87
|
})), /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
82
88
|
id: "3647884394"
|
|
83
89
|
}, [".container.jsx-3647884394{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-wrap:wrap;-ms-flex-wrap:wrap;flex-wrap:wrap;}", ".spacer.jsx-3647884394{-webkit-box-flex:1;-webkit-flex-grow:1;-ms-flex-positive:1;flex-grow:1;}", ".page-navigation.jsx-3647884394{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-flex-shrink:0;-ms-flex-negative:0;flex-shrink:0;min-height:32px;}"]));
|
|
@@ -97,6 +103,7 @@ Pagination.propTypes = {
|
|
|
97
103
|
pageSize: PropTypes.number.isRequired,
|
|
98
104
|
className: PropTypes.string,
|
|
99
105
|
dataTest: PropTypes.string,
|
|
106
|
+
disabled: PropTypes.bool,
|
|
100
107
|
hidePageSelect: PropTypes.bool,
|
|
101
108
|
hidePageSizeSelect: PropTypes.bool,
|
|
102
109
|
hidePageSummary: PropTypes.bool,
|
|
@@ -3,28 +3,18 @@ import React from 'react';
|
|
|
3
3
|
import * as pagers from './__fixtures__/index.js';
|
|
4
4
|
import { Pagination } from './pagination.js';
|
|
5
5
|
const subtitle = 'Allows navigation through data displayed over several pages';
|
|
6
|
-
const description =
|
|
7
|
-
Pagination allows data to be split in pages. Paging large amounts of data avoids overwhelming users and should always be used wherever a lot of data is displayed. Pagination controls allow a user to browse through a set of data or navigate to a specific page depending on the type of pagination used.
|
|
8
|
-
|
|
9
|
-
**Do not rely on pagination for navigating datasets. A user should be able to search within, sort and filter datasets too, rather than needing to click through many pages looking for the right data item.**
|
|
10
|
-
|
|
11
|
-
\`\`\`js
|
|
12
|
-
import { Pagination } from '@dhis2/ui'
|
|
13
|
-
\`\`\`
|
|
14
|
-
|
|
15
|
-
_**Note**: Dropdown menus may not display properly on this page. View these demos in the 'Canvas' tab._
|
|
16
|
-
`;
|
|
6
|
+
const description = "\nPagination allows data to be split in pages. Paging large amounts of data avoids overwhelming users and should always be used wherever a lot of data is displayed. Pagination controls allow a user to browse through a set of data or navigate to a specific page depending on the type of pagination used.\n\n**Do not rely on pagination for navigating datasets. A user should be able to search within, sort and filter datasets too, rather than needing to click through many pages looking for the right data item.**\n\n```js\nimport { Pagination } from '@dhis2/ui'\n```\n\n_**Note**: Dropdown menus may not display properly on this page. View these demos in the 'Canvas' tab._\n";
|
|
17
7
|
|
|
18
8
|
const logOnPageChange = page => {
|
|
19
|
-
console.log(
|
|
9
|
+
console.log("Now navigate to page ".concat(page, "..."));
|
|
20
10
|
};
|
|
21
11
|
|
|
22
12
|
const logOnPageSizeChange = pageSize => {
|
|
23
|
-
console.log(
|
|
13
|
+
console.log("Now change page size to ".concat(pageSize, "..."));
|
|
24
14
|
};
|
|
25
15
|
|
|
26
16
|
export default {
|
|
27
|
-
title: '
|
|
17
|
+
title: 'Pagination',
|
|
28
18
|
component: Pagination,
|
|
29
19
|
parameters: {
|
|
30
20
|
componentSubtitle: subtitle,
|
|
@@ -46,6 +36,10 @@ const Template = args => /*#__PURE__*/React.createElement(Pagination, args);
|
|
|
46
36
|
export const Default = Template.bind({});
|
|
47
37
|
Default.args = { ...pagers.atTenthPage
|
|
48
38
|
};
|
|
39
|
+
export const Disabled = Template.bind({});
|
|
40
|
+
Disabled.args = { ...pagers.atTenthPage,
|
|
41
|
+
disabled: true
|
|
42
|
+
};
|
|
49
43
|
export const PagerAtFirstPage = Template.bind({});
|
|
50
44
|
PagerAtFirstPage.args = { ...pagers.atFirstPage
|
|
51
45
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dhis2-ui/pagination",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.2.2",
|
|
4
4
|
"description": "UI Pagination",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -33,10 +33,10 @@
|
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@dhis2/prop-types": "^3.0.0-beta.1",
|
|
36
|
-
"@dhis2-ui/button": "8.
|
|
37
|
-
"@dhis2-ui/select": "8.
|
|
38
|
-
"@dhis2/ui-constants": "8.
|
|
39
|
-
"@dhis2/ui-icons": "8.
|
|
36
|
+
"@dhis2-ui/button": "8.2.2",
|
|
37
|
+
"@dhis2-ui/select": "8.2.2",
|
|
38
|
+
"@dhis2/ui-constants": "8.2.2",
|
|
39
|
+
"@dhis2/ui-icons": "8.2.2",
|
|
40
40
|
"classnames": "^2.3.1",
|
|
41
41
|
"prop-types": "^15.7.2"
|
|
42
42
|
},
|