@atlaskit/pagination 14.3.2 → 14.4.0
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/CHANGELOG.md +6 -0
- package/dist/cjs/pagination.js +6 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/pagination.js +5 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/pagination.js +6 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/pagination.d.ts +1 -1
- package/dist/types/types.d.ts +14 -3
- package/dist/types-ts4.5/pagination.d.ts +1 -1
- package/dist/types-ts4.5/types.d.ts +14 -3
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @atlaskit/pagination
|
|
2
2
|
|
|
3
|
+
## 14.4.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`12d9c63d4c1`](https://bitbucket.org/atlassian/atlassian-frontend/commits/12d9c63d4c1) - [ux] pass pageLabel to dynamic-table component and updat prev label in examples, add description in the types file, update example files
|
|
8
|
+
|
|
3
9
|
## 14.3.2
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
package/dist/cjs/pagination.js
CHANGED
|
@@ -28,7 +28,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
28
28
|
var analyticsAttributes = {
|
|
29
29
|
componentName: 'pagination',
|
|
30
30
|
packageName: "@atlaskit/pagination",
|
|
31
|
-
packageVersion: "14.
|
|
31
|
+
packageVersion: "14.4.0"
|
|
32
32
|
};
|
|
33
33
|
function InnerPagination(_ref, ref) {
|
|
34
34
|
var _ref$components = _ref.components,
|
|
@@ -38,6 +38,8 @@ function InnerPagination(_ref, ref) {
|
|
|
38
38
|
selectedIndex = _ref.selectedIndex,
|
|
39
39
|
_ref$label = _ref.label,
|
|
40
40
|
label = _ref$label === void 0 ? 'pagination' : _ref$label,
|
|
41
|
+
_ref$pageLabel = _ref.pageLabel,
|
|
42
|
+
pageLabel = _ref$pageLabel === void 0 ? 'page' : _ref$pageLabel,
|
|
41
43
|
_ref$previousLabel = _ref.previousLabel,
|
|
42
44
|
previousLabel = _ref$previousLabel === void 0 ? 'previous' : _ref$previousLabel,
|
|
43
45
|
_ref$nextLabel = _ref.nextLabel,
|
|
@@ -77,6 +79,7 @@ function InnerPagination(_ref, ref) {
|
|
|
77
79
|
}, analyticsAttributes));
|
|
78
80
|
var transform = function transform(page, currPageIndex, testId) {
|
|
79
81
|
var selectedPage = pages[selectedIndexValue];
|
|
82
|
+
var pageIndexLabel = "".concat(pageLabel, " ").concat(getPageLabel ? getPageLabel(page, currPageIndex) : page);
|
|
80
83
|
return /*#__PURE__*/_react.default.createElement(_page.default, {
|
|
81
84
|
key: "page-".concat(getPageLabel ? getPageLabel(page, currPageIndex) : currPageIndex),
|
|
82
85
|
component: components.Page,
|
|
@@ -86,6 +89,8 @@ function InnerPagination(_ref, ref) {
|
|
|
86
89
|
selectedPageIndex: currPageIndex
|
|
87
90
|
});
|
|
88
91
|
},
|
|
92
|
+
"aria-current": page === selectedPage ? 'page' : undefined,
|
|
93
|
+
"aria-label": pageIndexLabel,
|
|
89
94
|
isSelected: page === selectedPage,
|
|
90
95
|
page: page,
|
|
91
96
|
testId: testId && "".concat(testId, "--").concat(page === selectedPage ? 'current-' : '', "page-").concat(currPageIndex)
|
package/dist/cjs/version.json
CHANGED
|
@@ -14,13 +14,14 @@ import collapseRange from './internal/utils/collapse-range';
|
|
|
14
14
|
const analyticsAttributes = {
|
|
15
15
|
componentName: 'pagination',
|
|
16
16
|
packageName: "@atlaskit/pagination",
|
|
17
|
-
packageVersion: "14.
|
|
17
|
+
packageVersion: "14.4.0"
|
|
18
18
|
};
|
|
19
19
|
function InnerPagination({
|
|
20
20
|
components = emptyObject,
|
|
21
21
|
defaultSelectedIndex = 0,
|
|
22
22
|
selectedIndex,
|
|
23
23
|
label = 'pagination',
|
|
24
|
+
pageLabel = 'page',
|
|
24
25
|
previousLabel = 'previous',
|
|
25
26
|
nextLabel = 'next',
|
|
26
27
|
style = emptyObject,
|
|
@@ -53,6 +54,7 @@ function InnerPagination({
|
|
|
53
54
|
});
|
|
54
55
|
const transform = (page, currPageIndex, testId) => {
|
|
55
56
|
const selectedPage = pages[selectedIndexValue];
|
|
57
|
+
const pageIndexLabel = `${pageLabel} ${getPageLabel ? getPageLabel(page, currPageIndex) : page}`;
|
|
56
58
|
return /*#__PURE__*/React.createElement(PageComponent, {
|
|
57
59
|
key: `page-${getPageLabel ? getPageLabel(page, currPageIndex) : currPageIndex}`,
|
|
58
60
|
component: components.Page,
|
|
@@ -60,6 +62,8 @@ function InnerPagination({
|
|
|
60
62
|
event,
|
|
61
63
|
selectedPageIndex: currPageIndex
|
|
62
64
|
}),
|
|
65
|
+
"aria-current": page === selectedPage ? 'page' : undefined,
|
|
66
|
+
"aria-label": pageIndexLabel,
|
|
63
67
|
isSelected: page === selectedPage,
|
|
64
68
|
page: page,
|
|
65
69
|
testId: testId && `${testId}--${page === selectedPage ? 'current-' : ''}page-${currPageIndex}`
|
package/dist/es2019/version.json
CHANGED
package/dist/esm/pagination.js
CHANGED
|
@@ -18,7 +18,7 @@ import collapseRange from './internal/utils/collapse-range';
|
|
|
18
18
|
var analyticsAttributes = {
|
|
19
19
|
componentName: 'pagination',
|
|
20
20
|
packageName: "@atlaskit/pagination",
|
|
21
|
-
packageVersion: "14.
|
|
21
|
+
packageVersion: "14.4.0"
|
|
22
22
|
};
|
|
23
23
|
function InnerPagination(_ref, ref) {
|
|
24
24
|
var _ref$components = _ref.components,
|
|
@@ -28,6 +28,8 @@ function InnerPagination(_ref, ref) {
|
|
|
28
28
|
selectedIndex = _ref.selectedIndex,
|
|
29
29
|
_ref$label = _ref.label,
|
|
30
30
|
label = _ref$label === void 0 ? 'pagination' : _ref$label,
|
|
31
|
+
_ref$pageLabel = _ref.pageLabel,
|
|
32
|
+
pageLabel = _ref$pageLabel === void 0 ? 'page' : _ref$pageLabel,
|
|
31
33
|
_ref$previousLabel = _ref.previousLabel,
|
|
32
34
|
previousLabel = _ref$previousLabel === void 0 ? 'previous' : _ref$previousLabel,
|
|
33
35
|
_ref$nextLabel = _ref.nextLabel,
|
|
@@ -67,6 +69,7 @@ function InnerPagination(_ref, ref) {
|
|
|
67
69
|
}, analyticsAttributes));
|
|
68
70
|
var transform = function transform(page, currPageIndex, testId) {
|
|
69
71
|
var selectedPage = pages[selectedIndexValue];
|
|
72
|
+
var pageIndexLabel = "".concat(pageLabel, " ").concat(getPageLabel ? getPageLabel(page, currPageIndex) : page);
|
|
70
73
|
return /*#__PURE__*/React.createElement(PageComponent, {
|
|
71
74
|
key: "page-".concat(getPageLabel ? getPageLabel(page, currPageIndex) : currPageIndex),
|
|
72
75
|
component: components.Page,
|
|
@@ -76,6 +79,8 @@ function InnerPagination(_ref, ref) {
|
|
|
76
79
|
selectedPageIndex: currPageIndex
|
|
77
80
|
});
|
|
78
81
|
},
|
|
82
|
+
"aria-current": page === selectedPage ? 'page' : undefined,
|
|
83
|
+
"aria-label": pageIndexLabel,
|
|
79
84
|
isSelected: page === selectedPage,
|
|
80
85
|
page: page,
|
|
81
86
|
testId: testId && "".concat(testId, "--").concat(page === selectedPage ? 'current-' : '', "page-").concat(currPageIndex)
|
package/dist/esm/version.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { PaginationPropTypes } from './types';
|
|
3
|
-
declare function InnerPagination<T>({ components, defaultSelectedIndex, selectedIndex, label, previousLabel, nextLabel, style, max, onChange, pages, getPageLabel, renderEllipsis, analyticsContext, testId, }: PaginationPropTypes<T>, ref: React.Ref<HTMLDivElement>): JSX.Element;
|
|
3
|
+
declare function InnerPagination<T>({ components, defaultSelectedIndex, selectedIndex, label, pageLabel, previousLabel, nextLabel, style, max, onChange, pages, getPageLabel, renderEllipsis, analyticsContext, testId, }: PaginationPropTypes<T>, ref: React.Ref<HTMLDivElement>): JSX.Element;
|
|
4
4
|
declare const _default: typeof InnerPagination;
|
|
5
5
|
export default _default;
|
package/dist/types/types.d.ts
CHANGED
|
@@ -18,15 +18,26 @@ export interface PaginationPropTypes<T = unknown> {
|
|
|
18
18
|
*/
|
|
19
19
|
getPageLabel?: (page: T, pageIndex: number) => number | string;
|
|
20
20
|
/**
|
|
21
|
-
* The aria-label for the pagination wrapper
|
|
21
|
+
* The aria-label for the pagination nav wrapper.
|
|
22
|
+
* The default value is "pagination".
|
|
22
23
|
*/
|
|
23
24
|
label?: string;
|
|
24
25
|
/**
|
|
25
|
-
* The aria-label for the next button
|
|
26
|
+
* The aria-label for the next button.
|
|
27
|
+
* The default value is "next".
|
|
26
28
|
*/
|
|
27
29
|
nextLabel?: string;
|
|
28
30
|
/**
|
|
29
|
-
* The aria-label for the
|
|
31
|
+
* The aria-label for the individual page numbers.
|
|
32
|
+
* The default value is "page".
|
|
33
|
+
* The page number is automatically appended to the pageLabel.
|
|
34
|
+
* For Example, pageLabel="página" will render aria-label="página 1"
|
|
35
|
+
* as the label for page 1.
|
|
36
|
+
*/
|
|
37
|
+
pageLabel?: string;
|
|
38
|
+
/**
|
|
39
|
+
* The aria-label for the previous button.
|
|
40
|
+
* The default value is "previous".
|
|
30
41
|
*/
|
|
31
42
|
previousLabel?: string;
|
|
32
43
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { PaginationPropTypes } from './types';
|
|
3
|
-
declare function InnerPagination<T>({ components, defaultSelectedIndex, selectedIndex, label, previousLabel, nextLabel, style, max, onChange, pages, getPageLabel, renderEllipsis, analyticsContext, testId, }: PaginationPropTypes<T>, ref: React.Ref<HTMLDivElement>): JSX.Element;
|
|
3
|
+
declare function InnerPagination<T>({ components, defaultSelectedIndex, selectedIndex, label, pageLabel, previousLabel, nextLabel, style, max, onChange, pages, getPageLabel, renderEllipsis, analyticsContext, testId, }: PaginationPropTypes<T>, ref: React.Ref<HTMLDivElement>): JSX.Element;
|
|
4
4
|
declare const _default: typeof InnerPagination;
|
|
5
5
|
export default _default;
|
|
@@ -18,15 +18,26 @@ export interface PaginationPropTypes<T = unknown> {
|
|
|
18
18
|
*/
|
|
19
19
|
getPageLabel?: (page: T, pageIndex: number) => number | string;
|
|
20
20
|
/**
|
|
21
|
-
* The aria-label for the pagination wrapper
|
|
21
|
+
* The aria-label for the pagination nav wrapper.
|
|
22
|
+
* The default value is "pagination".
|
|
22
23
|
*/
|
|
23
24
|
label?: string;
|
|
24
25
|
/**
|
|
25
|
-
* The aria-label for the next button
|
|
26
|
+
* The aria-label for the next button.
|
|
27
|
+
* The default value is "next".
|
|
26
28
|
*/
|
|
27
29
|
nextLabel?: string;
|
|
28
30
|
/**
|
|
29
|
-
* The aria-label for the
|
|
31
|
+
* The aria-label for the individual page numbers.
|
|
32
|
+
* The default value is "page".
|
|
33
|
+
* The page number is automatically appended to the pageLabel.
|
|
34
|
+
* For Example, pageLabel="página" will render aria-label="página 1"
|
|
35
|
+
* as the label for page 1.
|
|
36
|
+
*/
|
|
37
|
+
pageLabel?: string;
|
|
38
|
+
/**
|
|
39
|
+
* The aria-label for the previous button.
|
|
40
|
+
* The default value is "previous".
|
|
30
41
|
*/
|
|
31
42
|
previousLabel?: string;
|
|
32
43
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/pagination",
|
|
3
|
-
"version": "14.
|
|
3
|
+
"version": "14.4.0",
|
|
4
4
|
"description": "Pagination allows you to divide large amounts of content into smaller chunks across multiple pages.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"@atlaskit/analytics-next": "^9.1.0",
|
|
40
40
|
"@atlaskit/button": "^16.7.0",
|
|
41
41
|
"@atlaskit/codemod-utils": "^4.2.0",
|
|
42
|
-
"@atlaskit/ds-explorations": "^2.
|
|
42
|
+
"@atlaskit/ds-explorations": "^2.2.0",
|
|
43
43
|
"@atlaskit/ds-lib": "^2.2.0",
|
|
44
44
|
"@atlaskit/icon": "^21.12.0",
|
|
45
45
|
"@atlaskit/primitives": "^0.9.0",
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"@atlaskit/code": "^14.6.0",
|
|
54
54
|
"@atlaskit/docs": "*",
|
|
55
55
|
"@atlaskit/ds-lib": "^2.2.0",
|
|
56
|
-
"@atlaskit/dynamic-table": "^14.
|
|
56
|
+
"@atlaskit/dynamic-table": "^14.10.0",
|
|
57
57
|
"@atlaskit/heading": "^1.3.0",
|
|
58
58
|
"@atlaskit/section-message": "^6.4.0",
|
|
59
59
|
"@atlaskit/ssr": "*",
|