@thecb/components 7.8.2-beta.3 → 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/dist/index.cjs.js +16 -8
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.esm.js +16 -8
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/atoms/layouts/Cluster.d.ts +1 -0
- package/src/components/molecules/pagination/Pagination.js +13 -7
- package/src/components/molecules/pagination/index.d.ts +1 -0
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;
|
|
@@ -103,6 +107,7 @@ const Pagination = ({
|
|
|
103
107
|
pageNext,
|
|
104
108
|
pagePrevious,
|
|
105
109
|
setCurrentPage,
|
|
110
|
+
ariaLabel,
|
|
106
111
|
themeValues
|
|
107
112
|
}) => {
|
|
108
113
|
const { isMobile } = useContext(ThemeContext);
|
|
@@ -144,7 +149,9 @@ const Pagination = ({
|
|
|
144
149
|
childGap={childGap}
|
|
145
150
|
overflow={true}
|
|
146
151
|
as="nav"
|
|
152
|
+
role="navigation"
|
|
147
153
|
innerWrapperAs="ul"
|
|
154
|
+
aria-label={ariaLabel}
|
|
148
155
|
extraStyles="> ul { padding: 0px; > li { list-style-type: none; } };"
|
|
149
156
|
>
|
|
150
157
|
{currentPage > 1 ? (
|
|
@@ -187,10 +194,10 @@ const Pagination = ({
|
|
|
187
194
|
padding="0"
|
|
188
195
|
extraStyles={`max-height: ${buttonHeight};`}
|
|
189
196
|
as="li"
|
|
197
|
+
key={item.id}
|
|
190
198
|
>
|
|
191
199
|
<ButtonWithAction
|
|
192
200
|
variant="ghost"
|
|
193
|
-
key={item.index}
|
|
194
201
|
text={item.index}
|
|
195
202
|
disabled={item.active}
|
|
196
203
|
extraDisabledStyles={extraDisabledStyles}
|
|
@@ -211,10 +218,9 @@ const Pagination = ({
|
|
|
211
218
|
</ButtonWithAction>
|
|
212
219
|
</Box>
|
|
213
220
|
) : (
|
|
214
|
-
<Box padding="0 10px">
|
|
221
|
+
<Box padding="0 10px" as="li" key={item.id}>
|
|
215
222
|
<Cluster justify="flex-end">
|
|
216
223
|
<Text
|
|
217
|
-
key={index}
|
|
218
224
|
variant="pXL"
|
|
219
225
|
weight={fontWeight}
|
|
220
226
|
color={numberColor ?? themeValues.numberColor}
|