@thecb/components 7.8.2-beta.4 → 7.8.2-beta.5
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/package.json
CHANGED
|
@@ -68,19 +68,23 @@ export const getPagesPanel = (page, pagesCount) => {
|
|
|
68
68
|
const space = page === 1 ? PAGING_INIT_SPACE : PAGING_SPACE;
|
|
69
69
|
const pages = [{ index: 1, isButton: true }];
|
|
70
70
|
if (page > space + 1) {
|
|
71
|
-
pages.push({ isDelimiter: true });
|
|
71
|
+
pages.push({ isDelimiter: true, id: "first-delimiter" });
|
|
72
72
|
}
|
|
73
73
|
for (
|
|
74
74
|
let j = Math.max(1, page - space) + 1;
|
|
75
75
|
j < Math.min(lastPageNumber, page + space);
|
|
76
76
|
j++
|
|
77
77
|
) {
|
|
78
|
-
pages.push({ index: j, isButton: true });
|
|
78
|
+
pages.push({ index: j, isButton: true, id: `page-${j}` });
|
|
79
79
|
}
|
|
80
80
|
if (page < lastPageNumber - space) {
|
|
81
|
-
pages.push({ isDelimiter: true });
|
|
81
|
+
pages.push({ isDelimiter: true, id: "last-delimiter" });
|
|
82
82
|
}
|
|
83
|
-
pages.push({
|
|
83
|
+
pages.push({
|
|
84
|
+
index: lastPageNumber,
|
|
85
|
+
isButton: true,
|
|
86
|
+
id: `page-${lastPageNumber}`
|
|
87
|
+
});
|
|
84
88
|
const activePage = pages.find(p => p.index === page);
|
|
85
89
|
if (activePage) {
|
|
86
90
|
activePage.active = true;
|
|
@@ -145,6 +149,7 @@ const Pagination = ({
|
|
|
145
149
|
childGap={childGap}
|
|
146
150
|
overflow={true}
|
|
147
151
|
as="nav"
|
|
152
|
+
role="navigation"
|
|
148
153
|
innerWrapperAs="ul"
|
|
149
154
|
aria-label={ariaLabel}
|
|
150
155
|
extraStyles="> ul { padding: 0px; > li { list-style-type: none; } };"
|
|
@@ -189,7 +194,7 @@ const Pagination = ({
|
|
|
189
194
|
padding="0"
|
|
190
195
|
extraStyles={`max-height: ${buttonHeight};`}
|
|
191
196
|
as="li"
|
|
192
|
-
key={
|
|
197
|
+
key={item.id}
|
|
193
198
|
>
|
|
194
199
|
<ButtonWithAction
|
|
195
200
|
variant="ghost"
|
|
@@ -213,7 +218,7 @@ const Pagination = ({
|
|
|
213
218
|
</ButtonWithAction>
|
|
214
219
|
</Box>
|
|
215
220
|
) : (
|
|
216
|
-
<Box padding="0 10px" as="li" key={
|
|
221
|
+
<Box padding="0 10px" as="li" key={item.id}>
|
|
217
222
|
<Cluster justify="flex-end">
|
|
218
223
|
<Text
|
|
219
224
|
variant="pXL"
|