@dhis2-ui/pagination 10.16.3-alpha.1 → 10.16.4
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/__tests__/get-item-range.test.js +1 -2
- package/build/cjs/__tests__/page-select.test.js +1 -2
- package/build/cjs/__tests__/page-size-select.test.js +1 -2
- package/build/cjs/__tests__/pagination.test.js +1 -2
- package/build/cjs/get-default-page-summary-text.js +7 -8
- package/build/cjs/get-item-range.js +7 -8
- package/build/cjs/locales/index.js +97 -59
- package/build/cjs/page-controls.js +33 -36
- package/build/cjs/page-select.js +28 -34
- package/build/cjs/page-size-select.js +28 -34
- package/build/cjs/page-summary.js +10 -11
- package/build/cjs/pagination.js +22 -23
- package/build/cjs/pagination.prod.stories.js +9 -13
- package/build/es/get-default-page-summary-text.js +7 -8
- package/build/es/get-item-range.js +7 -8
- package/build/es/locales/index.js +72 -34
- package/build/es/page-controls.js +33 -36
- package/build/es/page-select.js +28 -34
- package/build/es/page-size-select.js +28 -34
- package/build/es/page-summary.js +10 -11
- package/build/es/pagination.js +22 -23
- package/build/es/pagination.prod.stories.js +8 -11
- package/package.json +5 -5
- package/src/locales/index.js +105 -34
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import i18n from './locales/index.js';
|
|
2
2
|
const isValidNumber = input => typeof input === 'number' && !isNaN(input);
|
|
3
|
-
export const getDefaultPageSummaryText =
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
} = _ref;
|
|
3
|
+
export const getDefaultPageSummaryText = ({
|
|
4
|
+
firstItem,
|
|
5
|
+
lastItem,
|
|
6
|
+
page,
|
|
7
|
+
pageCount,
|
|
8
|
+
total
|
|
9
|
+
}) => {
|
|
11
10
|
if (isValidNumber(total) && isValidNumber(lastItem)) {
|
|
12
11
|
return i18n.t('Page {{page}} of {{pageCount}}, items {{firstItem}}-{{lastItem}} of {{total}}', {
|
|
13
12
|
page,
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
export const getItemRange =
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
} = _ref;
|
|
1
|
+
export const getItemRange = ({
|
|
2
|
+
isLastPage,
|
|
3
|
+
page,
|
|
4
|
+
pageLength,
|
|
5
|
+
pageSize,
|
|
6
|
+
total
|
|
7
|
+
}) => {
|
|
9
8
|
// page is 1-based
|
|
10
9
|
let firstItem = (page - 1) * pageSize + 1;
|
|
11
10
|
let lastItem = firstItem + pageSize - 1;
|
|
@@ -42,38 +42,76 @@ import viTranslations from './vi/translations.json';
|
|
|
42
42
|
import zhTranslations from './zh/translations.json';
|
|
43
43
|
import zh_CNTranslations from './zh_CN/translations.json';
|
|
44
44
|
const namespace = 'default';
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
i18n.
|
|
50
|
-
i18n.
|
|
51
|
-
i18n.
|
|
52
|
-
i18n.
|
|
53
|
-
i18n.
|
|
54
|
-
i18n.
|
|
55
|
-
i18n.
|
|
56
|
-
i18n.
|
|
57
|
-
i18n.
|
|
58
|
-
i18n.
|
|
59
|
-
i18n.
|
|
60
|
-
i18n.
|
|
61
|
-
i18n.
|
|
62
|
-
i18n.
|
|
63
|
-
i18n.
|
|
64
|
-
i18n.
|
|
65
|
-
i18n.
|
|
66
|
-
i18n.
|
|
67
|
-
i18n.
|
|
68
|
-
i18n.
|
|
69
|
-
i18n.
|
|
70
|
-
i18n.
|
|
71
|
-
i18n.
|
|
72
|
-
i18n.
|
|
73
|
-
i18n.
|
|
74
|
-
i18n.
|
|
75
|
-
i18n.
|
|
76
|
-
i18n.
|
|
77
|
-
i18n.
|
|
78
|
-
i18n.
|
|
45
|
+
|
|
46
|
+
// Use 'deep' = true and 'overwrite' = false to add to, but not overwrite,
|
|
47
|
+
// custom translations from the datastore (added by the app adapter)
|
|
48
|
+
|
|
49
|
+
i18n.addResourceBundle('ar', namespace, arTranslations, true, false);
|
|
50
|
+
i18n.addResourceBundle('ar', namespace, arTranslations, true, false);
|
|
51
|
+
i18n.addResourceBundle('ar_IQ', namespace, ar_IQTranslations, true, false);
|
|
52
|
+
i18n.addResourceBundle('ar-IQ', namespace, ar_IQTranslations, true, false);
|
|
53
|
+
i18n.addResourceBundle('bn', namespace, bnTranslations, true, false);
|
|
54
|
+
i18n.addResourceBundle('bn', namespace, bnTranslations, true, false);
|
|
55
|
+
i18n.addResourceBundle('ckb', namespace, ckbTranslations, true, false);
|
|
56
|
+
i18n.addResourceBundle('ckb', namespace, ckbTranslations, true, false);
|
|
57
|
+
i18n.addResourceBundle('cs', namespace, csTranslations, true, false);
|
|
58
|
+
i18n.addResourceBundle('cs', namespace, csTranslations, true, false);
|
|
59
|
+
i18n.addResourceBundle('da', namespace, daTranslations, true, false);
|
|
60
|
+
i18n.addResourceBundle('da', namespace, daTranslations, true, false);
|
|
61
|
+
i18n.addResourceBundle('en', namespace, enTranslations, true, false);
|
|
62
|
+
i18n.addResourceBundle('en', namespace, enTranslations, true, false);
|
|
63
|
+
i18n.addResourceBundle('es', namespace, esTranslations, true, false);
|
|
64
|
+
i18n.addResourceBundle('es', namespace, esTranslations, true, false);
|
|
65
|
+
i18n.addResourceBundle('es_419', namespace, es_419Translations, true, false);
|
|
66
|
+
i18n.addResourceBundle('es-419', namespace, es_419Translations, true, false);
|
|
67
|
+
i18n.addResourceBundle('fr', namespace, frTranslations, true, false);
|
|
68
|
+
i18n.addResourceBundle('fr', namespace, frTranslations, true, false);
|
|
69
|
+
i18n.addResourceBundle('hi_IN', namespace, hi_INTranslations, true, false);
|
|
70
|
+
i18n.addResourceBundle('hi-IN', namespace, hi_INTranslations, true, false);
|
|
71
|
+
i18n.addResourceBundle('id', namespace, idTranslations, true, false);
|
|
72
|
+
i18n.addResourceBundle('id', namespace, idTranslations, true, false);
|
|
73
|
+
i18n.addResourceBundle('km', namespace, kmTranslations, true, false);
|
|
74
|
+
i18n.addResourceBundle('km', namespace, kmTranslations, true, false);
|
|
75
|
+
i18n.addResourceBundle('lo', namespace, loTranslations, true, false);
|
|
76
|
+
i18n.addResourceBundle('lo', namespace, loTranslations, true, false);
|
|
77
|
+
i18n.addResourceBundle('my', namespace, myTranslations, true, false);
|
|
78
|
+
i18n.addResourceBundle('my', namespace, myTranslations, true, false);
|
|
79
|
+
i18n.addResourceBundle('nb', namespace, nbTranslations, true, false);
|
|
80
|
+
i18n.addResourceBundle('nb', namespace, nbTranslations, true, false);
|
|
81
|
+
i18n.addResourceBundle('nl', namespace, nlTranslations, true, false);
|
|
82
|
+
i18n.addResourceBundle('nl', namespace, nlTranslations, true, false);
|
|
83
|
+
i18n.addResourceBundle('prs', namespace, prsTranslations, true, false);
|
|
84
|
+
i18n.addResourceBundle('prs', namespace, prsTranslations, true, false);
|
|
85
|
+
i18n.addResourceBundle('ps', namespace, psTranslations, true, false);
|
|
86
|
+
i18n.addResourceBundle('ps', namespace, psTranslations, true, false);
|
|
87
|
+
i18n.addResourceBundle('pt', namespace, ptTranslations, true, false);
|
|
88
|
+
i18n.addResourceBundle('pt', namespace, ptTranslations, true, false);
|
|
89
|
+
i18n.addResourceBundle('pt_BR', namespace, pt_BRTranslations, true, false);
|
|
90
|
+
i18n.addResourceBundle('pt-BR', namespace, pt_BRTranslations, true, false);
|
|
91
|
+
i18n.addResourceBundle('ro', namespace, roTranslations, true, false);
|
|
92
|
+
i18n.addResourceBundle('ro', namespace, roTranslations, true, false);
|
|
93
|
+
i18n.addResourceBundle('ru', namespace, ruTranslations, true, false);
|
|
94
|
+
i18n.addResourceBundle('ru', namespace, ruTranslations, true, false);
|
|
95
|
+
i18n.addResourceBundle('sv', namespace, svTranslations, true, false);
|
|
96
|
+
i18n.addResourceBundle('sv', namespace, svTranslations, true, false);
|
|
97
|
+
i18n.addResourceBundle('tet', namespace, tetTranslations, true, false);
|
|
98
|
+
i18n.addResourceBundle('tet', namespace, tetTranslations, true, false);
|
|
99
|
+
i18n.addResourceBundle('tg', namespace, tgTranslations, true, false);
|
|
100
|
+
i18n.addResourceBundle('tg', namespace, tgTranslations, true, false);
|
|
101
|
+
i18n.addResourceBundle('uk', namespace, ukTranslations, true, false);
|
|
102
|
+
i18n.addResourceBundle('uk', namespace, ukTranslations, true, false);
|
|
103
|
+
i18n.addResourceBundle('ur', namespace, urTranslations, true, false);
|
|
104
|
+
i18n.addResourceBundle('ur', namespace, urTranslations, true, false);
|
|
105
|
+
i18n.addResourceBundle('uz_Latn', namespace, uz_LatnTranslations, true, false);
|
|
106
|
+
i18n.addResourceBundle('uz-Latn', namespace, uz_LatnTranslations, true, false);
|
|
107
|
+
i18n.addResourceBundle('uz_UZ_Cyrl', namespace, uz_UZ_CyrlTranslations, true, false);
|
|
108
|
+
i18n.addResourceBundle('uz-Cyrl-UZ', namespace, uz_UZ_CyrlTranslations, true, false);
|
|
109
|
+
i18n.addResourceBundle('uz_UZ_Latn', namespace, uz_UZ_LatnTranslations, true, false);
|
|
110
|
+
i18n.addResourceBundle('uz-Latn-UZ', namespace, uz_UZ_LatnTranslations, true, false);
|
|
111
|
+
i18n.addResourceBundle('vi', namespace, viTranslations, true, false);
|
|
112
|
+
i18n.addResourceBundle('vi', namespace, viTranslations, true, false);
|
|
113
|
+
i18n.addResourceBundle('zh', namespace, zhTranslations, true, false);
|
|
114
|
+
i18n.addResourceBundle('zh', namespace, zhTranslations, true, false);
|
|
115
|
+
i18n.addResourceBundle('zh_CN', namespace, zh_CNTranslations, true, false);
|
|
116
|
+
i18n.addResourceBundle('zh-CN', namespace, zh_CNTranslations, true, false);
|
|
79
117
|
export default i18n;
|
|
@@ -10,42 +10,39 @@ const translate = (prop, interpolationObject) => {
|
|
|
10
10
|
}
|
|
11
11
|
return prop;
|
|
12
12
|
};
|
|
13
|
-
const PageControls =
|
|
14
|
-
|
|
15
|
-
|
|
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
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
dynamic: [spacers.dp4]
|
|
47
|
-
}, ["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-inline-start:0;}", `div.__jsx-style-dynamic-selector .button-next{height:32px;padding-inline-end:0;margin-inline-start:${spacers.dp4};}`, "div.__jsx-style-dynamic-selector .navigator-icon.__jsx-style-dynamic-selector:dir(rtl){-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg);}"]));
|
|
48
|
-
};
|
|
13
|
+
const PageControls = ({
|
|
14
|
+
dataTest,
|
|
15
|
+
isNextDisabled,
|
|
16
|
+
isPreviousDisabled,
|
|
17
|
+
nextPageText,
|
|
18
|
+
page,
|
|
19
|
+
previousPageText,
|
|
20
|
+
onClick
|
|
21
|
+
}) => /*#__PURE__*/React.createElement("div", {
|
|
22
|
+
"data-test": `${dataTest}-pagecontrols`,
|
|
23
|
+
className: _JSXStyle.dynamic([["3252926163", [spacers.dp4]]])
|
|
24
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
|
25
|
+
secondary: true,
|
|
26
|
+
className: "button-previous",
|
|
27
|
+
small: true,
|
|
28
|
+
disabled: isPreviousDisabled,
|
|
29
|
+
onClick: () => onClick(page - 1),
|
|
30
|
+
dataTest: `${dataTest}-page-previous`
|
|
31
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
32
|
+
className: _JSXStyle.dynamic([["3252926163", [spacers.dp4]]]) + " " + "navigator-icon"
|
|
33
|
+
}, /*#__PURE__*/React.createElement(IconChevronLeft16, null)), translate(previousPageText)), /*#__PURE__*/React.createElement(Button, {
|
|
34
|
+
secondary: true,
|
|
35
|
+
className: "button-next",
|
|
36
|
+
small: true,
|
|
37
|
+
disabled: isNextDisabled,
|
|
38
|
+
onClick: () => onClick(page + 1),
|
|
39
|
+
dataTest: `${dataTest}-page-next`
|
|
40
|
+
}, translate(nextPageText), /*#__PURE__*/React.createElement("div", {
|
|
41
|
+
className: _JSXStyle.dynamic([["3252926163", [spacers.dp4]]]) + " " + "navigator-icon"
|
|
42
|
+
}, /*#__PURE__*/React.createElement(IconChevronRight16, null))), /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
43
|
+
id: "3252926163",
|
|
44
|
+
dynamic: [spacers.dp4]
|
|
45
|
+
}, ["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-inline-start:0;}", `div.__jsx-style-dynamic-selector .button-next{height:32px;padding-inline-end:0;margin-inline-start:${spacers.dp4};}`, "div.__jsx-style-dynamic-selector .navigator-icon.__jsx-style-dynamic-selector:dir(rtl){-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg);}"]));
|
|
49
46
|
PageControls.propTypes = {
|
|
50
47
|
dataTest: PropTypes.string.isRequired,
|
|
51
48
|
nextPageText: PropTypes.oneOfType([PropTypes.string, PropTypes.func]).isRequired,
|
package/build/es/page-select.js
CHANGED
|
@@ -14,40 +14,34 @@ const translate = (prop, interpolationObject) => {
|
|
|
14
14
|
const createAvailablePages = length => Array.from({
|
|
15
15
|
length
|
|
16
16
|
}, (_x, i) => (i + 1).toString());
|
|
17
|
-
const PageSelect =
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
selected
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
label: availablePage
|
|
46
|
-
}))), /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
47
|
-
id: "599400768",
|
|
48
|
-
dynamic: [spacers.dp12]
|
|
49
|
-
}, [`div.__jsx-style-dynamic-selector{margin-inline-end:${spacers.dp12};}`]));
|
|
50
|
-
};
|
|
17
|
+
const PageSelect = ({
|
|
18
|
+
dataTest,
|
|
19
|
+
disabled,
|
|
20
|
+
pageSelectText,
|
|
21
|
+
onChange,
|
|
22
|
+
page,
|
|
23
|
+
pageCount
|
|
24
|
+
}) => /*#__PURE__*/React.createElement("div", {
|
|
25
|
+
"data-test": `${dataTest}-gotopage`,
|
|
26
|
+
className: _JSXStyle.dynamic([["599400768", [spacers.dp12]]])
|
|
27
|
+
}, /*#__PURE__*/React.createElement(SingleSelect, {
|
|
28
|
+
dense: true,
|
|
29
|
+
disabled: disabled,
|
|
30
|
+
selected: page.toString(),
|
|
31
|
+
onChange: ({
|
|
32
|
+
selected
|
|
33
|
+
}) => onChange(parseInt(selected, 10)),
|
|
34
|
+
className: "select",
|
|
35
|
+
dataTest: `${dataTest}-page-select`,
|
|
36
|
+
prefix: translate(pageSelectText)
|
|
37
|
+
}, createAvailablePages(pageCount).map(availablePage => /*#__PURE__*/React.createElement(SingleSelectOption, {
|
|
38
|
+
key: availablePage,
|
|
39
|
+
value: availablePage,
|
|
40
|
+
label: availablePage
|
|
41
|
+
}))), /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
42
|
+
id: "599400768",
|
|
43
|
+
dynamic: [spacers.dp12]
|
|
44
|
+
}, [`div.__jsx-style-dynamic-selector{margin-inline-end:${spacers.dp12};}`]));
|
|
51
45
|
PageSelect.propTypes = {
|
|
52
46
|
dataTest: PropTypes.string.isRequired,
|
|
53
47
|
page: PropTypes.number.isRequired,
|
|
@@ -11,40 +11,34 @@ const translate = (prop, interpolationObject) => {
|
|
|
11
11
|
}
|
|
12
12
|
return prop;
|
|
13
13
|
};
|
|
14
|
-
const PageSizeSelect =
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
selected
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
label: length
|
|
43
|
-
}))), /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
44
|
-
id: "3539890457",
|
|
45
|
-
dynamic: [spacers.dp12]
|
|
46
|
-
}, [`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-inline-end:${spacers.dp12};-webkit-box-flex:1;-webkit-flex-grow:1;-ms-flex-positive:1;flex-grow:1;}`]));
|
|
47
|
-
};
|
|
14
|
+
const PageSizeSelect = ({
|
|
15
|
+
dataTest,
|
|
16
|
+
disabled,
|
|
17
|
+
pageSizeSelectText,
|
|
18
|
+
pageSize,
|
|
19
|
+
pageSizes,
|
|
20
|
+
onChange
|
|
21
|
+
}) => /*#__PURE__*/React.createElement("div", {
|
|
22
|
+
"data-test": `${dataTest}-pagesize`,
|
|
23
|
+
className: _JSXStyle.dynamic([["3539890457", [spacers.dp12]]])
|
|
24
|
+
}, /*#__PURE__*/React.createElement(SingleSelect, {
|
|
25
|
+
dense: true,
|
|
26
|
+
disabled: disabled,
|
|
27
|
+
selected: pageSize.toString(),
|
|
28
|
+
onChange: ({
|
|
29
|
+
selected
|
|
30
|
+
}) => onChange(parseInt(selected, 10)),
|
|
31
|
+
className: "select",
|
|
32
|
+
dataTest: `${dataTest}-pagesize-select`,
|
|
33
|
+
prefix: translate(pageSizeSelectText)
|
|
34
|
+
}, pageSizes.map(length => /*#__PURE__*/React.createElement(SingleSelectOption, {
|
|
35
|
+
key: length,
|
|
36
|
+
value: length,
|
|
37
|
+
label: length
|
|
38
|
+
}))), /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
39
|
+
id: "3539890457",
|
|
40
|
+
dynamic: [spacers.dp12]
|
|
41
|
+
}, [`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-inline-end:${spacers.dp12};-webkit-box-flex:1;-webkit-flex-grow:1;-ms-flex-positive:1;flex-grow:1;}`]));
|
|
48
42
|
PageSizeSelect.propTypes = {
|
|
49
43
|
dataTest: PropTypes.string.isRequired,
|
|
50
44
|
pageSize: PropTypes.number.isRequired,
|
package/build/es/page-summary.js
CHANGED
|
@@ -9,17 +9,16 @@ const translate = (prop, interpolationObject) => {
|
|
|
9
9
|
}
|
|
10
10
|
return prop;
|
|
11
11
|
};
|
|
12
|
-
const PageSummary =
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
} = _ref;
|
|
12
|
+
const PageSummary = ({
|
|
13
|
+
dataTest,
|
|
14
|
+
firstItem,
|
|
15
|
+
inactive,
|
|
16
|
+
lastItem,
|
|
17
|
+
page,
|
|
18
|
+
pageCount,
|
|
19
|
+
pageSummaryText,
|
|
20
|
+
total
|
|
21
|
+
}) => {
|
|
23
22
|
const summary = translate(pageSummaryText, {
|
|
24
23
|
firstItem,
|
|
25
24
|
lastItem,
|
package/build/es/pagination.js
CHANGED
|
@@ -21,29 +21,28 @@ const defaultProps = {
|
|
|
21
21
|
pageSummaryText: getDefaultPageSummaryText,
|
|
22
22
|
previousPageText: () => i18n.t('Previous')
|
|
23
23
|
};
|
|
24
|
-
const Pagination =
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
} = _ref;
|
|
24
|
+
const Pagination = ({
|
|
25
|
+
className,
|
|
26
|
+
dataTest = defaultProps.dataTest,
|
|
27
|
+
disabled,
|
|
28
|
+
hidePageSelect,
|
|
29
|
+
hidePageSizeSelect,
|
|
30
|
+
hidePageSummary,
|
|
31
|
+
isLastPage,
|
|
32
|
+
nextPageText = defaultProps.nextPageText,
|
|
33
|
+
onPageChange,
|
|
34
|
+
onPageSizeChange,
|
|
35
|
+
page,
|
|
36
|
+
pageCount,
|
|
37
|
+
pageLength,
|
|
38
|
+
pageSelectText = defaultProps.pageSelectText,
|
|
39
|
+
pageSize,
|
|
40
|
+
pageSizes = defaultProps.pageSizes,
|
|
41
|
+
pageSizeSelectText = defaultProps.pageSizeSelectText,
|
|
42
|
+
pageSummaryText = defaultProps.pageSummaryText,
|
|
43
|
+
previousPageText = defaultProps.previousPageText,
|
|
44
|
+
total
|
|
45
|
+
}) => {
|
|
47
46
|
const {
|
|
48
47
|
firstItem,
|
|
49
48
|
lastItem
|
|
@@ -96,17 +96,14 @@ WithoutAnySelect.args = {
|
|
|
96
96
|
...WithoutGoToPageSelect.args,
|
|
97
97
|
...WithoutPageSizeSelect.args
|
|
98
98
|
};
|
|
99
|
-
const InBox =
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
}
|
|
108
|
-
}, /*#__PURE__*/React.createElement(Pagination, args));
|
|
109
|
-
};
|
|
99
|
+
const InBox = ({
|
|
100
|
+
boxWidth,
|
|
101
|
+
...args
|
|
102
|
+
}) => /*#__PURE__*/React.createElement("div", {
|
|
103
|
+
style: {
|
|
104
|
+
width: boxWidth
|
|
105
|
+
}
|
|
106
|
+
}, /*#__PURE__*/React.createElement(Pagination, args));
|
|
110
107
|
export const MediumWidth = InBox.bind({});
|
|
111
108
|
MediumWidth.args = {
|
|
112
109
|
...pagers.atTenthPage,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dhis2-ui/pagination",
|
|
3
|
-
"version": "10.16.
|
|
3
|
+
"version": "10.16.4",
|
|
4
4
|
"description": "UI Pagination",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -34,10 +34,10 @@
|
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"@dhis2/prop-types": "^3.1.2",
|
|
37
|
-
"@dhis2-ui/button": "10.16.
|
|
38
|
-
"@dhis2-ui/select": "10.16.
|
|
39
|
-
"@dhis2/ui-constants": "10.16.
|
|
40
|
-
"@dhis2/ui-icons": "10.16.
|
|
37
|
+
"@dhis2-ui/button": "10.16.4",
|
|
38
|
+
"@dhis2-ui/select": "10.16.4",
|
|
39
|
+
"@dhis2/ui-constants": "10.16.4",
|
|
40
|
+
"@dhis2/ui-icons": "10.16.4",
|
|
41
41
|
"classnames": "^2.3.1",
|
|
42
42
|
"prop-types": "^15.7.2"
|
|
43
43
|
},
|