@atlaskit/pagination 16.0.0 → 16.0.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/CHANGELOG.md +14 -0
- package/dist/cjs/internal/components/render-ellipsis.compiled.css +0 -1
- package/dist/cjs/internal/components/render-ellipsis.js +2 -4
- package/dist/cjs/pagination.js +41 -91
- package/dist/es2019/internal/components/render-ellipsis.compiled.css +0 -1
- package/dist/es2019/internal/components/render-ellipsis.js +2 -4
- package/dist/es2019/pagination.js +37 -83
- package/dist/esm/internal/components/render-ellipsis.compiled.css +0 -1
- package/dist/esm/internal/components/render-ellipsis.js +2 -4
- package/dist/esm/pagination.js +41 -91
- package/package.json +8 -14
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @atlaskit/pagination
|
|
2
2
|
|
|
3
|
+
## 16.0.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
|
|
9
|
+
## 16.0.1
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [#119674](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/119674)
|
|
14
|
+
[`796d5838394c2`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/796d5838394c2) -
|
|
15
|
+
revert the changes for pagination page navigator markup
|
|
16
|
+
|
|
3
17
|
## 16.0.0
|
|
4
18
|
|
|
5
19
|
### Major Changes
|
|
@@ -9,12 +9,10 @@ exports.default = renderEllipsis;
|
|
|
9
9
|
require("./render-ellipsis.compiled.css");
|
|
10
10
|
var _runtime = require("@compiled/react/runtime");
|
|
11
11
|
var _react = _interopRequireDefault(require("react"));
|
|
12
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
13
12
|
var _compiled = require("@atlaskit/primitives/compiled");
|
|
14
13
|
var _visuallyHidden = _interopRequireDefault(require("@atlaskit/visually-hidden"));
|
|
15
14
|
var styles = {
|
|
16
|
-
|
|
17
|
-
containerNew: "_1e0c1txw _kqswh2mm _19pkidpf"
|
|
15
|
+
container: "_1e0c1txw _kqswh2mm"
|
|
18
16
|
};
|
|
19
17
|
function renderEllipsis(_ref) {
|
|
20
18
|
var key = _ref.key,
|
|
@@ -25,7 +23,7 @@ function renderEllipsis(_ref) {
|
|
|
25
23
|
as: "li",
|
|
26
24
|
testId: testId,
|
|
27
25
|
key: key,
|
|
28
|
-
xcss:
|
|
26
|
+
xcss: styles.container,
|
|
29
27
|
paddingInline: "space.100"
|
|
30
28
|
}, /*#__PURE__*/_react.default.createElement(_compiled.Text, {
|
|
31
29
|
testId: testId && "".concat(testId, "-text")
|
package/dist/cjs/pagination.js
CHANGED
|
@@ -17,7 +17,6 @@ var _noop = _interopRequireDefault(require("@atlaskit/ds-lib/noop"));
|
|
|
17
17
|
var _useControlled3 = _interopRequireDefault(require("@atlaskit/ds-lib/use-controlled"));
|
|
18
18
|
var _chevronLeftChevronLeftLarge = _interopRequireDefault(require("@atlaskit/icon/utility/migration/chevron-left--chevron-left-large"));
|
|
19
19
|
var _chevronRightChevronRightLarge = _interopRequireDefault(require("@atlaskit/icon/utility/migration/chevron-right--chevron-right-large"));
|
|
20
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
21
20
|
var _compiled = require("@atlaskit/primitives/compiled");
|
|
22
21
|
var _navigator = _interopRequireDefault(require("./internal/components/navigator"));
|
|
23
22
|
var _page = _interopRequireDefault(require("./internal/components/page"));
|
|
@@ -36,7 +35,7 @@ var styles = {
|
|
|
36
35
|
var analyticsAttributes = {
|
|
37
36
|
componentName: 'pagination',
|
|
38
37
|
packageName: "@atlaskit/pagination",
|
|
39
|
-
packageVersion: "16.0.
|
|
38
|
+
packageVersion: "16.0.2"
|
|
40
39
|
};
|
|
41
40
|
function NavigatorIcon(_ref) {
|
|
42
41
|
var chevronDirection = _ref.chevronDirection;
|
|
@@ -122,94 +121,6 @@ function InnerPagination(_ref2, ref) {
|
|
|
122
121
|
testId: testId && "".concat(testId, "--").concat(isCurrentPage ? 'current-' : '', "page-").concat(currPageIndex)
|
|
123
122
|
}, getPageLabel ? getPageLabel(page, currPageIndex) : page));
|
|
124
123
|
};
|
|
125
|
-
var oldPaginationList = /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_navigator.default, {
|
|
126
|
-
key: "left-navigator",
|
|
127
|
-
component: components.Previous,
|
|
128
|
-
onClick: function onClick(event) {
|
|
129
|
-
return onChangeWithAnalytics({
|
|
130
|
-
event: event,
|
|
131
|
-
selectedPageIndex: selectedIndexValue - 1
|
|
132
|
-
});
|
|
133
|
-
},
|
|
134
|
-
isDisabled: isDisabled || selectedIndexValue === 0,
|
|
135
|
-
iconBefore: /*#__PURE__*/_react.default.createElement(NavigatorIcon, {
|
|
136
|
-
chevronDirection: "left"
|
|
137
|
-
}),
|
|
138
|
-
"aria-label": previousLabel,
|
|
139
|
-
testId: testId && "".concat(testId, "--left-navigator")
|
|
140
|
-
}), /*#__PURE__*/_react.default.createElement(_compiled.Inline, {
|
|
141
|
-
space: "space.0",
|
|
142
|
-
alignBlock: "baseline",
|
|
143
|
-
as: "ul",
|
|
144
|
-
xcss: styles.paginationMenu
|
|
145
|
-
}, (0, _collapseRange.default)(pages, selectedIndexValue, {
|
|
146
|
-
max: max,
|
|
147
|
-
ellipsis: renderEllipsis,
|
|
148
|
-
transform: transform
|
|
149
|
-
}, testId)), /*#__PURE__*/_react.default.createElement(_navigator.default, {
|
|
150
|
-
key: "right-navigator",
|
|
151
|
-
component: components.Next,
|
|
152
|
-
onClick: function onClick(event) {
|
|
153
|
-
return onChangeWithAnalytics({
|
|
154
|
-
event: event,
|
|
155
|
-
selectedPageIndex: selectedIndexValue + 1
|
|
156
|
-
});
|
|
157
|
-
},
|
|
158
|
-
isDisabled: isDisabled || selectedIndexValue === pages.length - 1,
|
|
159
|
-
iconBefore: /*#__PURE__*/_react.default.createElement(NavigatorIcon, {
|
|
160
|
-
chevronDirection: "right"
|
|
161
|
-
}),
|
|
162
|
-
"aria-label": nextLabel,
|
|
163
|
-
testId: testId && "".concat(testId, "--right-navigator")
|
|
164
|
-
}));
|
|
165
|
-
var newPaginationList = /*#__PURE__*/_react.default.createElement(_compiled.Inline, {
|
|
166
|
-
space: "space.0",
|
|
167
|
-
alignBlock: "center",
|
|
168
|
-
as: "ul",
|
|
169
|
-
xcss: styles.paginationMenu
|
|
170
|
-
}, /*#__PURE__*/_react.default.createElement(_compiled.Inline, {
|
|
171
|
-
as: "li",
|
|
172
|
-
xcss: styles.paginationMenuItem,
|
|
173
|
-
key: "previous-page"
|
|
174
|
-
}, /*#__PURE__*/_react.default.createElement(_navigator.default, {
|
|
175
|
-
key: "left-navigator",
|
|
176
|
-
component: components.Previous,
|
|
177
|
-
onClick: function onClick(event) {
|
|
178
|
-
return onChangeWithAnalytics({
|
|
179
|
-
event: event,
|
|
180
|
-
selectedPageIndex: selectedIndexValue - 1
|
|
181
|
-
});
|
|
182
|
-
},
|
|
183
|
-
isDisabled: isDisabled || selectedIndexValue === 0,
|
|
184
|
-
iconBefore: /*#__PURE__*/_react.default.createElement(NavigatorIcon, {
|
|
185
|
-
chevronDirection: "left"
|
|
186
|
-
}),
|
|
187
|
-
"aria-label": previousLabel,
|
|
188
|
-
testId: testId && "".concat(testId, "--left-navigator")
|
|
189
|
-
})), (0, _collapseRange.default)(pages, selectedIndexValue, {
|
|
190
|
-
max: max,
|
|
191
|
-
ellipsis: renderEllipsis,
|
|
192
|
-
transform: transform
|
|
193
|
-
}, testId), /*#__PURE__*/_react.default.createElement(_compiled.Inline, {
|
|
194
|
-
as: "li",
|
|
195
|
-
xcss: styles.paginationMenuItem,
|
|
196
|
-
key: "next-page"
|
|
197
|
-
}, /*#__PURE__*/_react.default.createElement(_navigator.default, {
|
|
198
|
-
key: "right-navigator",
|
|
199
|
-
component: components.Next,
|
|
200
|
-
onClick: function onClick(event) {
|
|
201
|
-
return onChangeWithAnalytics({
|
|
202
|
-
event: event,
|
|
203
|
-
selectedPageIndex: selectedIndexValue + 1
|
|
204
|
-
});
|
|
205
|
-
},
|
|
206
|
-
isDisabled: isDisabled || selectedIndexValue === pages.length - 1,
|
|
207
|
-
iconBefore: /*#__PURE__*/_react.default.createElement(NavigatorIcon, {
|
|
208
|
-
chevronDirection: "right"
|
|
209
|
-
}),
|
|
210
|
-
"aria-label": nextLabel,
|
|
211
|
-
testId: testId && "".concat(testId, "--right-navigator")
|
|
212
|
-
})));
|
|
213
124
|
return (
|
|
214
125
|
/*#__PURE__*/
|
|
215
126
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
@@ -222,7 +133,46 @@ function InnerPagination(_ref2, ref) {
|
|
|
222
133
|
}, /*#__PURE__*/_react.default.createElement(_compiled.Inline, {
|
|
223
134
|
space: "space.0",
|
|
224
135
|
alignBlock: "center"
|
|
225
|
-
}, (
|
|
136
|
+
}, /*#__PURE__*/_react.default.createElement(_navigator.default, {
|
|
137
|
+
key: "left-navigator",
|
|
138
|
+
component: components.Previous,
|
|
139
|
+
onClick: function onClick(event) {
|
|
140
|
+
return onChangeWithAnalytics({
|
|
141
|
+
event: event,
|
|
142
|
+
selectedPageIndex: selectedIndexValue - 1
|
|
143
|
+
});
|
|
144
|
+
},
|
|
145
|
+
isDisabled: isDisabled || selectedIndexValue === 0,
|
|
146
|
+
iconBefore: /*#__PURE__*/_react.default.createElement(NavigatorIcon, {
|
|
147
|
+
chevronDirection: "left"
|
|
148
|
+
}),
|
|
149
|
+
"aria-label": previousLabel,
|
|
150
|
+
testId: testId && "".concat(testId, "--left-navigator")
|
|
151
|
+
}), /*#__PURE__*/_react.default.createElement(_compiled.Inline, {
|
|
152
|
+
space: "space.0",
|
|
153
|
+
alignBlock: "baseline",
|
|
154
|
+
as: "ul",
|
|
155
|
+
xcss: styles.paginationMenu
|
|
156
|
+
}, (0, _collapseRange.default)(pages, selectedIndexValue, {
|
|
157
|
+
max: max,
|
|
158
|
+
ellipsis: renderEllipsis,
|
|
159
|
+
transform: transform
|
|
160
|
+
}, testId)), /*#__PURE__*/_react.default.createElement(_navigator.default, {
|
|
161
|
+
key: "right-navigator",
|
|
162
|
+
component: components.Next,
|
|
163
|
+
onClick: function onClick(event) {
|
|
164
|
+
return onChangeWithAnalytics({
|
|
165
|
+
event: event,
|
|
166
|
+
selectedPageIndex: selectedIndexValue + 1
|
|
167
|
+
});
|
|
168
|
+
},
|
|
169
|
+
isDisabled: isDisabled || selectedIndexValue === pages.length - 1,
|
|
170
|
+
iconBefore: /*#__PURE__*/_react.default.createElement(NavigatorIcon, {
|
|
171
|
+
chevronDirection: "right"
|
|
172
|
+
}),
|
|
173
|
+
"aria-label": nextLabel,
|
|
174
|
+
testId: testId && "".concat(testId, "--right-navigator")
|
|
175
|
+
})))
|
|
226
176
|
);
|
|
227
177
|
}
|
|
228
178
|
|
|
@@ -2,12 +2,10 @@
|
|
|
2
2
|
import "./render-ellipsis.compiled.css";
|
|
3
3
|
import { ax, ix } from "@compiled/react/runtime";
|
|
4
4
|
import React from 'react';
|
|
5
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
6
5
|
import { Box, Text } from '@atlaskit/primitives/compiled';
|
|
7
6
|
import VisuallyHidden from '@atlaskit/visually-hidden';
|
|
8
7
|
const styles = {
|
|
9
|
-
|
|
10
|
-
containerNew: "_1e0c1txw _kqswh2mm _19pkidpf"
|
|
8
|
+
container: "_1e0c1txw _kqswh2mm"
|
|
11
9
|
};
|
|
12
10
|
export default function renderEllipsis({
|
|
13
11
|
key,
|
|
@@ -19,7 +17,7 @@ export default function renderEllipsis({
|
|
|
19
17
|
as: "li",
|
|
20
18
|
testId: testId,
|
|
21
19
|
key: key,
|
|
22
|
-
xcss:
|
|
20
|
+
xcss: styles.container,
|
|
23
21
|
paddingInline: "space.100"
|
|
24
22
|
}, /*#__PURE__*/React.createElement(Text, {
|
|
25
23
|
testId: testId && `${testId}-text`
|
|
@@ -7,7 +7,6 @@ import noop from '@atlaskit/ds-lib/noop';
|
|
|
7
7
|
import useControlled from '@atlaskit/ds-lib/use-controlled';
|
|
8
8
|
import ChevronLeftLargeIcon from '@atlaskit/icon/utility/migration/chevron-left--chevron-left-large';
|
|
9
9
|
import ChevronRightLargeIcon from '@atlaskit/icon/utility/migration/chevron-right--chevron-right-large';
|
|
10
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
11
10
|
import { Box, Inline } from '@atlaskit/primitives/compiled';
|
|
12
11
|
import Navigator from './internal/components/navigator';
|
|
13
12
|
import PageComponent from './internal/components/page';
|
|
@@ -22,7 +21,7 @@ const styles = {
|
|
|
22
21
|
const analyticsAttributes = {
|
|
23
22
|
componentName: 'pagination',
|
|
24
23
|
packageName: "@atlaskit/pagination",
|
|
25
|
-
packageVersion: "16.0.
|
|
24
|
+
packageVersion: "16.0.2"
|
|
26
25
|
};
|
|
27
26
|
function NavigatorIcon({
|
|
28
27
|
chevronDirection
|
|
@@ -96,86 +95,6 @@ function InnerPagination({
|
|
|
96
95
|
testId: testId && `${testId}--${isCurrentPage ? 'current-' : ''}page-${currPageIndex}`
|
|
97
96
|
}, getPageLabel ? getPageLabel(page, currPageIndex) : page));
|
|
98
97
|
};
|
|
99
|
-
const oldPaginationList = /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Navigator, {
|
|
100
|
-
key: "left-navigator",
|
|
101
|
-
component: components.Previous,
|
|
102
|
-
onClick: event => onChangeWithAnalytics({
|
|
103
|
-
event,
|
|
104
|
-
selectedPageIndex: selectedIndexValue - 1
|
|
105
|
-
}),
|
|
106
|
-
isDisabled: isDisabled || selectedIndexValue === 0,
|
|
107
|
-
iconBefore: /*#__PURE__*/React.createElement(NavigatorIcon, {
|
|
108
|
-
chevronDirection: "left"
|
|
109
|
-
}),
|
|
110
|
-
"aria-label": previousLabel,
|
|
111
|
-
testId: testId && `${testId}--left-navigator`
|
|
112
|
-
}), /*#__PURE__*/React.createElement(Inline, {
|
|
113
|
-
space: "space.0",
|
|
114
|
-
alignBlock: "baseline",
|
|
115
|
-
as: "ul",
|
|
116
|
-
xcss: styles.paginationMenu
|
|
117
|
-
}, collapseRange(pages, selectedIndexValue, {
|
|
118
|
-
max: max,
|
|
119
|
-
ellipsis: renderEllipsis,
|
|
120
|
-
transform
|
|
121
|
-
}, testId)), /*#__PURE__*/React.createElement(Navigator, {
|
|
122
|
-
key: "right-navigator",
|
|
123
|
-
component: components.Next,
|
|
124
|
-
onClick: event => onChangeWithAnalytics({
|
|
125
|
-
event,
|
|
126
|
-
selectedPageIndex: selectedIndexValue + 1
|
|
127
|
-
}),
|
|
128
|
-
isDisabled: isDisabled || selectedIndexValue === pages.length - 1,
|
|
129
|
-
iconBefore: /*#__PURE__*/React.createElement(NavigatorIcon, {
|
|
130
|
-
chevronDirection: "right"
|
|
131
|
-
}),
|
|
132
|
-
"aria-label": nextLabel,
|
|
133
|
-
testId: testId && `${testId}--right-navigator`
|
|
134
|
-
}));
|
|
135
|
-
const newPaginationList = /*#__PURE__*/React.createElement(Inline, {
|
|
136
|
-
space: "space.0",
|
|
137
|
-
alignBlock: "center",
|
|
138
|
-
as: "ul",
|
|
139
|
-
xcss: styles.paginationMenu
|
|
140
|
-
}, /*#__PURE__*/React.createElement(Inline, {
|
|
141
|
-
as: "li",
|
|
142
|
-
xcss: styles.paginationMenuItem,
|
|
143
|
-
key: "previous-page"
|
|
144
|
-
}, /*#__PURE__*/React.createElement(Navigator, {
|
|
145
|
-
key: "left-navigator",
|
|
146
|
-
component: components.Previous,
|
|
147
|
-
onClick: event => onChangeWithAnalytics({
|
|
148
|
-
event,
|
|
149
|
-
selectedPageIndex: selectedIndexValue - 1
|
|
150
|
-
}),
|
|
151
|
-
isDisabled: isDisabled || selectedIndexValue === 0,
|
|
152
|
-
iconBefore: /*#__PURE__*/React.createElement(NavigatorIcon, {
|
|
153
|
-
chevronDirection: "left"
|
|
154
|
-
}),
|
|
155
|
-
"aria-label": previousLabel,
|
|
156
|
-
testId: testId && `${testId}--left-navigator`
|
|
157
|
-
})), collapseRange(pages, selectedIndexValue, {
|
|
158
|
-
max: max,
|
|
159
|
-
ellipsis: renderEllipsis,
|
|
160
|
-
transform
|
|
161
|
-
}, testId), /*#__PURE__*/React.createElement(Inline, {
|
|
162
|
-
as: "li",
|
|
163
|
-
xcss: styles.paginationMenuItem,
|
|
164
|
-
key: "next-page"
|
|
165
|
-
}, /*#__PURE__*/React.createElement(Navigator, {
|
|
166
|
-
key: "right-navigator",
|
|
167
|
-
component: components.Next,
|
|
168
|
-
onClick: event => onChangeWithAnalytics({
|
|
169
|
-
event,
|
|
170
|
-
selectedPageIndex: selectedIndexValue + 1
|
|
171
|
-
}),
|
|
172
|
-
isDisabled: isDisabled || selectedIndexValue === pages.length - 1,
|
|
173
|
-
iconBefore: /*#__PURE__*/React.createElement(NavigatorIcon, {
|
|
174
|
-
chevronDirection: "right"
|
|
175
|
-
}),
|
|
176
|
-
"aria-label": nextLabel,
|
|
177
|
-
testId: testId && `${testId}--right-navigator`
|
|
178
|
-
})));
|
|
179
98
|
return (
|
|
180
99
|
/*#__PURE__*/
|
|
181
100
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
@@ -188,7 +107,42 @@ function InnerPagination({
|
|
|
188
107
|
}, /*#__PURE__*/React.createElement(Inline, {
|
|
189
108
|
space: "space.0",
|
|
190
109
|
alignBlock: "center"
|
|
191
|
-
},
|
|
110
|
+
}, /*#__PURE__*/React.createElement(Navigator, {
|
|
111
|
+
key: "left-navigator",
|
|
112
|
+
component: components.Previous,
|
|
113
|
+
onClick: event => onChangeWithAnalytics({
|
|
114
|
+
event,
|
|
115
|
+
selectedPageIndex: selectedIndexValue - 1
|
|
116
|
+
}),
|
|
117
|
+
isDisabled: isDisabled || selectedIndexValue === 0,
|
|
118
|
+
iconBefore: /*#__PURE__*/React.createElement(NavigatorIcon, {
|
|
119
|
+
chevronDirection: "left"
|
|
120
|
+
}),
|
|
121
|
+
"aria-label": previousLabel,
|
|
122
|
+
testId: testId && `${testId}--left-navigator`
|
|
123
|
+
}), /*#__PURE__*/React.createElement(Inline, {
|
|
124
|
+
space: "space.0",
|
|
125
|
+
alignBlock: "baseline",
|
|
126
|
+
as: "ul",
|
|
127
|
+
xcss: styles.paginationMenu
|
|
128
|
+
}, collapseRange(pages, selectedIndexValue, {
|
|
129
|
+
max: max,
|
|
130
|
+
ellipsis: renderEllipsis,
|
|
131
|
+
transform
|
|
132
|
+
}, testId)), /*#__PURE__*/React.createElement(Navigator, {
|
|
133
|
+
key: "right-navigator",
|
|
134
|
+
component: components.Next,
|
|
135
|
+
onClick: event => onChangeWithAnalytics({
|
|
136
|
+
event,
|
|
137
|
+
selectedPageIndex: selectedIndexValue + 1
|
|
138
|
+
}),
|
|
139
|
+
isDisabled: isDisabled || selectedIndexValue === pages.length - 1,
|
|
140
|
+
iconBefore: /*#__PURE__*/React.createElement(NavigatorIcon, {
|
|
141
|
+
chevronDirection: "right"
|
|
142
|
+
}),
|
|
143
|
+
"aria-label": nextLabel,
|
|
144
|
+
testId: testId && `${testId}--right-navigator`
|
|
145
|
+
})))
|
|
192
146
|
);
|
|
193
147
|
}
|
|
194
148
|
|
|
@@ -2,12 +2,10 @@
|
|
|
2
2
|
import "./render-ellipsis.compiled.css";
|
|
3
3
|
import { ax, ix } from "@compiled/react/runtime";
|
|
4
4
|
import React from 'react';
|
|
5
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
6
5
|
import { Box, Text } from '@atlaskit/primitives/compiled';
|
|
7
6
|
import VisuallyHidden from '@atlaskit/visually-hidden';
|
|
8
7
|
var styles = {
|
|
9
|
-
|
|
10
|
-
containerNew: "_1e0c1txw _kqswh2mm _19pkidpf"
|
|
8
|
+
container: "_1e0c1txw _kqswh2mm"
|
|
11
9
|
};
|
|
12
10
|
export default function renderEllipsis(_ref) {
|
|
13
11
|
var key = _ref.key,
|
|
@@ -18,7 +16,7 @@ export default function renderEllipsis(_ref) {
|
|
|
18
16
|
as: "li",
|
|
19
17
|
testId: testId,
|
|
20
18
|
key: key,
|
|
21
|
-
xcss:
|
|
19
|
+
xcss: styles.container,
|
|
22
20
|
paddingInline: "space.100"
|
|
23
21
|
}, /*#__PURE__*/React.createElement(Text, {
|
|
24
22
|
testId: testId && "".concat(testId, "-text")
|
package/dist/esm/pagination.js
CHANGED
|
@@ -11,7 +11,6 @@ import noop from '@atlaskit/ds-lib/noop';
|
|
|
11
11
|
import useControlled from '@atlaskit/ds-lib/use-controlled';
|
|
12
12
|
import ChevronLeftLargeIcon from '@atlaskit/icon/utility/migration/chevron-left--chevron-left-large';
|
|
13
13
|
import ChevronRightLargeIcon from '@atlaskit/icon/utility/migration/chevron-right--chevron-right-large';
|
|
14
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
15
14
|
import { Box, Inline } from '@atlaskit/primitives/compiled';
|
|
16
15
|
import Navigator from './internal/components/navigator';
|
|
17
16
|
import PageComponent from './internal/components/page';
|
|
@@ -26,7 +25,7 @@ var styles = {
|
|
|
26
25
|
var analyticsAttributes = {
|
|
27
26
|
componentName: 'pagination',
|
|
28
27
|
packageName: "@atlaskit/pagination",
|
|
29
|
-
packageVersion: "16.0.
|
|
28
|
+
packageVersion: "16.0.2"
|
|
30
29
|
};
|
|
31
30
|
function NavigatorIcon(_ref) {
|
|
32
31
|
var chevronDirection = _ref.chevronDirection;
|
|
@@ -112,94 +111,6 @@ function InnerPagination(_ref2, ref) {
|
|
|
112
111
|
testId: testId && "".concat(testId, "--").concat(isCurrentPage ? 'current-' : '', "page-").concat(currPageIndex)
|
|
113
112
|
}, getPageLabel ? getPageLabel(page, currPageIndex) : page));
|
|
114
113
|
};
|
|
115
|
-
var oldPaginationList = /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Navigator, {
|
|
116
|
-
key: "left-navigator",
|
|
117
|
-
component: components.Previous,
|
|
118
|
-
onClick: function onClick(event) {
|
|
119
|
-
return onChangeWithAnalytics({
|
|
120
|
-
event: event,
|
|
121
|
-
selectedPageIndex: selectedIndexValue - 1
|
|
122
|
-
});
|
|
123
|
-
},
|
|
124
|
-
isDisabled: isDisabled || selectedIndexValue === 0,
|
|
125
|
-
iconBefore: /*#__PURE__*/React.createElement(NavigatorIcon, {
|
|
126
|
-
chevronDirection: "left"
|
|
127
|
-
}),
|
|
128
|
-
"aria-label": previousLabel,
|
|
129
|
-
testId: testId && "".concat(testId, "--left-navigator")
|
|
130
|
-
}), /*#__PURE__*/React.createElement(Inline, {
|
|
131
|
-
space: "space.0",
|
|
132
|
-
alignBlock: "baseline",
|
|
133
|
-
as: "ul",
|
|
134
|
-
xcss: styles.paginationMenu
|
|
135
|
-
}, collapseRange(pages, selectedIndexValue, {
|
|
136
|
-
max: max,
|
|
137
|
-
ellipsis: renderEllipsis,
|
|
138
|
-
transform: transform
|
|
139
|
-
}, testId)), /*#__PURE__*/React.createElement(Navigator, {
|
|
140
|
-
key: "right-navigator",
|
|
141
|
-
component: components.Next,
|
|
142
|
-
onClick: function onClick(event) {
|
|
143
|
-
return onChangeWithAnalytics({
|
|
144
|
-
event: event,
|
|
145
|
-
selectedPageIndex: selectedIndexValue + 1
|
|
146
|
-
});
|
|
147
|
-
},
|
|
148
|
-
isDisabled: isDisabled || selectedIndexValue === pages.length - 1,
|
|
149
|
-
iconBefore: /*#__PURE__*/React.createElement(NavigatorIcon, {
|
|
150
|
-
chevronDirection: "right"
|
|
151
|
-
}),
|
|
152
|
-
"aria-label": nextLabel,
|
|
153
|
-
testId: testId && "".concat(testId, "--right-navigator")
|
|
154
|
-
}));
|
|
155
|
-
var newPaginationList = /*#__PURE__*/React.createElement(Inline, {
|
|
156
|
-
space: "space.0",
|
|
157
|
-
alignBlock: "center",
|
|
158
|
-
as: "ul",
|
|
159
|
-
xcss: styles.paginationMenu
|
|
160
|
-
}, /*#__PURE__*/React.createElement(Inline, {
|
|
161
|
-
as: "li",
|
|
162
|
-
xcss: styles.paginationMenuItem,
|
|
163
|
-
key: "previous-page"
|
|
164
|
-
}, /*#__PURE__*/React.createElement(Navigator, {
|
|
165
|
-
key: "left-navigator",
|
|
166
|
-
component: components.Previous,
|
|
167
|
-
onClick: function onClick(event) {
|
|
168
|
-
return onChangeWithAnalytics({
|
|
169
|
-
event: event,
|
|
170
|
-
selectedPageIndex: selectedIndexValue - 1
|
|
171
|
-
});
|
|
172
|
-
},
|
|
173
|
-
isDisabled: isDisabled || selectedIndexValue === 0,
|
|
174
|
-
iconBefore: /*#__PURE__*/React.createElement(NavigatorIcon, {
|
|
175
|
-
chevronDirection: "left"
|
|
176
|
-
}),
|
|
177
|
-
"aria-label": previousLabel,
|
|
178
|
-
testId: testId && "".concat(testId, "--left-navigator")
|
|
179
|
-
})), collapseRange(pages, selectedIndexValue, {
|
|
180
|
-
max: max,
|
|
181
|
-
ellipsis: renderEllipsis,
|
|
182
|
-
transform: transform
|
|
183
|
-
}, testId), /*#__PURE__*/React.createElement(Inline, {
|
|
184
|
-
as: "li",
|
|
185
|
-
xcss: styles.paginationMenuItem,
|
|
186
|
-
key: "next-page"
|
|
187
|
-
}, /*#__PURE__*/React.createElement(Navigator, {
|
|
188
|
-
key: "right-navigator",
|
|
189
|
-
component: components.Next,
|
|
190
|
-
onClick: function onClick(event) {
|
|
191
|
-
return onChangeWithAnalytics({
|
|
192
|
-
event: event,
|
|
193
|
-
selectedPageIndex: selectedIndexValue + 1
|
|
194
|
-
});
|
|
195
|
-
},
|
|
196
|
-
isDisabled: isDisabled || selectedIndexValue === pages.length - 1,
|
|
197
|
-
iconBefore: /*#__PURE__*/React.createElement(NavigatorIcon, {
|
|
198
|
-
chevronDirection: "right"
|
|
199
|
-
}),
|
|
200
|
-
"aria-label": nextLabel,
|
|
201
|
-
testId: testId && "".concat(testId, "--right-navigator")
|
|
202
|
-
})));
|
|
203
114
|
return (
|
|
204
115
|
/*#__PURE__*/
|
|
205
116
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
@@ -212,7 +123,46 @@ function InnerPagination(_ref2, ref) {
|
|
|
212
123
|
}, /*#__PURE__*/React.createElement(Inline, {
|
|
213
124
|
space: "space.0",
|
|
214
125
|
alignBlock: "center"
|
|
215
|
-
},
|
|
126
|
+
}, /*#__PURE__*/React.createElement(Navigator, {
|
|
127
|
+
key: "left-navigator",
|
|
128
|
+
component: components.Previous,
|
|
129
|
+
onClick: function onClick(event) {
|
|
130
|
+
return onChangeWithAnalytics({
|
|
131
|
+
event: event,
|
|
132
|
+
selectedPageIndex: selectedIndexValue - 1
|
|
133
|
+
});
|
|
134
|
+
},
|
|
135
|
+
isDisabled: isDisabled || selectedIndexValue === 0,
|
|
136
|
+
iconBefore: /*#__PURE__*/React.createElement(NavigatorIcon, {
|
|
137
|
+
chevronDirection: "left"
|
|
138
|
+
}),
|
|
139
|
+
"aria-label": previousLabel,
|
|
140
|
+
testId: testId && "".concat(testId, "--left-navigator")
|
|
141
|
+
}), /*#__PURE__*/React.createElement(Inline, {
|
|
142
|
+
space: "space.0",
|
|
143
|
+
alignBlock: "baseline",
|
|
144
|
+
as: "ul",
|
|
145
|
+
xcss: styles.paginationMenu
|
|
146
|
+
}, collapseRange(pages, selectedIndexValue, {
|
|
147
|
+
max: max,
|
|
148
|
+
ellipsis: renderEllipsis,
|
|
149
|
+
transform: transform
|
|
150
|
+
}, testId)), /*#__PURE__*/React.createElement(Navigator, {
|
|
151
|
+
key: "right-navigator",
|
|
152
|
+
component: components.Next,
|
|
153
|
+
onClick: function onClick(event) {
|
|
154
|
+
return onChangeWithAnalytics({
|
|
155
|
+
event: event,
|
|
156
|
+
selectedPageIndex: selectedIndexValue + 1
|
|
157
|
+
});
|
|
158
|
+
},
|
|
159
|
+
isDisabled: isDisabled || selectedIndexValue === pages.length - 1,
|
|
160
|
+
iconBefore: /*#__PURE__*/React.createElement(NavigatorIcon, {
|
|
161
|
+
chevronDirection: "right"
|
|
162
|
+
}),
|
|
163
|
+
"aria-label": nextLabel,
|
|
164
|
+
testId: testId && "".concat(testId, "--right-navigator")
|
|
165
|
+
})))
|
|
216
166
|
);
|
|
217
167
|
}
|
|
218
168
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/pagination",
|
|
3
|
-
"version": "16.0.
|
|
3
|
+
"version": "16.0.2",
|
|
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,15 +39,15 @@
|
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
41
|
"@atlaskit/analytics-next": "^11.0.0",
|
|
42
|
-
"@atlaskit/button": "^21.
|
|
42
|
+
"@atlaskit/button": "^21.1.0",
|
|
43
43
|
"@atlaskit/codemod-utils": "^4.2.0",
|
|
44
44
|
"@atlaskit/css": "^0.10.0",
|
|
45
45
|
"@atlaskit/ds-lib": "^4.0.0",
|
|
46
|
-
"@atlaskit/icon": "^24.
|
|
46
|
+
"@atlaskit/icon": "^24.1.0",
|
|
47
47
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
48
|
-
"@atlaskit/primitives": "^14.
|
|
49
|
-
"@atlaskit/tokens": "^4.
|
|
50
|
-
"@atlaskit/visually-hidden": "^
|
|
48
|
+
"@atlaskit/primitives": "^14.1.0",
|
|
49
|
+
"@atlaskit/tokens": "^4.3.0",
|
|
50
|
+
"@atlaskit/visually-hidden": "^3.0.0",
|
|
51
51
|
"@babel/runtime": "^7.0.0",
|
|
52
52
|
"memoize-one": "^6.0.0"
|
|
53
53
|
},
|
|
@@ -60,13 +60,12 @@
|
|
|
60
60
|
"@af/visual-regression": "*",
|
|
61
61
|
"@atlaskit/code": "^16.0.0",
|
|
62
62
|
"@atlaskit/docs": "*",
|
|
63
|
-
"@atlaskit/heading": "^5.
|
|
63
|
+
"@atlaskit/heading": "^5.1.0",
|
|
64
64
|
"@atlaskit/link": "*",
|
|
65
65
|
"@atlaskit/section-message": "^8.0.0",
|
|
66
66
|
"@atlaskit/ssr": "*",
|
|
67
67
|
"@atlaskit/visual-regression": "*",
|
|
68
|
-
"@
|
|
69
|
-
"@atlassian/feature-flags-test-utils": "*",
|
|
68
|
+
"@testing-library/dom": "^10.1.0",
|
|
70
69
|
"@testing-library/react": "^13.4.0",
|
|
71
70
|
"react-dom": "^18.2.0",
|
|
72
71
|
"typescript": "~5.4.2"
|
|
@@ -93,10 +92,5 @@
|
|
|
93
92
|
"static"
|
|
94
93
|
]
|
|
95
94
|
}
|
|
96
|
-
},
|
|
97
|
-
"platform-feature-flags": {
|
|
98
|
-
"jfp-a11y-team_pagination_list-markup": {
|
|
99
|
-
"type": "boolean"
|
|
100
|
-
}
|
|
101
95
|
}
|
|
102
96
|
}
|